pull in more changes from upstream

This commit is contained in:
David 2015-04-04 19:08:49 -04:00
commit 767514c639
2 changed files with 15 additions and 5 deletions

View File

@ -12,7 +12,7 @@
table {text-align: left; width: 100%} table {text-align: left; width: 100%}
th {padding: 10px 0px;} th {padding: 10px 0px;}
td, text {padding: 3px 18px 3px 0px; font-size: 14px;} td, text {padding: 3px 0 3px 0; font-size: 14px;}
#tableFilter {margin: 12px 0px; border: none; border-bottom: 1px solid #333; background-color: transparent; padding: 0px; font-family: Merriweather; color: #fff; font-size: 13px; height: 22px;} #tableFilter {margin: 12px 0px; border: none; border-bottom: 1px solid #333; background-color: transparent; padding: 0px; font-family: Merriweather; color: #fff; font-size: 13px; height: 22px;}
.noMatches {margin-left: 20px; font-size: 11px; font-style: italic; visibility: hidden;} .noMatches {margin-left: 20px; font-size: 11px; font-style: italic; visibility: hidden;}

View File

@ -101,6 +101,7 @@
var URL = "0AnhMurQVK5pqdHU0UF9QTFRRNTQwR3hQTFdOV3laRGc" var URL = "0AnhMurQVK5pqdHU0UF9QTFRRNTQwR3hQTFdOV3laRGc"
Tabletop.init( { key: URL, callback: showInfo, simpleSheet: true } ) Tabletop.init( { key: URL, callback: showInfo, simpleSheet: true } )
}) })
// so long, so messy // so long, so messy
function showInfo(gData) { function showInfo(gData) {
tableOptions = { tableOptions = {
@ -116,8 +117,6 @@
// useful bits from the original data // useful bits from the original data
var optionsJSON = ["name", "address", "city", "rowNumber"] var optionsJSON = ["name", "address", "city", "rowNumber"]
var geoJSON = Sheetsee.createGeoJSON(gData, optionsJSON) var geoJSON = Sheetsee.createGeoJSON(gData, optionsJSON)
// change the color of the most recently added spot's marker
geoJSON[geoJSON.length - 1].properties["marker-color"] = "#FF4646"
// create map, tilelayer (map background), markers and popups // create map, tilelayer (map background), markers and popups
var map = Sheetsee.loadMap("map") var map = Sheetsee.loadMap("map")
@ -133,10 +132,11 @@
}) })
// set it and pan to it // set it and pan to it
$('#latestSpot').html(latestSpot) $('#latestSpot').html(latestSpot)
map.panTo([theLatestSpot.lat, theLatestSpot.long]) map.setView([theLatestSpot.lat, theLatestSpot.long], 14)
// when someone clicks on a row, highlight it and // when someone clicks on a row, highlight it and
// re-center the map // re-center the map
// TODO show popup, change marker color
$('.spotRow').live("click", function(event) { $('.spotRow').live("click", function(event) {
$('.spotRow').removeClass("selectedRow") $('.spotRow').removeClass("selectedRow")
var rowNumber = $(this).closest("tr").attr("id") var rowNumber = $(this).closest("tr").attr("id")
@ -148,7 +148,7 @@
$('#latestSpot').css("display", "none") $('#latestSpot').css("display", "none")
$('#selectedSpot').html(selectedSpot).css("display", "inline") $('#selectedSpot').html(selectedSpot).css("display", "inline")
var selectedCoords = [dataElement[0].lat, dataElement[0].long] var selectedCoords = [dataElement[0].lat, dataElement[0].long]
map.panTo(selectedCoords) map.setView(selectedCoords, 14)
}) })
// so that the first map and info that loads // so that the first map and info that loads
@ -198,7 +198,17 @@
numberOfSpots: gData.length numberOfSpots: gData.length
}) })
$('#theNumberofSpots').html(theNumberofSpots) $('#theNumberofSpots').html(theNumberofSpots)
if(window.location.hash) {
$('#tableFilter').val(window.location.hash.substring(1)).keyup()
$('.spotRow').first().click()
}
} }
$(document).on('keyup', '#tableFilter', function() {
window.location.hash = $(this).val()
$('.spotRow').first().click()
})
</script> </script>
</body> </body>
</html> </html>