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.
7 window.buildbot = window.buildbot || {};
9 var prefs = new buildbot.PrefStore;
11 // Initialize the checkbox checked state from the saved preference.
13 var checkbox = document.getElementById('notifications');
14 prefs.getUseNotifications(function(useNotifications) {
15 checkbox.checked = useNotifications;
16 checkbox.addEventListener(
18 function() {prefs.setUseNotifications(checkbox.checked);});
21 var textbox = document.getElementById('try-job-username');
22 prefs.getTryJobUsername(function(tryJobUsername) {
23 textbox.value = tryJobUsername;
24 textbox.addEventListener(
26 function() {prefs.setTryJobUsername(textbox.value);});