 onReceiveTemporaryChatRoom = (message) ->
     console.log "Chat Message Temporary: " + message.body
     msg = JSON.parse(message.body)
+
+    tempMessages[msg.username] = msg.text
+
     if msg.text is ''
-        $('#temporaryInputPopover').html ""
-    else
-        $('#temporaryInputPopover').html "<u><strong>#{msg.username}</strong></u> #{msg.text}"
+        tempMessages = _.omit(tempMessages, msg.username)
+    html = ''
+    _.each _.pairs(tempMessages), (pair) ->
+        html += "<u><strong>#{pair[0]}</strong></u> #{pair[1]}<hr/>"
+    $('#temporaryInputPopover').html "#{html}"
 
 
 # WebSocket chat message receive eventhandler

stompClient = {}
lastUser = {}
lastMessage = ''

$('#temporaryInput').on 'click', (event) ->
    $('#chatMessage').popover('toggle')

    , 1000


# update temporary input
setInterval ->
        message = {}
        message.text = _.escape($.trim($('#chatMessage').val()))
        message.status = 'temp'
        message.chatroom = $('#chatRoomSelected').val()
        message.username = $('#userName').val()

        stompClient.send "/app/tempMessage", {}, JSON.stringify(message)
    , 700


# store userName into localStorage
$('#userName').on 'keyup', ->
    localStorage['userName'] = $('#userName').val()
