PluginProbe
Authorizer / 2.8.7
Authorizer v2.8.7
3.15.3 3.15.2 3.15.1 3.15.0 3.14.3 3.14.4 3.14.2 3.14.1 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.10 2.9.11 2.9.12 2.9.13 2.9.2 2.9.3 2.9.6 All 126 releases
authorizer / js / authorizer-login-custom_google.js

authorizer-login-custom_google.js in Authorizer 2.8.7, at js/authorizer-login-custom_google.js

30 lines 1001 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Inserts the "Sign in with Google" button.
3 */
4
5 /* global document, signInCallback, gapi */
6 ( function() {
7 var po = document.createElement( 'script' );
8 po.type = 'text/javascript';
9 po.async = true;
10 po.src = 'https://plus.google.com/js/client:plusone.js?onload=render';
11 var scr = document.getElementsByTagName( 'script' )[0];
12 scr.parentNode.insertBefore( po, scr );
13 })();
14
15 /* Executed when the APIs finish loading */
16 // eslint-disable-next-line
17 function render() { // jshint ignore:line
18 // Additional params including the callback, the rest of the params will
19 // come from the page-level configuration.
20 var additionalParams = {
21 callback: signInCallback,
22 };
23 // Attach a click listener to a button to trigger the flow.
24 var signinButton = document.getElementById( 'googleplus_button' );
25 signinButton.addEventListener( 'click', function() {
26 gapi.auth.signIn( additionalParams ); // Will use page level configuration
27 jQuery( '#googleplus_button' ).animate({ opacity: 0.5 });
28 });
29 }
30