Some updates for testing Comet

This commit is contained in:
Evan Prodromou 2009-04-26 12:06:50 -04:00
parent 056d0a2555
commit 262dbeac78
3 changed files with 1478 additions and 365 deletions

View File

@ -69,8 +69,6 @@ class Bayeux
$oReturn = json_decode($data); $oReturn = json_decode($data);
common_debug(print_r($oReturn, true));
if (is_array($oReturn)) { if (is_array($oReturn)) {
$oReturn = $oReturn[0]; $oReturn = $oReturn[0];
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,30 @@
// update the local timeline from a Comet server // update the local timeline from a Comet server
// //
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');
}
}();