repo: janusweb
action: commit
revision: 
path_from: 
revision_from: bd24c41c764b91b77e0861eebbfddfc8b0f38bd9:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit bd24c41c764b91b77e0861eebbfddfc8b0f38bd9
Author: James Baicoianu 
Date:   Fri Apr 15 01:09:14 2016 -0700

    Fixed chat message format

diff --git a/scripts/chat.js b/scripts/chat.js
index 770c900e41f2f4d76a6e8fd1260de55136d04a73..
index ..71cc80aae2903699657a752c1f3bb82ca7ce783d 100644
--- a/scripts/chat.js
+++ b/scripts/chat.js
@@ -1,6 +1,6 @@
 elation.requireCSS('janusweb.chat');
 elation.require(['ui.window', 'ui.list', 'ui.input', 'elation.collection'], function() {
-  elation.template.add('janusweb.chat.message', '[{userId}] {message.data}');
+  elation.template.add('janusweb.chat.message', '[{userId}] {message}');

   elation.component.add('janusweb.chat', function() {
     this.init = function() {
@@ -40,7 +40,7 @@ elation.require(['ui.window', 'ui.list', 'ui.input', 'elation.collection'], func
     }
     this.sendmessage = function() {
       this.client.send({'method': 'chat', data: this.input.value});
-      var msg = {userId: 'me', message: { data: this.input.value }, self: true};
+      var msg = {userId: 'me', message: this.input.value, self: true};
       this.addmessage(msg);
       elation.events.fire({element: this, type: 'janusweb_chat_send', data: msg});
       this.input.value = '';
diff --git a/scripts/janusweb.js b/scripts/janusweb.js
index 2a3f988f561e9298aee096d1b48206f63e2d6c81..
index ..5f2be7560b10af5fd4da67c9672d4a8850652cdf 100644
--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -171,7 +171,7 @@ elation.require(['janusweb.config', 'engine.things.generic','engine.things.remot
         if (!this.remotePlayers.hasOwnProperty(userId)) {
           var remoteplayer = this.spawnRemotePlayer(msg.data.data);
           elation.events.fire({element: this, type: 'janusweb_user_joined', data: remoteplayer});
-          this.chat.addmessage({userId: ' ! ', message: { data: userId + ' entered room'} });
+          this.chat.addmessage({userId: ' ! ', message: userId + ' entered room' });
         }
         else {
           this.moveRemotePlayer(msg.data.data);
@@ -181,7 +181,7 @@ elation.require(['janusweb.config', 'engine.things.generic','engine.things.remot
         var remoteplayer = this.remotePlayers[msg.data.data.userId];
         console.log("removing player", msg.data.data.userId, remoteplayer);
         elation.events.fire({element: this, type: 'janusweb_user_left', data: remoteplayer});
-        this.chat.addmessage({userId: ' ! ', message: { data: msg.data.data.userId + ' left room'} });
+        this.chat.addmessage({userId: ' ! ', message: msg.data.data.userId + ' left room' });
         if (remoteplayer && remoteplayer.parent) {
           remoteplayer.die();
         }

-----END OF PAGE-----