sammularczyk / thedaywefightback.js

Add a banner to your site in opposition to mass surveillance on 02/11

Home Page:https://thedaywefightback.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

thedaywefightback.js

thedaywefightback.js is a javascript snippet that automatically activates at midnight of February 11th and adds a banner to your site for 24 hours in support of thedaywefightback.org.

banner

You can add it to your site now - it won't be activated until midnight EST on February 11th. You can also host the files locally.

If you own a website, no matter how big or small, you can be part of this.

Some things to know

  • If users are outside the US, a different version of the banner will be shown with appropriate actions.

Other ways to install

  • Cloudflare app
  • Wordpress pluging
  • Drupal plugin

Getting started

Simply copy and paste the code below into your website, right above the closing tag.

Place the code below before </body> tag. The script loads asynchronously and won't affect page load times.

<!--[if !(lte IE 8)]><!-->
<script> 
  // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt GPL-v3-or-Later
  (function(){
    var e = document.createElement('script'); e.type='text/javascript'; e.async = true;
    e.src = document.location.protocol + '//d1agz031tafz8n.cloudfront.net/thedaywefightback.js/widget.min.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s);
  })();
  // @license-end
</script>
<!--<![endif]-->

Customize the banner

You can choose a different banner style and customize the preferences using a javascript object:

<!--[if !(lte IE 8)]><!-->
<script> 
  // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt GPL-v3-or-Later
  var tdwfb_config = {
    custom_salution: 'Dear reddit:', // Sets the salutation at the top left. Default is "Dear Internet Users:"
    letter_to_community: '<p>The NSA’s actions undermine online privacy and tilt the balance of power away from the people.</p> <p>Our rights won’t defend themselves — we have to step up. Join us in calling and emailing Congress to demand they pass good laws to defend privacy.</p>', // Changes the default text on the left hand side of the banner. Accepts HTML.
    debug_mode: false // If true, the banner shows even if the date is not yet 02/11/2014
  };
  (function(){
    var e = document.createElement('script'); e.type='text/javascript'; e.async = true;
    e.src = document.location.protocol + '//d1agz031tafz8n.cloudfront.net/thedaywefightback.js/widget.min.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s);
  })();
  // @license-end
</script>
<!--<![endif]-->

Please feel free to fork and submit pull requests for any bugs or quirks you might find. thedaywefightback.js's code is licensed under the terms of the GNU Affero General Public License version 3, or, at your option, any later version (See [./COPYING].)

Built by Taskforce.is members Thomas Davis and Sina Khanifar.

A big thank you to Twilio for sponsoring calls and Rob Spectre for all his help.

List of participating sites:

About

Add a banner to your site in opposition to mass surveillance on 02/11

https://thedaywefightback.org

License:GNU Affero General Public License v3.0


Languages

Language:JavaScript 68.3%Language:CSS 30.1%Language:Ruby 1.5%