| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Updates the Drive related Flags section. | 6 * Updates the Drive related Flags section. |
| 7 * @param {Array} flags List of dictionaries describing flags. | 7 * @param {Array} flags List of dictionaries describing flags. |
| 8 */ | 8 */ |
| 9 function updateDriveRelatedFlags(flags) { | 9 function updateDriveRelatedFlags(flags) { |
| 10 var ul = $('drive-related-flags'); | 10 var ul = $('drive-related-flags'); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 deltaUpdateStatus['push-notification-enabled']; | 181 deltaUpdateStatus['push-notification-enabled']; |
| 182 $('polling-interval-sec').textContent = | 182 $('polling-interval-sec').textContent = |
| 183 deltaUpdateStatus['polling-interval-sec']; | 183 deltaUpdateStatus['polling-interval-sec']; |
| 184 $('last-update-check-time').textContent = | 184 $('last-update-check-time').textContent = |
| 185 deltaUpdateStatus['last-update-check-time']; | 185 deltaUpdateStatus['last-update-check-time']; |
| 186 $('last-update-check-error').textContent = | 186 $('last-update-check-error').textContent = |
| 187 deltaUpdateStatus['last-update-check-error']; | 187 deltaUpdateStatus['last-update-check-error']; |
| 188 } | 188 } |
| 189 | 189 |
| 190 /** | 190 /** |
| 191 * Updates the event log section. |
| 192 * @param {Array} log Array of events. |
| 193 */ |
| 194 function updateEventLog(log) { |
| 195 var ul = $('event-log'); |
| 196 updateKeyValueList(ul, log); |
| 197 } |
| 198 |
| 199 /** |
| 191 * Creates an element named |elementName| containing the content |text|. | 200 * Creates an element named |elementName| containing the content |text|. |
| 192 * @param {string} elementName Name of the new element to be created. | 201 * @param {string} elementName Name of the new element to be created. |
| 193 * @param {string} text Text to be contained in the new element. | 202 * @param {string} text Text to be contained in the new element. |
| 194 * @return {HTMLElement} The newly created HTML element. | 203 * @return {HTMLElement} The newly created HTML element. |
| 195 */ | 204 */ |
| 196 function createElementFromText(elementName, text) { | 205 function createElementFromText(elementName, text) { |
| 197 var element = document.createElement(elementName); | 206 var element = document.createElement(elementName); |
| 198 element.appendChild(document.createTextNode(text)); | 207 element.appendChild(document.createTextNode(text)); |
| 199 return element; | 208 return element; |
| 200 } | 209 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 228 a.href = '#' + section.id; | 237 a.href = '#' + section.id; |
| 229 var li = document.createElement('li'); | 238 var li = document.createElement('li'); |
| 230 li.appendChild(a); | 239 li.appendChild(a); |
| 231 toc.appendChild(li); | 240 toc.appendChild(li); |
| 232 } | 241 } |
| 233 | 242 |
| 234 window.setInterval(function() { | 243 window.setInterval(function() { |
| 235 chrome.send('periodicUpdate'); | 244 chrome.send('periodicUpdate'); |
| 236 }, 1000); | 245 }, 1000); |
| 237 }); | 246 }); |
| OLD | NEW |