Skip to content

Commit

Permalink
Merge pull request #89 from arobins/master
Browse files Browse the repository at this point in the history
Fix some compiler warnings
  • Loading branch information
Elliott Marquez authored Oct 23, 2018
2 parents cb0a9fd + efdc44e commit 636a339
Show file tree
Hide file tree
Showing 7 changed files with 279 additions and 255 deletions.
10 changes: 5 additions & 5 deletions google-client-loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@
* Wrapper for `gapi.auth`.
*/
get auth() {
return gapi.auth;
return window.gapi.auth;
},

ready: function() {
this._loader = document.createElement('google-js-api');

if (!this.shadowRoot) { this.attachShadow({mode: 'open'}); }
this.shadowRoot.appendChild(this._loader);

this.listen(this._loader, 'js-api-load', '_loadClient');
},

Expand All @@ -151,7 +151,7 @@
},

_loadClient: function() {
gapi.load('client', this._doneLoadingClient.bind(this));
window.gapi.load('client', this._doneLoadingClient.bind(this));
},

_handleLoadResponse: function(response) {
Expand Down Expand Up @@ -226,7 +226,7 @@
}
_statuses[this.name] = 'loading';
_loaders[this.name] = this;
gapi.client.load(this.name, this.version,
window.gapi.client.load(this.name, this.version,
this._handleLoadResponse.bind(this), root);
}
}
Expand Down
56 changes: 30 additions & 26 deletions google-js-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,42 @@
</script>
-->
<script>
Polymer({
(function() {
'use strict';

is: 'google-js-api',
Polymer({

behaviors: [
Polymer.IronJsonpLibraryBehavior
],
is: 'google-js-api',

properties: {
behaviors: [
Polymer.IronJsonpLibraryBehavior
],

/** @private */
libraryUrl: {
type: String,
value: 'https://apis.google.com/js/api.js?onload=%%callback%%'
},
properties: {

/** @private */
libraryUrl: {
type: String,
value: 'https://apis.google.com/js/api.js?onload=%%callback%%'
},

/**
* Fired when the API library is loaded and available.
* @event js-api-load
*/
/**
* Name of event fired when library is loaded and available.
*/
notifyEvent: {
type: String,
value: 'js-api-load'
/**
* Fired when the API library is loaded and available.
* @event js-api-load
*/
/**
* Name of event fired when library is loaded and available.
*/
notifyEvent: {
type: String,
value: 'js-api-load'
},
},
},

get api() {
return gapi;
}
get api() {
return window.gapi;
}

});
});
})();
</script>
66 changes: 35 additions & 31 deletions google-legacy-loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,44 @@
Fires `api-load` event when ready.
-->
<script>
Polymer({

is: 'google-legacy-loader',

behaviors: [
Polymer.IronJsonpLibraryBehavior
],

properties: {

/** @private */
libraryUrl: {
type: String,
value: 'https://www.google.com/jsapi?callback=%%callback%%'
(function() {
'use strict';

Polymer({

is: 'google-legacy-loader',

behaviors: [
Polymer.IronJsonpLibraryBehavior
],

properties: {

/** @private */
libraryUrl: {
type: String,
value: 'https://www.google.com/jsapi?callback=%%callback%%'
},

/**
* Fired when the API library is loaded and available.
* @event js-api-load
*/
/**
* Name of event fired when library is loaded and available.
*/
notifyEvent: {
type: String,
value: 'api-load'
}
},

/**
* Fired when the API library is loaded and available.
* @event js-api-load
*/
/**
* Name of event fired when library is loaded and available.
* Wrapper for `google` API namespace.
*/
notifyEvent: {
type: String,
value: 'api-load'
get api() {
return google;
}
},

/**
* Wrapper for `google` API namespace.
*/
get api() {
return google;
}
});
});
})();
</script>
Loading

0 comments on commit 636a339

Please sign in to comment.