|
17 | 17 | <!DOCTYPE html> |
18 | 18 | <html> |
19 | 19 | <head> |
20 | | - <title>Picker API Quickstart</title> |
| 20 | + <title>Google Picker API Quickstart</title> |
21 | 21 | <meta charset="utf-8" /> |
22 | 22 | </head> |
23 | 23 | <body> |
24 | | -<p>Picker API API Quickstart</p> |
| 24 | +<p>Google Picker API Quickstart</p> |
25 | 25 |
|
26 | | -<!--Add buttons to initiate auth sequence and sign out--> |
| 26 | +<!--Add buttons to initiate auth sequence and sign out.--> |
27 | 27 | <button id="authorize_button" onclick="handleAuthClick()">Authorize</button> |
28 | 28 | <button id="signout_button" onclick="handleSignoutClick()">Sign Out</button> |
29 | 29 |
|
|
39 | 39 | // included, separated by spaces. |
40 | 40 | const SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly'; |
41 | 41 |
|
42 | | - // TODO(developer): Set to client ID and API key from the Developer Console |
| 42 | + // TODO(developer): Replace with your client ID and API key from https://console.cloud.google.com/. |
43 | 43 | const CLIENT_ID = '<YOUR_CLIENT_ID>'; |
44 | 44 | const API_KEY = '<YOUR_API_KEY>'; |
45 | 45 |
|
46 | | - // TODO(developer): Replace with your own project number from console.developers.google.com. |
| 46 | + // TODO(developer): Replace with your project number from https://console.cloud.google.com/. |
47 | 47 | const APP_ID = '<YOUR_APP_ID>'; |
48 | 48 |
|
49 | 49 | let tokenClient; |
50 | 50 | let accessToken = null; |
51 | 51 | let pickerInited = false; |
52 | 52 | let gisInited = false; |
53 | 53 |
|
54 | | - |
55 | 54 | document.getElementById('authorize_button').style.visibility = 'hidden'; |
56 | 55 | document.getElementById('signout_button').style.visibility = 'hidden'; |
57 | 56 |
|
|
132 | 131 | } |
133 | 132 |
|
134 | 133 | /** |
135 | | - * Create and render a Picker object for searching images. |
| 134 | + * Create and render a Google Picker object for searching images. |
136 | 135 | */ |
137 | 136 | function createPicker() { |
138 | 137 | const view = new google.picker.View(google.picker.ViewId.DOCS); |
|
152 | 151 |
|
153 | 152 | /** |
154 | 153 | * Displays the file details of the user's selection. |
155 | | - * @param {object} data - Containers the user selection from the picker |
| 154 | + * @param {object} data - Contains the user selection from the Google Picker. |
156 | 155 | */ |
157 | 156 | async function pickerCallback(data) { |
158 | 157 | if (data.action === google.picker.Action.PICKED) { |
159 | | - let text = `Picker response: \n${JSON.stringify(data, null, 2)}\n`; |
| 158 | + let text = `Google Picker response: \n${JSON.stringify(data, null, 2)}\n`; |
160 | 159 | const document = data[google.picker.Response.DOCUMENTS][0]; |
161 | 160 | const fileId = document[google.picker.Document.ID]; |
162 | 161 | console.log(fileId); |
|
0 commit comments