| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * This file is part of the URL Fixer, | 2 * This file is part of the URL Fixer, |
| 3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
| 4 * | 4 * |
| 5 * URL Fixer is free software: you can redistribute it and/or modify | 5 * URL Fixer is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * URL Fixer is distributed in the hope that it will be useful, | 9 * URL Fixer is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
| 15 * along with URL Fixer. If not, see <http://www.gnu.org/licenses/>. | 15 * along with URL Fixer. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 Cu.import("resource://gre/modules/Services.jsm"); | 18 Cu.import("resource://gre/modules/Services.jsm"); |
| 19 | 19 |
| 20 let {Prefs} = require("prefs"); | 20 let {Prefs} = require("prefs"); |
| 21 Prefs.addListener(onPrefChange); | 21 Prefs.addListener(onPrefChange); |
| 22 window.addEventListener("unload", function() Prefs.removeListener(onPrefChange), false); | 22 window.addEventListener("unload", function() Prefs.removeListener(onPrefChange), false); |
| 23 | 23 |
| 24 function initCheckboxes() | |
| 25 { | |
| 26 E("domainOptIn").checked = Prefs.domainOptIn; | |
|
Thomas Greiner
2016/12/07 15:43:34
What about the preference's default value in lib/p
Wladimir Palant
2016/12/08 12:48:14
Well, with the extension going to be unsupported t
| |
| 27 } | |
| 28 | |
| 29 function onItemSelected(list) | 24 function onItemSelected(list) |
| 30 { | 25 { |
| 31 let button = E(list.getAttribute("_removeButton")); | 26 let button = E(list.getAttribute("_removeButton")); |
| 32 let items = list.selectedItems; | 27 let items = list.selectedItems; |
| 33 button.disabled = (items.length == 0 || (items.length == 1 && !items[0].value) ); | 28 button.disabled = (items.length == 0 || (items.length == 1 && !items[0].value) ); |
| 34 } | 29 } |
| 35 | 30 |
| 36 function onFindChange() | 31 function onFindChange() |
| 37 { | 32 { |
| 38 let find = E("find"); | 33 let find = E("find"); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 for (let i = items.length - 1; i >= 0; i--) | 162 for (let i = items.length - 1; i >= 0; i--) |
| 168 { | 163 { |
| 169 let searchString = items[i].getAttribute("value"); | 164 let searchString = items[i].getAttribute("value"); |
| 170 delete Prefs[pref][searchString]; | 165 delete Prefs[pref][searchString]; |
| 171 | 166 |
| 172 if (pref == "whitelist") | 167 if (pref == "whitelist") |
| 173 onWhitelistEntryRemoved(searchString); | 168 onWhitelistEntryRemoved(searchString); |
| 174 } | 169 } |
| 175 Prefs[pref] = JSON.parse(JSON.stringify(Prefs[pref])); | 170 Prefs[pref] = JSON.parse(JSON.stringify(Prefs[pref])); |
| 176 } | 171 } |
| OLD | NEW |