Skip to content

Commit 636a339

Browse files
author
Elliott Marquez
authored
Merge pull request #89 from arobins/master
Fix some compiler warnings
2 parents cb0a9fd + efdc44e commit 636a339

7 files changed

+279
-255
lines changed

google-client-loader.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@
134134
* Wrapper for `gapi.auth`.
135135
*/
136136
get auth() {
137-
return gapi.auth;
137+
return window.gapi.auth;
138138
},
139139

140140
ready: function() {
141141
this._loader = document.createElement('google-js-api');
142-
142+
143143
if (!this.shadowRoot) { this.attachShadow({mode: 'open'}); }
144144
this.shadowRoot.appendChild(this._loader);
145-
145+
146146
this.listen(this._loader, 'js-api-load', '_loadClient');
147147
},
148148

@@ -151,7 +151,7 @@
151151
},
152152

153153
_loadClient: function() {
154-
gapi.load('client', this._doneLoadingClient.bind(this));
154+
window.gapi.load('client', this._doneLoadingClient.bind(this));
155155
},
156156

157157
_handleLoadResponse: function(response) {
@@ -226,7 +226,7 @@
226226
}
227227
_statuses[this.name] = 'loading';
228228
_loaders[this.name] = this;
229-
gapi.client.load(this.name, this.version,
229+
window.gapi.client.load(this.name, this.version,
230230
this._handleLoadResponse.bind(this), root);
231231
}
232232
}

google-js-api.html

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,38 +26,42 @@
2626
</script>
2727
-->
2828
<script>
29-
Polymer({
29+
(function() {
30+
'use strict';
3031

31-
is: 'google-js-api',
32+
Polymer({
3233

33-
behaviors: [
34-
Polymer.IronJsonpLibraryBehavior
35-
],
34+
is: 'google-js-api',
3635

37-
properties: {
36+
behaviors: [
37+
Polymer.IronJsonpLibraryBehavior
38+
],
3839

39-
/** @private */
40-
libraryUrl: {
41-
type: String,
42-
value: 'https://apis.google.com/js/api.js?onload=%%callback%%'
43-
},
40+
properties: {
41+
42+
/** @private */
43+
libraryUrl: {
44+
type: String,
45+
value: 'https://apis.google.com/js/api.js?onload=%%callback%%'
46+
},
4447

45-
/**
46-
* Fired when the API library is loaded and available.
47-
* @event js-api-load
48-
*/
49-
/**
50-
* Name of event fired when library is loaded and available.
51-
*/
52-
notifyEvent: {
53-
type: String,
54-
value: 'js-api-load'
48+
/**
49+
* Fired when the API library is loaded and available.
50+
* @event js-api-load
51+
*/
52+
/**
53+
* Name of event fired when library is loaded and available.
54+
*/
55+
notifyEvent: {
56+
type: String,
57+
value: 'js-api-load'
58+
},
5559
},
56-
},
5760

58-
get api() {
59-
return gapi;
60-
}
61+
get api() {
62+
return window.gapi;
63+
}
6164

62-
});
65+
});
66+
})();
6367
</script>

google-legacy-loader.html

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,44 @@
1616
Fires `api-load` event when ready.
1717
-->
1818
<script>
19-
Polymer({
20-
21-
is: 'google-legacy-loader',
22-
23-
behaviors: [
24-
Polymer.IronJsonpLibraryBehavior
25-
],
26-
27-
properties: {
28-
29-
/** @private */
30-
libraryUrl: {
31-
type: String,
32-
value: 'https://www.google.com/jsapi?callback=%%callback%%'
19+
(function() {
20+
'use strict';
21+
22+
Polymer({
23+
24+
is: 'google-legacy-loader',
25+
26+
behaviors: [
27+
Polymer.IronJsonpLibraryBehavior
28+
],
29+
30+
properties: {
31+
32+
/** @private */
33+
libraryUrl: {
34+
type: String,
35+
value: 'https://www.google.com/jsapi?callback=%%callback%%'
36+
},
37+
38+
/**
39+
* Fired when the API library is loaded and available.
40+
* @event js-api-load
41+
*/
42+
/**
43+
* Name of event fired when library is loaded and available.
44+
*/
45+
notifyEvent: {
46+
type: String,
47+
value: 'api-load'
48+
}
3349
},
3450

3551
/**
36-
* Fired when the API library is loaded and available.
37-
* @event js-api-load
38-
*/
39-
/**
40-
* Name of event fired when library is loaded and available.
52+
* Wrapper for `google` API namespace.
4153
*/
42-
notifyEvent: {
43-
type: String,
44-
value: 'api-load'
54+
get api() {
55+
return google;
4556
}
46-
},
47-
48-
/**
49-
* Wrapper for `google` API namespace.
50-
*/
51-
get api() {
52-
return google;
53-
}
54-
});
57+
});
58+
})();
5559
</script>

0 commit comments

Comments
 (0)