• This repository has been archived on 19/Oct/2022
  • Stars
    star
    678
  • Rank 66,609 (Top 2 %)
  • Language
    JavaScript
  • License
    BSD 2-Clause "Sim...
  • Created about 10 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Embed this widget on your site and help save net neutrality!

CircleCI

How to install the widget

Add this to any page, and you're golden: (See the demo!)

<script src="https://widget.battleforthenet.com/widget.js" async></script>

Or, follow these easy instructions for Tumblr.

The goal of this project is to allow anyone with a web site to run their own campaign to save net neutrality. Simply add one line of JavaScript and you're good to go! The modal animation will show up front-and-center on your page, prompting visitors to contact Congress and the FCC.

If you have any problems or questions regarding the widget, please submit an issue.

How it works

The widget is designed to appear once per user, per device, per day, but can be configured to display at a different interval. If you'd like to force it to show up on your page for testing, reload the page with #ALWAYS_SHOW_BFTN_WIDGET at the end of the URL.

Please take a look at widget.js if you want to see exactly what you'll be embedding on your page.

  • Compatible with Firefox, Chrome, Safari and Internet Explorer 11+.
  • Embed the widget JavaScript code on your page.
  • Optionally pass in customization parameters (see below), or defaults are used.
  • Widget checks to make sure it should be shown (hasn't been shown to this user recently and user hasn't initiated a call or clicked a donate link recently, via cookie). You can override this check for testing purposes.
  • Widget preloads any images required for the chosen animation.
  • Widget injects a floating iframe onto your page. All but the most trivial styles and interactions take place in the iframe so as not to interfere with your CSS and JavaScript.
  • Animation displays in floating iframe.
  • The user can dismiss the iframe and a cookie is written so it won't show again until cookie expires (unless you override).

Modal customization options:

If you define an object called _bftn_options before including the widget code, you can pass some properties in to customize the default behavior.

<script type="text/javascript">
  var _bftn_options = {
    /*
     * Choose from 'take-action', 'capitol', 'onemorevote', 'countdown', 'glitch', 'money', 'stop', 'slow', 'without'.
     * Default is 'take-action'.
     */
    theme: 'onemorevote', // @type {string}
    
    /*
     * Or, if you want your own custom theme, specify its properties here.
     * Unspecified options will fall back to the default values.
     */
    theme: {
      className: 'money', // @type {string} will be applied to iframe body tag
      logos: ['images/money.png', 'images/stop.png'], // @type {Array} img src values
      headline: 'Your headline here.', // @type {string} modal headline text
      body: 'Your body here.' // @type {string} modal body text
    },
    
    /*
     * Choose from 'fp' for Free Press, 'dp' for Demand Progress or
     * 'fftf' for Fight for the Future. Omit this property to randomly split
     * form submissions between all organizations in the Battle for the Net 
     * coalition.
     */
    org: 'fftf', // @type {string}
    
    /*
     * Specify a delay (in milliseconds) before showing the widget. Defaults to one 
     * second.
     */
    delay: 1000, // @type {number}
    
    /*
     * Specify a date for the countdown theme. Defaults to November 23rd, 2017
     * (when the FCC is expected to announce a vote) if omitted. ISO-8601 dates are
     * UTC time, three-argument dates (with a zero-based month) are local time.
     */
    date: new Date(2017, 10, 23), // @type {Date}

    /*
     * Specify view cookie expiration. After initial view, modal will not be
     * displayed to a user again until after this cookie expires. Defaults to one
     * day.
     */
    viewCookieExpires: 1, // @type {number}

    /*
     * Specify action cookie expiration. After initiating a call or clicking a
     * donate link, modal will not be displayed to a user again until after this
     * cookie expires. Defaults to one week.
     */
    actionCookieExpires: 7, // @type {number}
    
    /*
     * If you show the modal on your homepage, you should let users close it to
     * access your site. However, if you launch a new tab to open the modal, closing
     * the modal just leaves the user staring at a blank page. Set this to true to
     * prevent closing the modal - the user can close the tab to dismiss it. Defaults
     * to false.
     */
    uncloseable: false, // @type {boolean}

    /*
     * Prevents the widget iframe from loading Google Analytics. Defaults to false.
     */
    disableGoogleAnalytics: false, // @type {boolean}
    
    /*
     * Always show the widget. Useful for testing.
     */
    always_show_widget: true // @type {boolean}
  };
</script>
<script src="https://widget.battleforthenet.com/widget.js" async></script>

More Repositories

1

battleforthenet

HTML
254
star
2

idl-members

Include code for member sites of the Internet Defense League
CSS
228
star
3

digital-climate-strike

Repository for Digital #ClimateStrike widget: https://digital.globalclimatestrike.net/
JavaScript
67
star
4

