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