]> git.wh0rd.org Git - chrome-ext/web-power-switch.git/blob - options.js
add a link to the options page when connection fails
[chrome-ext/web-power-switch.git] / options.js
1 // Written by Mike Frysinger <vapier@gmail.com>.  Released into the public domain.  Suck it.
2
3 function update_settings() {
4         var setting = {};
5         setting[this.id] = this.value;
6         storage.set(setting);
7 }
8
9 window.onload = function() {
10         storage.get(settings_keys, function(settings) {
11                 settings_keys.forEach(function(key) {
12                         var field = document.getElementById(key);
13                         field.value = settings[key] || settings_defaults[key];
14                         field.oninput = update_settings;
15                 });
16         });
17 };