Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: chrome/common/extensions/docs/examples/api/notifications/options.js

Issue 8309001: Adding `content_security_policy` to a few sample extensions. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: License and whitespace. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 /*
6 Grays out or [whatever the opposite of graying out is called] the option
7 field.
8 */
9 function ghost(isDeactivated) {
10 options.style.color = isDeactivated ? 'graytext' : 'black';
11 // The label color.
12 options.frequency.disabled = isDeactivated; // The control manipulability.
13 }
14
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.
21
22 if (!options.isActivated.checked) { ghost(true); }
23
24 // Set the display activation and frequency.
25 options.isActivated.onchange = function() {
26 localStorage.isActivated = options.isActivated.checked;
27 ghost(!options.isActivated.checked);
28 };
29
30 options.frequency.onchange = function() {
31 localStorage.frequency = options.frequency.value;
32 };
33 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698