| Index: chrome/content/options.js | 
| =================================================================== | 
| --- a/chrome/content/options.js | 
| +++ b/chrome/content/options.js | 
| @@ -47,19 +47,18 @@ | 
| whitelistElement.removeItemAt(i); | 
| // Build a list of custom rules and sort it alphabetically | 
| - let customRules = Prefs.custom_replace; | 
| + let prefRulesList = Prefs.custom_replace; | 
| 
 
Wladimir Palant
2012/09/21 14:40:25
Whitelist and custom rules are no longer mangled t
 
 | 
| + let prefWhitelist = Prefs.whitelist; | 
| let ruleList = []; | 
| let whitelist = []; | 
| - for (let searchString in customRules) | 
| + | 
| + for (let searchString in prefRulesList) | 
| { | 
| - if(searchString == customRules[searchString]) | 
| - { | 
| - whitelist.push(searchString); | 
| - } | 
| - else | 
| - { | 
| - ruleList.push([searchString, customRules[searchString]]); | 
| - } | 
| + ruleList.push([searchString, prefRulesList[searchString]]); | 
| + } | 
| + for (let searchString in prefWhitelist) | 
| + { | 
| + whitelist.push(searchString); | 
| } | 
| ruleList.sort(function(a, b) | 
| @@ -138,7 +137,7 @@ | 
| E("find").oninput(); | 
| } | 
| -function removeRule(btn) | 
| +function removeRule(btn, pref) | 
| 
 
Wladimir Palant
2012/09/21 14:40:25
If you have _list as the attribute of the button t
 
 | 
| { | 
| let list = E(btn.getAttribute("_list")); | 
| let items = list.selectedItems; | 
| @@ -146,7 +145,7 @@ | 
| for (let i = items.length - 1; i >= 0; i--) | 
| { | 
| let searchString = items[i].getAttribute("value"); | 
| - delete Prefs.custom_replace[searchString]; | 
| + delete Prefs[pref][searchString]; | 
| } | 
| - Prefs.custom_replace = JSON.parse(JSON.stringify(Prefs.custom_replace)); | 
| + Prefs[pref] = JSON.parse(JSON.stringify(Prefs[pref])); | 
| 
 
Wladimir Palant
2012/09/21 14:40:25
It's too bad that we have to use that hack. This n
 
 | 
| } |