Permalink
Browse files

Added a nametag so user can be identified

  • Loading branch information...
1 parent 8ec4cd7 commit 598bf9ab47754e0696a315d48df68a29cd591035 @andrew-smith committed Jun 14, 2012
Showing with 4 additions and 1 deletion.
  1. +1 −0 public/index.jade
  2. +3 −1 public/js/livewall.js
View
@@ -23,6 +23,7 @@ html(lang="en")
h1 LiveWall
#topdiv
+ input#nametag(style="float:left", size='10')
input#colorpickerHolder(style="float:right", size='2', readonly='true')
#canvas_container
@@ -30,6 +30,8 @@ function canvas_init()
}
});
+ //create random username
+ $('#nametag').val('user' + Math.floor(Math.random()*1001));
//start socket.io connection
socket = io.connect(document.URL);
@@ -109,7 +111,7 @@ function sendChat(user,msg)
//called when the chat box has data to send
function chatBoxSubmit()
{
- sendChat("user1", $('#chatmsg').val());
+ sendChat($('#nametag').val(), $('#chatmsg').val());
$('#chatmsg').val(''); //clear the chat
}

0 comments on commit 598bf9a

Please sign in to comment.