Sha256: 501fe54a5d2f18148c2922b3ec98729e9aadddaaed8621bd4d34d09b655d8dca

Contents?: true

Size: 763 Bytes

Versions: 2

Compression:

Stored size: 763 Bytes

Contents

#= require_tree ./lib

#= require _page
#= require _link
#= require _form

class Wiselinks
  constructor: ($target = $('body'), options = {}) ->
    this._try_jquery()

    if this.enabled()
      options = $.extend(this._defaults(), options)
      @page = new _Wiselinks.Page($target, options)

  enabled: ->
    !History.emulated.pushState || @options.html4 == true 

  load: (url, target, render = 'template') ->
    @page.load(url, target, render)

  reload: () ->
    @page.reload()
  
  _defaults: ->
    html4: true
    html4_root_path: '/'
    target_missing: null
    assets_digest: $("meta[name='assets-digest']").attr("content")      

  _try_jquery: ->
    throw "[Wiselinks] jQuery is not loaded" unless window.jQuery?  

window.Wiselinks = Wiselinks

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wiselinks-0.6.1 lib/assets/javascripts/wiselinks.js.coffee
wiselinks-0.6.0 lib/assets/javascripts/wiselinks.js.coffee