<commit_before><!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="msapplication-tap-highlight" content="no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <meta name="google-signin-client_id" content="281004210608-u8qtp7kq3b0ue0hud116vis7ll5kk1r2.apps.googleusercontent.com" />
        <!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self' google.com amazonaws.com phonegap.com data: gap: https://ssl.gstatic.com https:; style-src 'self' 'unsafe-inline'; media-src *"> -->
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <title>Vinyl Collection</title>
    </head>
    <body>
        <div class="app">
  <img id="image" style="position:absolute; top:10px; left:10px" src="" />
            <h1>PhoneGap</h1>
            <div id="deviceready">
                <p class="event listening">Connecting to Device</p>
                <p class="event received">Device is Ready</p>

    <p id="feedback">not logged in</p>
    <button onclick="isAvailable()">Available?</button>
    <br/><br/>
    <button onclick="login()">Login with Google+</button>
    <br/><br/>
    <button onclick="trySilentLogin()">Try silent login with Google+</button>
    <br/><br/>
    <button onclick="logout()">Logout</button>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <button onclick="disconnect()">Disconnect</button>
    <br/><br/>
            </div>
        </div>
        <script type="text/javascript" src="js/aws-sdk.min.js"></script>
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="js/index.js"></script>
<!--        <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script> -->
        <script type="text/javascript">
            app.initialize();

  function isAvailable() {
    window.plugins.googleplus.isAvailable(function(avail) {alert(avail)});
  }
  function login() {
    //OAuth.popup('google_plus', { cache: true }).done(function(result) {
    window.plugins.googleplus.login(
        { 'offline': true, 'scopes': 'oauth profile email',
          'webApiKey': '281004210608-u8qtp7kq3b0ue0hud116vis7ll5kk1r2.apps.googleusercontent.com' },
        function (obj) {
          document.querySelector("#image").src = obj.imageUrl;
          document.querySelector("#image").style.visibility = 'visible';
          document.querySelector("#feedback").innerHTML = "Hi, " + obj.displayName + ", " + obj.email;
        },
        function (msg) {
          document.querySelector("#feedback").innerHTML = "error: " + msg;
        }
    );
  }
  function trySilentLogin() {
    OAuth.initialize('Ihw78JWF5ziCxkW7v8nHmhtctBU');
    OAuth.popup('google_plus').done(function(result) {
        console.log(JSON.stringify(result));

        AWS.config.region = "us-east-1";
        var params = {
            IdentityPoolId: 'us-east-1:e41d9661-01a5-4afb-ba65-f47b37bedcd1',
            Logins: {
               'accounts.google.com': result.id_token
            }
        };
        console.log(JSON.stringify(params));
        AWS.config.credentials = new AWS.CognitoIdentityCredentials(params);
	AWS.config.credentials.refresh(function(error) {<commit_msg>OK, new plugin is working as far as I can see!<commit_after><!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="msapplication-tap-highlight" content="no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <meta name="google-signin-client_id" content="281004210608-u8qtp7kq3b0ue0hud116vis7ll5kk1r2.apps.googleusercontent.com" />
        <!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self' google.com amazonaws.com phonegap.com data: gap: https://ssl.gstatic.com https:; style-src 'self' 'unsafe-inline'; media-src *"> -->
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <title>Vinyl Collection</title>
    </head>
    <body>
        <div class="app">
  <img id="image" style="position:absolute; top:10px; left:10px" src="" />
            <h1>PhoneGap</h1>
            <div id="deviceready">
                <p class="event listening">Connecting to Device</p>
                <p class="event received">Device is Ready</p>

    <p id="feedback">not logged in</p>
    <button onclick="isAvailable()">Available?</button>
    <br/><br/>
    <button onclick="login()">Login with Google+</button>
    <br/><br/>
    <button onclick="trySilentLogin()">Try silent login with Google+</button>
    <br/><br/>
    <button onclick="logout()">Logout</button>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <button onclick="disconnect()">Disconnect</button>
    <br/><br/>
            </div>
        </div>
        <script type="text/javascript" src="js/aws-sdk.min.js"></script>
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="js/index.js"></script>
<!--        <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script> -->
        <script type="text/javascript">
            app.initialize();

  function isAvailable() {
    window.plugins.googleplus.isAvailable(function(avail) {alert(avail)});
  }
  function login() {
    //OAuth.popup('google_plus', { cache: true }).done(function(result) {
    window.plugins.googleplus.login(
        { 'offline': true, 'scopes': 'profile email',
          'webClientId': '281004210608-u8qtp7kq3b0ue0hud116vis7ll5kk1r2.apps.googleusercontent.com' },
        function (obj) {
          document.querySelector("#image").src = obj.imageUrl;
          document.querySelector("#image").style.visibility = 'visible';
<!--          document.querySelector("#feedback").innerHTML = "Hi, " + obj.displayName + ", " + obj.email; -->
          document.querySelector("#feedback").innerHTML = JSON.stringify(obj);
        },
        function (msg) {
          document.querySelector("#feedback").innerHTML = "error: " + msg;
        }
    );
  }
  function trySilentLogin() {
    OAuth.initialize('Ihw78JWF5ziCxkW7v8nHmhtctBU');
    OAuth.popup('google_plus').done(function(result) {
        console.log(JSON.stringify(result));

        AWS.config.region = "us-east-1";
        var params = {
            IdentityPoolId: 'us-east-1:e41d9661-01a5-4afb-ba65-f47b37bedcd1',
            Logins: {
               'accounts.google.com': result.id_token
            }
        };
        console.log(JSON.stringify(params));
        AWS.config.credentials = new AWS.CognitoIdentityCredentials(params);
	AWS.config.credentials.refresh(function(error) {
{'fraction_non_alphanumeric': 0.17162944582299422, 'fraction_numerical': 0.02481389578163772, 'mean_word_length': 3.0689848569826137, 'pattern_counts': {'":': 0, '<': 118, '<?xml version=': 0, '>': 118, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2076693', 'n_tokens_mistral': 2404, 'n_tokens_neox': 2301, 'n_words': 361}