Get rid of /clear command and keybind

Since the introduction of infinite scrolling, `/clear` is now broken. As far as I can tell, there is no way to reproduce something decent (and working!) without drastically changing its behavior from "hide the messages in current channel" to "permanently destroy all messages in memory in the current channel", which is not a great change to introduce sneakily 😂.

The code for this was very trivial, so removing it now until there is a better way to do so, if this is ever possible.

Also, `/clear` was not even autocompleted, sooo...
This commit is contained in:
Jérémie Astori 2017-09-13 19:53:40 -04:00
parent 376e7a60fb
commit 92f8c2bfef
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8
4 changed files with 0 additions and 51 deletions

View File

@ -403,15 +403,6 @@
</div>
</div>
<div class="help-item">
<div class="subject">
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>L</kbd>
</div>
<div class="description">
<p>Clear the current screen</p>
</div>
</div>
<div class="help-item">
<div class="subject">
<kbd>Ctrl</kbd> + <kbd>K</kbd>
@ -479,15 +470,6 @@
</div>
</div>
<div class="help-item">
<div class="subject">
<kbd></kbd> + <kbd></kbd> + <kbd>L</kbd>
</div>
<div class="description">
<p>Clear the current screen</p>
</div>
</div>
<div class="help-item">
<div class="subject">
<kbd></kbd> + <kbd>K</kbd>
@ -583,15 +565,6 @@
</div>
</div>
<div class="help-item">
<div class="subject">
<code>/clear</code>
</div>
<div class="description">
<p>Clear the current screen.</p>
</div>
</div>
<div class="help-item">
<div class="subject">
<code>/collapse</code>

View File

@ -2,7 +2,6 @@
const $ = require("jquery");
const Mousetrap = require("mousetrap");
const utils = require("./utils");
const input = $("#input");
const sidebar = $("#sidebar");
const windows = $("#windows");
@ -61,16 +60,6 @@ Mousetrap.bind([
channels.eq(target).click();
});
Mousetrap.bind([
"command+shift+l",
"ctrl+shift+l"
], function(e) {
if (e.target === input[0]) {
utils.clear();
e.preventDefault();
}
});
Mousetrap.bind([
"escape"
], function() {

View File

@ -180,11 +180,6 @@ $(function() {
input.val("");
resetInputHeight(input.get(0));
if (text.indexOf("/clear") === 0) {
utils.clear();
return;
}
if (text.indexOf("/collapse") === 0) {
$(".chan.active .toggle-preview.opened").click();
return;

View File

@ -1,11 +1,9 @@
"use strict";
const $ = require("jquery");
const chat = $("#chat");
const input = $("#input");
module.exports = {
clear,
confirmExit,
forceFocus,
move,
@ -26,12 +24,6 @@ function forceFocus() {
input.trigger("click").focus();
}
function clear() {
chat.find(".active")
.find(".show-more").addClass("show").end()
.find(".messages .msg, .date-marker-container").remove();
}
function toggleNickEditor(toggle) {
$("#nick").toggleClass("editable", toggle);
$("#nick-value").attr("contenteditable", toggle);