mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Fixed CSS, add and use language vars via WCF.Language, tabs change when clicking on badges too
This commit is contained in:
parent
3afc1d8e94
commit
9689d3b397
@ -212,10 +212,10 @@ TimWolla.WCF ?= {}
|
||||
li.append a
|
||||
menu = $ '<ul></ul>'
|
||||
menu.addClass 'chatUserMenu'
|
||||
menu.append $ '<li><a href="javascript:;">{lang}wcf.chat.query{/lang}</a></li>'
|
||||
menu.append $ '<li><a href="javascript:;">{lang}wcf.chat.kick{/lang}</a></li>'
|
||||
menu.append $ '<li><a href="javascript:;">{lang}wcf.chat.ban{/lang}</a></li>'
|
||||
menu.append $ '<li><a href="index.php/User/'+user.userID+'">{lang}wcf.chat.profile{/lang}</a></li>'
|
||||
menu.append $ '<li><a href="javascript:;">' + WCF.Language.get('wcf.chat.query') + '</a></li>'
|
||||
menu.append $ '<li><a href="javascript:;">' + WCF.Language.get('wcf.chat.kick') + '</a></li>'
|
||||
menu.append $ '<li><a href="javascript:;">' + WCF.Language.get('wcf.chat.ban') + '</a></li>'
|
||||
menu.append $ '<li><a href="index.php/User/' + user.userID + '">' + WCF.Language.get('wcf.chat.profile') + '</a></li>'
|
||||
@events.userMenu.fire user, menu
|
||||
li.append menu
|
||||
li.appendTo $ '#chatUserList'
|
||||
@ -307,15 +307,15 @@ TimWolla.WCF ?= {}
|
||||
# @param jQuery-object target
|
||||
###
|
||||
toggleSidebarContents: (target) ->
|
||||
return if target.parent().hasClass 'active'
|
||||
return if target.parents('li').hasClass 'active'
|
||||
|
||||
if target.parent().attr('id') is 'toggleUsers'
|
||||
if target.parents('li').attr('id') is 'toggleUsers'
|
||||
$('#toggleUsers').addClass 'active'
|
||||
$('#toggleRooms').removeClass 'active'
|
||||
|
||||
$('#chatRoomList').hide()
|
||||
$('#chatUserList').show()
|
||||
else if target.parent().attr('id') is 'toggleRooms'
|
||||
else if target.parents('li').attr('id') is 'toggleRooms'
|
||||
$('#toggleRooms').addClass 'active'
|
||||
$('#toggleUsers').removeClass 'active'
|
||||
|
||||
|
@ -209,4 +209,38 @@ #sidebarContainer {
|
||||
overflow-y: auto;
|
||||
height: 420px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#sidebarContainer a {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#chatCopyright {
|
||||
bottom: 5px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.sidebarContent {
|
||||
> div {
|
||||
ul {
|
||||
> li {
|
||||
margin-top: 5px;
|
||||
background-color: transparent !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sidebarContent {
|
||||
> div {
|
||||
ul {
|
||||
> li.activeMenuItem {
|
||||
> a {
|
||||
background-color: #FFFFFF;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
14
template/chat.tpl
Normal file → Executable file
14
template/chat.tpl
Normal file → Executable file
@ -12,11 +12,13 @@
|
||||
background-repeat: no-repeat;
|
||||
min-height: 50%;
|
||||
}
|
||||
#chatUserList > li > .bgFix a {
|
||||
#chatUserList > li > a {
|
||||
background-image: url({icon size='S'}arrowRight{/icon});
|
||||
background-position: 15px center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
#chatUserList > li.activeMenuItem > .bgFix a {
|
||||
#chatUserList > li.activeMenuItem > a {
|
||||
background-image: url({icon size='S'}arrowDown{/icon});
|
||||
}
|
||||
|
||||
@ -82,7 +84,7 @@
|
||||
|
||||
<body id="tpl{$templateName|ucfirst}">
|
||||
{capture assign='sidebar'}
|
||||
<div id="sidebarContent">
|
||||
<div id="sidebarContent" class="sidebarContent">
|
||||
<nav class="chatSidebarTabs">
|
||||
<ul>
|
||||
<li id="toggleUsers" class="active"><a href="javascript:;" title="{lang}wcf.chat.users{/lang}">{lang}wcf.chat.users{/lang} <span class="badge">0</span></a></li>
|
||||
@ -191,6 +193,10 @@
|
||||
animations: {CHAT_ANIMATIONS},
|
||||
maxTextLength: {CHAT_LENGTH}
|
||||
}
|
||||
WCF.Language.add('wcf.chat.query', '{lang}wcf.chat.query{/lang}');
|
||||
WCF.Language.add('wcf.chat.kick', '{lang}wcf.chat.kick{/lang}');
|
||||
WCF.Language.add('wcf.chat.ban', '{lang}wcf.chat.ban{/lang}');
|
||||
WCF.Language.add('wcf.chat.profile', '{lang}wcf.chat.profile{/lang}');
|
||||
{event name='shouldInit'}
|
||||
TimWolla.WCF.Chat.init();
|
||||
{event name='didInit'}
|
||||
@ -214,4 +220,4 @@
|
||||
|
||||
{include file='footer' sandbox=false}
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user