1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Fix fullscreen mode on mobile devices and single line information messages

This commit is contained in:
Maximilian Mader 2014-03-02 20:02:50 +01:00
parent 1a2ffaaa77
commit 515a670a6c
2 changed files with 21 additions and 5 deletions

View File

@ -121,9 +121,6 @@ Make the user leave the chat when **Tims Chat** is about to be unloaded.
undefined undefined
$(window).resize -> $(window).resize ->
# TODO
return if WCF.System.Mobile.UX._enabled
if $('html').hasClass 'fullscreen' if $('html').hasClass 'fullscreen'
do -> do ->
verticalContentPadding = $('#content').innerHeight() - $('#content').height() verticalContentPadding = $('#content').innerHeight() - $('#content').height()
@ -132,19 +129,26 @@ Make the user leave the chat when **Tims Chat** is about to be unloaded.
$('#content > *:visible').each (k, v) -> height += $(v).outerHeight() $('#content > *:visible').each (k, v) -> height += $(v).outerHeight()
height height
return if verticalSizeOfContentElements is 0
freeSpace = $('body').height() - verticalContentPadding - verticalSizeOfContentElements freeSpace = $('body').height() - verticalContentPadding - verticalSizeOfContentElements
$('.timsChatMessageContainer').height $('.timsChatMessageContainer').height() + freeSpace $('.timsChatMessageContainer').height $('.timsChatMessageContainer').height() + freeSpace
do -> do ->
verticalSidebarPadding = $('.sidebar').innerHeight() - $('.sidebar').height()
verticalUserListContainerPadding = $('#timsChatUserListContainer').innerHeight() - $('#timsChatUserListContainer').height() verticalUserListContainerPadding = $('#timsChatUserListContainer').innerHeight() - $('#timsChatUserListContainer').height()
sidebarHeight = $('.sidebar > div').height() sidebarHeight = $('.sidebar > div').height()
freeSpace = $('body').height() - verticalUserListContainerPadding - sidebarHeight freeSpace = $('body').height() - verticalSidebarPadding - verticalUserListContainerPadding - sidebarHeight
$('#timsChatUserList').height $('#timsChatUserList').height() + freeSpace $('#timsChatUserList').height $('#timsChatUserList').height() + freeSpace
if $('#timsChatAutoscroll').data 'status' if $('#timsChatAutoscroll').data 'status'
$('.timsChatMessageContainer.active').scrollTop $('.timsChatMessageContainer.active').prop 'scrollHeight' $('.timsChatMessageContainer.active').scrollTop $('.timsChatMessageContainer.active').prop 'scrollHeight'
$('.mobileSidebarToggleButton').on 'click', ->
do $(window).resize
Insert the appropriate smiley code into the input when a smiley is clicked. Insert the appropriate smiley code into the input when a smiley is clicked.
$('#smilies').on 'click', 'img', -> insertText " #{$(@).attr('alt')} " $('#smilies').on 'click', 'img', -> insertText " #{$(@).attr('alt')} "
@ -454,6 +458,10 @@ load messages if the appropriate event arrives.
be.bastelstu.wcf.nodePush.onMessage 'be.bastelstu.chat.join', refreshRoomList be.bastelstu.wcf.nodePush.onMessage 'be.bastelstu.chat.join', refreshRoomList
be.bastelstu.wcf.nodePush.onMessage 'be.bastelstu.chat.leave', refreshRoomList be.bastelstu.wcf.nodePush.onMessage 'be.bastelstu.chat.leave', refreshRoomList
Switch to fullscreen mode on mobile devices
do $('#timsChatFullscreen').click if WCF.System.Mobile.UX._enabled
Finished! Enable the input now and join the chat. Finished! Enable the input now and join the chat.
join roomID join roomID

View File

@ -47,6 +47,14 @@
</ul> </ul>
<input type="checkbox" class="timsChatMessageBlockMarker jsTooltip" value="{@$message.messageID}" title="{lang}chat.global.markAll{/lang}" /> <input type="checkbox" class="timsChatMessageBlockMarker jsTooltip" value="{@$message.messageID}" title="{lang}chat.global.markAll{/lang}" />
{elseif $message.type == $messageTypes.INFORMATION}
<div class="timsChatTextContainer">
<span class="timsChatText" data-message-id="{@$message.messageID}">
{@$message.formattedMessage}
<input type="checkbox" class="timsChatMessageMarker jsTooltip" value="{@$message.messageID}" title="{lang}chat.global.mark{/lang}"/>
</span>
</div>
{else} {else}
<span class="timsChatTextContainer"> <span class="timsChatTextContainer">
<span class="timsChatText" data-message-id="{@$message.messageID}"> <span class="timsChatText" data-message-id="{@$message.messageID}">