aboutsummaryrefslogtreecommitdiff
path: root/chrome
diff options
context:
space:
mode:
authorEinar Egilsson2011-08-29 16:55:35 +0200
committerEinar Egilsson2011-08-29 16:55:35 +0200
commit66ad230105ccf1b504d9589886f174020c324b18 (patch)
treefe63fe3493fe0a9e796f9aa14507db22277d664b /chrome
parent14c86c9676cd02a61c0a2d1254ea1843d7713473 (diff)
Config entries working in new html settings
Diffstat (limited to 'chrome')
-rw-r--r--chrome/js/settings.js15
-rw-r--r--chrome/settings.html12
2 files changed, 21 insertions, 6 deletions
diff --git a/chrome/js/settings.js b/chrome/js/settings.js
index 195b2af..3ab7c25 100644
--- a/chrome/js/settings.js
+++ b/chrome/js/settings.js
@@ -82,4 +82,19 @@ $(document).ready(function() {
$('#import').click(importRedirects);
$('#export').click(exportRedirects);
+
+ function bindConfig() {
+ $('#config input[type="checkbox"]').each(function() {
+ var pref = $(this).attr('data-pref');
+ $(this).attr('checked', prefs[pref]);
+ });
+ }
+
+ bindConfig();
+ prefs.addListener({ changedPrefs:bindConfig});
+
+ $('#config input[type="checkbox"]').bind('CheckboxStateChange', function() {
+ var pref = $(this).attr('data-pref');
+ prefs[pref] = !!$(this).attr('checked');
+ });
}); \ No newline at end of file
diff --git a/chrome/settings.html b/chrome/settings.html
index 10472f6..cdf20fa 100644
--- a/chrome/settings.html
+++ b/chrome/settings.html
@@ -35,11 +35,11 @@
<button id="import">Import</button>
<button id="export">Export</button>
</div>
- <div id="configuration">
- <input type="checkbox" /> Enable Redirector
- <input type="checkbox" /> Show status bar icon
- <input type="checkbox" /> Show context menu
- <input type="checkbox" /> Enable debug output
+ <div id="config">
+ <input type="checkbox" id="enable-redirector" data-pref="enabled" /> Enable Redirector
+ <input type="checkbox" id="show-status-bar-icon" data-pref="showStatusBarIcon"/> Show status bar icon
+ <input type="checkbox" id="show-context-menu" data-pref="showContextMenu"/> Show context menu
+ <input type="checkbox" id="enable-debug-output" data-pref="debugEnabled"/> Enable debug output
</div>
<div id="redirect-form">
<div>
@@ -73,7 +73,7 @@
</div>
<div>
<label>Enabled</label>
- <input type="checkbox"/>
+ <input type="checkbox" />
</div>
</div>
</body>