stoptheslowlane

For slowlane.js and an awesome protest in support of Net Neutrality.
CSS
38
star
5

readthetpp

Read the TPP!
JavaScript
28
star
6

countdown-widget

The clock is ticking on net neutrality. Join the Internet Countdown and keep the web free and open!
HTML
24
star
7

votebot-api

Voter Registration chatbot
JavaScript
15
star
8

redalert-widget

Red Alert for Net Neutrality widget
JavaScript
14
star
9

old.fightforthefuture.org

Old Homepage
HTML
12
star
10

votebot-forms

Voter Registration form submission to states
Python
12
star
11

eunetneutrality

HTML
9
star
12

breakcongressinternet

Break Congress' Internet
CSS
8
star
13

spotifyunwrapped.org

JavaScript
7
star
14

july23-widget

July 23, 2018 day of action widget
Vue
6
star
15

anticensorship-mirror-python

Team Future Anti-censorship Alerts for Python
Python
6
star
16

reset-the-net-widget

Embeddable JavaScript modal widget for RTN
CSS
6
star
17

Kill-SOPA

JavaScript
6
star
18

idl-website

HTML
5
star
19

reset-the-net-homepage

Don't ask for your privacy. Take it back.
CSS
5
star
20

americancensorship

HTML
4
star
21

iVoted2012

...
HTML
4
star
22

votebot-www

web front end for votebot at hello.vote
HTML
4
star
23

fftf-campaign-boilerplate

A boilerplate for setting up new campaigns for Fight for the Future
CSS
4
star
24

getyourcensoron

HTML
4
star
25

internet-vote-widget

Join the fight against TPP with your web site!
HTML
3
star
26

reset-the-net-pack

Software and tips tailored to common computers, phones, and tablets that literally anyone can use.
HTML
3
star
27

freejulian

Free Julian Assange!
HTML
3
star
28

watch-widget

For June 2019 hearings
HTML
3
star
29

digital-climate-strike-wp

PHP
3
star
30

earth-day-live-widget

The Earth Day Live Javascript Widget - so anyone with a website can join Earth Day Live
JavaScript
3
star
31

TeamFutureForFirefox

Help save the internet, with Team Future!
JavaScript
3
star
32

phantom-dc-extras

Backend form submission queue for EFForg/phantom-of-the-capitol
Python
3
star
33

bigsurveillance

HTML
3
star
34

sopastrike

sopastrike.com
HTML
3
star
35

freeprogress

lol
JavaScript
2
star
36

sopacountdown

sopacountdown.com
2
star
37

fftf-brand

Branding page for FFTF
JavaScript
2
star
38

lovescensorship

HTML
2
star
39

stopfasttrack

Stop Fast Track for TPP!
HTML
2
star
40

pardonsnowden

Pardon Snowden!
CSS
2
star
41

june11-widget

June 11, 2018 day of action widget
JavaScript
2
star
42

fb-voterreg

Facebook app for voter registration
Python
2
star
43

anticensorship-info

The heart of Internet Defense League's Anti-Censorship Widget. Help us stop government censorship forever!
HTML
2
star
44

defendcrypto.org

Vue
2
star
45

volunteers

Volunteer for Fight for the Future! Honor and glory will be yours.
2
star
46

fftf-starter-template

Nuxt 2 starter site for campaigns
Vue
1
star
47

happybirthdaychelsea.com

JavaScript
1
star
48

call-obama

Did Obama Break the Net? (dot com)
JavaScript
1
star
49

ifeelnaked

#ifeelnaked
CSS
1
star
50

reset-the-net-form

How you participate is up to you, but be ambitious!
JavaScript
1
star
51

twitter-blaster

JavaScript
1
star
52

battleforthenet-thedecision-www

Frontend (Prototype)
JavaScript
1
star
53

python-turbovote

Python
1
star
54

call-fcc

Call the FCC!
HTML
1
star
55

digital-climate-strike-shopify

Shopify App for Global Climate Strikes
Ruby
1
star
56

ateams.fightforthefuture.org

Quit your job, work for us, start an A-Team & change the world
HTML
1
star
57

votefornetneutrality

CSS
1
star
58

getavpn

CSS
1
star
59

dumpyahoo.com

CSS
1
star
60

takedownabuse

HTML
1
star
61

saveonlinefreespeech

HTML
1
star
62

team-future-web

Javascript web app for Team Future frontend
JavaScript
1
star
63

savesecurity.org

Vue
1
star
64

unplugthensa

HTML
1
star
65

free-bieber

freebieber.org rails app
ActionScript
1
star
66

protestsign

An animated protest sign for the web!
HTML
1
star
67

securitypledge

HTML
1
star