diff options
| author | Jules Laplace <jules@okfoc.us> | 2013-02-24 17:16:32 -0800 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2013-02-24 17:16:32 -0800 |
| commit | f031288fbd95ebb47729835a2930d0266482adcf (patch) | |
| tree | 4705df0f7fb5401c9954bebc6cca011ecb7df3f4 /public/js/game.js | |
| parent | 818c99a0fa7ac29fbe11c382ef2d76e243e8e8f8 (diff) | |
uploading images to server working
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: { |
