From 515a670a6c664b024601a633d7c3616f254326a2 Mon Sep 17 00:00:00 2001 From: Maximilian Mader Date: Sun, 2 Mar 2014 20:02:50 +0100 Subject: [PATCH] Fix fullscreen mode on mobile devices and single line information messages --- file/js/be.bastelstu.Chat.litcoffee | 18 +++++++++++++----- template/message.tpl | 8 ++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index 871e5ac..8e22cc5 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -121,9 +121,6 @@ Make the user leave the chat when **Tims Chat** is about to be unloaded. undefined $(window).resize -> - # TODO - return if WCF.System.Mobile.UX._enabled - if $('html').hasClass 'fullscreen' do -> 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() height + return if verticalSizeOfContentElements is 0 + freeSpace = $('body').height() - verticalContentPadding - verticalSizeOfContentElements $('.timsChatMessageContainer').height $('.timsChatMessageContainer').height() + freeSpace + do -> + verticalSidebarPadding = $('.sidebar').innerHeight() - $('.sidebar').height() verticalUserListContainerPadding = $('#timsChatUserListContainer').innerHeight() - $('#timsChatUserListContainer').height() sidebarHeight = $('.sidebar > div').height() - freeSpace = $('body').height() - verticalUserListContainerPadding - sidebarHeight + freeSpace = $('body').height() - verticalSidebarPadding - verticalUserListContainerPadding - sidebarHeight $('#timsChatUserList').height $('#timsChatUserList').height() + freeSpace if $('#timsChatAutoscroll').data 'status' $('.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. $('#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.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. join roomID diff --git a/template/message.tpl b/template/message.tpl index 8cef693..61aa38e 100644 --- a/template/message.tpl +++ b/template/message.tpl @@ -47,6 +47,14 @@ + {elseif $message.type == $messageTypes.INFORMATION} +
+ + {@$message.formattedMessage} + + + +
{else}