Skip to content

Instantly share code, notes, and snippets.

@Keloran
Created May 28, 2014 08:30
Show Gist options
  • Save Keloran/3845cd89c72992f0fb08 to your computer and use it in GitHub Desktop.
Save Keloran/3845cd89c72992f0fb08 to your computer and use it in GitHub Desktop.
Select file not included
Uncaught TypeError: undefined is not a function === home.js?body=1:24
#= 'jQuery/jquery.selectBox.min'
#= 'jQuery/jquery.timepicker.min'
#= 'Utils/jscoord-1.1.1'
class CarPark
@mapObject: false
@grabFromSubmit: false
@markers: new Array()
initalize: ->
mapOptions = {
center: new google.maps.LatLng 53.4843396, -2.2427308
zoom: 11
};
mapObject = new google.maps.Map $("#map-canvas"), mapOptions
false
constructor: ->
$ = jQuery
$(".select").selectBox()
$(".select:disabled").selectBox("disable")
$("#slider-form").submit ->
bPassed = false
dateFrom = $("#date_from").val()
dateTo = $("#date_to").val()
timeForm = $("#time_from").val()
timeTo = $("#time_to").val()
bValsPassed = true
if $("#location").val() == "" then bValsPassed = false
if dateFrom == "" then bValsPassed = false
if dateTo == "" then bValsPassed = false
if timeTo == "" then timeTo.val timeTo.attr "placeholder"
if timeFrom == "" then timeFrom.val timeFrom.attr "placeholder"
bDatePassed = true
if dateFrom > dateTo then bDatePassed = false
bTimePassed = true
if !bDatePassed
if timeTo < timeFrom then bTimePassed = true
if bDatePassed && bTimePassed && bValsPassed then bPassed = true
if $("#chosenCarPark").val() != "" then $("#slider-form").attr "action", "/details"
if !bPassed
event.preventDefault()
doLocation $("#location").val()
grabFromSubmit = false
false
false
$(".datepicker").datepicker {dateFormat: "yy-mm-dd"}
$(".time-select").timepicker {
timeFormat: "G:i",
scrollDefaultNow: true
}
this.initalize()
$("#location").blur ->
if !grabFromSubmit then doLocation $(this).val()
false
$("body").click (event) ->
if $(event.target).parent().closest(".ui-datepicker-header").length != 0 || $(event.target).hasClass "datepicker" == true then
else
if $(".datepicker")
$(".datepicker").datepicker "hide", 0
false
false
false
carpark = new CarPark()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment