From 66ad230105ccf1b504d9589886f174020c324b18 Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Mon, 29 Aug 2011 16:55:35 +0200 Subject: Config entries working in new html settings --- chrome/js/settings.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'chrome/js') 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 -- cgit v1.2.3-70-g09d2