/
index.html
291 lines (264 loc) · 11.9 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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<html>
<head>
<title>Coding Workshops</title>
<script type="text/javascript" src="js/ICanHaz.js"></script>
<script type="text/javascript" src='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.js'></script>
<script type="text/javascript" src='js/jquery.js '></script>
<script type="text/javascript" src='js/tabletop.js'></script>
<script type="text/javascript" src='js/sheetsee.js'></script>
<script type="text/javascript" src='js/leaflet.markercluster.js'></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.css' rel='stylesheet' />
<link rel='stylesheet' type='text/css' href='http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic'>
<link media="screen" rel="stylesheet" type="text/css" href="css/style.css">
<link media="screen" rel="stylesheet" type="text/css" href="css/site.css">
<link rel="stylesheet" href="css/MarkerCluster.css" />
<link rel="stylesheet" href="css/MarkerCluster.Default.css" />
</head>
<body>
<div id="wrapper">
<h1> <a href="index.html"> Coding Workshops</a></h1>
<p class="heading"> Coding is getting more and more popular. Here's a list of coding schools and workshops where you can learn how to code. </p>
<div>
<ul class="nav">
<li><a href="#info">INFO</a> -</li>
<li><a href="http://jlord.github.com/sheetsee.js" target="_blank">POWERED BY SHEETSEE.JS</a> -</li>
<li><a href="http://www.github.com/rosario/coding-workshops" target="_blank">Github</a> -</li>
<li><a href="http://www.twitter.com/_sarhus" target="_blank">@_sarhus</a></li>
</ul>
</div>
<div class="container">
<div id="map"></div>
<div id="rightSide">
<div id="latestSpot"></div>
<div id="selectedSpot"></div>
</div>
</div>
<div class="container">
<input id="tableFilter" type="text" placeholder="filter by.."></input>
<span class="clear button">Clear</span> <span class="resetMap button">Reset Map</span>
<span class="noMatches">no matches</span>
<div id="hackSpotsTable"></div>
</div>
<div id="info" class="container">
<h3>Contribute! <!-- <div style="display:inline;" id="theNumberofSpots"></div> --></h3>
<p>Add more Coding Workshops using this
<a href="https://docs.google.com/spreadsheet/ccc?key=0AjW3KStmslDndFVrS2x2STNGR3JWZnZyQUxBTjk1RlE#gid=0" target="_blank">this Google Spreadsheet</a>.
The website will auto-update after you've saved (thanks to <a href="http://jlord.github.io/sheetsee.js/"> Sheetsee.js</a>).
You'll need to <strong>get the lat and long</strong> of the venue, use this <a href="http://www.latlong.net/" target="_blank">website</a>.
Please try to fill out all the columns.</p>
<h3>Info</h3>
<p>A shameless copy of <a href="http://jlord.github.io/hack-spots/">Hack Spots</a>, but for Coding Workshops.
You can find the source code on <a href="http://github.com/rosario/coding-workshops">github</a>.
Credits go to <a href="https://twitter.com/jllord"> Jessica Lord </a> for her amazing
<a href="http://jlord.github.io/sheetsee.js/"> Sheetsee.js</a>.
</p>
</div>
</div><!-- end wrapper -->
<script id="hackSpotsTable" type="text/html">
<table>
<tr>
<th class="tHeader">Name</th>
<th class="tHeader">Website</th>
<th class="tHeader">Address</th>
<th class="tHeader">City</th>
<th class="tHeader">Country</th>
</tr>
{{#rows}}
<tr id="{{rowNumber}}" class="spotRow">
<td>{{name}}</td>
<td>{{website}}</td>
<td>{{address}}</td>
<td>{{city}}</td>
<td>{{country}}</td>
</tr>
{{/rows}}
</table>
</script>
<script id="latestSpot" type="text/html">
{{#rows}}
<h4 class="fauxButton">MOST RECENT SPOT</h4>
<h2>{{name}}</h2>
<p class="colorText"><a href="{{website}}"> {{website}} </a><p>
<p class="colorText">{{address}}<p>
<p class="colorText">{{city}},{{country}} {{#postcode}} {{postcode}} {{/postcode}}</p>
<ul>
<li><span class="category">Cost:</span> {{cost}}</li>
<li><span class="category">Required Experience:</span> {{requiredexperience}}</li>
<li><span class="category">Programming Languages:</span> {{programminglanguages}}</li>
<li><span class="category">Class Size:</span> {{classsize}}</li>
<li><span class="category">Hours/Week:</span> {{hoursweek}}</li>
<li><span class="category">Job Assistance:</span> {{jobassistance}}</li>
<li><span class="category">Refund:</span> {{refund}}</li>
<li><span class="category">Financial Aid:</span> {{financialaid}}</li>
<li><span class="category">Payment Plan:</span> {{paymentplan}}</li>
<li><span class="category">Twitter:</span> <a href="http://www.twitter.com/{{contributerstwitter}}" target="_blank">@{{contributerstwitter}}</a></li>
</ul>
<ul>
<li><a href="https://maps.google.com/maps?q={{address}},{{city}},{{state}}" target="_blank">View in Google Maps</a></li>
</ul>
{{/rows}}
</script>
<script id="theNumberofSpots" type="text/html" style="display:inline;">
<span class="red-text">{{numberOfSpots}}</span> hack spots strong!
</script>
<script id="popUps" type="text/html">
<h2>{{ name }}</h2>
</script>
<script id="selectedSpot" type="text/html">
{{#rows}}
<h4 class="fauxButton">SELECTED SPOT</h4>
<h2>{{name}}</h2>
<p class="colorText">{{address}}<p>
<p class="colorText">{{city}},{{country}} {{#postcode}} {{postcode}} {{/postcode}}</p>
<ul>
<li><span class="category">Cost:</span> {{cost}}</li>
<li><span class="category">Required Experience:</span> {{requiredexperience}}</li>
<li><span class="category">Programming Languages:</span> {{programminglanguages}}</li>
<li><span class="category">Class Size:</span> {{classsize}}</li>
<li><span class="category">Hours/Week:</span> {{hoursweek}}</li>
<li><span class="category">Job Assistance:</span> {{jobassistance}}</li>
<li><span class="category">Refund:</span> {{refund}}</li>
<li><span class="category">Financial Aid:</span> {{financialaid}}</li>
<li><span class="category">Payment Plan:</span> {{paymentplan}}</li>
<li><span class="category">Contributed By:</span> <a href="http://www.twitter.com/{{contributerstwitter}}" target="_blank">@{{contributerstwitter}}</a></li>
</ul>
<ul>
<li><a href="https://maps.google.com/maps?q={{address}},{{city}},{{country}}" target="_blank">View in Google Maps</a></li>
</ul>
{{/rows}}
</script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var gData;
var URL = "0AjW3KStmslDndFVrS2x2STNGR3JWZnZyQUxBTjk1RlE";
Tabletop.init( { key: URL, callback: showInfo, simpleSheet: true } )
})
// so long, so messy
function showInfo(data) {
gData = data
// make the table, and the search bar
Sheetsee.makeTable(gData, "#hackSpotsTable")
Sheetsee.initiateTableFilter(gData, "#tableFilter", "#hackSpotsTable")
// when someone clicks on a row, highlight it and
// re-center the map
$('.spotRow').live("click", function(event) {
$('.spotRow').removeClass("selectedRow")
var rowNumber = $(this).closest("tr").attr("id")
$('#' + rowNumber).addClass("selectedRow")
var dataElement = Sheetsee.getMatches(gData, rowNumber, "rowNumber")
var selectedSpot = ich.selectedSpot({
rows: dataElement
})
$('#latestSpot').css("display", "none")
$('#selectedSpot').html(selectedSpot).css("display", "inline")
var selectedCoords = [dataElement[0].lat, dataElement[0].long]
matchGeoJSONbyRowNumber(rowNumber, geoJSON, gData, "#FF4646")
var markerLayer = Sheetsee.addMarkerLayer(geoJSON, map, 13)
addPopups(map, markerLayer)
map.panTo(selectedCoords, 13)
})
// so that the first map and info that loads
// is complete and doesn't show rows that are
// actively being edited by folk
function findLatestCompleteSpot(data) {
var latestCompleteSpot = []
var startWithLatestRow = data.reverse()
startWithLatestRow.forEach(function(row){
if (!row.lat || !row.long || !row.name || !row.address || !row.city) return
else latestCompleteSpot.push(row)
})
return latestCompleteSpot[0]
}
// find the latest spot with the most important
// info filled in (to prevent map breaking if
// someone is currently editing spreadsheet)
var theLatestSpot = findLatestCompleteSpot(gData)
var latestSpot = ich.latestSpot({
rows: theLatestSpot
})
$('#latestSpot').html(latestSpot)
function highlightLastMarker(geoJSON, highlightColor) {
geoJSON[0].properties["marker-color"] = highlightColor
return geoJSON
}
// create geoJSON with coordinates and other
// useful bits from the original data
var optionsJSON = ["name", "address", "city", "rowNumber"]
var geoJSONnoHL = Sheetsee.createGeoJSON(gData, optionsJSON)
// change the color of the most recently added spot's marker
var geoJSON = highlightLastMarker(geoJSONnoHL, "#FF4646")
// create map, tilelayer (map background), markers and popups
var map = Sheetsee.loadMap("map")
Sheetsee.addTileLayer(map, 'github.map-xgq2svrz')
var markerLayer = Sheetsee.addMarkerLayer(geoJSON, map, 13)
addPopups(map, markerLayer)
// design the popups to have the content and
// interactions that we want
function addPopups(map, markerLayer) {
markerLayer.eachLayer(function(marker) {
var popupContent = ich.popUps(marker.feature.opts)
marker.bindPopup(popupContent, {closeButton: false,})
})
markerLayer.on('click', function(e) {
// clear any selected rows
$('.spotRow').removeClass("selectedRow")
// get row number of selected marker
var rowNumber = e.layer.feature.opts.rowNumber.toString()
// find that row in the table and make consider it selected
$('#' + rowNumber).addClass("selectedRow")
// using row number, find that marker in the geoJSON, give it
// the selected marker color
matchGeoJSONbyRowNumber(rowNumber, geoJSON, gData, "#FF4646")
// var markerLayer = Sheetsee.addMarkerLayer(geoJSON, map, 13)
// addPopups(map, markerLayer)
// using row number, get the data for the selected spot
var dataElement = Sheetsee.getMatches(gData, rowNumber, "rowNumber")
// take those details and re-write the selected spot section
var selectedSpot = ich.selectedSpot({
rows: dataElement
})
$('#latestSpot').css("display", "none")
$('#selectedSpot').html(selectedSpot).css("display", "inline")
})
}
$('.resetMap').click(function() {
$('.spotRow').removeClass("selectedRow")
markerLayer = Sheetsee.addMarkerLayer(geoJSON, map, 13)
addPopups(map, markerLayer)
$('#latestSpot').css("display", "inline")
$('#selectedSpot').css("display", "none")
})
// find total number of spots added
var numberOfSpots = gData.length
var theNumberofSpots = ich.theNumberofSpots({
numberOfSpots: numberOfSpots
})
$('#theNumberofSpots').html(theNumberofSpots)
function matchGeoJSONbyRowNumber(rowNumber, geoJSON, gdata, highlightColor) {
geoJSON.forEach(function (d) {
if (d.properties["marker-color"] === highlightColor) {
var origColor = gData[0].hexcolor
d.properties["marker-color"] = origColor
}
for (var key in d.opts) {
var value = d.opts[key].toString().toLowerCase()
if (key === 'rowNumber' && value.match(rowNumber.toString().toLowerCase())) {
d.properties["marker-color"] = highlightColor
return geoJSON
}
}
})
}
}
</script>
<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-46537375-1', 'codingworkshops.com');
ga('send', 'pageview');
</script>
</body>
</html>