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

Merge branch 'frontend'

This commit is contained in:
Tim Düsterhus 2014-02-27 22:46:06 +01:00
commit 513bdf4e24
3 changed files with 74 additions and 31 deletions

View File

@ -50,6 +50,8 @@ exposed by a function if necessary.
remainingFailures = 3 remainingFailures = 3
overlaySmileyList = null
events = events =
newMessage: $.Callbacks() newMessage: $.Callbacks()
userMenu: $.Callbacks() userMenu: $.Callbacks()
@ -122,8 +124,7 @@ Make the user leave the chat when **Tims Chat** is about to be unloaded.
# TODO # TODO
return if WCF.System.Mobile.UX._enabled return if WCF.System.Mobile.UX._enabled
return unless $('html').hasClass 'fullscreen' if $('html').hasClass 'fullscreen'
do -> do ->
verticalContentPadding = $('#content').innerHeight() - $('#content').height() verticalContentPadding = $('#content').innerHeight() - $('#content').height()
verticalSizeOfContentElements = do -> verticalSizeOfContentElements = do ->
@ -141,12 +142,33 @@ Make the user leave the chat when **Tims Chat** is about to be unloaded.
freeSpace = $('body').height() - verticalUserListContainerPadding - sidebarHeight freeSpace = $('body').height() - verticalUserListContainerPadding - sidebarHeight
$('#timsChatUserList').height $('#timsChatUserList').height() + freeSpace $('#timsChatUserList').height $('#timsChatUserList').height() + freeSpace
if $('#timsChatAutoscroll').data 'status'
$('.timsChatMessageContainer.active').scrollTop $('.timsChatMessageContainer.active').prop 'scrollHeight'
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')} "
Copy the first loaded category of smilies so it won't get detached by wcfDialog
overlaySmileyList = $('<ul class="smileyList">').append $('#smilies .smileyList').clone().children()
Add click event to smilies in the overlay
overlaySmileyList.on 'click', 'img', ->
insertText " #{$(@).attr('alt')} "
overlaySmileyList.wcfDialog 'close'
Open the smiley wcfDialog
$('#timsChatSmileyPopupButton').on 'click', ->
overlaySmileyList.wcfDialog
title: WCF.Language.get 'chat.general.smilies'
overlaySmileyList.css
'max-height': $(window).height() - overlaySmileyList.parent().siblings('.dialogTitlebar').outerHeight()
'overflow': 'auto'
Handle private channel menu Handle private channel menu
$('#timsChatMessageTabMenu > .tabMenu').on 'click', '.timsChatMessageTabMenuAnchor', -> $('#timsChatMessageTabMenu > .tabMenu').on 'click', '.timsChatMessageTabMenuAnchor', ->
@ -312,6 +334,7 @@ Toggle fullscreen mode.
$('.timsChatMessageContainer').height messageContainerSize $('.timsChatMessageContainer').height messageContainerSize
$('#timsChatUserList').height userListSize $('#timsChatUserList').height userListSize
$('html').removeClass 'fullscreen' $('html').removeClass 'fullscreen'
do $(window).resize
Toggle checkboxes. Toggle checkboxes.
@ -828,9 +851,9 @@ Joins a room.
$('#timsChatTopic > .topic').text currentRoom.topic $('#timsChatTopic > .topic').text currentRoom.topic
if currentRoom.topic.trim() is '' if currentRoom.topic.trim() is ''
$('#timsChatTopic').addClass 'empty' $('#timsChatTopic').addClass 'invisible'
else else
$('#timsChatTopic').removeClass 'empty' $('#timsChatTopic').removeClass 'invisible'
$('.timsChatMessage').addClass 'unloaded' $('.timsChatMessage').addClass 'unloaded'
@ -867,7 +890,7 @@ Open private channel
$('.timsChatMessageContainer').height $('.timsChatMessageContainer').height() $('.timsChatMessageContainer').height $('.timsChatMessageContainer').height()
if userID isnt 0 if userID isnt 0
$('#timsChatTopic').removeClass 'empty' $('#timsChatTopic').removeClass 'invisible'
$('#timsChatTopic > .topic').html WCF.Language.get 'chat.global.privateChannelTopic', {username: userList.allTime[userID].username} $('#timsChatTopic > .topic').html WCF.Language.get 'chat.global.privateChannelTopic', {username: userList.allTime[userID].username}
$('#timsChatMessageTabMenu').removeClass 'singleTab' $('#timsChatMessageTabMenu').removeClass 'singleTab'
@ -893,9 +916,9 @@ Open private channel
else else
$('#timsChatTopic > .topic').text currentRoom.topic $('#timsChatTopic > .topic').text currentRoom.topic
if currentRoom.topic.trim() is '' if currentRoom.topic.trim() is ''
$('#timsChatTopic').addClass 'empty' $('#timsChatTopic').addClass 'invisible'
else else
$('#timsChatTopic').removeClass 'empty' $('#timsChatTopic').removeClass 'invisible'
$('.timsChatMessageContainer').removeClass 'active' $('.timsChatMessageContainer').removeClass 'active'
$("#timsChatMessageContainer#{userID}").addClass 'active' $("#timsChatMessageContainer#{userID}").addClass 'active'

