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

Unified Diff: polymer_1.0.4/bower_components/google-signin/demo/index.html

Issue 1205703007: Add polymer 1.0 to npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Renamed folder to 1.0.4 Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: polymer_1.0.4/bower_components/google-signin/demo/index.html
diff --git a/polymer_1.0.4/bower_components/google-signin/demo/index.html b/polymer_1.0.4/bower_components/google-signin/demo/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..ee54ac22cd07fa39cc4aabf312bd776cfb640e6c
--- /dev/null
+++ b/polymer_1.0.4/bower_components/google-signin/demo/index.html
@@ -0,0 +1,142 @@
+<!doctype html>
+<!-- Copyright (c) 2014 Google Inc. All rights reserved. -->
+<html>
+<head>
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
+
+ <title>google-signin Demo</title>
+
+ <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
+ <link rel="import" href="../google-signin.html">
+ <link rel="import" href="../google-signin-aware.html">
+
+ <!-- Demo only styles -->
+ <style>
+ body {
+ font-family: 'RobotoDraft', 'Roboto', sans-serif;
+ line-height:1.2;
+ vertical-align:middle;
+ background: rgba(204, 204, 204, 0.31);
+ }
+
+
+ .map {
+ background: whitesmoke;
+ margin: .5rem -1.5rem 0 -1.5rem;
+ padding: 0.5rem;
+ }
+
+ h1 {
+ font-size: 2rem;
+ font-weight:200;
+ clear: both;
+ }
+
+ h1 strong {
+ font-weight:300;
+ color:#539D00;
+ }
+
+ h2 {
+ font-size:.9rem;
+ line-height:2.5;
+ color:gray;
+ font-weight:400;
+ clear: both;
+ }
+
+ .showcase {
+ display: inline-block;
+ margin-right: 2rem;
+ float: left;
+ }
+ </style>
+
+</head>
+
+<body>
+ <p>A <code>&lt;google-signin&gt;</code> element looks like this button:</p>
+
+ <p><google-signin brand="google" client-id="1054047045356-j8pgqgls9vdef3rl09hapoicumbte0bo.apps.googleusercontent.com"></google-signin>
+or like this if plus scopes are present
+ <google-signin brand="google-plus"></google-signin>
+ </p>
+ <p>Signin button can vary its appearance:</p>
+ <p>Width:
+ <google-signin brand="google" width="wide"></google-signin>
+ <google-signin brand="google" width="iconOnly"></google-signin>
+ Height:
+ <google-signin brand="google" height="tall"></google-signin>
+ <google-signin brand="google" height="standard"></google-signin>
+ <google-signin brand="google" height="short"></google-signin>
+ </p>
+ <p>
+ Theme:
+ <google-signin brand="google" theme="dark"></google-signin>
+ <google-signin brand="google" theme="light"></google-signin>
+ <google-signin brand="google-plus" theme="light"></google-signin>
+ <google-signin brand="google-plus" theme="light" raised></google-signin>
+ </p>
+ <!-- Demo the ability to use the google-signin-aware element. -->
+ <p><code>&lt;google-signin-aware&gt;</code> is a companion element.</p>
+ <p>You can use it inside your components to request additional scopes.</p>
+ <p>Every signin button will request all the scopes present in the document,
+ and change its appearance to match</p>
+ <p>For example, here is a signin-aware scope. You can change its scopes via popup</p>
+ <template id="awareness" is="dom-bind">
+ <div><code>&lt;google-signin-aware
+ <div>scope=
+ <select value="{{scope::change}}">
+ <option value="">None</option>
+ <option value="https://www.googleapis.com/auth/analytics">Google Analytics</option>
+ <option value="https://www.googleapis.com/auth/plus.login">Google Plus view circles</option>
+ <option value="https://www.googleapis.com/auth/youtube">YouTube</option>
+ <option value="https://www.googleapis.com/auth/calendar">Calendar</option>
+ <option value="profile">Profile info</option>
+ </select>
+ </div>
+ <div>signedIn="<span>{{signedIn}}</span>"</div>
+ <div>isAuthorized="<span>{{isAuthorized}}</span>"</div>
+ <div>needAdditionalAuth:"<span>{{needAdditionalAuth}}</span>"&gt;</div>
+ </code></div>
+ <p>Every new scope you select will be added to requested scopes.</p>
+ <p>When you select a Google Plus scope, button will turn red.</p>
+ <google-signin></google-signin>
+ </p>
+ <google-signin-aware
+ scopes="{{scope}}"
+ signed-in="{{signedIn}}"
+ is-authorized="{{isAuthorized}}"
+ need-additional-auth="{{needAdditionalAuth}}"
+ on-google-signin-aware-success="handleSignIn"
+ on-google-signin-aware-signed-out="handleSignOut"></google-signin-aware>
+ <p>User name:<span>{{userName}}</span></p>
+ <p>Testing <code>google-signin-aware</code> events: <span>{{status}}</span></p>
+ <p><button on-click="disconnect">Disconnect to start over</button></p>
+ </template>
+ <script>
+ var aware = document.querySelector('#awareness');
+ aware.status = 'Not granted';
+ aware.userName = 'N/A';
+ aware.handleSignIn = function(response) {
+ this.status = 'Signin granted';
+ // console.log('[Aware] Signin Response', response);
+ this.userName = gapi.auth2.getAuthInstance().currentUser.get().getBasicProfile().getName();
+ };
+ aware.handleSignOut = function(response) {
+ this.status = 'Signed out';
+ // console.log('[Aware] Signout Response', response);
+ this.userName = 'N/A';
+ };
+ aware.disconnect = function() {
+ var b = document.querySelector('google-signin');
+ var currentUser = gapi.auth2.getAuthInstance().currentUser.get();
+ if (currentUser) {
+ currentUser.disconnect();
+ }
+ gapi.auth2.getAuthInstance().signOut();
+ };
+
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698