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

Side by Side Diff: notification.js

Issue 29321084: Issue 2195 - Added notification opt-out (Platform) (Closed)
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:
View unified diff | Download patch
« no previous file with comments | « lib/prefs.js ('k') | options.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 Notification.markAsShown(notification.id); 103 Notification.markAsShown(notification.id);
104 notification.onClicked(); 104 notification.onClicked();
105 break; 105 break;
106 } 106 }
107 window.close(); 107 window.close();
108 }, true); 108 }, true);
109 } 109 }
110 110
111 var notificationElement = document.getElementById("notification"); 111 var notificationElement = document.getElementById("notification");
112 notificationElement.className = notification.type; 112 notificationElement.className = notification.type;
113 notificationElement.style.display = "block"; 113 notificationElement.hidden = false;
114 114 notificationElement.addEventListener("click", function(event)
115 document.getElementById("close-notification").addEventListener("click", functi on()
116 { 115 {
117 notificationElement.style.display = "none"; 116 switch (event.target.id)
118 notification.onClicked(); 117 {
119 }, false); 118 case "notification-close":
119 notificationElement.classList.add("closing");
120 break;
121 case "notification-optout":
122 Notification.toggleIgnoreCategory("*", true);
123 case "notification-hide":
124 notificationElement.hidden = true;
125 notification.onClicked();
126 break;
127 }
128 }, true);
120 }, false); 129 }, false);
OLDNEW
« no previous file with comments | « lib/prefs.js ('k') | options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld