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

Delta Between Two Patch Sets: chrome/content/ui/firstRun.js

Issue 11089006: Be more selective for the sharing fallback (Closed)
Left Patch Set: Created July 8, 2013, 11:12 a.m.
Right Patch Set: Created July 9, 2013, 12:20 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
LEFTRIGHT
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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Don't open the share page if the sharing script would be blocked 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); 216 var filter = defaultMatcher.matchesAny(event.target.getAttribute("data-scrip t"), "SCRIPT", "adblockplus.org", true);
Thomas Greiner 2013/07/08 13:46:47 _script is not a standard attribute for anchor tag
217 if (!(filter instanceof BlockingFilter)) 217 if (!(filter instanceof BlockingFilter))
218 { 218 {
219 event.preventDefault(); 219 event.preventDefault();
220 openSharePopup(Utils.getDocLink(event.target.id)); 220 openSharePopup(Utils.getDocLink(event.target.id));
221 } 221 }
222 } 222 }
223 223
224 function setLinks(id) 224 function setLinks(id)
225 { 225 {
226 var element = E(id); 226 var element = E(id);
(...skipping 22 matching lines...) Expand all
249 UI.openFiltersDialog(); 249 UI.openFiltersDialog();
250 else 250 else
251 { 251 {
252 backgroundPage.openOptions(); 252 backgroundPage.openOptions();
253 } 253 }
254 } 254 }
255 255
256 function updateToggleButton(feature, isEnabled) 256 function updateToggleButton(feature, isEnabled)
257 { 257 {
258 var button = E("toggle-" + feature); 258 var button = E("toggle-" + feature);
259 if (isEnabled && button.classList.contains("off")) 259 if (isEnabled)
260 button.classList.remove("off"); 260 button.classList.remove("off");
261 else if (!isEnabled && !button.classList.contains("off")) 261 else
262 button.classList.add("off"); 262 button.classList.add("off");
263 } 263 }
264 264
265 document.addEventListener("DOMContentLoaded", onDOMLoaded, false); 265 document.addEventListener("DOMContentLoaded", onDOMLoaded, false);
266 })(); 266 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld