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 // TODO(ivankr): remove when http://crosbug.com/20660 is resolved. |
| 29 var inputs = document.querySelectorAll('input[pref]'); |
| 30 for (var i = 0, el; el = inputs[i]; i++) { |
| 31 el.addEventListener('keyup', function(e) { |
| 32 cr.dispatchSimpleEvent(this, 'change'); |
| 33 }); |
| 34 } |
| 35 |
28 Preferences.getInstance().initialize(); | 36 Preferences.getInstance().initialize(); |
29 chrome.send('coreOptionsInitialize'); | 37 chrome.send('coreOptionsInitialize'); |
30 | 38 |
31 ProxyOptions.getInstance().visible = true; | 39 ProxyOptions.getInstance().visible = true; |
32 } | 40 } |
33 | 41 |
34 document.addEventListener('DOMContentLoaded', load); | 42 document.addEventListener('DOMContentLoaded', load); |
35 | 43 |
OLD | NEW |