Permalink
Browse files

[Bug 702816] SOPA participation.

  • Loading branch information...
1 parent 38fff11 commit e004f820abd3d7a5f15bd452ec524f37d12e6de7 @rlr rlr committed Nov 16, 2011
Showing with 30 additions and 0 deletions.
  1. BIN media/img/mozillaorg_censorship_wht.png
  2. +28 −0 media/js/sopa.js
  3. +1 −0 settings.py
  4. +1 −0 templates/base.html
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -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));
View
@@ -452,6 +452,7 @@ def JINJA_CONFIG():
'js/main.js',
'js/format.js',
'js/loadtest.js',
+ 'js/sopa.js',
),
'libs/jqueryui': (
'js/libs/jqueryui.min.js',
View
@@ -57,6 +57,7 @@
data-for-os="{{ for_os|json }}"
data-for-version="{{ for_version|json }}"
data-usernames-api="{{ url('users.api.usernames') }}"
+ data-media-url="{{ MEDIA_URL }}"
{% if extra_body_attrs -%}
{% for attr, val in extra_body_attrs.items() %}{{ attr }}="{{ val }}" {% endfor %}
{%- endif %}>

0 comments on commit e004f82

Please sign in to comment.