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

Unified Diff: chrome/content/ui/firstRun.js

Issue 11075001: Added fallback to first-run page for when social media buttons are blocked by filters (Closed)
Patch Set: Created June 27, 2013, 10:18 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/content/ui/firstRun.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/firstRun.js
===================================================================
--- a/chrome/content/ui/firstRun.js
+++ b/chrome/content/ui/firstRun.js
@@ -106,7 +106,7 @@
onWindowResize();
- initSocialLinks(null);
+ initSocialLinks();
}
function onScroll()
@@ -222,20 +222,26 @@
glassPane.className = "visible";
}
- function initSocialLinks(variant)
+ function initSocialLinks()
{
var networks = ["twitter", "facebook", "gplus"];
networks.forEach(function(network)
{
var link = E("share-" + network);
- link.addEventListener("click", function(e)
- {
- e.preventDefault();
- openSharePopup(Utils.getDocLink("share-" + network) + "&variant=" + variant);
- }, false);
+ link.addEventListener("click", onSocialLinkClick, false);
});
}
+ function onSocialLinkClick(event)
+ {
+ var filter = defaultMatcher.matchesAny("https://platform.twitter.com/widgets.js", "SCRIPT", "adblockplus.org", true);
+ if (!(filter instanceof BlockingFilter))
+ {
+ event.preventDefault();
+ openSharePopup(Utils.getDocLink(event.target.id));
+ }
+ }
+
function setLinks(id)
{
var element = E(id);
« no previous file with comments | « chrome/content/ui/firstRun.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld