OLD | NEW |
1 /* | 1 /* |
2 * This Source Code is subject to the terms of the Mozilla Public License | 2 * This Source Code is subject to the terms of the Mozilla Public License |
3 * version 2.0 (the "License"). You can obtain a copy of the License at | 3 * version 2.0 (the "License"). You can obtain a copy of the License at |
4 * http://mozilla.org/MPL/2.0/. | 4 * http://mozilla.org/MPL/2.0/. |
5 */ | 5 */ |
6 | 6 |
7 Cu.import("resource://gre/modules/Services.jsm"); | 7 Cu.import("resource://gre/modules/Services.jsm"); |
8 | 8 |
9 let {Prefs} = require("prefs"); | 9 let {Prefs} = require("prefs"); |
10 Prefs.addListener(onPrefChange); | 10 Prefs.addListener(onPrefChange); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 E("find").value = E("replace").value = ""; | 145 E("find").value = E("replace").value = ""; |
146 E("find").oninput(); | 146 E("find").oninput(); |
147 } | 147 } |
148 | 148 |
149 function removeRule(btn, pref) | 149 function removeRule(btn, pref) |
150 { | 150 { |
151 let list = E(btn.getAttribute("_list")); | 151 let list = E(btn.getAttribute("_list")); |
152 let items = list.selectedItems; | 152 let items = list.selectedItems; |
153 | 153 |
154 let {onWhitelistEntryRemoved} = require("rules"); | 154 let {onWhitelistEntryRemoved} = require("typoRules"); |
155 | 155 |
156 for (let i = items.length - 1; i >= 0; i--) | 156 for (let i = items.length - 1; i >= 0; i--) |
157 { | 157 { |
158 let searchString = items[i].getAttribute("value"); | 158 let searchString = items[i].getAttribute("value"); |
159 delete Prefs[pref][searchString]; | 159 delete Prefs[pref][searchString]; |
160 | 160 |
161 if (pref == "whitelist") | 161 if (pref == "whitelist") |
162 onWhitelistEntryRemoved(searchString); | 162 onWhitelistEntryRemoved(searchString); |
163 } | 163 } |
164 Prefs[pref] = JSON.parse(JSON.stringify(Prefs[pref])); | 164 Prefs[pref] = JSON.parse(JSON.stringify(Prefs[pref])); |
165 } | 165 } |
OLD | NEW |