diff options
Diffstat (limited to 'public/js/game.js')
| -rw-r--r-- | public/js/game.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/public/js/game.js b/public/js/game.js index af05ad9..c348e9a 100644 --- a/public/js/game.js +++ b/public/js/game.js @@ -8,6 +8,7 @@ var Game = { // Bind events from the server socket.on('event-join', Events.receive.join); socket.on('event-message', Events.receive.message); + socket.on('event-image', Events.receive.image); Auth.init(); Chat.init(); } @@ -23,9 +24,16 @@ var Events = { } }, - message: function(msg){ + message: function(msg) { Chat.add(msg); + }, + + image: function(data) { + console.log(data); + if (data.nick == Game.nick) return; + $("#image").attr("src", data.url).show(); } + }, send: { |
