()
| 37 | |
| 38 | // Sets the client's username |
| 39 | function setUsername () { |
| 40 | username = cleanInput($usernameInput.val().trim()); |
| 41 | |
| 42 | // If the username is valid |
| 43 | if (username) { |
| 44 | $loginPage.fadeOut(); |
| 45 | $chatPage.show(); |
| 46 | $loginPage.off('click'); |
| 47 | $currentInput = $inputMessage.focus(); |
| 48 | |
| 49 | // Tell the server your username |
| 50 | socket.emit('add user', username); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | // Sends a chat message |
| 55 | function sendMessage () { |
no test coverage detected