Javascript for windclocks

Working meetings

Every Wednesday, 16:00 on #tik

Needed pre-info

TAK server und json protokoll (updated!)

some info on MACs of Clocks

XEP-0060: Publish-Subscribe

Server Requirements

Browsers don't support a built-in support for XMPP protocol. However you can tunnel XMPP sessions over HTTP connections using HTTP long polling. XMPP server (Openfire in our case) has a built-in support for HTTP-managed connections called BOSH (Bidirectional streams Over Synchronous HTTP).

Openfire BOSH Configuration

initial planning

Minimum demand

  • a clean .js for implementing into a webpage
  • a downloadable bar for one/two popular browsers (easy implement)

Maximum demand

  • an alarm clock
  • implementation perfectionized for drupal
  • during the Art Radio September Event that the streams as well are shown on the bar, so that people can tune in, when there is a show.


Development is based on Strophe.js - An XMPP library for JavaScript. It's in active development, has a pubsub plugin and good documentation. Check out the book: Professional XMPP Programming with JavaScript and jQuery.

Openfire limitations
Anonymous subscriptions to pubsub nodes aren't possible with Openfire so we have to define a user (“js”?) which is used to subscribe to clocks. (see


  • Strophe Javascript library
  • Strophe pubsub plugin
  • flXHR
  • jquery


Get the code from subversion:
Get the code as zip:

You can check out a working version here:
Check out debug version to see traffic between Openfire pubsub service and JS client:


  1. Establish connection to with jid
  2. Retrieve all clocks
  3. Subscribe to all clocks
  4. Update clock info when node gets actualized

Info from clocks

so-onOne: 17098 { slope: -1 (float) | orientation: 763 (float) | } Thu Jul 21 2011 22:54:26 GMT+0200 (CET)
clockName: tik  { metainfo: value (format) | ... }                  datetime of last update


  • avoid flXHR: Openfire doesn't support Cross-Origin Resource Sharing (CORS) so we depend on flXHR.
  • update to actual jquery version
  • document code
  • firefox/chrome extension
  • javascript library for use with Processing.js


windclocks/javascript.txt · Last modified: 2015/08/23 22:26 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki