forked from sfbrigade/sf-crime-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
269 lines (246 loc) · 15.3 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>SF Crime Data</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Libre+Franklin:300,400,500|Montserrat">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="//cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css">
<link rel="stylesheet" href="//cdn.datatables.net/buttons/1.2.1/css/buttons.dataTables.min.css">
<link rel="stylesheet" href="//cdn.datatables.net/fixedheader/3.1.2/css/fixedHeader.dataTables.min.css">
<link rel="stylesheet" href="//api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.css">
<link rel="stylesheet" href="//api.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.css"/>
<link rel="stylesheet" href="//api.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.Default.css"/>
<link rel="stylesheet" href="css/daterangepicker.css">
<link rel="stylesheet" href="css/jquery.nouislider.css">
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js">
</script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="starter-template">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<p id="beta">* Beta test *</p>
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<!-- Button trigger modal -->
<button type="button" id="feedback-btn" class="hidden-xs btn btn-primary btn-sm pull-right" data-toggle="modal" data-target="#myModal">
Leave Feedback
</button>
<button type="button" id="feedback-btn" class="visible-xs btn btn-primary btn-xs pull-right" data-toggle="modal" data-target="#myModal">
Leave Feedback
</button>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<h1>San Francisco Crime Data</h1>
<h2>SFPD data provided by <a href="https://data.sfgov.org/" target="_blank">SF OpenData</a></h2>
</div>
</div>
<div id="sfim-controls" class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div id="address-control" class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="form-group" id="searchgroup">
<label for="inputAddress">Address</label>
<input type="text" class="form-control typeahead" name="inputAddress" id="inputAddress" placeholder="Enter address" autocomplete="off" data-provide="typeahead">
</div>
</div>
<div id="slider-number-control" class="col-xs-12 col-sm-12 col-md-2 col-lg-2">
<div class="form-group">
<label for="range-slider-input">Radius (ft)</label>
<input id="range-slider-input" class="form-control" type="text">
</div>
</div>
<div id="slider-control" class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="form-group">
<div class="slider-body">
<label for="range-slider">Adjust Radius</label>
<div id="range-slider"></div>
</div>
</div>
</div>
<div id="date-control" class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="form-group">
<label for="select-time">Time period</label>
<input id="daterange" type="text" class="form-control">
<div class="subheader" id="data-updated"></div>
</div>
</div>
</div>
</div>
<div id="map" class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div class="loading" style="display:none;">
<div class="circle"></div>
</div>
</div>
<div id="controls-lower" class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="padding:0px !important;">
<div id="btns-export" class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="padding:0px !important;">
<div class="export-btn col-xs-12 col-sm-12 col-md-3 col-lg-3">
<a href="javascript:void(0)" id="download-csv">
<button class="btn btn-sm btn-primary download-csv btn-block">
<span class="glyphicon glyphicon-arrow-down"></span>
Download CSV</button>
</a>
</div>
<div class="export-btn col-xs-12 col-sm-12 col-md-3 col-lg-3">
<a href="javascript:void(0)" id="open-geojsonio" target="_blank">
<button class="btn btn-sm btn-primary open-geojsonio btn-block">
<span class="glyphicon glyphicon-new-window"></span>
Open with Geojson.io</button>
</a>
</div>
<div class="export-btn col-xs-12 col-sm-12 col-md-3 col-lg-3">
<a href="javascript:void(0)" id="open-cartodb" target="_blank">
<button class="btn btn-sm btn-primary open-cartodb btn-block">
<span class="glyphicon glyphicon-new-window"></span>
Open with CartoDB</button>
</a>
</div>
<div class="export-btn right col-xs-12 col-sm-12 col-md-3 col-lg-3">
<a href="mailto:?subject=My results from sfcrimedata.org&body=Here is the link to my search: " id="email-share">
<button class="btn btn-sm btn-primary btn-block">
<span class="glyphicon glyphicon glyphicon-send"></span>
Share by E-mail</button>
</a>
</div>
</div>
<div id="sfim-table" class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="padding:0px !important;">
<table id="example" class="display table table-responsive" data-min="11" cellspacing="0" width="100%">
<tfoot>
<tr>
</tr>
</tfoot>
</table>
</div>
</div>
<div style="clear: both"></div>
<!-- <footer class="small">
<p>Data from <a href="https://data.sfgov.org/" target="_blank">SF OpenData</a>.</p>
</footer> -->
<!-- Feedback Modal -->
<div class="modal fade" id="myModal" role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal" type="button"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Feedback</h4>
</div>
<div class="modal-body">
<form action="https://formspree.io/[email protected]" method="post">
<div>
<p>Please provide your email address so we can contact you with any questions. We will not share your information or spam you.</p>
</div>
<div class="form-group">
<label for="inputName">Name</label>
<input type="text" id="inputName" class="form-control" name="name" placeholder="Jane Doe">
</div>
<div class="form-group">
<label for="inputEmail">Email</label>
<input type="email" id="inputEmail" class="form-control" name="email" placeholder="[email protected]">
</div>
<label>Is this website easy to use?</label>
<br>
<label class="radio-inline">
<input type="radio" name="Is this website easy to use?" value="yes"> Yes
</label>
<label class="radio-inline">
<input type="radio" name="Is this website easy to use?" value="somewhat"> Somewhat
</label>
<label class="radio-inline">
<input type="radio" name="Is this website easy to use?" value="no"> No
</label>
<div class="form-group"></div>
<label>How likely are you to use this website for professional or personal needs?</label>
<label class="radio-inline">
<input type="radio" value="highly-likely" name="How likely are you to use?"> Highly likely
</label>
<label class="radio-inline">
<input type="radio" value="somewhat-likely" name="How likely are you to use?"> Somewhat likely
</label>
<label class="radio-inline">
<input type="radio" value="unlikely" name="How likely are you to use?"> Unlikely
</label>
<div class="form-group"></div>
<div class="form-group">
<p>If you selected 'No' or 'Unlikely' above, please tell us how we can improve.</p>
<label for="textArea">Comments</label>
<textarea class="form-control" id="textArea" name="general comments" rows="4"></textarea>
</div>
<div>
<!-- This hidden input field is to thrwart scrapers -->
<input name="_gotcha" style="display: none" type="text">
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal" type="button">Close</button> <button class="btn btn-primary" type="submit" value="Send">Send</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Load jQuery from Google's CDN, so that it is likely to be already in the client's cache -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Load pre-made scripts from vendors -->
<script src="//cdnjs.cloudflare.com/ajax/libs/URI.js/1.18.1/URI.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/URI.js/1.18.1/jquery.URI.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="//api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.js"></script>
<script src="//api.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/leaflet.markercluster.js"></script>
<script src="//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script>
<script src="//cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.js"></script>
<script src="//cdn.datatables.net/buttons/1.2.1/js/dataTables.buttons.min.js"></script>
<script src="//cdn.datatables.net/buttons/1.2.1/js/buttons.colVis.min.js"></script>
<script src="//cdn.datatables.net/fixedheader/3.1.2/js/dataTables.fixedHeader.min.js"></script>
<script src="js/vendor/moment.js"></script>
<script src="js/vendor/daterangepicker.js"></script>
<script src="js/vendor/jquery.nouislider.all.min.js"></script>
<script src="js/vendor/bootstrap3-typeahead.js"></script>
<!-- Pre-made scripts loaded -->
<!-- Loading modules -->
<script src="js/modules/resources.js"></script>
<script src="js/modules/map.js"></script>
<script src="js/modules/controls.js"></script>
<script src="js/modules/urlSearch.js"></script>
<!-- Loading modules finished.... -->
<script>
/**
Lets start the whole application from a jQuery document.ready event
*/
$(document).ready(function() {
//Start the resources module with a Promise first so that all resources we might ever need would be loaded
var initLoaded = new Promise(
function(resolve, reject){
resolve(resourcesModule.init(initializeUI))
reject(function(){
throw new Error("Our resources didn't load correctly, yikes!")
})
}
)
function initializeUI() {
//Start the UI relevant modules here in a callback function
mapModule.init($("#map"));
controlsModule.init($("#sfim-controls"), $("#controls-lower"));
}
// then once all resources are loaded check to see if there is a search in the URL
initLoaded.then(function(){
if(location.search) {
urlSearch.runURLsearch();
}
}, function(error){
console.error(error)
})
});
</script>
</body>
</html>