Speed up development with full-stack environments for every branch.

Learn More

thedaywefightback.js [JavaScript]

75 Runs 815 Views 6 Copies

Cloned from github repository: https://github.com/tfrce/thedaywefightback.js

Saved

Saved

sundip 66

sundip
published 3 years ago

    
      
      

    thedaywefightback.js

    Please feel free to make pull requests with any fixes, and leave suggestions and bugs on our issue page. We've tried our best to accomodate all browsers but will fix any remaining issues before the 11th.

    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.

    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.

    <a href="http://tfrce.github.io/thedaywefightback.js/example/banner.html" target="_blank"><img src="screenshots/tdwfb-banner.png" alt="banner" /></a>

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

    Demo pages

    View the US demo page or the international demo page - (unless explicitly set the banner uses GeoIP to detect your location).

    Getting started

    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.

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

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

    <!--[if !(lte IE 8)]><!-->
    <script type="text/javascript"> 
      // @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]-->

    The widget supports all screen sizes and platforms, if you encounter a bug please let us know on the issues page.

    The counts will reset on the day, and only the additions on the 11th will contribute to the total.

    Customize the banner

    You can customize the preferences using a javascript object:

    <script type="text/javascript"> 
      // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt GPL-v3-or-Later
      // The defaults are set below
      var tdwfb_config = {
        greeting: 'Dear Internet Users', // Sets the salutation at the top left
        disableDate: false, // If true, the banner shows even if the date is not yet 02/11/2014
        callOnly: false // If true, the banner only displays a form for calling congress
      };
      (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>

    Other ways to install the banner

    A Cloudflare app and Wordpress plugin will be added soon.

    Let us know you're taking part

    If you add the banner to your site, sign up at TheDayWeFightBack.org and let us know.

    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.

    Screenshots

    Main Banner

    <img src="screenshots/tdwfb-banner.png" alt="banner" />

    Call Tool Pop-up

    <img src="screenshots/call-tool.png" alt="call tool" />

    Email Tool Pop-up

    <img src="screenshots/email-tool.png" alt="email tool" />

    Please login/signup to get access to the terminal.

    Your session has timed out.

    Dismiss (the page may not function properly).