]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Comet/cometupdate.js
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
[quix0rs-gnu-social.git] / plugins / Comet / cometupdate.js
1 // update the local timeline from a Comet server
2 //
3
4 var CometUpdate = function()
5 {
6      var _server;
7      var _timeline;
8      var _userid;
9      var _replyurl;
10      var _favorurl;
11      var _deleteurl;
12      var _cometd;
13
14      return {
15           init: function(server, timeline, userid, replyurl, favorurl, deleteurl)
16           {
17                _cometd = $.cometd; // Uses the default Comet object
18                _cometd.init(server);
19                _server = server;
20                _timeline = timeline;
21                _userid = userid;
22                _favorurl = favorurl;
23                _replyurl = replyurl;
24                _deleteurl = deleteurl;
25                _cometd.subscribe(timeline, function(message) { RealtimeUpdate.receive(message.data) });
26                $(window).unload(function() { _cometd.disconnect(); } );
27           }
28      }
29 }();
30