View File

@ -212,7 +212,7 @@
border-color: @wcfContainerBorderColor; border-color: @wcfContainerBorderColor;
> .timsChatText { > .timsChatText {
li { > li {
border-style: solid; border-style: solid;
border-width: 0 0 1px 0; border-width: 0 0 1px 0;
border-color: @wcfContainerBorderColor; border-color: @wcfContainerBorderColor;
@ -425,7 +425,7 @@
#timsChatUserList { #timsChatUserList {
> ul { > ul {
> li { > .timsChatUser {
&.you { &.you {
a { a {
&:hover { &:hover {
@ -435,6 +435,10 @@
} }
} }
&.away {
opacity: 0.5;
}
a { a {
img { img {
margin-right: @wcfGapTiny; margin-right: @wcfGapTiny;
@ -455,6 +459,10 @@
} }
} }
#timsChatUploadDropdownMenu {
z-index: 398;
}
#timsChatCopyrightDialog { #timsChatCopyrightDialog {
> div { > div {
background-repeat: no-repeat; background-repeat: no-repeat;
@ -465,6 +473,18 @@
#fish { #fish {
font-size: 2rem; font-size: 2rem;
} }
.dialogContent {
.smileyList {
> li {
> a {
img {
margin: @wcfGapTiny;
}
}
}
}
}
} }
// TODO // TODO

View File

@ -158,7 +158,7 @@ Probieren Sie, den Chat neu zu laden<!-- , bei Risiken und Nebenwirkungen fragen
<item name="chat.global.scroll"><![CDATA[Scrollen]]></item> <item name="chat.global.scroll"><![CDATA[Scrollen]]></item>
<item name="chat.global.notify"><![CDATA[Benachrichtigen]]></item> <item name="chat.global.notify"><![CDATA[Benachrichtigen]]></item>
<item name="chat.global.notify.title"><![CDATA[Neue Nachrichten]]></item> <item name="chat.global.notify.title"><![CDATA[Neue Nachrichten]]></item>
<item name="chat.global.smilies"><![CDATA[Smilies]]></item> <item name="chat.global.smilies"><![CDATA[Smileys]]></item>
<item name="chat.global.clear"><![CDATA[Chat leeren]]></item> <item name="chat.global.clear"><![CDATA[Chat leeren]]></item>
<item name="chat.global.mark"><![CDATA[Markieren]]></item> <item name="chat.global.mark"><![CDATA[Markieren]]></item>
<item name="chat.global.fullscreen"><![CDATA[Vollbild]]></item> <item name="chat.global.fullscreen"><![CDATA[Vollbild]]></item>