 
 ###
 
-
-
 class   TextChat
+    # Init the text chat window and the callbacks in the event manager.
     constructor     : (NetworkManager) ->
         @jqForm       = ($ 'form#chatForm')
         @jqMessageBox = ($ '#tcMessagesContainer')

        EventManager.addEvent "receiveTextMessage", (message) =>
            @update message

    update          : (message) =>
        @addMessage message

    sendMessage     : (message) =>
        if message? and message isnt ""
            message =

                event ['message', null, message]
                @addMessage message

    # Add a new message to the text chat window.
    addMessage      : (message) =>
        jqLastElem = do (@jqMessageBox.find 'div.msgBox').last
        prevTime   = jqLastElem.attr 'rel'
