forked from GoogleChrome/chrome-extensions-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.js
32 lines (25 loc) · 911 Bytes
/
options.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2012 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.
(function() {
window.buildbot = window.buildbot || {};
var prefs = new buildbot.PrefStore;
// Initialize the checkbox checked state from the saved preference.
function main() {
var checkbox = document.getElementById('notifications');
prefs.getUseNotifications(function(useNotifications) {
checkbox.checked = useNotifications;
checkbox.addEventListener(
'click',
function() {prefs.setUseNotifications(checkbox.checked);});
});
var textbox = document.getElementById('try-job-username');
prefs.getTryJobUsername(function(tryJobUsername) {
textbox.value = tryJobUsername;
textbox.addEventListener(
'change',
function() {prefs.setTryJobUsername(textbox.value);});
});
}
main();
})();