Sha256: 14ab27992aec174ac0f27f6f0090a5fe7ef767f21bacaa5e8d2a358d49d610ec

Contents?: true

Size: 2 KB

Versions: 3

Compression:

Stored size: 2 KB

Contents

#= require limit
#= require combobox
#= require jquery.tagsinput
#= require prevent_submit_on_enter
#= require slider_input
#= require bootstrap-wysihtml5-all
#= require support/pickers
#= require chosen-jquery
#= require ajax-chosen
#= require jquery.remotipart
#= require jquery.validate
#= require ckeditor/init

## require jquery.form


$(document).ready ->

  $("input[data-limit],textarea[data-limit]").limit()
  $("select:not([data-remote])").chosen()

  $("select[data-remote]").each ->
    $(this).ajaxChosen {method: "GET", url:$(this).data('remote'), dataType: 'json'}, (data) ->
      data

  $("input.taglist").each ->
    taglist = $(this)
    autocomplete_url = taglist.data("autocomplete")
    defaultText = taglist.data("text") || "Add tag"
    taglist.tagsInput
      autocomplete_url: autocomplete_url
      autocomplete: { minLength: 3 },
      defaultText: defaultText, 
      minChars: 3


  $('input.slider').sliderInput()

  $("textarea.markup").wysihtml5
    'font-styles' : false
    emphasis: true
    lists: false
    html: false
    link: false
    image: false

  $(".on-focus-help").each ->
    self = $(this)
    input = self.parent().find("input")
    input.focus(->
      self.show "fast"
    ).blur ->
      self.hide "fast"
      
  $('input.datepicker').each (i, e) ->
    display = $(this)
    name = display.attr("name")
    display.removeAttr("name")

    input = $("<input name='#{name}' type='hidden' />")
    display.before(input)

    display.datepicker
      altField: input
      altFormat: "yy-mm-dd"
      dateFormat: "d M yy"
      beforeShow: ->
        setTimeout( ( -> $('.ui-datepicker').css("z-index", 9999) ),100);


    if !!display.val()
      display.datepicker("setDate", new Date(display.val()))

    close = $("<a class='close datepicker-cancel'>&times;</a>")
    close.click ->
      display.datepicker("setDate", null)
    display.after(close)

  # ============
  # = CKEditor =
  # ============
  $( '.markup-ckeditor' ).each ->
      CKEDITOR.replace( $(this).attr('id') );
    

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fullstack-admin-0.1.18 app/assets/javascripts/support/forms.js.coffee
fullstack-admin-0.1.17 app/assets/javascripts/support/forms.js.coffee
fullstack-admin-0.1.16 app/assets/javascripts/support/forms.js.coffee