demo-private.html
2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!doctype html>
<!-- Copyright (c) 2015 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-sheets private data demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="../google-sheets.html">
<link rel="import" href="../../google-map/google-map.html">
<link rel="import" href="../../google-signin/google-signin.html">
<style>
* {
box-sizing: border-box;
}
body {
margin: 2em;
font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial;
font-weight: 300;
background-color: #f1f1f3;
}
a {
text-decoration: none;
color: blue;
}
ul {
padding-left: 0;
}
ul, li {
list-style: none;
font-size: 14px;
}
section {
border-radius: 3px;
box-shadow: 1px 1px 3px #ccc;
padding: 1em 2em;
background-color: white;
width: 500px;
min-height: 500px;
}
main {
justify-content: space-around;
margin-top: 2em;
}
</style>
</head>
<body>
<google-signin
client-id="1054047045356-j8pgqgls9vdef3rl09hapoicumbte0bo.apps.googleusercontent.com"
scopes="https://spreadsheets.google.com/feeds">
</google-signin>
<p>A <code><google-sheets></code> element returning data from a <b>private</b> Google Spreadsheet:</p>
<p><b>Note:</b> update the demo source to your clientId and private spreadsheet key for the demo to work.</p>
<main class="layout horizontal">
<template id="spreadsheets" is="dom-bind">
<!-- Example: private spreadsheet -->
<google-sheets id="sheet" tab-id="1"
client-id="1054047045356-j8pgqgls9vdef3rl09hapoicumbte0bo.apps.googleusercontent.com"
key="1QMGizivw3UJ3-R9BFK7sfrXE0RL87dygk2C0RcuKoDY"
open-in-google-docs-url="{{openInGoogleDocsURL}}"
tab="{{tab}}"
spreadsheets="{{spreadsheets}}"
rows="{{rows}}"></google-sheets>
<section>
<heading>
<h3>List of spreadsheets</h3>
</heading>
<ul>
<template is="dom-repeat" items="[[spreadsheets]]">
<li>{{item.title.$t}}</li>
</template>
</ul>
</section>
<section>
<heading>
<h3>Spreadsheet rows:
<a href="{{openInGoogleDocsURL}}" target="_blank" title="Open in Google Docs →">
"<span>{{tab.title}}</span>" tab
</a>
</h3>
<h5>updated: <span>{{tab.updated}}</span>, by: <template is="dom-repeat" items="{{rows.authors}}"><span>{{item.name}}</span></template></h5>
</heading>
<ul>
<template is="dom-repeat" items="{{rows}}">
<li>Name: <span>{{item.gsx$name.$t}}</span> ( lat: <span>{{item.gsx$lat.$t}}</span>, lng: <span>{{item.gsx$lng.$t}}</span> )</li>
</template>
</ul>
</section>
</template>
</main>
</body>
</html>