| 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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 if (Prefs.notifications_showui) | 80 if (Prefs.notifications_showui) |
| 81 { | 81 { |
| 82 initCheckbox("shouldShowNotifications", { | 82 initCheckbox("shouldShowNotifications", { |
| 83 get: function() | 83 get: function() |
| 84 { | 84 { |
| 85 return Prefs.notifications_ignoredcategories.indexOf("*") == -1; | 85 return Prefs.notifications_ignoredcategories.indexOf("*") == -1; |
| 86 }, | 86 }, |
| 87 toggle: function() | 87 toggle: function() |
| 88 { | 88 { |
| 89 NotificationStorage.toggleIgnoreCategory("*"); | 89 NotificationStorage.toggleIgnoreCategory("*"); |
| 90 return Prefs.notifications_ignoredcategories.indexOf("*") == -1; | 90 return this.get(); |
|
Sebastian Noack
2015/06/25 13:55:04
How about |this.get()| to avoid code duplication?
Thomas Greiner
2015/06/25 16:48:44
Done.
| |
| 91 } | 91 } |
| 92 }); | 92 }); |
| 93 } | 93 } |
| 94 else | 94 else |
| 95 document.getElementById("shouldShowNotificationsContainer").hidden = true; | 95 document.getElementById("shouldShowNotificationsContainer").hidden = true; |
| 96 | 96 |
| 97 ext.onMessage.addListener(onMessage); | 97 ext.onMessage.addListener(onMessage); |
| 98 | 98 |
| 99 // Load recommended subscriptions | 99 // Load recommended subscriptions |
| 100 loadRecommendations(); | 100 loadRecommendations(); |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 664 links[i].href = arguments[i + 1]; | 664 links[i].href = arguments[i + 1]; |
| 665 links[i].setAttribute("target", "_blank"); | 665 links[i].setAttribute("target", "_blank"); |
| 666 } | 666 } |
| 667 else if (typeof arguments[i + 1] == "function") | 667 else if (typeof arguments[i + 1] == "function") |
| 668 { | 668 { |
| 669 links[i].href = "javascript:void(0);"; | 669 links[i].href = "javascript:void(0);"; |
| 670 links[i].addEventListener("click", arguments[i + 1], false); | 670 links[i].addEventListener("click", arguments[i + 1], false); |
| 671 } | 671 } |
| 672 } | 672 } |
| 673 } | 673 } |
| LEFT | RIGHT |