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