forked from GNUsocial/gnu-social
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:
@@ -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 '';
|
||||
}
|
||||
}();
|
||||
|
||||
|
Reference in New Issue
Block a user