LEFT | RIGHT |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus 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 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus 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 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 207 |
208 if (value == defaultValue) | 208 if (value == defaultValue) |
209 { | 209 { |
210 delete overrides[pref]; | 210 delete overrides[pref]; |
211 ext.storage.remove(prefToKey(pref)); | 211 ext.storage.remove(prefToKey(pref)); |
212 } | 212 } |
213 else | 213 else |
214 { | 214 { |
215 overrides[pref] = value; | 215 overrides[pref] = value; |
216 | 216 |
217 let storageItems = {}; | 217 let items = {}; |
218 storageItems[prefToKey(pref)] = value; | 218 items[prefToKey(pref)] = value; |
219 ext.storage.set(storageItems); | 219 ext.storage.set(items); |
220 } | 220 } |
221 }, | 221 }, |
222 enumerable: true | 222 enumerable: true |
223 }); | 223 }); |
224 } | 224 } |
225 | 225 |
226 function init() | 226 function init() |
227 { | 227 { |
228 let prefs = Object.keys(defaults); | 228 let prefs = Object.keys(defaults); |
229 prefs.forEach(addPreference); | 229 prefs.forEach(addPreference); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 Prefs.onChanged._dispatch(pref); | 279 Prefs.onChanged._dispatch(pref); |
280 } | 280 } |
281 } | 281 } |
282 }); | 282 }); |
283 } | 283 } |
284 | 284 |
285 Prefs.isLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded); | 285 Prefs.isLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded); |
286 } | 286 } |
287 | 287 |
288 init(); | 288 init(); |
LEFT | RIGHT |