Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/options.js

Issue 8382011: Applied changes from emailed code review (Closed)
Patch Set: Created Sept. 18, 2012, 2:06 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/content/options.xul » ('j') | lib/rules.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
« no previous file with comments | « no previous file | chrome/content/options.xul » ('j') | lib/rules.js » ('J')

Powered by Google App Engine
This is Rietveld