Sha256: f7852383bb1335e960b0d6229ab318f1b2d76a61ea6bf3bea88d794d0fef1499

Contents?: true

Size: 531 Bytes

Versions: 4

Compression:

Stored size: 531 Bytes

Contents

$ ->
  $('.pages .chzn-select').chosen
    allow_single_deselect: true
    no_results_text: 'No results matched'

  $('.pages')
    .on 'focusout', '#page_url', ->
      if $(this).val().length > 0
        if ! /^([\w\-]{3,})$/.test($(this).val())
          alert('Invalid URL!')
          $(this).val('')
    .on 'submit', '.simple_form', (event) ->
      url = $('#page_url')
      if url.val().length > 0
        if ! /^([\w\-]{3,})$/.test(url.val())
          alert('Invalid URL!')
          url.val('')
          return false

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
simple-pages-rails-0.7.0 app/assets/javascripts/simple_pages/pages.js.coffee
simple-pages-rails-0.6.0 app/assets/javascripts/simple_pages/pages.js.coffee
simple-pages-rails-0.5.0 app/assets/javascripts/simple_pages/pages.js.coffee
simple-pages-rails-0.4.0 app/assets/javascripts/simple_pages/pages.js.coffee