mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Fix mute command in user menu
see https://tims.bastelstu.be/forum/index.php/Thread/129-Knebeln-per-Dropdown-nicht-m%C3%B6glich/
This commit is contained in:
parent
ecb82e74d7
commit
9d8359a52c
@ -278,15 +278,9 @@ Reset autocompleter to default status, when the input is `click`ed, as the posit
|
||||
|
||||
Bind user menu functions
|
||||
|
||||
$('#dropdownMenuContainer').on 'click', '.jsTimsChatUserMenuWhisper', ->
|
||||
command = "/whisper #{userList.current[$(@).parents('ul').data 'userID'].username}, "
|
||||
return if $('#timsChatInput').val().match(new RegExp WCF.String.escapeRegExp("^#{command}"), 'i')
|
||||
|
||||
insertText command, prepend: yes
|
||||
|
||||
$('#dropdownMenuContainer').on 'click', '.jsTimsChatUserMenuQuery', -> openPrivateChannel $(@).parents('ul').data 'userID'
|
||||
$('#dropdownMenuContainer').on 'click', '.jsTimsChatUserMenuBan', ->
|
||||
command = "/ban #{userList.current[$(@).parents('ul').data 'userID'].username}, "
|
||||
$('#dropdownMenuContainer').on 'click', '.jsTimsChatUserMenuCommand', ->
|
||||
command = "/#{$(@).data 'command'} #{userList.current[$(@).parents('ul').data 'userID'].username}, "
|
||||
return if $('#timsChatInput').val().match(new RegExp WCF.String.escapeRegExp("^#{command}"), 'i')
|
||||
|
||||
insertText command, prepend: yes
|
||||
|
@ -1,9 +1,9 @@
|
||||
{literal}
|
||||
<ul data-user-id="{$user.userID}">
|
||||
<li><a class="jsTimsChatUserMenuWhisper">{lang}chat.global.whisper{/lang}</a></li>
|
||||
<li><a class="jsTimsChatUserMenuCommand" data-command="whisper">{lang}chat.global.whisper{/lang}</a></li>
|
||||
<li><a class="jsTimsChatUserMenuQuery">{lang}chat.global.query{/lang}</a></li>
|
||||
{if $room.permissions.canMute}<li><a class="jsTimsChatUserMenuMute">{lang}chat.global.mute{/lang}</a></li>{/if}
|
||||
{if $room.permissions.canBan}<li><a class="jsTimsChatUserMenuBan">{lang}chat.global.ban{/lang}</a></li>{/if}
|
||||
{if $room.permissions.canMute}<li><a class="jsTimsChatUserMenuCommand" data-command="mute">{lang}chat.global.mute{/lang}</a></li>{/if}
|
||||
{if $room.permissions.canBan}<li><a class="jsTimsChatUserMenuCommand" data-command="ban">{lang}chat.global.ban{/lang}</a></li>{/if}
|
||||
<li><a href="{$user.link}" class="userLink" data-user-id="{$user.userID}">{lang}chat.global.profile{/lang}</a></li>
|
||||
{/literal}
|
||||
{event name='menuItems'}
|
||||
|
Loading…
Reference in New Issue
Block a user