diff options
Diffstat (limited to 'public/js/user.js')
| -rw-r--r-- | public/js/user.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/public/js/user.js b/public/js/user.js new file mode 100644 index 0000000..4233c5a --- /dev/null +++ b/public/js/user.js @@ -0,0 +1,14 @@ +function User (app) { + var base = this; + base.name = Math.floor(Math.random() * 1000000) + ""; + + app.send('event-join', { + 'name': base.name + }); + + app.receive('event-join', function(json){ + console.log(json); + app.chat.receive(json.name, "has joined") + }) + +} |
