| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <!-- |
| 3 @license |
| 4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 8 Code distributed by Google as part of the polymer project is also |
| 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 <meta charset="utf-8"> |
| 14 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initia
l-scale=1.0, user-scalable=yes"> |
| 15 <title>iron-jsonp-library Demo</title> |
| 16 <script src="../../webcomponentsjs/webcomponents-lite.js"></script> |
| 17 <link rel="import" href="../../paper-styles/paper-styles.html"> |
| 18 <link rel="import" href="../../paper-styles/demo-pages.html"> |
| 19 <link rel="import" href="../../paper-spinner/paper-spinner.html"> |
| 20 <link rel="import" href="../iron-jsonp-library.html"> |
| 21 <style is="custom-style"> |
| 22 |
| 23 .loading { |
| 24 color: var(--google-grey-500); |
| 25 } |
| 26 |
| 27 .success { |
| 28 color: var(--paper-green-800); |
| 29 } |
| 30 |
| 31 .failure { |
| 32 color: var(--paper-red-800); |
| 33 } |
| 34 |
| 35 paper-spinner { |
| 36 --paper-spinner-layer-1-color: var(--google-grey-500); |
| 37 --paper-spinner-layer-2-color: var(--google-grey-500); |
| 38 --paper-spinner-layer-3-color: var(--google-grey-500); |
| 39 --paper-spinner-layer-4-color: var(--google-grey-500); |
| 40 } |
| 41 </style> |
| 42 </head> |
| 43 <body> |
| 44 |
| 45 <div class="vertical-section vertical-section-container centered"> |
| 46 <h1><iron-jsonp-library></h1> |
| 47 <template is="dom-bind"> |
| 48 <h3>Good loader</h3> |
| 49 <iron-jsonp-library |
| 50 library-url="https://apis.google.com/js/plusone.js?onload=%%callback%%
" |
| 51 notify-event="api-load" |
| 52 library-loaded="{{loaded}}" |
| 53 library-error-message="{{errorMessage}}"></iron-jsonp-library> |
| 54 <template is="dom-if" if="{{loaded}}"> |
| 55 <p class="success">The <code>Google+ API</code> has been loaded</p> |
| 56 </template> |
| 57 <template is="dom-if" if="{{!loaded}}"> |
| 58 <template is="dom-if" if="{{errorMessage}}"> |
| 59 <p class="failure">{{errorMessage}}</p> |
| 60 </template> |
| 61 <template is="dom-if" if="{{!errorMessage}}"> |
| 62 <p class="loading">Loading...</p> |
| 63 </template> |
| 64 </template> |
| 65 </template> |
| 66 <hr> |
| 67 <template is="dom-bind"> |
| 68 <h3>Bad loader</h3> |
| 69 <iron-jsonp-library |
| 70 library-url="https://badapis.google.com/js/plusone.js?onload=%%callbac
k%%" |
| 71 notify-event="api-load" |
| 72 library-loaded="{{loaded}}" |
| 73 library-error-message="{{errorMessage}}"></iron-jsonp-library> |
| 74 <template is="dom-if" if="{{loaded}}"> |
| 75 <p><code>badapis</code> has been loaded</p> |
| 76 </template> |
| 77 <template is="dom-if" if="{{!loaded}}"> |
| 78 <template is="dom-if" if="{{errorMessage}}"> |
| 79 <p class="failure">{{errorMessage}}</p> |
| 80 </template> |
| 81 <template is="dom-if" if="{{!errorMessage}}"> |
| 82 <p class="loading">Loading...</p> |
| 83 </template> |
| 84 </template> |
| 85 </template> |
| 86 </div> |
| 87 |
| 88 </body> |
| 89 </html> |
| OLD | NEW |