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

Side by Side Diff: notification.js

Issue 5464830253203456: Refactored the abstraction layer to address prerendered pages on Safari caused by leaky abstraction (Closed)
Patch Set: Addressed comments Created April 11, 2014, 2:47 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 | « metadata.safari ('k') | popup.js » ('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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 messageElement.addEventListener("click", function(event) 82 messageElement.addEventListener("click", function(event)
83 { 83 {
84 var link = event.target; 84 var link = event.target;
85 while (link && link !== messageElement && link.localName !== "a") 85 while (link && link !== messageElement && link.localName !== "a")
86 link = link.parentNode; 86 link = link.parentNode;
87 if (!link) 87 if (!link)
88 return; 88 return;
89 event.preventDefault(); 89 event.preventDefault();
90 event.stopPropagation(); 90 event.stopPropagation();
91 ext.windows.getLastFocused(function(win) { win.openTab(link.href); }); 91 ext.pages.open(link.href);
92 }); 92 });
93 93
94 if (notification.type == "question") 94 if (notification.type == "question")
95 { 95 {
96 document.getElementById("notification-question").addEventListener("click", f unction(event) 96 document.getElementById("notification-question").addEventListener("click", f unction(event)
97 { 97 {
98 event.preventDefault(); 98 event.preventDefault();
99 event.stopPropagation(); 99 event.stopPropagation();
100 100
101 var approved = false; 101 var approved = false;
(...skipping 14 matching lines...) Expand all
116 var notificationElement = document.getElementById("notification"); 116 var notificationElement = document.getElementById("notification");
117 notificationElement.className = notification.type; 117 notificationElement.className = notification.type;
118 notificationElement.style.display = "block"; 118 notificationElement.style.display = "block";
119 119
120 document.getElementById("close-notification").addEventListener("click", functi on() 120 document.getElementById("close-notification").addEventListener("click", functi on()
121 { 121 {
122 notificationElement.style.display = "none"; 122 notificationElement.style.display = "none";
123 notification.onClicked(); 123 notification.onClicked();
124 }, false); 124 }, false);
125 }, false); 125 }, false);
OLDNEW
« no previous file with comments | « metadata.safari ('k') | popup.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld