From fb5eb0664aa4cdcf3be5a279795f2fb8abe684d8 Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Tue, 5 Dec 2017 18:53:13 -0800 Subject: [PATCH] Add 'Channel list' to network context menu --- client/css/style.css | 1 + client/js/lounge.js | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/client/css/style.css b/client/css/style.css index 6ab8c4d3..aa504704 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -222,6 +222,7 @@ kbd { .context-menu-user::before { content: "\f007"; /* http://fontawesome.io/icon/user/ */ } .context-menu-chan::before { content: "\f0f6"; /* http://fontawesome.io/icon/file-text-o/ */ } .context-menu-close::before { content: "\f00d"; /* http://fontawesome.io/icon/times/ */ } +.context-menu-list::before { content: "\f03a"; /* http://fontawesome.io/icon/list/ */ } #sidebar .chan.lobby::before, #chat .lobby .title::before { content: "\f0a0"; /* http://fontawesome.io/icon/hdd-o/ */ } diff --git a/client/js/lounge.js b/client/js/lounge.js index 3adf2881..386eac97 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -90,6 +90,13 @@ $(function() { data: target.data("target"), }); output += templates.contextmenu_divider(); + if (target.hasClass("lobby")) { + output += templates.contextmenu_item({ + class: "list", + text: "List all channels", + data: target.data("target"), + }); + } output += templates.contextmenu_item({ class: "close", text: target.hasClass("lobby") ? "Disconnect" : target.hasClass("channel") ? "Leave" : "Close", @@ -442,6 +449,12 @@ $(function() { case "user": $(".channel.active .users .user[data-name='" + $(this).data("data") + "']").click(); break; + case "list": + socket.emit("input", { + target: chat.data("id"), + text: "/list", + }); + break; } });