| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 function getAppsCallback(data) { | 5 function getAppsCallback(data) { |
| 6 logEvent('recieved apps'); | 6 logEvent('recieved apps'); |
| 7 var appsSection = $('apps-section'); | 7 var appsSection = $('apps-section'); |
| 8 var debugSection = $('debug'); | 8 var appsSectionContent = $('apps-section-content'); |
| 9 appsSection.textContent = ''; | 9 appsSectionContent.textContent = ''; |
| 10 | 10 |
| 11 data.apps.forEach(function(app) { | 11 data.apps.forEach(function(app) { |
| 12 appsSection.appendChild(apps.createElement(app)); | 12 appsSectionContent.appendChild(apps.createElement(app)); |
| 13 }); | 13 }); |
| 14 | 14 |
| 15 // TODO(aa): Figure out what to do with the debug mode when we turn apps on | 15 appsSectionContent.appendChild(apps.createWebStoreElement()); |
| 16 // for everyone. | |
| 17 if (appsSection.hasChildNodes()) { | |
| 18 appsSection.classList.remove('disabled'); | |
| 19 if (data.showDebugLink) { | |
| 20 debugSection.classList.remove('disabled'); | |
| 21 } | |
| 22 | |
| 23 appsSection.appendChild(apps.createWebStoreElement()); | |
| 24 } else { | |
| 25 appsSection.classList.add('disabled'); | |
| 26 debugSection.classList.add('disabled'); | |
| 27 } | |
| 28 } | 16 } |
| 29 | 17 |
| 30 var apps = { | 18 var apps = { |
| 31 /** | 19 /** |
| 32 * @this {!HTMLAnchorElement} | 20 * @this {!HTMLAnchorElement} |
| 33 */ | 21 */ |
| 34 handleClick_: function() { | 22 handleClick_: function() { |
| 35 var launchType = ''; | 23 var launchType = ''; |
| 36 var inputElements = document.querySelectorAll( | 24 var inputElements = document.querySelectorAll( |
| 37 '#apps-launch-control input'); | 25 '#apps-launch-control input'); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 }, | 112 }, |
| 125 | 113 |
| 126 createWebStoreElement: function() { | 114 createWebStoreElement: function() { |
| 127 return this.createElement_({ | 115 return this.createElement_({ |
| 128 'id': 'web-store-entry', | 116 'id': 'web-store-entry', |
| 129 'name': localStrings.getString('web_store_title'), | 117 'name': localStrings.getString('web_store_title'), |
| 130 'launch_url': localStrings.getString('web_store_url') | 118 'launch_url': localStrings.getString('web_store_url') |
| 131 }); | 119 }); |
| 132 } | 120 } |
| 133 }; | 121 }; |
| OLD | NEW |