├── Gemfile
├── .pairs
├── public
├── images
│ ├── badge.png
│ ├── logo-132.png
│ └── logo-200.png
├── stylesheets
│ └── stop_censorship.css
└── javascripts
│ ├── stop_censorship.js
│ └── cloudflare.js
├── Rakefile
├── cloudflare.md
├── spec
└── javascripts
│ ├── support
│ ├── jasmine_config.rb
│ ├── jasmine_runner.rb
│ └── jasmine.yml
│ ├── helpers
│ └── SpecHelper.js
│ └── stop_censorship_spec.js
├── Gemfile.lock
├── UNLICENSE
├── Readme.md
├── cloudflare.json
└── index.html
/Gemfile:
--------------------------------------------------------------------------------
1 | source :rubygems
2 |
3 | gem "jasmine"
4 |
--------------------------------------------------------------------------------
/.pairs:
--------------------------------------------------------------------------------
1 | pairs:
2 | ms: Michael Sofaer; michael
3 | cj: Chris Joel; chris
4 | email:
5 | prefix: pair
6 | domain: cloudflare.com
7 |
--------------------------------------------------------------------------------
/public/images/badge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fightforthefuture/internet_defense_league_cloud_flare/HEAD/public/images/badge.png
--------------------------------------------------------------------------------
/public/images/logo-132.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fightforthefuture/internet_defense_league_cloud_flare/HEAD/public/images/logo-132.png
--------------------------------------------------------------------------------
/public/images/logo-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fightforthefuture/internet_defense_league_cloud_flare/HEAD/public/images/logo-200.png
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | task :default => [:jasmine]
2 |
3 |
4 | begin
5 | require 'rubygems'
6 | require 'jasmine'
7 | load 'jasmine/tasks/jasmine.rake'
8 | rescue LoadError
9 | task :jasmine do
10 | abort "Jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine"
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/cloudflare.md:
--------------------------------------------------------------------------------
1 | #Defend the Internet
2 |
3 | This app lets you join the sites willing to band together to defend the internet
4 | from damaging legislation.
5 |
6 | You turn it on, and when there's an action, your site will automatically be a part of it.
7 |
8 | This file does not allow
9 |
--------------------------------------------------------------------------------
/spec/javascripts/support/jasmine_config.rb:
--------------------------------------------------------------------------------
1 | module Jasmine
2 | class Config
3 |
4 | # Add your overrides or custom config code here
5 |
6 | end
7 | end
8 |
9 |
10 | # Note - this is necessary for rspec2, which has removed the backtrace
11 | module Jasmine
12 | class SpecBuilder
13 | def declare_spec(parent, spec)
14 | me = self
15 | example_name = spec["name"]
16 | @spec_ids << spec["id"]
17 | backtrace = @example_locations[parent.description + " " + example_name]
18 | parent.it example_name, {} do
19 | me.report_spec(spec["id"])
20 | end
21 | end
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/spec/javascripts/helpers/SpecHelper.js:
--------------------------------------------------------------------------------
1 | beforeEach(function() {
2 | this.sopa = null;
3 | var self = this;
4 |
5 | var promise = CloudFlare.require(["stop_censorship","cloudflare/jquery1.7", "cloudflare/user"],
6 | function(stop_censorship, $, user){
7 | self.sopa = stop_censorship;
8 | self.user = user
9 | window.$ = $
10 | }
11 | )
12 |
13 | waitsFor(function(){
14 | return this.sopa !== null;
15 | })
16 | });
17 |
18 | afterEach(function(){
19 | this.user.setCookie("__cfduid", "")
20 | this.user.setCookie("cf_sopa", "")
21 | $(".sopa_badge").remove()
22 | this.sopa.config.cookie = null
23 | })
24 |
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: http://rubygems.org/
3 | specs:
4 | childprocess (0.2.3)
5 | ffi (~> 1.0.6)
6 | diff-lcs (1.1.3)
7 | ffi (1.0.11)
8 | jasmine (1.1.2)
9 | jasmine-core (>= 1.1.0)
10 | rack (>= 1.1)
11 | rspec (>= 1.3.1)
12 | selenium-webdriver (>= 0.1.3)
13 | jasmine-core (1.1.0)
14 | multi_json (1.0.4)
15 | rack (1.3.5)
16 | rspec (2.7.0)
17 | rspec-core (~> 2.7.0)
18 | rspec-expectations (~> 2.7.0)
19 | rspec-mocks (~> 2.7.0)
20 | rspec-core (2.7.1)
21 | rspec-expectations (2.7.0)
22 | diff-lcs (~> 1.1.2)
23 | rspec-mocks (2.7.0)
24 | rubyzip (0.9.5)
25 | selenium-webdriver (2.15.0)
26 | childprocess (>= 0.2.1)
27 | ffi (~> 1.0.9)
28 | multi_json (~> 1.0.4)
29 | rubyzip
30 |
31 | PLATFORMS
32 | ruby
33 |
34 | DEPENDENCIES
35 | jasmine
36 |
--------------------------------------------------------------------------------
/spec/javascripts/support/jasmine_runner.rb:
--------------------------------------------------------------------------------
1 | $:.unshift(ENV['JASMINE_GEM_PATH']) if ENV['JASMINE_GEM_PATH'] # for gem testing purposes
2 |
3 | require 'rubygems'
4 | require 'jasmine'
5 | jasmine_config_overrides = File.expand_path(File.join(File.dirname(__FILE__), 'jasmine_config.rb'))
6 | require jasmine_config_overrides if File.exist?(jasmine_config_overrides)
7 | if Jasmine::Dependencies.rspec2?
8 | require 'rspec'
9 | else
10 | require 'spec'
11 | end
12 |
13 | jasmine_config = Jasmine::Config.new
14 | spec_builder = Jasmine::SpecBuilder.new(jasmine_config)
15 |
16 | should_stop = false
17 |
18 | if Jasmine::Dependencies.rspec2?
19 | RSpec.configuration.after(:suite) do
20 | spec_builder.stop if should_stop
21 | end
22 | else
23 | Spec::Runner.configure do |config|
24 | config.after(:suite) do
25 | spec_builder.stop if should_stop
26 | end
27 | end
28 | end
29 |
30 | spec_builder.start
31 | should_stop = true
32 | spec_builder.declare_suites
33 |
--------------------------------------------------------------------------------
/UNLICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
")
37 | .bind("click", function(){ self.inspirationalDialog() })
38 | },
39 | placeBadge : function(){
40 | if(!$("body").find(".sopa_badge").length) {
41 | $("body").append(this.badge())
42 | }
43 | },
44 |
45 | tweetWindow : function(options) {
46 | window.open(
47 | "https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Fcloudflare.com"+
48 | "&text="+encodeURIComponent(options.text)+
49 | "&url="+encodeURIComponent(options.url)+
50 | "&hashtags="+encodeURIComponent(options.hashtag)+
51 | "&via=cloudflare",
52 | "_blank",
53 | "height=450,left=445,personalbar=0,resiable=1,scrollbars=1,toolbar=0,top=225,width=550"
54 | );
55 | },
56 |
57 | senatorDropdown: function(){
58 | var senators =[["AK","Lisa Murkowski","907-456-0233"],["AK","Mark Begich","907-271-5915"],["AL","Jefferson Sessions","334-244-7017"],["AL","Richard Shelby","205-759-5047"],["AR","John Boozman","479-725-0400"],["AR","Mark Pryor","501-324-6336"],["AZ","Jon Kyl","602-840-1891"],["AZ","John McCain","602-952-2410"],["CA","Barbara Boxer","510-286-8537"],["CA","Dianne Feinstein","415-393-0707"],["CO","Michael Bennet","303-455-7600"],["CO","Mark Udall","303-650-7820"],["CT","Richard Blumenthal","860-258-6940"],["CT","Joseph Lieberman","860-549-8463"],["DE","Thomas Carper","302-573-6291"],["DE","Chris Coons","302-573-6345"],["FL","Bill Nelson","407-872-7161"],["FL","Marco Rubio","305-418-8553"],["GA","C. Saxby Chambliss","770-763-9090"],["GA","John Isakson","770-661-0999"],["HI","Daniel Akaka","808-522-8970"],["HI","Daniel Inouye","808-541-2542"],["IA","Charles Grassley","515-288-1145"],["IA","Thomas Harkin","515-284-4574"],["ID","Michael Crapo","208-334-1776"],["ID","James Risch","208-342-7985"],["IL","Richard Durbin","312-353-4952"],["IL","Mark Kirk","312-886-3506"],["IN","Daniel Coats","317-554-0750"],["IN","Richard Lugar","317-226-5555"],["KS","Pat Roberts","913-451-9343"],["KY","Mitch McConnell","502-582-6304"],["KY","Rob Portman","361-576-1231"],["LA","Mary Landrieu","225-389-0395"],["LA","David Vitter","337-262-6898"],["MA","Scott Brown","617-565-3170"],["MA","John Kerry","617-565-8519"],["MD","Barbara Mikulski","410-962-4510"],["ME","Susan Collins","207-945-0417"],["ME","Olympia Snowe","207-874-0883"],["MI","Carl Levin","313-226-6020"],["MI","Debbie Stabenow","517-203-1760"],["MN","Al Franken","651-221-1016"],["MN","Amy Klobuchar","612-727-5220"],["MO","Roy Blunt","816-471-7141"],["MO","Claire McCaskill","816-421-1639"],["MS","Thad Cochran","601-965-4459"],["MS","Roger Wicker","601-965-4644"],["MT","Max Baucus","406-657-6790"],["MT","Jon Tester","406-449-5401"],["NC","Richard Burr","910-251-1058"],["NC","Kay Hagan","336-333-5311"],["ND","Kent Conrad","701-258-4648"],["ND","John Hoeven","701-250-4618"],["NE","Mike Johanns","308-632-6032"],["NE","E. Benjamin Nelson","402-441-4600"],["NH","Kelly Ayotte","603-622-7979"],["NH","Jeanne Shaheen","603-647-7500"],["NJ","Frank Lautenberg","973-639-8700"],["NJ","Robert Menendez","973-645-3030"],["NM","Jeff Bingaman","505-346-6601"],["NM","Tom Udall","505-346-6791"],["NV","Dean Heller","775-686-5770"],["NV","Harry Reid","702-388-5020"],["NY","Kirsten Gillibrand","212-688-6262"],["NY","Charles Schumer","212-486-4430"],["OH","Sherrod Brown","216-522-7272"],["OK","James Inhofe","918-748-5111"],["OK","Tom Coburn","918-581-7651"],["OR","Jeffery Merkley","503-326-3386"],["PA","Robert Casey","570-941-0930"],["PA","Pat Toomey","610-434-1444"],["RI","John Reed","401-943-3100"],["RI","Sheldon Whitehouse","401-453-5294"],["SC","Jim DeMint","864-233-5366"],["SC","Lindsey Graham","864-250-1417"],["SD","Tim Johnson","414-276-7282"],["SD","John Thune","605-334-9596"],["TN","Lamar Alexander","615-736-5129"],["TN","Bob Corker","423-756-2757"],["TX","John Cornyn","512-469-6034"],["TX","Kay Hutchison","214-361-3500"],["UT","Orrin Hatch","801-524-4380"],["UT","Mike Lee","801-524-5933"],["VA","Mark Warner","804-775-2314"],["VA","James Webb","804-771-2221"],["VT","Patrick Leahy","802-863-2525"],["VT","Bernard Sanders","802-862-0697"],["WA","Patty Murray","206-553-5545"],["WI","Ron Johnson","605-332-8896"],["WI","Herbert Kohl","414-297-4451"],["WV","Joe Manchin","304-342-5855"],["WV","John Rockefeller","304-347-5372"],["WY","John Barrasso","307-261-6413"],["WY","Michael Enzi","307-682-6268"]]
59 | var senatorsByState = {}
60 | $.each(senators, function(i, senator){
61 | var state = $.trim(senator[0]);
62 |
63 | senatorsByState[state] = senatorsByState[state] || [];
64 | senatorsByState[state].push(senator.slice(1));
65 |
66 | })
67 | var target = $("
")
37 | .bind("click", function(){ self.inspirationalDialog() })
38 | },
39 | placeBadge : function(){
40 | if(!$("body").find(".sopa_badge").length) {
41 | $("body").append(this.badge())
42 | }
43 | },
44 |
45 | tweetWindow : function(options) {
46 | window.open(
47 | "https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Fcloudflare.com"+
48 | "&text="+encodeURIComponent(options.text)+
49 | "&url="+encodeURIComponent(options.url)+
50 | "&hashtags="+encodeURIComponent(options.hashtag)+
51 | "&via=cloudflare",
52 | "_blank",
53 | "height=450,left=445,personalbar=0,resiable=1,scrollbars=1,toolbar=0,top=225,width=550"
54 | );
55 | },
56 |
57 | senatorDropdown: function(){
58 | var senators =[["AK","Lisa Murkowski","907-456-0233"],["AK","Mark Begich","907-271-5915"],["AL","Jefferson Sessions","334-244-7017"],["AL","Richard Shelby","205-759-5047"],["AR","John Boozman","479-725-0400"],["AR","Mark Pryor","501-324-6336"],["AZ","Jon Kyl","602-840-1891"],["AZ","John McCain","602-952-2410"],["CA","Barbara Boxer","510-286-8537"],["CA","Dianne Feinstein","415-393-0707"],["CO","Michael Bennet","303-455-7600"],["CO","Mark Udall","303-650-7820"],["CT","Richard Blumenthal","860-258-6940"],["CT","Joseph Lieberman","860-549-8463"],["DE","Thomas Carper","302-573-6291"],["DE","Chris Coons","302-573-6345"],["FL","Bill Nelson","407-872-7161"],["FL","Marco Rubio","305-418-8553"],["GA","C. Saxby Chambliss","770-763-9090"],["GA","John Isakson","770-661-0999"],["HI","Daniel Akaka","808-522-8970"],["HI","Daniel Inouye","808-541-2542"],["IA","Charles Grassley","515-288-1145"],["IA","Thomas Harkin","515-284-4574"],["ID","Michael Crapo","208-334-1776"],["ID","James Risch","208-342-7985"],["IL","Richard Durbin","312-353-4952"],["IL","Mark Kirk","312-886-3506"],["IN","Daniel Coats","317-554-0750"],["IN","Richard Lugar","317-226-5555"],["KS","Pat Roberts","913-451-9343"],["KY","Mitch McConnell","502-582-6304"],["KY","Rob Portman","361-576-1231"],["LA","Mary Landrieu","225-389-0395"],["LA","David Vitter","337-262-6898"],["MA","Scott Brown","617-565-3170"],["MA","John Kerry","617-565-8519"],["MD","Barbara Mikulski","410-962-4510"],["ME","Susan Collins","207-945-0417"],["ME","Olympia Snowe","207-874-0883"],["MI","Carl Levin","313-226-6020"],["MI","Debbie Stabenow","517-203-1760"],["MN","Al Franken","651-221-1016"],["MN","Amy Klobuchar","612-727-5220"],["MO","Roy Blunt","816-471-7141"],["MO","Claire McCaskill","816-421-1639"],["MS","Thad Cochran","601-965-4459"],["MS","Roger Wicker","601-965-4644"],["MT","Max Baucus","406-657-6790"],["MT","Jon Tester","406-449-5401"],["NC","Richard Burr","910-251-1058"],["NC","Kay Hagan","336-333-5311"],["ND","Kent Conrad","701-258-4648"],["ND","John Hoeven","701-250-4618"],["NE","Mike Johanns","308-632-6032"],["NE","E. Benjamin Nelson","402-441-4600"],["NH","Kelly Ayotte","603-622-7979"],["NH","Jeanne Shaheen","603-647-7500"],["NJ","Frank Lautenberg","973-639-8700"],["NJ","Robert Menendez","973-645-3030"],["NM","Jeff Bingaman","505-346-6601"],["NM","Tom Udall","505-346-6791"],["NV","Dean Heller","775-686-5770"],["NV","Harry Reid","702-388-5020"],["NY","Kirsten Gillibrand","212-688-6262"],["NY","Charles Schumer","212-486-4430"],["OH","Sherrod Brown","216-522-7272"],["OK","James Inhofe","918-748-5111"],["OK","Tom Coburn","918-581-7651"],["OR","Jeffery Merkley","503-326-3386"],["PA","Robert Casey","570-941-0930"],["PA","Pat Toomey","610-434-1444"],["RI","John Reed","401-943-3100"],["RI","Sheldon Whitehouse","401-453-5294"],["SC","Jim DeMint","864-233-5366"],["SC","Lindsey Graham","864-250-1417"],["SD","Tim Johnson","414-276-7282"],["SD","John Thune","605-334-9596"],["TN","Lamar Alexander","615-736-5129"],["TN","Bob Corker","423-756-2757"],["TX","John Cornyn","512-469-6034"],["TX","Kay Hutchison","214-361-3500"],["UT","Orrin Hatch","801-524-4380"],["UT","Mike Lee","801-524-5933"],["VA","Mark Warner","804-775-2314"],["VA","James Webb","804-771-2221"],["VT","Patrick Leahy","802-863-2525"],["VT","Bernard Sanders","802-862-0697"],["WA","Patty Murray","206-553-5545"],["WI","Ron Johnson","605-332-8896"],["WI","Herbert Kohl","414-297-4451"],["WV","Joe Manchin","304-342-5855"],["WV","John Rockefeller","304-347-5372"],["WY","John Barrasso","307-261-6413"],["WY","Michael Enzi","307-682-6268"]]
59 | var senatorsByState = {}
60 | $.each(senators, function(i, senator){
61 | var state = $.trim(senator[0]);
62 |
63 | senatorsByState[state] = senatorsByState[state] || [];
64 | senatorsByState[state].push(senator.slice(1));
65 |
66 | })
67 | var target = $("