-
Notifications
You must be signed in to change notification settings - Fork 0
/
indivisible.html
388 lines (353 loc) · 15.4 KB
/
indivisible.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<!doctype html>
<meta charset="utf-8" />
<meta name='google-site-verification' content='-jE-f4Gbpim9_feo74iK5zP_-tegU7xvV89-yqFy7ZI' />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="description" content="IndivisibleGuide | A PRACTICAL GUIDE FOR RESISTING THE TRUMP AGENDA">
<meta name="keywords" content="IndivisibleGuide">
<meta property="og:image" content="https://s3.amazonaws.com/IndivisibleGuide.org/images/social2.png" />
<meta property="og:url" content="https://IndivisibleGuide.org/" />
<meta property="og:title" content="Indivisible Guide | A PRACTICAL GUIDE FOR RESISTING THE TRUMP AGENDA"/>
<meta property="og:description" content=""/>
<link href='//api.tiles.mapbox.com/mapbox.js/v2.1.9/mapbox.css' rel='stylesheet' />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="https://d2zfgjd0dxweyq.cloudfront.net/css/events-map.css">
<link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css?family=Montserrat:100,200,400,700|Petit+Formal+Script:400' />
<title>IndivisibleGuide | A PRACTICAL GUIDE FOR RESISTING THE TRUMP AGENDA</title>
<!--[if lte IE 9]>
<meta http-equiv="refresh" content="0; url=https://go.berniesanders.com/page/event/search_simple" />
<![endif]-->
<body class='list-view initial-view'>
<section id='header'>
<div id="header" class=montserrat>
<div class="main-title-area">
<div style="margin-bottom: 4px;">
<div id='spiel'>
<strong>IndivisibleGuide</strong><br>
</div>
</div>
</div>
<nav>
<ul id="nav">
<li><a href="https://actionnetwork.org/forms/register-local-group?clear_id=true" class="contribute" target="_blank">Register a Group</a></li>
<li><a href="https://actionnetwork.org/events/new?event_campaign_id=2365" class="contribute" target="_blank">Host a Meeting</a></li>
<li><a href="https://actionnetwork.org/events/new?event_campaign_id=2367" class="contribute" target="_blank">Plan an Action</a></li>
</ul>
</nav>
<div style="clear: both"></div>
</div>
</section>
<section id='activity-area' class='clearfix'>
<article id='events'>
<div id='filters'>
<div id='loading-icon' class=montserrat>Loading...</div>
<h3 id='switch-link'>
<a href='javascript: void(null)' onclick='window.mapManager.toMapView()' id='to-map-view'>Show Map</a>
<a href='javascript: void(null)' onclick='window.mapManager.toListView()' id='to-list-view'>Show List</a>
</h3>
<h4 class='lato title'>
<span id='screen-title'>Filters</span>
<span id='mobile-title'>IndivisibleGuide</span>
</h4>
<form id='filter-form'>
<table>
<tr>
<td>
<h5 class=montserrat>By Zipcode</h5>
<input type='number' name='zipcode' maxlength='5' placeholder='ZIPCODE' onclick="this.select();" >
</td>
<td>
<h5 class=montserrat>Distance</h5>
<select name='distance'>
<option value='5'>5mi</option>
<option value='20'>20mi</option>
<option value='50' selected='selected'>50mi</option>
<option value='100'>100mi</option>
</select>
</td>
<td>
<h5 class=montserrat>Sort By</h5>
<select name='sort'>
<option value='time' selected='selected'>Time</option>
<option value='distance'>Distance</option>
</select>
<input type='button' style='position: absolute; z-index: -1; opacity: 0;' id='hidden-button'/>
</td>
</tr>
</table>
<div id='filter-popup-area' class='montserrat'>
<a href='javascript: void(null)' class='filter-button show-filter' onclick='$("#events").addClass("show-type-filter");'>
Search by Type
</a>
<div id='filter-list-area'>
<h5>Search by Type</h5>
<div id='f-container'>
<div id='filter-list-container'>
<ul id='filter-list'></ul>
</div>
<div style='text-align: center; font-size: 11px; margin-top: 10px; color: lightgray;'>
<a href='javascript: void(null)' id='show-all'
onclick='$("#filter-list").find("input[type=checkbox]").prop("checked", true).trigger("change");'>Show All</a> •
<a href='javascript: void(null)'
onclick='$("#filter-list").find("input[type=checkbox]").prop("checked", false).trigger("change")'>Hide All</a>
</div>
</div>
<p align='right'>
<a href='javascript: void(null)' class='filter-button'
onclick='$("#events").removeClass("show-type-filter");'>
Hide Legend
</a>
</p>
</div>
</div>
<nav id='mobile-nav'>
<ul id="nav">
<li><a href="https://actionnetwork.org/forms/register-local-group?clear_id=true" class="contribute" target="_blank">Register a<br/>Group</a></li>
<li><a href="https://actionnetwork.org/events/new?event_campaign_id=2365" class="contribute" target="_blank">Host a<br/>Meeting</a></li>
<li><a href="https://actionnetwork.org/events/new?event_campaign_id=2367" class="contribute" target="_blank">Plan an<br/>Action</a></li>
</ul>
</nav>
</form>
</div>
<div id='event-list-container'>
<div id='hide-show-office' data-count="0">
<a href='javascript: void(null)' class='contribute-big show-office' onclick='$("body").addClass("show-office")'>
<span class='show-offices'>⊲ Show Nearby Offices (<span id='campaign-off-count'></span>)</span>
</a>
<a href='javascript: void(null);' class='contribute-big hide-office' onclick='$("body").removeClass("show-office")'>
<span class='hide-offices'>⊳ Hide Offices</span>
</a>
</div>
<ul id='event-list'><li class='mobile-only lato'>Please type in your <span style='font-weight: 400'>zipcode</span> to view nearby groups, meetings, and events.
</li></ul>
<footer>
<div id='footer-area' >
<sub>© IndivisibleGuide | <a href='https://www.indivisibleguide.com/privacy-policy/'>Privacy Policy</a></sub>
</div>
</footer>
</div>
</article>
<article id='map'>
<div id='map-container'></div>
</article>
</section>
<section id='campaign-offices'>
<div class='viewport'>
<h3 class='title'>Nearby Campaign Offices</h3>
<a class='close-button lato' href='javascript: void(null);' onclick='$("body").removeClass("show-office")'>x</a>
<div class='container'>
<ul id='campaign-office-list'></ul>
</div>
</div>
</section>
<script src="https://d2zfgjd0dxweyq.cloudfront.net/js/jquery.gz"></script>
<script src='https://d2zfgjd0dxweyq.cloudfront.net/js/d3.gz' type='text/javascript'></script>
<script id='zipcodes-datadump' type='text/plain'></script>
<script src='https://d2zfgjd0dxweyq.cloudfront.net/js/deparam.min.gz'></script>
<script src='https://d2zfgjd0dxweyq.cloudfront.net/js/mapbox.gz'></script>
<!-- <script src='/js/leaflet-bouncer.js'></script> -->
<script src='https://d2zfgjd0dxweyq.cloudfront.net/js/moment.min.js'></script>
<script src='https://d2zfgjd0dxweyq.cloudfront.net/js/js-cookie.js'></script>
<script src='/js/MapManagerTranspiled.js'></script>
<script type='text/javascript'>
window.eventTypeFilters = [
// {
// name: 'Campaign Office',
// id: 'campaign-office',
// onItem: "<img style='width: 14px; height: 14px;' src='//d2bq2yf31lju3q.cloudfront.net/img/icon/star.png' />",
// offItem: "<img style='width: 14px; height: 14px;' src='//d2bq2yf31lju3q.cloudfront.net/img/icon/star-gray.png' />"
// },
{
name: 'Group',
id: 'group'
},
{
name: 'Group Meeting',
id: 'group-meeting'
},
{
name: 'Indivisible Action',
id: 'indivisible-action'
}
];
</script>
<script type='text/javascript'>
(function($, d3) {
var date = new Date();
$("#loading-icon").show();
$.ajax({
url: 'https://dnb6leangx6dc.cloudfront.net/output/indivisible.js.gz',
dataType: 'script',
cache: true, // otherwise will get fresh copy every page load
success: function(data) {
window.EVENT_DATA = window.INDIVISIBLE_EVENTS;
d3.csv('//d1y0otadi3knf6.cloudfront.net/d/us_postal_codes.gz',
function(zipcodes) {
$("#loading-icon").hide();
//Clean data
window.EVENT_DATA.forEach(function(d) {
d.filters = [];
//Set filter info
switch(d.event_type) {
case "Group Meeting": d.filters.push('group-meeting'); break;
case "Indivisible Action": d.filters.push("indivisible-action"); break;
case "Group": d.filters.push("group"); break;
default: d.filters.push('other'); break;
}
d.is_official = d.is_official == "1";
if (d.is_official) { d.filters.push("official-event"); }
});
var oldDate = new Date();
/* Extract default lat lon */
var m = /.*\?c=(.+?),(.+?),(\d+)z#?.*/g.exec(window.location.href)
if (m && m[1] && m[2] && m[3]) {
var defaultCoord = {
center: [parseFloat(m[1]), parseFloat(m[2])],
zoom: parseInt(m[3])
};
window.mapManager = MapManager(window.EVENT_DATA, campaignOffices, zipcodes, { defaultCoord: defaultCoord });
var params = $.deparam
window.mapManager.filterByCoords(defaultCoord.center, 50, params.sort, params.f);
} else {
window.mapManager = MapManager(window.EVENT_DATA, null, zipcodes);
}
if($("input[name='zipcode']").val() == '' && Cookies.get('map.bernie.zipcode') && window.location.hash == '') {
$("input[name='zipcode']").val(Cookies.get('map.bernie.zipcode'));
window.location.hash = $("#filter-form").serialize();
} else {
$(window).trigger("hashchange");
}
});
}
});
/** initial loading before activating listeners...
*/
var params = $.deparam(window.location.hash.substring(1));
if (params.zipcode) {
$("input[name='zipcode']").val(params.zipcode);
}
if (params.distance) { $("select[name='distance']").val(params.distance);}
if (params.sort) { $("select[name='sort']").val(params.sort);}
/* Prepare filters */
$("#filter-list").append(
window.eventTypeFilters.map(function(d) {
return $("<li />")
.append(
$("<input type='checkbox' class='filter-type' />")
.attr('name', 'f[]')
.attr("value", d.id)
.attr("id", d.id)
.prop("checked", !params.f ? true : $.inArray(d.id, params.f) >= 0)
)
.append($("<label />").attr('for', d.id).append($("<span />").addClass('filter-on')
.append(d.onItem ? d.onItem : $("<span>").addClass('circle-button default-on')))
.append($("<span />").addClass('filter-off')
.append(d.offItem ? d.offItem : $("<span>").addClass('circle-button default-off')))
.append($("<span>").text(d.name)));
})
);
/***
* define events
*/
//only numbers
$("input[name='zipcode']").on('keyup keydown', function(e) {
if (e.type == 'keydown' && (e.keyCode < 48 || e.keyCode > 57)
&& e.keyCode != 8 && !(e.keyCode >= 37 || e.keyCode <= 40)) {
return false;
}
if (e.type == 'keyup' && $(this).val().length == 5) {
if (! (e.keyCode >= 37 && e.keyCode <= 40) ) {
$(this).closest("form#filter-form").submit();
$("#hidden-button").focus();
}
}
});
/***
* onchange of select
*/
$("select[name='distance'],select[name='sort']").on('change', function(e) {
$(this).closest("form#filter-form").submit();
});
/**
* On filter type change
*/
$(".filter-type").on('change', function(e) {
$(this).closest("form#filter-form").submit();
})
//On submit
$("form#filter-form").on('submit', function(e) {
var serial = $(this).serialize();
window.location.hash = serial;
e.preventDefault();
return false;
});
$(window).on('hashchange', function(e) {
var hash = window.location.hash;
if (hash.length == 0 || hash.substring(1) == 0) { $("#loading-icon").hide(); return false; }
var params = $.deparam(hash.substring(1));
//Custom feature for specific default lat/lon
//lat=40.7415479&lon=-73.8239609&zoom=17
setTimeout(function() {
$("#loading-icon").show();
if ( window.mapManager._options && window.mapManager._options.defaultCoord && params.zipcode.length != 5) {
window.mapManager.filterByType(params.f);
window.mapManager.filterByCoords(window.mapManager._options.defaultCoord.center, params.distance, params.sort, params.f);
} else {
window.mapManager.filterByType(params.f);
window.mapManager.filter(params.zipcode, params.distance, params.sort, params.f);
}
$("#loading-icon").hide();
// var $info = window.votingInfoManager.getInfo(window.mapManager._zipcodes[params.zipcode].state);
// $(".registration-msg").remove();
// if ($info) {
// $info.prependTo("#event-list-container");
// }
}, 10);
// $("#loading-icon").hide();
if (params.zipcode.length == 5 && $("body").hasClass("initial-view")) {
$("#events").removeClass("show-type-filter");
$("body").removeClass("initial-view");
}
});
var pre = $.deparam(window.location.hash.substring(1));
if ($("body").hasClass("initial-view")) {
if ($(window).width() >= 600 && (!pre.zipcode || pre && pre.zipcode.length != 5)) {
$("#events").addClass("show-type-filter");
}
}
})(jQuery, d3);
</script>
<!-- SOCIAL -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-58354050-1', 'auto');
ga('send', 'pageview');
</script>
<script>
// window.fbAsyncInit = function() {
// FB.init({
// appId : '1747464662152148',
// xfbml : true,
// version : 'v2.5'
// });
// };
// (function(d, s, id){
// var js, fjs = d.getElementsByTagName(s)[0];
// if (d.getElementById(id)) {return;}
// js = d.createElement(s); js.id = id;
// js.src = "//connect.facebook.net/en_US/sdk.js";
// fjs.parentNode.insertBefore(js, fjs);
// }(document, 'script', 'facebook-jssdk'));
</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</body>
<script>
function fbShare(url, title, descr, image, winWidth, winHeight) {
var winTop = (screen.height / 2) - (winHeight / 2);
var winLeft = (screen.width / 2) - (winWidth / 2);
window.open('http://www.facebook.com/sharer.php?s=100&p[title]=' + title + '&p[summary]=' + descr + '&p[url]=' + url + '&p[images][0]=' + image, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
}
</script>