forked from GNUsocial/gnu-social
Preparing plugins for no-minify-in-core-policy
also making the file structure better with js and css folders for Realtime and LinkPreview
This commit is contained in:
27
plugins/Comet/js/cometupdate.js
Normal file
27
plugins/Comet/js/cometupdate.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// update the local timeline from a Comet server
|
||||
var CometUpdate = function()
|
||||
{
|
||||
var _server;
|
||||
var _timeline;
|
||||
var _userid;
|
||||
var _replyurl;
|
||||
var _favorurl;
|
||||
var _deleteurl;
|
||||
var _cometd;
|
||||
|
||||
return {
|
||||
init: function(server, timeline, userid, replyurl, favorurl, deleteurl)
|
||||
{
|
||||
_cometd = $.cometd; // Uses the default Comet object
|
||||
_cometd.init(server);
|
||||
_server = server;
|
||||
_timeline = timeline;
|
||||
_userid = userid;
|
||||
_favorurl = favorurl;
|
||||
_replyurl = replyurl;
|
||||
_deleteurl = deleteurl;
|
||||
_cometd.subscribe(timeline, function(message) { RealtimeUpdate.receive(message.data) });
|
||||
$(window).unload(function() { _cometd.disconnect(); } );
|
||||
}
|
||||
}
|
||||
}();
|
1451
plugins/Comet/js/jquery.comet.js
Normal file
1451
plugins/Comet/js/jquery.comet.js
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user