data.js 586 B

123456789101112131415161718192021222324252627282930313233
  1. var
  2. /**
  3. * @type SlackWrapper
  4. **/
  5. SLACK;
  6. /**
  7. * @constructor
  8. **/
  9. function SlackWrapper() {
  10. /** @type {number} */
  11. this.lastServerVersion = 0;
  12. /** @type {SlackData} */
  13. this.context = new SlackData(null);
  14. }
  15. SlackWrapper.prototype.update = function(data) {
  16. if (data["v"])
  17. this.lastServerVersion = data["v"];
  18. if (data["static"]) {
  19. this.context.updateStatic(data["static"]);
  20. onContextUpdated();
  21. }
  22. if (data["live"]) {
  23. console.log("updated LIVE");
  24. }
  25. console.log(this);
  26. };
  27. SLACK = new SlackWrapper();