orbitedupdater.js 614 B

12345678910111213141516171819202122232425
  1. // Update the local timeline from a Orbited server
  2. var OrbitedUpdater = function()
  3. {
  4. return {
  5. init: function(server, port, timeline, username, password)
  6. {
  7. // set up stomp client.
  8. stomp = new STOMPClient();
  9. stomp.onmessageframe = function(frame) {
  10. RealtimeUpdate.receive(JSON.parse(frame.body));
  11. };
  12. stomp.onconnectedframe = function() {
  13. stomp.subscribe(timeline);
  14. }
  15. stomp.connect(server, port, username, password);
  16. }
  17. }
  18. }();