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
3 // found in the LICENSE file.
5 var Preferences
= options
.Preferences
;
6 var DetailsInternetPage
= options
.internet
.DetailsInternetPage
;
9 * DOMContentLoaded handler, sets up the page.
13 document
.documentElement
.setAttribute('os', 'chromeos');
15 // Decorate the existing elements in the document.
16 cr
.ui
.decorate('input[pref][type=checkbox]', options
.PrefCheckbox
);
17 cr
.ui
.decorate('input[pref][type=number]', options
.PrefNumber
);
18 cr
.ui
.decorate('input[pref][type=radio]', options
.PrefRadio
);
19 cr
.ui
.decorate('input[pref][type=range]', options
.PrefRange
);
20 cr
.ui
.decorate('select[pref]', options
.PrefSelect
);
21 cr
.ui
.decorate('input[pref][type=text]', options
.PrefTextField
);
22 cr
.ui
.decorate('input[pref][type=url]', options
.PrefTextField
);
24 DetailsInternetPage
.initializeProxySettings();
26 // TODO(ivankr): remove when http://crosbug.com/20660 is resolved.
27 var inputs
= document
.querySelectorAll('input[pref]');
28 for (var i
= 0, el
; el
= inputs
[i
]; i
++) {
29 el
.addEventListener('keyup', function(e
) {
30 cr
.dispatchSimpleEvent(this, 'change');
34 Preferences
.getInstance().initialize();
35 chrome
.send('coreOptionsInitialize');
37 var params
= parseQueryParams(window
.location
);
38 var network
= params
.network
;
40 console
.error('Error: No network argument provided!');
43 chrome
.send('selectNetwork', [network
]);
45 DetailsInternetPage
.showProxySettings();
48 disableTextSelectAndDrag(function(e
) {
50 return src
instanceof HTMLTextAreaElement
||
51 src
instanceof HTMLInputElement
&&
52 /text|url/.test(src
.type
);
55 document
.addEventListener('DOMContentLoaded', load
);