diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-04-26 15:08:49 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-04-26 15:08:49 -0400 |
commit | ccf45d454c68f7f667d07e0db608569e049ec285 (patch) | |
tree | ebfa90bc4676f5e0e0dbb65944f47405789c067c /plugins/Comet/updatetimeline.js | |
parent | 262dbeac787ad3aecb28c470484eb3fc8d036d93 (diff) |
Lots of tweaking to make things work
Did some tweaking and maneuvering to make things work. This version
will now show a "notice received" alert box -- lots of progress! Had
to test with Java server, not Python server.
Diffstat (limited to 'plugins/Comet/updatetimeline.js')
-rw-r--r-- | plugins/Comet/updatetimeline.js | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js index 6612b5116..7b22445e3 100644 --- a/plugins/Comet/updatetimeline.js +++ b/plugins/Comet/updatetimeline.js @@ -3,28 +3,34 @@ var updater = function() { - var _handshook = false; - var _connected = false; - var _cometd; + var _cometd; - return { - init: function() - { - _cometd = $.cometd; // Uses the default Comet object - _cometd.init(_timelineServer); - _cometd.subscribe(_timeline, this, receive); - $(window).unload(leave); - } - } + return { + init: function(server, timeline) + { + _cometd = $.cometd; // Uses the default Comet object + _cometd.setLogLevel('debug'); + _cometd.init(server); + _cometd.subscribe(timeline, receive); + $(window).unload(leave); + } + } - function leave() - { - _cometd.disconnect(); - } + function leave() + { + _cometd.disconnect(); + } - function receive(message) - { - var noticeItem = makeNoticeItem(message.data); - var noticeList = $('ul.notices'); - } + function receive(message) + { + alert("Received notice."); + var noticeItem = makeNoticeItem(message.data); + var noticeList = $('ul.notices'); + } + + function makeNoticeItem(data) + { + return ''; + } }(); + |