2009-04-26 03:20:24 +09:00
|
|
|
// update the local timeline from a Comet server
|
|
|
|
//
|
|
|
|
|
2009-04-27 01:06:50 +09:00
|
|
|
var updater = function()
|
|
|
|
{
|
|
|
|
var _handshook = false;
|
|
|
|
var _connected = false;
|
|
|
|
var _cometd;
|
|
|
|
|
|
|
|
return {
|
|
|
|
init: function()
|
|
|
|
{
|
|
|
|
_cometd = $.cometd; // Uses the default Comet object
|
|
|
|
_cometd.init(_timelineServer);
|
|
|
|
_cometd.subscribe(_timeline, this, receive);
|
|
|
|
$(window).unload(leave);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function leave()
|
|
|
|
{
|
|
|
|
_cometd.disconnect();
|
|
|
|
}
|
|
|
|
|
|
|
|
function receive(message)
|
|
|
|
{
|
|
|
|
var noticeItem = makeNoticeItem(message.data);
|
|
|
|
var noticeList = $('ul.notices');
|
|
|
|
}
|
|
|
|
}();
|