$ -> $('.tip').livequery -> $(@).tooltip() $('time.ago').livequery -> $(@).timeago() $('textarea.autogrow').livequery -> $(@).autogrow() $('select.chzn').livequery -> $(@).chosen() $('input, textarea').livequery -> $(@).not('input[type=password]').placeholder() $("select, input:checkbox, input:radio, input:file").livequery -> $(@).not('.hidden').not('.chzn').not('.bare').uniform() $("form").livequery -> $(@).preventDoubleSubmission() $('input[type=date]').livequery -> $(@).not('.bare').datepicker numberOfMonths: 2 dateFormat: 'yy-mm-dd' showOn: 'focus' $("a[data-toggle=modal]").livequery -> $(@).click -> target = $(@).attr('data-target') url = $(@).attr('href') $(target).find('.modal-body').load(url) $('input.autoSuggest').livequery -> # $(@).autoSuggest "/path/to/script", # minChars: 2 autoSuggestData = [{value: "21", name: "Mick Jagger"},{value: "43", name: "Johnny Storm"},{value: "46", name: "Richard Hatch"}] $(@).autoSuggest autoSuggestData, startText: "AutoSuggesting" selectedItemProp: "name" searchObjProps: "name" $('.dataTable').livequery -> $(@).dataTable "bPaginate": false # Don't paginate "aaSorting": [] # No initial sorting "aoColumnDefs": [ # Use this to make the final column un-sortable { "bSortable": false, "aTargets": [ -1 ] } ] # "bJQueryUI": true # Use jQueryUI styling jQuery.fn.preventDoubleSubmission = -> $form = $(this) $form.bind "submit", (e) -> if $form.data("submitted") is true e.preventDefault() else $form.data "submitted", true $form.find('input[type=submit], button').attr('disabled', 'disabled') $form.ajaxComplete -> $form.data "submitted", false $form.find('input[type=submit], button').removeAttr('disabled')