1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00
Tim Düsterhus 2014-03-10 18:25:03 +01:00
parent ecb82e74d7
commit 9d8359a52c
2 changed files with 5 additions and 11 deletions

View File

@ -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

View File

@ -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'}