Please feel free to make pull requests with any fixes, and leave suggestions and bugs on our issue page.
thedaywefightback.js is a javascript snippet that automatically activates at midnight of February 11th and adds a banner to your site for 26 hours in support of thedaywefightback.org.
The goal is to drive as many phone calls and emails on the 11th. The calls are connected automatically by our call server for free thanks to Twilio.
If you own a website, no matter how big or small, you can be part of this.
- US demo page - Shown automatically to visitors from US IP addresses.
- International demo page - Shown automatically to visitors from non-US IP addresses.
- Call-only version of the banner - Shown if the callOnly flag is set to true, focusses people on the phone call action.
Note: Please don't copy the code from the source files of the demo pages. Use the code below instead.
You can add the snippet to your site now - it won't be activated until midnight EST on February 11th and will remain active for 26 hours.
Place the code below before </body>
tag. The script loads asynchronously and won't affect page load times.
<!--[if !(lt IE 8)]><!-->
<script type="text/javascript">
(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);
})();
</script>
<!--<![endif]-->
The widget supports all screen sizes and platforms, if you encounter a bug please let us know on the issues page.
- Cloudflare app - Allows you to add the banner with one click if you use Cloudflare.
- Wordpress plugin - Adds the banner to a Wordpress site (also available at Wordpress.org).
- Wordress.com: Go to My Blog > Appearance > Widgets and add the "Internet Defense League" widget.
- Drupal 7.x plugin - Adds the banner to a Drupal 7.x site.
- Octopress instructions - Instructions for adding the banner to an Octopress blog
- Subreddit instructions - Add a static banner to your subreddit
- Joomla plugin - Adds the banner to a Joomla 2.5.x / 3.2.x site.
- Concrete5 Plugin - Adds the banner automatically to a Concrete5 site.
You can configure the banner using a javascript object:
<!--[if !(lt IE 8)]><!-->
<script type="text/javascript">
// The defaults are set below
var tdwfb_config = {
greeting: 'Dear Internet', // Sets the salutation shown in the banner.
disableDate: false, // If true, the banner shows even if the date is not yet 02/11/2014. Use for testing.
callOnly: true // If true, the banner emphasizes calling congress over emailing.
};
(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);
})();
</script>
<!--<![endif]-->
###Custom CSS
The body tag has a class of "tdwfb-banner". You can use this to style elements if needed.
For example, to change the background from black to something lighter:
.tdwfb-banner {
background: #111;
}
If you add the banner to your site, sign up at TheDayWeFightBack.org and let us know.
Built by Taskforce.is members Thomas Davis, Sina Khanifar, Sam Mularczyk and Beau Gunderson.
Design by Max Temkin.
A big thank you to Twilio for sponsoring calls.