diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-07-14 15:40:58 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-07-14 15:40:58 -0400 |
commit | 5ab718bf22fda29dc30fbd004f7866af82eeb879 (patch) | |
tree | 9ca072f0590dc76dd41f9801cdcb96309283a007 /plugins/Comet/cometupdate.js | |
parent | 3baa1c6a85892d710f7bb51b742bf288d0d7aac9 (diff) |
Change CometPlugin so it re-uses stuff from RealtimePlugin
Diffstat (limited to 'plugins/Comet/cometupdate.js')
-rw-r--r-- | plugins/Comet/cometupdate.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/Comet/cometupdate.js b/plugins/Comet/cometupdate.js new file mode 100644 index 000000000..432778c19 --- /dev/null +++ b/plugins/Comet/cometupdate.js @@ -0,0 +1,30 @@ +// 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, RealtimeUpdater.receive); + $(window).unload(leave); + } + } +}(); + |