X-Git-Url: https://git.wh0rd.org/?p=chrome-ext%2Fwake-on-lan.git;a=blobdiff_plain;f=js%2Fmain.js;fp=js%2Fmain.js;h=0978f8faf0999fa434c5e2642aeedadcdb9e7821;hp=b6ce2a9f6d184677d098dca4300a5a27fc64a0fa;hb=6293bf85123c57c4ead5dee7cdce7a07a4290a22;hpb=dbe21571384c2d2a22c9c0ed48b5848267ab4975 diff --git a/js/main.js b/js/main.js index b6ce2a9..0978f8f 100644 --- a/js/main.js +++ b/js/main.js @@ -199,12 +199,14 @@ var settings_keys = [ 'mac', 'pass', 'port', + 'theme', ]; function load_settings() { var storage = chrome.storage.local; chrome.storage.local.get(settings_keys, function(settings) { + set_theme(settings['theme'] || 'dark'); var form = $$('form[name=settings]'); form.host.value = settings['host'] || '192.168.0.255'; form.port.value = settings['port'] || '40000'; @@ -227,6 +229,7 @@ function store_settings() { 'mac': form.mac.value, 'pass': form.pass.value, 'port': form.port.value, + 'theme': curr_theme, }; chrome.storage.local.set(settings); } @@ -238,6 +241,7 @@ window.onload = function() { $$('form[name=settings]').onsubmit = send; $$('a[name=mac-paste]').onclick = paste_mac; $$('a[name=pass-paste]').onclick = paste_pass; + $$('input[name=theme]').onclick = toggle_theme; load_settings(); };