diff --git a/client/index.html b/client/index.html index 1e358be4..b7cb9b51 100644 --- a/client/index.html +++ b/client/index.html @@ -590,6 +590,18 @@ +
+
+ /collapse +
+
+

+ Collapse all previews in the current channel (opposite of + /expand) +

+
+
+
/connect host [port] @@ -653,6 +665,18 @@
+
+
+ /expand +
+
+

+ Expand all previews in the current channel (opposite of + /collapse) +

+
+
+
/invite nick [channel] diff --git a/client/js/constants.js b/client/js/constants.js index c001cbaf..f95fbd00 100644 --- a/client/js/constants.js +++ b/client/js/constants.js @@ -25,11 +25,13 @@ const commands = [ "/ban", "/banlist", "/close", + "/collapse", "/connect", "/ctcp", "/deop", "/devoice", "/disconnect", + "/expand", "/invite", "/join", "/kick", diff --git a/client/js/lounge.js b/client/js/lounge.js index 2057c722..b67bc4eb 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -334,6 +334,16 @@ $(function() { return; } + if (text.indexOf("/collapse") === 0) { + $(".chan.active .toggle-button.opened").click(); + return; + } + + if (text.indexOf("/expand") === 0) { + $(".chan.active .toggle-button:not(.opened)").click(); + return; + } + socket.emit("input", { target: chat.data("id"), text: text