| OLD | NEW | 
|---|
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> | 
| 2 <html i18n-values="dir:textdirection"> | 2 <html i18n-values="dir:textdirection"> | 
| 3 <head> | 3 <head> | 
| 4   <meta charset="utf-8"> | 4   <meta charset="utf-8"> | 
| 5   <style> | 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" assetpath="elements/viewer-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   bottom: 0; | 
|  | 177   display: block; | 
|  | 178   font-size: 0; | 
|  | 179   opacity: 1; | 
|  | 180   position: fixed; | 
|  | 181   right: 0; | 
|  | 182 } | 
|  | 183 | 
|  | 184 #hover { | 
|  | 185   padding: 20px; | 
|  | 186 } | 
|  | 187 | 
|  | 188 #toolbar { | 
|  | 189   border-radius: 3px; | 
|  | 190   box-shadow: 0 1px 2px gray, 0 3px 3px rgba(0, 0, 0, .2); | 
|  | 191   overflow: hidden; | 
|  | 192 } | 
|  | 193 </style> | 
|  | 194     <div id="hover" on-mouseover="{{fadeIn}}" on-mousemove="{{fadeIn}}" on-mouse
     out="{{fadeOut}}"> | 
|  | 195       <div id="toolbar"> | 
|  | 196         <content></content> | 
|  | 197       </div> | 
|  | 198     </div> | 
|  | 199   </template> | 
|  | 200 | 
|  | 201 </polymer-element> | 
|  | 202 | 
|  | 203 <polymer-element name="viewer-button" attributes="src latchable" assetpath="elem
     ents/viewer-button/"> | 
|  | 204   <template> | 
|  | 205     <style>/* Copyright 2013 The Chromium Authors. All rights reserved. | 
|  | 206  * Use of this source code is governed by a BSD-style license that can be | 
|  | 207  * found in the LICENSE file. */ | 
|  | 208 | 
|  | 209 #icon { | 
|  | 210   background-position: center center; | 
|  | 211   background-repeat: no-repeat; | 
|  | 212   background-size: 100% 100%; | 
|  | 213   height: 100%; | 
|  | 214   width: 100%; | 
|  | 215 } | 
|  | 216 | 
|  | 217 :host { | 
|  | 218   -webkit-user-select: none; | 
|  | 219   background-image: -webkit-linear-gradient(rgb(60, 80, 119), rgb(15, 24, 41)); | 
|  | 220   border: 1px solid rgb(11, 9, 16); | 
|  | 221   cursor: default; | 
|  | 222   display: inline-block; | 
|  | 223   height: 36px; | 
|  | 224   margin: 0; | 
|  | 225   width: 43px; | 
|  | 226 } | 
|  | 227 | 
|  | 228 :host(:focus:host) { | 
|  | 229   outline: none; | 
|  | 230 } | 
|  | 231 | 
|  | 232 :host(:hover:host) { | 
|  | 233   background-image: -webkit-linear-gradient(rgb(73, 102, 155), rgb(32, 52, 95)); | 
|  | 234 } | 
|  | 235 | 
|  | 236 :host(.latchable.polymer-selected:host), | 
|  | 237 :host(:active:host) { | 
|  | 238   background-color: rgb(75, 103, 156); | 
|  | 239   background-image: none; | 
|  | 240 } | 
|  | 241 </style> | 
|  | 242     <div id="icon"></div> | 
|  | 243   </template> | 
|  | 244 | 
|  | 245 </polymer-element> | 
|  | 246 <style> | 
| 6     body { | 247     body { | 
| 7       background-color: #ccc; | 248       background-color: #ccc; | 
| 8       font-family: sans-serif; | 249     } | 
|  | 250     viewer-toolbar { | 
|  | 251       z-index: 2; | 
|  | 252     } | 
|  | 253     object { | 
|  | 254       z-index: 1; | 
| 9     } | 255     } | 
| 10   </style> | 256   </style> | 
| 11 </head> | 257 </head> | 
| 12 <body marginwidth="0" marginheight="0" > | 258 <body marginwidth="0" marginheight="0"> | 
|  | 259 | 
|  | 260 <viewer-toolbar> | 
|  | 261   <polymer-selector> | 
|  | 262     <viewer-button src="button_fit_page.png" latchable="true"></viewer-button> | 
|  | 263     <viewer-button src="button_fit_width.png" latchable="true"></viewer-button> | 
|  | 264     <viewer-button src="button_zoom_in.png"></viewer-button> | 
|  | 265     <viewer-button src="button_zoom_out.png"></viewer-button> | 
|  | 266   </polymer-selector> | 
|  | 267   <viewer-button src="button_save.png"></viewer-button> | 
|  | 268   <viewer-button src="button_print.png"></viewer-button> | 
|  | 269 </viewer-toolbar> | 
|  | 270 | 
|  | 271 | 
|  | 272 <script src="pdf.js"></script> | 
| 13 </body> | 273 </body> | 
| 14 <script src="pdf.js" language="javascript" type="text/javascript"></script> | 274 <script src="pdf_viewer.js" language="javascript" type="text/javascript"></scrip
     t> | 
| 15 </html> | 275 </html> | 
| OLD | NEW | 
|---|