$ ->
# For Web-app mode, uncomment this (and the CSS in style.scss) to make the cols fill the browser
# $('.col1, .col2, .col3').css('height',$(window).height() - $('.main_nav').outerHeight() - $('.branding').outerHeight() - 60 + 'px')
# $(window).resize ->
# $('.col1, .col2, .col3').css('height',$(window).height() - $('.main_nav').outerHeight() - $('.branding').outerHeight() - 60 + 'px')
setTimeAgoInWords = () ->
$('.ago').each ->
t = $(this)
if(t.attr('datetime'))
date = new Date(t.attr('datetime'))
t.attr('title', date.toString())
t.text(date.timeAgoInWords() + ' ago')
setTimeAgoInWords()
setInterval(setTimeAgoInWords, 10000)
$('.popup').livequery ->
$(this).fancybox
overlayColor: "#fff"
transitionIn:"none"
transitionOut:"none"
titlePosition:"outside"
showCloseButton:false
titleFormat: (title, currentArray, currentIndex, currentOpts) ->
return if title == ''
return '
'
$('#fancybox-content .close').live 'click', (e) -> #close_lightbox_from_link(e)
e.preventDefault()
$.fancybox.close()
$('input[type="date"]').livequery ->
$(this).datepicker
numberOfMonths: 2
dateFormat: 'yy-mm-dd'
showOn: 'focus'
$('textarea.autoGrow').livequery ->
$(this).autogrow()
$("select:not(.chzn), input:checkbox, input:radio, input:file").livequery ->
$(this).uniform()
$('select.chzn').livequery ->
$(this).chosen()
$('input.autoSuggest').livequery ->
# $(this).autoSuggest "/path/to/script",
# minChars: 2
autoSuggestData = [{value: "21", name: "Mick Jagger"},{value: "43", name: "Johnny Storm"},{value: "46", name: "Richard Hatch"}]
$(this).autoSuggest autoSuggestData,
startText: "AutoSuggesting"
selectedItemProp: "name"
searchObjProps: "name"
$('input, textarea').livequery ->
$(this).placeholder()
$('.dataTable').livequery ->
$(this).dataTable
"bPaginate": false # Don't paginate
"aaSorting": [] # No initial sorting
# "bJQueryUI": true # Use jQueryUI styling
# "aoColumnDefs": [ # Use this to make the final column un-sortable
# { "bSortable": false, "aTargets": [ -1 ] }
# ]