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

Side by Side Diff: chrome/content/ui/firstRun.js

Issue 11089006: Be more selective for the sharing fallback (Closed)
Patch Set: Created July 8, 2013, 11:12 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
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-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 var networks = ["twitter", "facebook", "gplus"]; 205 var networks = ["twitter", "facebook", "gplus"];
206 networks.forEach(function(network) 206 networks.forEach(function(network)
207 { 207 {
208 var link = E("share-" + network); 208 var link = E("share-" + network);
209 link.addEventListener("click", onSocialLinkClick, false); 209 link.addEventListener("click", onSocialLinkClick, false);
210 }); 210 });
211 } 211 }
212 212
213 function onSocialLinkClick(event) 213 function onSocialLinkClick(event)
214 { 214 {
215 var filter = defaultMatcher.matchesAny("https://platform.twitter.com/widgets .js", "SCRIPT", "adblockplus.org", true); 215 // Don't open the share page if the sharing script would be blocked
216 var filter = defaultMatcher.matchesAny(event.target.getAttribute("_script"), "SCRIPT", "adblockplus.org", true);
Thomas Greiner 2013/07/08 13:46:47 _script is not a standard attribute for anchor tag
216 if (!(filter instanceof BlockingFilter)) 217 if (!(filter instanceof BlockingFilter))
217 { 218 {
218 event.preventDefault(); 219 event.preventDefault();
219 openSharePopup(Utils.getDocLink(event.target.id)); 220 openSharePopup(Utils.getDocLink(event.target.id));
220 } 221 }
221 } 222 }
222 223
223 function setLinks(id) 224 function setLinks(id)
224 { 225 {
225 var element = E(id); 226 var element = E(id);
(...skipping 30 matching lines...) Expand all
256 { 257 {
257 var button = E("toggle-" + feature); 258 var button = E("toggle-" + feature);
258 if (isEnabled && button.classList.contains("off")) 259 if (isEnabled && button.classList.contains("off"))
259 button.classList.remove("off"); 260 button.classList.remove("off");
260 else if (!isEnabled && !button.classList.contains("off")) 261 else if (!isEnabled && !button.classList.contains("off"))
261 button.classList.add("off"); 262 button.classList.add("off");
262 } 263 }
263 264
264 document.addEventListener("DOMContentLoaded", onDOMLoaded, false); 265 document.addEventListener("DOMContentLoaded", onDOMLoaded, false);
265 })(); 266 })();
OLDNEW
« chrome/content/ui/firstRun.html ('K') | « chrome/content/ui/firstRun.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld