OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 var OptionsPage = options.OptionsPage; | 5 var OptionsPage = options.OptionsPage; |
6 var Preferences = options.Preferences; | 6 var Preferences = options.Preferences; |
7 var ProxyOptions = options.ProxyOptions; | 7 var ProxyOptions = options.ProxyOptions; |
8 | 8 |
9 /** | 9 /** |
10 * DOMContentLoaded handler, sets up the page. | 10 * DOMContentLoaded handler, sets up the page. |
11 */ | 11 */ |
12 function load() { | 12 function load() { |
13 localStrings = new LocalStrings(); | 13 localStrings = new LocalStrings(); |
14 | 14 |
15 if (cr.isChromeOS) | 15 if (cr.isChromeOS) |
16 document.documentElement.setAttribute('os', 'chromeos'); | 16 document.documentElement.setAttribute('os', 'chromeos'); |
17 | 17 |
18 // Decorate the existing elements in the document. | 18 // Decorate the existing elements in the document. |
19 cr.ui.decorate('input[pref][type=checkbox]', options.PrefCheckbox); | 19 cr.ui.decorate('input[pref][type=checkbox]', options.PrefCheckbox); |
20 cr.ui.decorate('input[pref][type=number]', options.PrefNumber); | 20 cr.ui.decorate('input[pref][type=number]', options.PrefNumber); |
21 cr.ui.decorate('input[pref][type=radio]', options.PrefRadio); | 21 cr.ui.decorate('input[pref][type=radio]', options.PrefRadio); |
22 cr.ui.decorate('input[pref][type=range]', options.PrefRange); | 22 cr.ui.decorate('input[pref][type=range]', options.PrefRange); |
23 cr.ui.decorate('select[pref]', options.PrefSelect); | 23 cr.ui.decorate('select[pref]', options.PrefSelect); |
24 cr.ui.decorate('input[pref][type=text]', options.PrefTextField); | 24 cr.ui.decorate('input[pref][type=text]', options.PrefTextField); |
25 cr.ui.decorate('input[pref][type=url]', options.PrefTextField); | 25 cr.ui.decorate('input[pref][type=url]', options.PrefTextField); |
26 ProxyOptions.getInstance().initializePage(); | 26 ProxyOptions.getInstance().initializePage(); |
27 | 27 |
28 var inputs = document.querySelectorAll('input[pref]'); | |
xiyuan
2011/09/21 17:14:37
nit: Let's put a TODO here to remove this when 206
Ivan Korotkov
2011/09/21 17:39:01
Done.
| |
29 for (var i = 0, el; el = inputs[i]; i++) { | |
30 el.addEventListener('keyup', function(e) { | |
31 cr.dispatchSimpleEvent(this, 'change'); | |
32 }); | |
33 } | |
34 | |
28 Preferences.getInstance().initialize(); | 35 Preferences.getInstance().initialize(); |
29 chrome.send('coreOptionsInitialize'); | 36 chrome.send('coreOptionsInitialize'); |
30 | 37 |
31 ProxyOptions.getInstance().visible = true; | 38 ProxyOptions.getInstance().visible = true; |
32 } | 39 } |
33 | 40 |
34 document.addEventListener('DOMContentLoaded', load); | 41 document.addEventListener('DOMContentLoaded', load); |
35 | 42 |
OLD | NEW |