forked from GNUsocial/gnu-social
Some updates for testing Comet
This commit is contained in:
parent
056d0a2555
commit
262dbeac78
@ -69,8 +69,6 @@ class Bayeux
|
||||
|
||||
$oReturn = json_decode($data);
|
||||
|
||||
common_debug(print_r($oReturn, true));
|
||||
|
||||
if (is_array($oReturn)) {
|
||||
$oReturn = $oReturn[0];
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,30 @@
|
||||
// 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');
|
||||
}
|
||||
}();
|
||||
|
Loading…
Reference in New Issue
Block a user