diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index ed2beb4..b1ebbf7 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -381,15 +381,17 @@ Visibly mark the message once the associated checkbox is checked. if checked elem.parents('.timsChatMessage').addClass 'checked' - elem.parents('.timsChatTextContainer').siblings('.timsChatMessageBlockMarker').prop 'checked', true + elem.parents('.timsChatTextContainer').siblings('.timsChatMessageGroupMarker').prop 'checked', true else delete markedMessages[messageID] parent.removeClass 'checked' elem.parents('.timsChatMessage').removeClass 'checked' - elem.parents('.timsChatTextContainer').siblings('.timsChatMessageBlockMarker').prop 'checked', false + elem.parents('.timsChatTextContainer').siblings('.timsChatMessageGroupMarker').prop 'checked', false - $(document).on 'click', '.timsChatMessageBlockMarker', (event) -> + # This function can be used to toggle the marking state of every “submessage” of one message container (speech bubble) + # The according element with the class “.timsChatMessageGroupMarker” has to be made visible via CSS. + $(document).on 'click', '.timsChatMessageGroupMarker', (event) -> $(event.target).siblings('.timsChatTextContainer').children('li').each (key, value) -> elem = $(value).find '.timsChatMessageMarker' @@ -617,17 +619,17 @@ Insert the given messages into the chat stream. if $('.timsChatMessage:last-child .timsChatTextContainer').is('ul') and lastMessage isnt null and lastMessage.type in [ v.config.messageTypes.NORMAL, v.config.messageTypes.WHISPER ] if lastMessage.type is message.type and lastMessage.sender is message.sender and lastMessage.receiver is message.receiver and lastMessage.isInPrivateChannel is message.isInPrivateChannel createNewMessage = no - + if message.type is v.config.messageTypes.CLEAR createNewMessage = yes clearChannel 0 - + if createNewMessage message.isFollowUp = no output = v.messageTemplate.fetch message: message messageTypes: v.config.messageTypes - + li = $ '
' li.addClass 'timsChatMessage' li.addClass "timsChatMessage#{message.type}" @@ -653,11 +655,16 @@ Insert the given messages into the chat stream. messageContainerID = message.sender else messageContainerID = 0 - - $("#timsChatMessageContainer#{messageContainerID} .timsChatMessage:last-child .timsChatTextContainer").append $(output).find('.timsChatTextContainer li:last-child') - + + textContainer = $("#timsChatMessageContainer#{messageContainerID}").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 + lastMessage = message - + $('.timsChatMessageContainer.active').scrollTop $('.timsChatMessageContainer.active').prop('scrollHeight') if $('#timsChatAutoscroll').data('status') is 1 Handles scroll event of message containers diff --git a/file/style/be.bastelstu.chat.less b/file/style/be.bastelstu.chat.less index 0a2714f..71ad57b 100644 --- a/file/style/be.bastelstu.chat.less +++ b/file/style/be.bastelstu.chat.less @@ -296,7 +296,7 @@ } } - .timsChatMessageMarker, .timsChatMessageBlockMarker { + .timsChatMessageMarker, .timsChatMessageGroupMarker { display: none; } @@ -356,22 +356,22 @@ display: inline-block; } - .timsChatMessageBlockMarker { + .timsChatMessageGroupMarker { top: 0; } - .timsChatMessageMarker, .timsChatMessageBlockMarker { + .timsChatMessageMarker, .timsChatMessageGroupMarker { position: absolute; right: -@wcfGapLarge ; } &.bubble { - .timsChatMessageMarker, .timsChatMessageBlockMarker { + .timsChatMessageMarker, .timsChatMessageGroupMarker { right: -@wcfGapLarge - 1; } &.right { - .timsChatMessageMarker, .timsChatMessageBlockMarker { + .timsChatMessageMarker, .timsChatMessageGroupMarker { // maybe find a better way, will do it for now right: -@wcfGapLarge - @wcfGapMedium - 32 - 1; } diff --git a/template/message.tpl b/template/message.tpl index 61aa38e..1f6b46e 100644 --- a/template/message.tpl +++ b/template/message.tpl @@ -46,7 +46,7 @@ - + {elseif $message.type == $messageTypes.INFORMATION}