summaryrefslogtreecommitdiff
path: root/plugins/Comet/updatetimeline.js
blob: 6612b51168e8ecaf1ac5d4451c33d228fdd44f3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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');
    }
}();