From 9d8359a52c3196265fbd68b62b692247c5c27641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 10 Mar 2014 18:25:03 +0100 Subject: [PATCH] Fix mute command in user menu see https://tims.bastelstu.be/forum/index.php/Thread/129-Knebeln-per-Dropdown-nicht-m%C3%B6glich/ --- file/js/be.bastelstu.Chat.litcoffee | 10 ++-------- template/userListUserMenu.tpl | 6 +++--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index 8e22cc5..ce7edb6 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -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 diff --git a/template/userListUserMenu.tpl b/template/userListUserMenu.tpl index 98cdfb8..3b5215f 100644 --- a/template/userListUserMenu.tpl +++ b/template/userListUserMenu.tpl @@ -1,9 +1,9 @@ {literal}