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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * A lookup helper function to find the first node that has an id (starting | 9 * A lookup helper function to find the first node that has an id (starting |
10 * at |node| and going up the parent chain). | 10 * at |node| and going up the parent chain). |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 var item = node.querySelector('.extension-list-item'); | 77 var item = node.querySelector('.extension-list-item'); |
78 item.style.backgroundImage = 'url(' + extension.icon + ')'; | 78 item.style.backgroundImage = 'url(' + extension.icon + ')'; |
79 | 79 |
80 var title = node.querySelector('.extension-title'); | 80 var title = node.querySelector('.extension-title'); |
81 title.textContent = extension.name; | 81 title.textContent = extension.name; |
82 | 82 |
83 var version = node.querySelector('.extension-version'); | 83 var version = node.querySelector('.extension-version'); |
84 version.textContent = extension.version; | 84 version.textContent = extension.version; |
85 | 85 |
86 var description = node.querySelector('.extension-description'); | 86 var description = node.querySelector('.extension-description span'); |
87 description.textContent = extension.description; | 87 description.textContent = extension.description; |
88 | 88 |
89 // The 'Show Browser Action' button. | 89 // The 'Show Browser Action' button. |
90 if (extension.enable_show_button) { | 90 if (extension.enable_show_button) { |
91 var showButton = node.querySelector('.show-button'); | 91 var showButton = node.querySelector('.show-button'); |
92 showButton.addEventListener('click', function(e) { | 92 showButton.addEventListener('click', function(e) { |
93 chrome.send('extensionSettingsShowButton', [extension.id]); | 93 chrome.send('extensionSettingsShowButton', [extension.id]); |
94 }); | 94 }); |
95 showButton.hidden = false; | 95 showButton.hidden = false; |
96 } | 96 } |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 267 } |
268 | 268 |
269 this.appendChild(node); | 269 this.appendChild(node); |
270 } | 270 } |
271 }; | 271 }; |
272 | 272 |
273 return { | 273 return { |
274 ExtensionsList: ExtensionsList | 274 ExtensionsList: ExtensionsList |
275 }; | 275 }; |
276 }); | 276 }); |
OLD | NEW |