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.
This commit is contained in:
Evan Prodromou
2009-04-26 15:08:49 -04:00
parent 262dbeac78
commit ccf45d454c
3 changed files with 516 additions and 32 deletions

View File

@@ -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 '';
}
}();