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 17 matching lines...) Expand all Loading... | |
28 /** | 28 /** |
29 * @type {Object.<string, boolean>} A map from extension id to a boolean | 29 * @type {Object.<string, boolean>} A map from extension id to a boolean |
30 * indicating whether the incognito warning is showing. This persists | 30 * indicating whether the incognito warning is showing. This persists |
31 * between calls to decorate. | 31 * between calls to decorate. |
32 */ | 32 */ |
33 var butterBarVisibility = {}; | 33 var butterBarVisibility = {}; |
34 | 34 |
35 ExtensionsList.prototype = { | 35 ExtensionsList.prototype = { |
36 __proto__: HTMLDivElement.prototype, | 36 __proto__: HTMLDivElement.prototype, |
37 | 37 |
38 // Appended to icon URL as a query string to prevent icon caching. | |
39 // Increments each time an extension is reloaded. | |
not at google - send to devlin
2013/02/12 22:57:52
use jsdoc style
/**
* @type {number} Appended to
epeterson
2013/02/12 23:52:42
Done.
| |
40 iconQueryId_: 0, | |
41 | |
38 /** @override */ | 42 /** @override */ |
39 decorate: function() { | 43 decorate: function() { |
40 this.textContent = ''; | 44 this.textContent = ''; |
41 | 45 |
42 this.showExtensionNodes_(); | 46 this.showExtensionNodes_(); |
43 }, | 47 }, |
44 | 48 |
45 getIdQueryParam_: function() { | 49 getIdQueryParam_: function() { |
46 return parseQueryParams(document.location)['id']; | 50 return parseQueryParams(document.location)['id']; |
47 }, | 51 }, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 node.classList.add('inactive-extension'); | 94 node.classList.add('inactive-extension'); |
91 | 95 |
92 if (!extension.userModifiable) | 96 if (!extension.userModifiable) |
93 node.classList.add('may-not-disable'); | 97 node.classList.add('may-not-disable'); |
94 | 98 |
95 var id_to_highlight = this.getIdQueryParam_(); | 99 var id_to_highlight = this.getIdQueryParam_(); |
96 if (node.id == id_to_highlight) | 100 if (node.id == id_to_highlight) |
97 node.classList.add('extension-highlight'); | 101 node.classList.add('extension-highlight'); |
98 | 102 |
99 var item = node.querySelector('.extension-list-item'); | 103 var item = node.querySelector('.extension-list-item'); |
100 item.style.backgroundImage = 'url(' + extension.icon + ')'; | 104 item.style.backgroundImage = 'url(' + extension.icon + '?' + |
105 (++this.iconQueryId_) + ')'; | |
not at google - send to devlin
2013/02/12 22:57:52
I think () around ++this.iconQueryId_ are unnecess
epeterson
2013/02/12 23:52:42
Done.
| |
101 | 106 |
102 var title = node.querySelector('.extension-title'); | 107 var title = node.querySelector('.extension-title'); |
103 title.textContent = extension.name; | 108 title.textContent = extension.name; |
104 | 109 |
105 var version = node.querySelector('.extension-version'); | 110 var version = node.querySelector('.extension-version'); |
106 version.textContent = extension.version; | 111 version.textContent = extension.version; |
107 | 112 |
108 var disableReason = node.querySelector('.extension-disable-reason'); | 113 var disableReason = node.querySelector('.extension-disable-reason'); |
109 disableReason.textContent = extension.disableReason; | 114 disableReason.textContent = extension.disableReason; |
110 | 115 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 } | 333 } |
329 | 334 |
330 this.appendChild(node); | 335 this.appendChild(node); |
331 } | 336 } |
332 }; | 337 }; |
333 | 338 |
334 return { | 339 return { |
335 ExtensionsList: ExtensionsList | 340 ExtensionsList: ExtensionsList |
336 }; | 341 }; |
337 }); | 342 }); |
OLD | NEW |