diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee
index b18888e..1b4726c 100644
--- a/file/js/be.bastelstu.Chat.litcoffee
+++ b/file/js/be.bastelstu.Chat.litcoffee
@@ -703,6 +703,13 @@ Insert the given messages into the chat stream.
createNewMessage = yes
clearChannel 0
+ if message.isInPrivateChannel and message.sender is WCF.User.userID
+ container = $ "#timsChatMessageContainer#{message.receiver} > ul"
+ else if message.isInPrivateChannel
+ container = $ "#timsChatMessageContainer#{message.sender} > ul"
+ else
+ container = $ '#timsChatMessageContainer0 > ul'
+
if createNewMessage
message.isFollowUp = no
output = v.messageTemplate.fetch
@@ -716,32 +723,35 @@ Insert the given messages into the chat stream.
li.addClass 'ownMessage' if message.sender is WCF.User.userID
li.append output
- if message.isInPrivateChannel and message.sender is WCF.User.userID
- li.appendTo $ "#timsChatMessageContainer#{message.receiver} > ul"
- else if message.isInPrivateChannel
- li.appendTo $ "#timsChatMessageContainer#{message.sender} > ul"
- else
- li.appendTo $ '#timsChatMessageContainer0 > ul'
+ li.appendTo container
else
message.isFollowUp = yes
output = v.messageTemplate.fetch
message: message
messageTypes: v.config.messageTypes
-
- if message.isInPrivateChannel and message.sender is WCF.User.userID
- messageContainerID = message.receiver
- else if message.isInPrivateChannel
- messageContainerID = message.sender
- else
- messageContainerID = 0
- textContainer = $("#timsChatMessageContainer#{messageContainerID}").find '.timsChatMessage:last-child .timsChatTextContainer'
+ textContainer = container.find '.timsChatMessage:last-child .timsChatTextContainer'
textContainer.append $(output).find('.timsChatTextContainer li:last-child')
# unmark messages
textContainer.parents('.timsChatMessage').removeClass 'checked'
textContainer.siblings('.timsChatMessageGroupMarker').prop 'checked', false
+ if v.config.messagesPerTab
+ timsChatText = container.find '.timsChatText'
+
+ if timsChatText.length > v.config.messagesPerTab
+ firstMessage = do timsChatText.first
+ timsChatMessage = firstMessage.parents '.timsChatMessage'
+
+ if timsChatMessage.find('.timsChatTextContainer').children().length > 1
+ time = firstMessage.siblings(':first').find '> time'
+ timsChatMessage.find('.timsChatInnerMessage > time').replaceWith time
+
+ do firstMessage.remove
+ else
+ do timsChatMessage.remove
+
lastMessage = message
$('.timsChatMessageContainer.active').scrollTop $('.timsChatMessageContainer.active').prop('scrollHeight') if $('#timsChatAutoscroll').data('status') is 1
diff --git a/language/de.xml b/language/de.xml
index d7f2b3b..a432414 100644
--- a/language/de.xml
+++ b/language/de.xml
@@ -125,6 +125,11 @@
+
+
+
+
+
- getCommand()}“ wurde nicht gefunden.]]>
- getUsername()}“ wurde nicht gefunden.]]>
diff --git a/language/en.xml b/language/en.xml
index 552e9b0..57f6728 100644
--- a/language/en.xml
+++ b/language/en.xml
@@ -125,6 +125,11 @@
+
+
+
+
+
- getCommand()}” could not be found.]]>
- getUsername()}” could not be found.]]>
diff --git a/template/chat.tpl b/template/chat.tpl
index 40e3d9b..d10cd16 100644
--- a/template/chat.tpl
+++ b/template/chat.tpl
@@ -58,7 +58,8 @@
messageURL: '{link application="chat" controller="NewMessages"}{/link}',
installedCommands: [ {implode from=$commands item='command'}'{$command|encodeJS}'{/implode} ],
messageTypes: { {implode from=$messageTypes key='name' item='messageType'}'{$name|substr:5|encodeJS}': {$messageType}{/implode} },
- autoAwayTime: {@CHAT_AUTOAWAY}
+ autoAwayTime: {@CHAT_AUTOAWAY},
+ messagesPerTab: {@$__wcf->getUser()->chatMessagesPerTab}
};
{event name='beforeInit'}
diff --git a/userOption.xml b/userOption.xml
index b5afd5a..8da896d 100644
--- a/userOption.xml
+++ b/userOption.xml
@@ -19,6 +19,15 @@
boolean
1
+
+
\ No newline at end of file