public/javascripts/chat_ui.js
// if a user input begins with the slash (/) character, its treated as a chat command.  If not, it's sent to the server as a chat message to be broadcast to other users, and its added to the chat room text of the room the user's currently in.
if a user input begins with the slash (/) character, its treated as a chat command.  If not, it's sent to the server as a chat message to be broadcast to other users, and its added to the chat room text of the room the user's currently in.
if a user input begins with the slash ( / ) character its treated as a chat command . If not it ' s sent to the server as a chat message to be broadcast to other users and its added to the chat room text of the room the user ' s currently in .
function processUserInput(chatApp, socket){
  var message = $('#send-message').val();
  var systemMessage;
  if (message.charAt(0) == '/') {
    systemMessage = chatApp.processCommand(message);
    if (systemMessage) {
      $('#messages').append(divSystemContentElement(systemMessage))
    }
  } else {
    chatApp.sendMessage($('#room').text(), message);
    $('#messages').append(divSystemContentElement(message));
    $('#messages').scrollTop($('#messages').prop('scrollHeight'));
  }
  $('#send-message').val(' ')
}
function processUserInput ( chatApp , socket ) { var message = $ ( '#send-message' ) . val ( ) ; var systemMessage ; if ( message . charAt ( 0 ) == '/' ) { systemMessage = chatApp . processCommand ( message ) ; if ( systemMessage ) { $ ( '#messages' ) . append ( divSystemContentElement ( systemMessage ) ) } } else { chatApp . sendMessage ( $ ( '#room' ) . text ( ) , message ) ; $ ( '#messages' ) . append ( divSystemContentElement ( message ) ) ; $ ( '#messages' ) . scrollTop ( $ ( '#messages' ) . prop ( 'scrollHeight' ) ) ; } $ ( '#send-message' ) . val ( ' ' ) }
if a user input begins with the slash (/) character, its treated as a chat command.
if a user input begins with the slash ( / ) character its treated as a chat command .