summaryrefslogtreecommitdiff
path: root/plugins/Orbited/orbitedupdater.js
blob: 8c5ab3b7327458063237126bf9f933ed9d4c1715 (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
// 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.onmessageframe = function(frame) {
                    RealtimeUpdate.receive(JSON.parse(frame.body));
               };

               stomp.onconnectedframe = function() {
                    stomp.subscribe(timeline);
               }

               stomp.connect(server, port, username, password);
          }
     }
}();