summaryrefslogtreecommitdiff
path: root/plugins/Orbited/orbitedupdater.js
blob: d70f4a4fda1d9ed95465b0829c232ae36c9f5789 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Update the local timeline from a Orbited server

var OrbitedUpdater = function()
{
     return {

          init: function(server, port, timeline, username, password)
          {
               // set up stomp client.
               stomp = new STOMPClient();

               stomp.connect(server, port, username, password);
               stomp.subscribe(timeline);

               stomp.onmessageframe = function(frame) {
                    RealtimeUpdate.receive(JSON.parse(frame.body));
               };
          };
     }
}();