Sha256: 6c425c44a8c604b59e94090830a71bfd5e555948375092b58c784fa273b3ab65
Contents?: true
Size: 927 Bytes
Versions: 3
Compression:
Stored size: 927 Bytes
Contents
#= require vendor/qunit #= require vendor/moment #= require vendor/sinon-timers #= require local_time #= require_self #= require_directory . @addTimeEl = ({format, type, datetime} = {}) -> format ?= "%Y" type ?= "time" datetime ?= "2013-11-12T12:13:00Z" el = document.createElement "time" el.setAttribute "data-local", type el.setAttribute "data-format", format el.setAttribute "datetime", datetime document.body.appendChild el el @setText = (el, text) -> textProperty = if "textContent" of el then "textContent" else "innerText" el[textProperty] = text @getText = (el) -> # innerHTML works in all browsers so using it ensures we're # reading the text content, not a potentially arbitrary property. el.innerHTML @triggerEvent = (name, el = document) -> event = document.createEvent "Events" event.initEvent name, true, true el.dispatchEvent event @run = -> triggerEvent "time:elapse"
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
local_time-1.0.2 | test/javascripts/local_time/index.js.coffee |
local_time-1.0.1 | test/javascripts/local_time/index.js.coffee |
local_time-1.0.0 | test/javascripts/local_time/index.js.coffee |