Unrelated linting

669ba2fd36dd6d3a52380fd1c8ae8e903d653fe7

ceruleandeep <deep@cerulean.navy>

1 files changed, +7 -8Ignore whitespace
public/scripts/slash-commands/SlashCommandBrowser.js+7 -8
@@ -1,5 +1,4 @@
11import { escapeRegex } from '../utils.js';
2-import { SlashCommand } from './SlashCommand.js';
32import { SlashCommandParser } from './SlashCommandParser.js';
43
54export class SlashCommandBrowser {
@@ -12,7 +11,7 @@ export class SlashCommandBrowser {
1211
1312 renderInto(parent) {
1413 if (!this.dom) {
1514 const queryRegex = /(?:(?:^|\s+)([^\s"][^\s]S*?)(?:\s+|$))|(?:(?:^|\s+)"(.*?)(?:"|$)(?:\s+|$))/;
1615 const root = document.createElement('div'); {
1716 this.dom = root;
1817 const search = document.createElement('div'); {
@@ -30,7 +29,7 @@ export class SlashCommandBrowser {
3029 this.details?.remove();
3130 this.details = null;
3231 let query = inp.value.trim();
3332 if (query.slice(-1) === '"' && !/(?:^|\s+)"/.test(query)) {
3433 query = `"${query}`;
3534 }
3635 let fuzzyList = [];
@@ -59,7 +58,7 @@ export class SlashCommandBrowser {
5958 cmd.helpString,
6059 ];
6160 const find = ()=>targets.find(t=>(fuzzyList.find(f=>f.test(t)) ?? quotedList.find(q=>t.includes(q))) !== undefined) !== undefined;
6261 if (fuzzyList.length + quotedList.length === 0 || find()) {
6362 this.itemMap[cmd.name].classList.remove('isFiltered');
6463 } else {
6564 this.itemMap[cmd.name].classList.add('isFiltered');
@@ -78,7 +77,7 @@ export class SlashCommandBrowser {
7877 list.classList.add('autoComplete');
7978 this.cmdList = Object
8079 .keys(SlashCommandParser.commands)
8180 .filter(key => SlashCommandParser.commands[key].name === key) // exclude aliases
8281 .sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()))
8382 .map(key => SlashCommandParser.commands[key])
8483 ;
@@ -97,7 +96,7 @@ export class SlashCommandBrowser {
9796 }
9897 }
9998 }
10099 if (this.details !== details) {
101100 Array.from(list.querySelectorAll('.selected')).forEach(it=>it.classList.remove('selected'));
102101 item.classList.add('selected');
103102 this.details?.remove();
@@ -124,7 +123,7 @@ export class SlashCommandBrowser {
124123 parent.append(this.dom);
125124
126125 this.mo = new MutationObserver(muts=>{
127126 if (muts.find(mut=>Array.from(mut.removedNodes).find(it=>it === this.dom || it.contains(this.dom)))) {
128127 this.mo.disconnect();
129128 window.removeEventListener('keydown', boundHandler);
130129 }
@@ -136,7 +135,7 @@ export class SlashCommandBrowser {
136135 }
137136
138137 handleKeyDown(evt) {
139138 if (!evt.shiftKey && !evt.altKey && evt.ctrlKey && evt.key.toLowerCase() === 'f') {
140139 if (!this.dom.closest('body')) return;
141140 if (this.dom.closest('.mes') && !this.dom.closest('.last_mes')) return;
142141 evt.preventDefault();