1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Merge branch 'master' of github.com:wbbaddons/Tims-Chat

This commit is contained in:
max-m 2012-01-07 00:29:17 +01:00
commit 908847c919
2 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,7 @@ TimWolla.WCF ?= {}
title: document.title
messageTemplate: null
newMessageCount: null
events: { newMessage: $.Callbacks() }
init: () ->
@bindEvents()
@refreshRoomList()
@ -175,6 +176,8 @@ TimWolla.WCF ?= {}
###
handleMessages: (messages) ->
for message in messages
@events.newMessage.fire message
output = @messageTemplate.fetch message
li = $ '<li></li>'
li.addClass 'chatMessage chatMessage'+message.type

View File

@ -182,7 +182,9 @@
animations: {CHAT_ANIMATIONS},
maxTextLength: {CHAT_LENGTH}
}
{event name='shouldInit'}
TimWolla.WCF.Chat.init();
{event name='didInit'}
TimWolla.WCF.Chat.handleMessages([
{implode from=$newestMessages item='message'}
{@$message->jsonify()}