Left: | ||
Right: |
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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 { | 328 { |
329 listenedPreferences[preference] = null; | 329 listenedPreferences[preference] = null; |
330 Prefs.on(preference, () => | 330 Prefs.on(preference, () => |
331 { | 331 { |
332 sendMessage("pref", preference, Prefs[preference]); | 332 sendMessage("pref", preference, Prefs[preference]); |
333 }); | 333 }); |
334 } | 334 } |
335 } | 335 } |
336 }); | 336 }); |
337 | 337 |
338 port.on("prefs.set", (message, sender) => | |
339 { | |
340 if (message.key == "notifications_ignoredcategories") | |
341 return NotificationStorage.toggleIgnoreCategory("*", !!message.value); | |
342 | |
343 return Prefs[message.key] = message.value; | |
344 }); | |
345 | |
338 port.on("prefs.toggle", (message, sender) => | 346 port.on("prefs.toggle", (message, sender) => |
339 { | 347 { |
340 if (message.key == "notifications_ignoredcategories") | 348 if (message.key == "notifications_ignoredcategories") |
341 return NotificationStorage.toggleIgnoreCategory("*", message.forceValue); | 349 return NotificationStorage.toggleIgnoreCategory("*"); |
342 | 350 |
343 if (typeof message.forceValue == "undefined") | 351 return Prefs[message.key] = !Prefs[message.key]; |
Manish Jethani
2017/10/09 14:41:45
I really think there should be a separate "prefs.s
kzar
2017/10/09 14:45:09
Yea you're probably right. I'll update the issue.
| |
344 return Prefs[message.key] = !Prefs[message.key]; | |
345 else | |
346 return Prefs[message.key] = message.forceValue; | |
347 }); | 352 }); |
348 | 353 |
349 port.on("notifications.get", (message, sender) => | 354 port.on("notifications.get", (message, sender) => |
350 { | 355 { |
351 let notification = getActiveNotification(); | 356 let notification = getActiveNotification(); |
352 | 357 |
353 if (!notification || | 358 if (!notification || |
354 "displayMethod" in message && | 359 "displayMethod" in message && |
355 !shouldDisplay(message.displayMethod, notification.type)) | 360 !shouldDisplay(message.displayMethod, notification.type)) |
356 return; | 361 return; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 if (message.url) | 437 if (message.url) |
433 subscriptions = [Subscription.fromURL(message.url)]; | 438 subscriptions = [Subscription.fromURL(message.url)]; |
434 | 439 |
435 for (let subscription of subscriptions) | 440 for (let subscription of subscriptions) |
436 { | 441 { |
437 if (subscription instanceof DownloadableSubscription) | 442 if (subscription instanceof DownloadableSubscription) |
438 Synchronizer.execute(subscription, true); | 443 Synchronizer.execute(subscription, true); |
439 } | 444 } |
440 }); | 445 }); |
441 })(this); | 446 })(this); |
LEFT | RIGHT |