Wiki

Clone wiki

timesheets / files / timesheets

timesheets.js

This file implements the SMIL Timesheets (a W3C working draft). This file includes the time schedulers, and internal and external (HTML5 Media) timers. To see the list of elements and attributes implemented so far, go to Development status.

States

A DOM node that is a target of timing data will be in one of three states:

  • idle : hasn't run yet
  • active : running
  • done : finished running

Time containers

Each time container has a timer, which can be an internal or external (ie. a Media element). In either case, you can play, pause, get/set time, etc. I intend these functions follow the syntax of HTML5 Media element (video|audio), but it's not implemented yet.

Note that time containers are "logical" nodes-- they have no visual representation in the HTML (ie. don't think of them like a <div> element in HTML!). That means, you can define a time container that includes (selects) child items that are 'distant' nodes in the DOM.

The 'select' Attribute

The current implementation uses Qwery [1] for query selectors, so it supports complex CSS selectors. It's possible to replace Qwery for other selector engine, eg. Sizzle, or jQuery, just change the dependency to load- and no need to change the actual code.

Event values

Apart from standard DOM events, you can use custom events too in begin/end attrs. Additionally, the engine fires events about activation state of elements, namely: 'begin', 'end', and 'change'. Events bubble up in the DOM which allows using event delegation.

----
[1] http://github.com/ded/qwery

Updated