Index: chrome/content/options.js |
=================================================================== |
--- a/chrome/content/options.js |
+++ b/chrome/content/options.js |
@@ -68,17 +68,17 @@ function updateList() |
else if (a[0] > b[0]) |
return 1; |
else |
return 0; |
}); |
whitelist.sort(); |
// Add the rules to the list |
- if(ruleList.length > 0) |
+ if (ruleList.length > 0) |
{ |
for (let i = 0; i < ruleList.length; i++) |
{ |
let [searchString, replacement] = ruleList[i]; |
let option = document.createElement('listitem'); |
option.setAttribute("value", searchString); |
@@ -97,17 +97,17 @@ function updateList() |
{ |
let option = document.createElement("listitem"); |
option.setAttribute("class", "auto-entry"); |
option.setAttribute("label", ruleListElement.getAttribute("_emptyLabel")); |
ruleListElement.appendChild(option); |
} |
- if(whitelist.length > 0) |
+ if (whitelist.length > 0) |
{ |
for (let i = 0; i < whitelist.length; i++) |
{ |
let option = document.createElement("listitem"); |
option.setAttribute("value", whitelist[i]); |
option.setAttribute("label", whitelist[i]) |
whitelistElement.appendChild(option); |
@@ -137,15 +137,20 @@ function addRule() |
E("find").oninput(); |
} |
function removeRule(btn, pref) |
{ |
let list = E(btn.getAttribute("_list")); |
let items = list.selectedItems; |
+ let {onWhitelistEntryRemoved} = require("rules"); |
+ |
for (let i = items.length - 1; i >= 0; i--) |
{ |
let searchString = items[i].getAttribute("value"); |
delete Prefs[pref][searchString]; |
+ |
+ if (pref == "whitelist") |
+ onWhitelistEntryRemoved(searchString); |
} |
Prefs[pref] = JSON.parse(JSON.stringify(Prefs[pref])); |
} |