forked from mozilla/kitsune
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
(function($) { | ||
var html = '<a style="width:400px;height:32px;vertical-align:middle;text-align:center;background-color:#000;position:absolute;z-index:5555;left:10px;background-image:url(%simg/mozillaorg_censorship_wht.png);background-position:center center;background-repeat:no-repeat;text-indent:-9999px;-moz-transform:rotate(-1deg);-webkit-transform:rotate(-1deg);transform:rotate(-1deg);top: 41px;" href="http://americancensorship.org">STOP CENSORSHIP</a>'; | ||
|
||
function isACD() { | ||
var start = new Date('Wed Nov 16 2011 00:00:01'), | ||
end = new Date('Thu Nov 17 2011 00:00:01'), | ||
now = new Date(); | ||
return (start < now && now < end); | ||
} | ||
|
||
function isEnUS() { | ||
return document.location.pathname.indexOf('/en-US/') === 0; | ||
} | ||
|
||
function isLandingPage() { | ||
var view = document.location.pathname.slice(7); | ||
return _.indexOf(['home', 'mobile', 'sync', 'firefox-home'], view) >= 0; | ||
} | ||
|
||
function isInProduct() { | ||
return k.getReferrer(k.getQueryParamsAsDict()) === 'inproduct'; | ||
} | ||
|
||
if (isACD() && isEnUS() && (isLandingPage() || isInProduct())) { | ||
$('#masthead').append(interpolate(html, [$('body').data('media-url')])); | ||
} | ||
|
||
}(jQuery)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters