OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE HTML> | |
2 <html i18n-values="dir:textdirection"> | |
3 <head> | |
4 <meta charset="utf-8"> | |
5 <script src="polymer_loader.js"></script> | |
6 | |
7 | |
8 | |
9 | |
10 <!-- | |
11 Copyright 2013 The Polymer Authors. All rights reserved. | |
12 Use of this source code is governed by a BSD-style | |
13 license that can be found in the LICENSE file. | |
14 --> | |
15 | |
16 <!-- <link rel="import" href="../polymer-dev/polymer.html"> --> | |
17 <!-- | |
18 Copyright 2013 The Polymer Authors. All rights reserved. | |
19 Use of this source code is governed by a BSD-style | |
20 license that can be found in the LICENSE file. | |
21 --> | |
22 <!-- | |
23 /** | |
24 * @module Polymer Elements | |
25 */ | |
26 --> | |
27 <!-- | |
28 /** | |
29 * The polymer-selection element is used to manage selection state. It has no | |
30 * visual appearance and is typically used in conjuneciton with another element. | |
31 * For example, <a href="polymer-selector.html">polymer-selector</a> | |
32 * use a polymer-selection to manage selection. | |
33 * | |
34 * To mark an item as selected, call the select(item) method on | |
35 * polymer-selection. Notice that the item itself is an argument to this method. | |
36 * The polymer-selection element manages selection state for any given set of | |
37 * items. When an item is selected, the `polymer-select` event is fired. | |
38 * The attribute "multi" indicates if multiple items can be selected at once. | |
39 * | |
40 * Example: | |
41 * | |
42 * <polymer-element name="selection-example"> | |
43 * <template> | |
44 * <style> | |
45 * ::-webkit-distributed(> .selected) { | |
46 * font-weight: bold; | |
47 * font-style: italic; | |
48 * } | |
49 * </style> | |
50 * <ul on-tap="{{itemTapAction}}"> | |
51 * <content></content> | |
52 * </ul> | |
53 * <polymer-selection id="selection" multi on-polymer-select="{{selectA ction}}"></polymer-selection> | |
54 * </template> | |
55 * <script> | |
56 * Polymer('selection-example', { | |
57 * itemTapAction: function(e) { | |
58 * this.$.selection.select(e.target); | |
59 * }, | |
60 * selectAction: function(e, detail) { | |
61 * detail.item.classList.toggle('selected', detail.isSelected); | |
62 * } | |
63 * }); | |
64 * </script> | |
65 * </polymer-element> | |
66 * | |
67 * <selection-example> | |
68 * <li>Red</li> | |
69 * <li>Green</li> | |
70 * <li>Blue</li> | |
71 * </selection-example> | |
72 * | |
73 * @class polymer-selection | |
74 */ | |
75 /** | |
76 * Fired when an item's selection state is changed. This event is fired both | |
77 * when an item is selected or deselected. The `isSelected` detail property | |
78 * contains the selection state. | |
79 * | |
80 * @event polymer-select | |
81 * @param {Object} detail | |
82 * @param {boolean} detail.isSelected true for selection and false for deselec tion | |
83 * @param {Object} detail.item the item element | |
84 */ | |
85 --> | |
86 | |
87 | |
88 <polymer-element name="polymer-selection" attributes="multi" assetpath="../../.. /../third_party/polymer/polymer-selection/"> | |
89 <template> | |
90 <style> | |
91 :host { | |
92 display: none !important; | |
93 } | |
94 </style> | |
95 </template> | |
96 | |
97 </polymer-element> | |
98 | |
99 <!-- | |
100 Copyright 2013 The Polymer Authors. All rights reserved. | |
101 Use of this source code is governed by a BSD-style | |
102 license that can be found in the LICENSE file. | |
103 --> | |
104 <!-- | |
105 /** | |
106 * @module Polymer Elements | |
107 */ | |
108 /** | |
109 * polymer-selector is used to manage a list of elements that can be selected. | |
110 * The attribute "selected" indicates which item element is being selected. | |
111 * The attribute "multi" indicates if multiple items can be selected at once. | |
112 * Tapping on the item element would fire "polymer-activate" event. Use | |
113 * "polymer-select" event to listen for selection changes. | |
114 * | |
115 * Example: | |
116 * | |
117 * <polymer-selector selected="0"> | |
118 * <div>Item 1</div> | |
119 * <div>Item 2</div> | |
120 * <div>Item 3</div> | |
121 * </polymer-selector> | |
122 * | |
123 * polymer-selector is not styled. So one needs to use "polymer-selected" CSS | |
124 * class to style the selected element. | |
125 * | |
126 * <style> | |
127 * .item.polymer-selected { | |
128 * background: #eee; | |
129 * } | |
130 * </style> | |
131 * ... | |
132 * <polymer-selector> | |
133 * <div class="item">Item 1</div> | |
134 * <div class="item">Item 2</div> | |
135 * <div class="item">Item 3</div> | |
136 * </polymer-selector> | |
137 * | |
138 * @class polymer-selector | |
139 */ | |
140 /** | |
141 * Fired when an item's selection state is changed. This event is fired both | |
142 * when an item is selected or deselected. The `isSelected` detail property | |
143 * contains the selection state. | |
144 * | |
145 * @event polymer-select | |
146 * @param {Object} detail | |
147 * @param {boolean} detail.isSelected true for selection and false for deselec tion | |
148 * @param {Object} detail.item the item element | |
149 */ | |
150 /** | |
151 * Fired when an item element is tapped. | |
152 * | |
153 * @event polymer-activate | |
154 * @param {Object} detail | |
155 * @param {Object} detail.item the item element | |
156 */ | |
157 --> | |
158 | |
159 | |
160 | |
161 <polymer-element name="polymer-selector" attributes="selected multi valueattr se lectedClass selectedProperty selectedItem selectedModel selectedIndex notap targ et itemsSelector activateEvent" assetpath="../../../../third_party/polymer/polym er-selector/"> | |
162 <template> | |
163 <polymer-selection id="selection" multi="{{multi}}" on-polymer-select="{{sel ectionSelect}}"></polymer-selection> | |
164 <content id="items" select="*"></content> | |
165 </template> | |
166 | |
167 </polymer-element> | |
168 | |
169 <polymer-element name="viewer-toolbar" attributes="fadingIn" on-mouseover="{{fad eIn}}" on-mousemove="{{fadeIn}}" on-mouseout="{{fadeOut}}" assetpath="elements/v iewer-toolbar/"> | |
170 <template> | |
171 <style>/* Copyright 2013 The Chromium Authors. All rights reserved. | |
172 * Use of this source code is governed by a BSD-style license that can be | |
173 * found in the LICENSE file. */ | |
174 | |
175 :host { | |
176 -webkit-transition: opacity 0.4s ease-in-out; | |
177 bottom: 0; | |
178 display: block; | |
179 font-size: 0; | |
180 opacity: 1; | |
181 position: fixed; | |
182 right: 0; | |
183 padding: 20px; | |
184 } | |
185 | |
186 #toolbar { | |
187 border-radius: 3px; | |
188 box-shadow: 0 1px 2px gray, 0 3px 3px rgba(0, 0, 0, .2); | |
189 overflow: hidden; | |
190 } | |
191 </style> | |
192 <div id="toolbar"> | |
193 <content></content> | |
194 </div> | |
195 </template> | |
196 | |
197 </polymer-element> | |
198 | |
199 <polymer-element name="viewer-button" attributes="src latchable" assetpath="elem ents/viewer-button/"> | |
200 <template> | |
201 <style>/* Copyright 2013 The Chromium Authors. All rights reserved. | |
202 * Use of this source code is governed by a BSD-style license that can be | |
203 * found in the LICENSE file. */ | |
204 | |
205 #icon { | |
206 background-position: center center; | |
207 background-repeat: no-repeat; | |
208 background-size: 100% 100%; | |
209 height: 100%; | |
210 width: 100%; | |
211 } | |
212 | |
213 :host { | |
214 -webkit-user-select: none; | |
215 background-image: -webkit-linear-gradient(rgb(60, 80, 119), rgb(15, 24, 41)); | |
216 border: 1px solid rgb(11, 9, 16); | |
217 cursor: default; | |
218 display: inline-block; | |
219 height: 36px; | |
220 margin: 0; | |
221 width: 43px; | |
222 } | |
223 | |
224 :host(:focus:host) { | |
225 outline: none; | |
226 } | |
227 | |
228 :host(:hover:host) { | |
229 background-image: -webkit-linear-gradient(rgb(73, 102, 155), rgb(32, 52, 95)); | |
230 } | |
231 | |
232 :host(.latchable.polymer-selected:host), | |
233 :host(:active:host) { | |
234 background-color: rgb(75, 103, 156); | |
235 background-image: none; | |
236 } | |
237 </style> | |
238 <div id="icon"></div> | |
239 </template> | |
240 | |
241 </polymer-element> | |
242 <style> | |
243 body { | |
244 background-color: #ccc; | |
245 } | |
246 viewer-toolbar { | |
247 z-index: 2; | |
248 } | |
249 object { | |
250 z-index: 1; | |
251 } | |
252 </style> | |
253 </head> | |
254 <body marginwidth="0" marginheight="0"> | |
255 | |
256 <viewer-toolbar> | |
257 <polymer-selector> | |
258 <viewer-button src="button_fit_page.png" latchable="true"></viewer-button> | |
arv (Not doing code reviews)
2014/01/06 15:42:43
Use boolean attributes for latchable?
raymes
2014/01/07 23:19:25
Done.
| |
259 <viewer-button src="button_fit_width.png" latchable="true"></viewer-button> | |
260 <viewer-button src="button_zoom_in.png"></viewer-button> | |
261 <viewer-button src="button_zoom_out.png"></viewer-button> | |
262 </polymer-selector> | |
263 <viewer-button src="button_save.png"></viewer-button> | |
264 <viewer-button src="button_print.png"></viewer-button> | |
265 </viewer-toolbar> | |
266 | |
267 | |
268 <script src="index.js"></script> | |
269 </body> | |
270 <script src="pdf.js" language="javascript" type="text/javascript"></script> | |
arv (Not doing code reviews)
2014/01/06 15:42:43
<script src="pdf.js"></script>
everything else is
raymes
2014/01/07 23:19:25
Done.
| |
271 </html> | |
OLD | NEW |