Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: options.js

Issue 29321084: Issue 2195 - Added notification opt-out (Platform) (Closed)
Left Patch Set: Created June 25, 2015, 1:09 p.m.
Right Patch Set: Created June 25, 2015, 4:44 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « options.html ('k') | popup.html » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
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 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld