forked from googleworkspace/browser-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
77 lines (70 loc) · 3.08 KB
/
index.html
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
<!--
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html>
<head>
<title>Google Sheets API Quickstart</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.4.2/mocha.min.css">
<meta charset="utf-8" />
</head>
<body>
<h2>Google Sheets API</h2>
<h3>Snippets - Javascript</h3>
<!--Add buttons to initiate auth sequence and sign out-->
<button id="authorize_button" style="display: none;">Authorize</button>
<button id="signout_button" style="display: none;">Sign Out</button>
<div id="mocha"></div>
<pre id="content"></pre>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.4.2/mocha.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.0.2/chai.min.js"></script>
<script src="base_test.js"></script>
<script src="test_snippets.js"></script>
<script src="snippets.js"></script>
<script type="text/javascript">
// Mocha/Chai (Global)
var assert = chai.assert;
mocha.setup('bdd');
/**
* Called when the signed in status changes, to update the UI
* appropriately. After a sign-in, the API is called.
*/
function updateSigninStatus(isSignedIn) {
if (isSignedIn) {
authorizeButton.style.display = 'none';
signoutButton.style.display = 'block';
describe('Google Sheets API', function() {
this.timeout(10000);
it('should create a spreadsheet', testCreateSpreadsheet);
it('should batch update a spreadsheet', testBatchUpdateSpreadsheet);
it('should get spreadsheet values', testGetSpreadsheetValues);
it('should batch get spreadsheet values', testBatchGetSpreadsheetValues);
it('should update spreadsheet values', testUpdateSpreadsheetValues);
it('should batch update spreadsheet values', testBatchUpdateSpreadsheetValues);
it('should append values to a spreadsheet', testAppendSpreadsheetValues);
it('should create pivot tables', testCreatePivotTables);
it('should conditionally format', testConditionallyFormat);
});
after(tearDown);
mocha.run();
} else {
authorizeButton.style.display = 'block';
signoutButton.style.display = 'none';
}
}
</script>
<script async defer src="https://apis.google.com/js/api.js"
onload="this.onload=function(){};handleClientLoad()"
onreadystatechange="if (this.readyState === 'complete') this.onload()">
</script>
</body>
</html>