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

Unified Diff: polymer_1.0.4/bower_components/ga-api-utils/build/demo.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/ga-api-utils/build/demo.html
diff --git a/polymer_1.0.4/bower_components/ga-api-utils/build/demo.html b/polymer_1.0.4/bower_components/ga-api-utils/build/demo.html
new file mode 100644
index 0000000000000000000000000000000000000000..23ec919d93a879f39c191e192a80b25ec2be92a2
--- /dev/null
+++ b/polymer_1.0.4/bower_components/ga-api-utils/build/demo.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Google Analytics JavaScript API Untilities Demo</title>
+</head>
+<body>
+
+<div id="embed-api-auth-container"></div>
+<pre id="account-summaries-output"></pre>
+
+<!-- Load the account summaries module, it will be at:
+ `window.gaApiUtils.accountSummaries` -->
+<script src="ga-api-utils.js"></script>
+
+<script>
+// Use the Embed API to authorize the user.
+(function(w,d,s,g,js,fs){
+ g=w.gapi||(w.gapi={});g.analytics={q:[],ready:function(f){this.q.push(f);}};
+ js=d.createElement(s);fs=d.getElementsByTagName(s)[0];
+ js.src='https://apis.google.com/js/platform.js';
+ fs.parentNode.insertBefore(js,fs);js.onload=function(){g.load('analytics');};
+}(window,document,'script'));
+
+gapi.analytics.ready(function() {
+
+ // Run the demo once the user is authorized.
+ gapi.analytics.auth.on('success', gaApiUtilsDemo);
+
+ // This client ID will work at http://localhost:8080.
+ // To run this demo on other hosts or ports, you must use your own client ID.
+ gapi.analytics.auth.authorize({
+ container: 'embed-api-auth-container',
+ clientid: '793177639245-olst43lspv93vkoql0b9l26hmpf9kfmv.apps.googleusercontent.com',
+ });
+});
+
+function gaApiUtilsDemo() {
+ var output = document.getElementById('account-summaries-output');
+ gaApiUtils.accountSummaries.get().then(
+ function onResolved(summaries) {
+ output.innerText = JSON.stringify(summaries.all(), null, 2);
+ },
+ function onRejected(error) {
+ output.innerText = error.message;
+ }
+ );
+}
+</script>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698