Sha256: 3f545bc8f3f5f19cb647cfc20855243ca07a5deb6be775a8d73b8ef6a437cd01

Contents?: true

Size: 766 Bytes

Versions: 2

Compression:

Stored size: 766 Bytes

Contents

Lagniappe = ->

Lagniappe:: =

  extendPrototypes: ->
    addFunction = (obj, func, key) ->
      obj::[key] = ->
        func.apply
          value: this
        , arguments
    unnicer = (obj, to_add) ->
      for key of to_add::
        addFunction obj, to_add::[key], key  unless obj::[key]
    unnicer String, Stringy
    unnicer Number, Numbery

  #Adds ALT159 functions to this Instance of an object
  chain: (value, type) ->
    f().extendPrototypes()
    value

  reloadStylesheets: ->
    queryString = "?reload=" + new Date().getTime()
    links = document.getElementsByTagName("link")
    i = 0
    while i < links.length
      links[i].href = links[i].href.replace(/\?.*|$/, queryString)  if links[i] and links[i].ref is "stylesheet"
      i++
    true

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alt159-rails-0.0.3 vendor/assets/javascripts/alt159/lib/types/langniappe.js.coffee
alt159-rails-0.0.2 vendor/assets/javascripts/alt159/src/types/langniappe.coffee