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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 | 6 |
7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
8 | 8 |
9 ////////////////////////////////////////////////////////////////////////////// | 9 ////////////////////////////////////////////////////////////////////////////// |
10 // ContentSettings class: | 10 // ContentSettings class: |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 }, | 71 }, |
72 }; | 72 }; |
73 | 73 |
74 /** | 74 /** |
75 * Sets the values for all the content settings radios. | 75 * Sets the values for all the content settings radios. |
76 * @param {Object} dict A mapping from radio groups to the checked value for | 76 * @param {Object} dict A mapping from radio groups to the checked value for |
77 * that group. | 77 * that group. |
78 */ | 78 */ |
79 ContentSettings.setContentFilterSettingsValue = function(dict) { | 79 ContentSettings.setContentFilterSettingsValue = function(dict) { |
80 for (var group in dict) { | 80 for (var group in dict) { |
81 document.querySelector('input[type=radio][name=' + group + | 81 document.querySelector('input[type=radio][name=' + group + '][value=' + |
82 '][value=' + dict[group] + ']').checked = true; | 82 dict[group]['value'] + ']').checked = true; |
83 var radios = document.querySelectorAll('input[type=radio][name=' + | |
84 group + ']'); | |
85 for (var i=0, len=radios.length; i<len; ++i) { | |
jochen (gone - plz use gerrit)
2010/12/07 09:43:52
spaces around operators, and i++
markusheintz_
2010/12/07 11:46:15
Done.
| |
86 radios[i].disabled = dict[group]['managed']; | |
87 } | |
88 | |
jochen (gone - plz use gerrit)
2010/12/07 09:43:52
no newline please
markusheintz_
2010/12/07 11:46:15
Done.
| |
83 } | 89 } |
84 }; | 90 }; |
85 | 91 |
86 /** | 92 /** |
87 * Initializes an exceptions list. | 93 * Initializes an exceptions list. |
88 * @param {string} type The content type that we are setting exceptions for. | 94 * @param {string} type The content type that we are setting exceptions for. |
89 * @param {Array} list An array of pairs, where the first element of each pair | 95 * @param {Array} list An array of pairs, where the first element of each pair |
90 * is the filter string, and the second is the setting (allow/block). | 96 * is the filter string, and the second is the setting (allow/block). |
91 */ | 97 */ |
92 ContentSettings.setExceptions = function(type, list) { | 98 ContentSettings.setExceptions = function(type, list) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 '] list'); | 164 '] list'); |
159 exceptionsList.patternValidityCheckComplete(pattern, valid); | 165 exceptionsList.patternValidityCheckComplete(pattern, valid); |
160 }; | 166 }; |
161 | 167 |
162 // Export | 168 // Export |
163 return { | 169 return { |
164 ContentSettings: ContentSettings | 170 ContentSettings: ContentSettings |
165 }; | 171 }; |
166 | 172 |
167 }); | 173 }); |
OLD | NEW |