| Index: chrome/common/extensions/docs/examples/api/notifications/options.js
|
| diff --git a/chrome/common/extensions/docs/examples/api/notifications/options.js b/chrome/common/extensions/docs/examples/api/notifications/options.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9f5e6a29a3b72f5e3cebfcdea8f4ada14aac5881
|
| --- /dev/null
|
| +++ b/chrome/common/extensions/docs/examples/api/notifications/options.js
|
| @@ -0,0 +1,33 @@
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +/*
|
| + Grays out or [whatever the opposite of graying out is called] the option
|
| + field.
|
| +*/
|
| +function ghost(isDeactivated) {
|
| + options.style.color = isDeactivated ? 'graytext' : 'black';
|
| + // The label color.
|
| + options.frequency.disabled = isDeactivated; // The control manipulability.
|
| +}
|
| +
|
| +window.addEventListener('load', function() {
|
| + // Initialize the option controls.
|
| + options.isActivated.checked = JSON.parse(localStorage.isActivated);
|
| + // The display activation.
|
| + options.frequency.value = localStorage.frequency;
|
| + // The display frequency, in minutes.
|
| +
|
| + if (!options.isActivated.checked) { ghost(true); }
|
| +
|
| + // Set the display activation and frequency.
|
| + options.isActivated.onchange = function() {
|
| + localStorage.isActivated = options.isActivated.checked;
|
| + ghost(!options.isActivated.checked);
|
| + };
|
| +
|
| + options.frequency.onchange = function() {
|
| + localStorage.frequency = options.frequency.value;
|
| + };
|
| +});
|
|
|