Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: pkg/polymer/lib/elements/polymer-google-jsapi/polymer-google-jsapi.html

Issue 175443005: [polymer] import all elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated from bower Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!--
2 Copyright 2013 The Polymer Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style
4 license that can be found in the LICENSE file.
5 -->
6 <link rel="import" href="../polymer/polymer.html">
7
8 <polymer-element name="polymer-google-jsapi">
9 <script>
10 (function() {
11 var state = '', instances = [], f;
12 function load() {
13 f = document.createElement('iframe');
14 f.style.display = 'none';
15 document.body.appendChild(f);
16 var d = f.contentWindow ? f.contentWindow.document : (f.contentDocument. document ? f.contentDocument.document : f.contentDocument);
17 d.open();
18 d.write(loader);
19 d.close();
20 }
21 var api;
22 var loaded = function(google) {
23 window.__polymer_google_jsapi = undefined;
24 window.google = api = google;
25 instances.forEach(function(i) {
26 i.provide();
27 });
28 }
29 var loader =
30 '<script type="text/javascript" src="https://www.google.com/jsapi"></scr ' + 'ipt>' +
31 '<script>parent.__polymer_google_jsapi(google);</scr' + 'ipt>'
32 ;
33 window.__polymer_google_jsapi = loaded;
34
35 Polymer('polymer-google-jsapi', {
36 ready: function() {
37 switch (state) {
38 case '':
39 instances.push(this);
40 load();
41 state = 'pending';
42 break;
43 case 'pending':
44 instances.push(this);
45 break;
46 case 'ready':
47 this.provide();
48 break;
49 }
50 },
51 provide: function() {
52 this.asyncMethod('notify');
53 },
54 notify: function() {
55 this.fire('polymer-google-jsapi-loaded');
56 },
57 get google() {
58 return api;
59 }
60 });
61 })();
62 </script>
63 </polymer-element>
OLDNEW
« no previous file with comments | « pkg/polymer/lib/elements/polymer-google-jsapi/index.html ('k') | pkg/polymer/lib/elements/polymer-grid-layout/.bower.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698