Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added a nametag so user can be identified

  • Loading branch information...
commit 598bf9ab47754e0696a315d48df68a29cd591035 1 parent 8ec4cd7
Andrew Smith authored

Showing 2 changed files with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. +1 0  public/index.jade
  2. +3 1 public/js/livewall.js
1  public/index.jade
@@ -23,6 +23,7 @@ html(lang="en")
23 23 h1 LiveWall
24 24
25 25 #topdiv
  26 + input#nametag(style="float:left", size='10')
26 27 input#colorpickerHolder(style="float:right", size='2', readonly='true')
27 28
28 29 #canvas_container
4 public/js/livewall.js
@@ -30,6 +30,8 @@ function canvas_init()
30 30 }
31 31 });
32 32
  33 + //create random username
  34 + $('#nametag').val('user' + Math.floor(Math.random()*1001));
33 35
34 36 //start socket.io connection
35 37 socket = io.connect(document.URL);
@@ -109,7 +111,7 @@ function sendChat(user,msg)
109 111 //called when the chat box has data to send
110 112 function chatBoxSubmit()
111 113 {
112   - sendChat("user1", $('#chatmsg').val());
  114 + sendChat($('#nametag').val(), $('#chatmsg').val());
113 115 $('#chatmsg').val(''); //clear the chat
114 116 }
115 117

0 comments on commit 598bf9a

Please sign in to comment.
Something went wrong with that request. Please try again.