moar
This commit is contained in:
109
index.html
109
index.html
@@ -8,30 +8,52 @@
|
||||
<script type="text/javascript" src='js/sheetsee.js'></script>
|
||||
<link rel="shortcut icon" href="https://raw.github.com/jllord/sheetsee-cache/master/favicon-p.png"/>
|
||||
|
||||
|
||||
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.0.0/mapbox.css' rel='stylesheet' />
|
||||
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic' rel='stylesheet' type='text/css'>
|
||||
<link href='http://fonts.googleapis.com/css?family=Amatic+SC:400,700' rel='stylesheet' type='text/css'>
|
||||
<link media="screen" rel="stylesheet" type="text/css" href="/css/style.css">
|
||||
<link media="screen" rel="stylesheet" type="text/css" href="/css/site.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<h1>Hack Spots</h1>
|
||||
<div id="container">
|
||||
|
||||
<div id="latestSpot"></div>
|
||||
<div id="selectedSpot"></div>
|
||||
<div>
|
||||
<ul class="nav">
|
||||
<li><strong>The collected favorites of those who hack<strong></li>
|
||||
<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/jlord/hack-spots" target="_blank">GITHUB</a> -</li>
|
||||
<li><a href="http://www.twitter.com/jllord" target="_blank">@JLLORD</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div id="rightSide">
|
||||
<div id="latestSpot"></div>
|
||||
<div id="selectedSpot"></div>
|
||||
</div>
|
||||
<div id="map"></div>
|
||||
</div>
|
||||
<div id="hackSpotsTable"></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>Info</h3>
|
||||
<p>When I'm visiting a new city I'd like to know which coffee shops have the best vibes, great coffee and are good for hunkering down and having a good hack. Yelp will tell you where the Starbucks is and Foursquare will tell you where your friend's have <em>been</em> - but did they like it and was it a grab in go place or a hack place? Plus, what about the people I don't follow on Foursquare or who can't check-in when in other countries?</p>
|
||||
|
||||
<p>This website is hooked up to <a href="" target="_blank">this Google Spreadsheet</a>, which I've shared with friends. They add their favorite spots and every visitor to the site gets the latest data.</p>
|
||||
|
||||
<p>Besides being a list I've wanted to have, it's a fantastic (or I think so) way of using <a href="http://jlord.github.io/sheetsee.js" target="_blank">sheetsee.js</a>, which is a little JavaScript library I've been working on. Sheetsee.js helps you hook a website to a Google spreadsheet that you then use to create or collaborate on data. </p>
|
||||
</div>
|
||||
</div><!-- end wrapper -->
|
||||
|
||||
<script id="hackSpotsTable" type="text/html">
|
||||
<table>
|
||||
<tr><th class="tHeader">Name</th><th class="tHeader">Address</th><th class="tHeader">City</th><th class="tHeader">State</th><th class="tHeader">Country</th></tr>
|
||||
<tr><th class="tHeader">Name</th><th class="tHeader">Address</th><th class="tHeader">City</th><th class="tHeader">State</th><th class="tHeader">Country</th><th class="">Elsewhere</th></tr>
|
||||
{{#rows}}
|
||||
<tr id="{{rowNumber}}" class="spotRow"><td>{{name}}</td><td>{{address}}</td><td>{{city}}</td><td>{{state}}</td><td>{{country}}</td><td><a class="button" href="https://maps.google.com/maps?q={{address}},{{city}},{{state}}" target="_blank">Map it!</a></td></tr>
|
||||
<tr id="{{rowNumber}}" class="spotRow"><td>{{name}}</td><td>{{address}}</td><td>{{city}}</td><td>{{state}}</td><td>{{country}}</td><td><a class="button" href="https://maps.google.com/maps?q={{address}},{{city}},{{state}}" target="_blank">G Map</a> <a class="button" href="http://www.yelp.com/search?find_desc={{name}},{{city}},{{state}}" target="_blank">Yelp</a></td></tr>
|
||||
<tr class="hideRow"><td>wifi: {{wifipassword}}</td></tr>
|
||||
{{/rows}}
|
||||
</table>
|
||||
@@ -39,32 +61,40 @@
|
||||
|
||||
<script id="latestSpot" type="text/html">
|
||||
{{#rows}}
|
||||
<h2>Recently Added</h2>
|
||||
<h3>{{name}}</h3>
|
||||
<p>{{address}}, {{city}}, {{state}}
|
||||
<h4 class="fauxButton">MOST RECENT SPOT</h4>
|
||||
<h2>{{name}}</h2>
|
||||
<p class="colorText">{{address}}, {{city}}, {{state}}
|
||||
<ul>
|
||||
<li>Wifi: {{wifipassword}}</li>
|
||||
<li>Outlets: {{outlets}}</li>
|
||||
<li>Couch: {{couch}}</li>
|
||||
<li>Large Table: {{largetable}}</li>
|
||||
<li>Outdoor Seating: {{outdoorseating}}</li>
|
||||
<li>Brewing: {{brewing}}</li>
|
||||
<li><span class="category">Wifi:</span> {{wifipassword}}</li>
|
||||
<li><span class="category">Outlets:</span> {{outlets}}</li>
|
||||
<li><span class="category">Couch:</span> {{couch}}</li>
|
||||
<li><span class="category">Large Table:</span> {{largetable}}</li>
|
||||
<li><span class="category">Outdoor Seating:</span> {{outdoorseating}}</li>
|
||||
<li><span class="category">Brewing:</span> {{brewing}}</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="https://maps.google.com/maps?q={{address}},{{city}},{{state}}" target="_blank">View in Google Maps</a></li>
|
||||
<li><a href="http://www.yelp.com/search?find_desc={{name}},{{city}},{{state}}" target="_blank">Find on Yelp</a></li>
|
||||
</ul>
|
||||
{{/rows}}
|
||||
</script>
|
||||
|
||||
<script id="selectedSpot" type="text/html">
|
||||
{{#rows}}
|
||||
<h2>Selected Spot</h2>
|
||||
<h3>{{name}}</h3>
|
||||
<p>{{address}}, {{city}}, {{state}}
|
||||
<h4 class="fauxButton">SELECTED SPOT</h4>
|
||||
<h2>{{name}}</h2>
|
||||
<p class="colorText">{{address}}, {{city}}, {{state}}
|
||||
<ul>
|
||||
<li>Wifi: {{wifipassword}}</li>
|
||||
<li>Outlets: {{outlets}}</li>
|
||||
<li>Couch: {{couch}}</li>
|
||||
<li>Large Table: {{largetable}}</li>
|
||||
<li>Outdoor Seating: {{outdoorseating}}</li>
|
||||
<li>Brewing: {{brewing}}</li>
|
||||
<li><span class="category">Wifi:</span> {{wifipassword}}</li>
|
||||
<li><span class="category">Outlets:</span> {{outlets}}</li>
|
||||
<li><span class="category">Couch:</span> {{couch}}</li>
|
||||
<li><span class="category">Large Table:</span> {{largetable}}</li>
|
||||
<li><span class="category">Outdoor Seating:</span> {{outdoorseating}}</li>
|
||||
<li><span class="category">Brewing:</span> {{brewing}}</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="https://maps.google.com/maps?q={{address}},{{city}},{{state}}" target="_blank">View in Google Maps</a></li>
|
||||
<li><a href="http://www.yelp.com/search?find_desc={{name}},{{city}},{{state}}" target="_blank">Find on Yelp</a></li>
|
||||
</ul>
|
||||
{{/rows}}
|
||||
</script>
|
||||
@@ -72,12 +102,14 @@
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
Sheetsee.makeTable(gData, "#hackSpotsTable")
|
||||
Sheetsee.initiateTableFilter(gData, "#tableFilter", "#hackSpotsTable")
|
||||
|
||||
$('.spotRow').click(function(event) {
|
||||
$('.spotRow').live("click", function(event) {
|
||||
$('.spotRow').removeClass("selectedRow")
|
||||
console.log("clicked!")
|
||||
var rowNumber = $(this).closest("tr").attr("id")
|
||||
console.log(rowNumber)
|
||||
$('#' + rowNumber).addClass("selectedRow")
|
||||
var dataElement = Sheetsee.getMatches(gData, rowNumber, "rowNumber")
|
||||
console.log(dataElement)
|
||||
var selectedSpot = ich.selectedSpot({
|
||||
rows: dataElement
|
||||
})
|
||||
@@ -95,6 +127,13 @@
|
||||
})
|
||||
$('#latestSpot').html(latestSpot)
|
||||
|
||||
function refocusMap(){
|
||||
var searchTerm = $('#tableFilter').val()
|
||||
var searchData = Sheetsee.getKeyword(gData, searchTerm)
|
||||
var searchCoords = ""
|
||||
// map.setView(viewCoords, zoomLevel)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
var optionsJSON = ["name", "address", "city", "rownumber"]
|
||||
@@ -107,12 +146,16 @@
|
||||
function addPopups(map, markerLayer) {
|
||||
markerLayer.on('click', function(e) {
|
||||
var feature = e.layer.feature
|
||||
var popupContent = '<h2>' + feature.opts.name + '</h2>' +
|
||||
'<h3>' + feature.opts.address + ', ' + feature.opts.city + '</h3>'
|
||||
var popupContent = '<h2>' + feature.opts.name + '</h2>'
|
||||
e.layer.bindPopup(popupContent,{closeButton: false,})
|
||||
})
|
||||
}
|
||||
|
||||
$('.resetMap').click(function() {
|
||||
$('.spotRow').removeClass("selectedRow")
|
||||
markerLayer = Sheetsee.addMarkerLayer(geoJSON, map, 11)
|
||||
$('#latestSpot').css("display", "inline")
|
||||
$('#selectedSpot').css("display", "none")
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user