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
3 // found in the LICENSE file.
6 Grays out or [whatever the opposite of graying out is called] the option
9 function ghost(isDeactivated) {
10 options.style.color = isDeactivated ? 'graytext' : 'black';
12 options.frequency.disabled = isDeactivated; // The control manipulability.
15 window.addEventListener('load', function() {
16 // Initialize the option controls.
17 options.isActivated.checked = JSON.parse(localStorage.isActivated);
18 // The display activation.
19 options.frequency.value = localStorage.frequency;
20 // The display frequency, in minutes.
22 if (!options.isActivated.checked) { ghost(true); }
24 // Set the display activation and frequency.
25 options.isActivated.onchange = function() {
26 localStorage.isActivated = options.isActivated.checked;
27 ghost(!options.isActivated.checked);
30 options.frequency.onchange = function() {
31 localStorage.frequency = options.frequency.value;