mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
chore: lint
This commit is contained in:
parent
93aa7278b7
commit
75bf8a1275
14 changed files with 21 additions and 33 deletions
|
|
@ -19,9 +19,8 @@ const Chars = fullstore();
|
|||
const toggleVim = (keyCode) => {
|
||||
const {_config, config} = CloudCmd;
|
||||
|
||||
if (keyCode === KEY.ESC) {
|
||||
if (keyCode === KEY.ESC)
|
||||
_config('vim', !config('vim'));
|
||||
}
|
||||
};
|
||||
|
||||
const isUndefined = (a) => typeof a === 'undefined';
|
||||
|
|
|
|||
|
|
@ -178,7 +178,8 @@ function decodePath(path) {
|
|||
const {prefix} = CloudCmd;
|
||||
const prefixReg = RegExp('^' + prefix + FS);
|
||||
|
||||
return decodeURI(path).replace(url, '')
|
||||
return decodeURI(path)
|
||||
.replace(url, '')
|
||||
.replace(prefixReg, '') // browser doesn't replace % -> %25% do it for him
|
||||
.replace('%%', '%25%')
|
||||
.replace(NBSP_REG, SPACE) || '/';
|
||||
|
|
|
|||
|
|
@ -16,9 +16,8 @@ async function show() {
|
|||
const [, cmd] = await Dialog.prompt('Command Line', '');
|
||||
const TERMINAL = '^(t|terminal)';
|
||||
|
||||
if (RegExp(`${TERMINAL}$`).test(cmd)) {
|
||||
if (RegExp(`${TERMINAL}$`).test(cmd))
|
||||
return await CloudCmd.Terminal.show();
|
||||
}
|
||||
|
||||
if (RegExp(TERMINAL).test(cmd)) {
|
||||
const command = cmd.replace(RegExp(`${TERMINAL} `), '');
|
||||
|
|
|
|||
|
|
@ -123,9 +123,8 @@ function create(createOptions) {
|
|||
if (commandExit)
|
||||
hide();
|
||||
|
||||
if (shiftKey && keyCode === Key.ESC) {
|
||||
if (shiftKey && keyCode === Key.ESC)
|
||||
hide();
|
||||
}
|
||||
});
|
||||
|
||||
Socket.on('exit', (code) => {
|
||||
|
|
|
|||
|
|
@ -90,9 +90,8 @@ function create() {
|
|||
Terminal.onKey(({domEvent}) => {
|
||||
const {keyCode, shiftKey} = domEvent;
|
||||
|
||||
if (shiftKey && keyCode === Key.ESC) {
|
||||
if (shiftKey && keyCode === Key.ESC)
|
||||
hide();
|
||||
}
|
||||
});
|
||||
|
||||
Socket.on('connect', exec.with(authCheck, socket));
|
||||
|
|
|
|||
|
|
@ -13,9 +13,8 @@ const store = fullstore(1);
|
|||
const isDigit = (a) => /^\d+$/.test(a);
|
||||
|
||||
module.exports = (el, {key, keyCode}) => {
|
||||
if (isDigit(key)) {
|
||||
if (isDigit(key))
|
||||
store(Number(key));
|
||||
}
|
||||
|
||||
if (keyCode === DOWN || keyCode === J) {
|
||||
const count = store();
|
||||
|
|
|
|||
|
|
@ -14,9 +14,8 @@ module.exports = (userMenu) => {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (str.startsWith('_')) {
|
||||
if (str.startsWith('_'))
|
||||
continue;
|
||||
}
|
||||
|
||||
names.push(str);
|
||||
const [key, name] = str.split(' - ');
|
||||
|
|
|
|||
|
|
@ -16,14 +16,12 @@ const {getPanel} = DOM;
|
|||
CloudCmd.sortPanel = (name, panel = getPanel()) => {
|
||||
const position = panel.dataset.name.replace('js-', '');
|
||||
|
||||
if (name !== sortPrevious) {
|
||||
if (name !== sortPrevious)
|
||||
order[position] = 'asc';
|
||||
else if (order[position] === 'asc')
|
||||
order[position] = 'desc';
|
||||
else
|
||||
order[position] = 'asc';
|
||||
} else {
|
||||
if (order[position] === 'asc')
|
||||
order[position] = 'desc';
|
||||
else
|
||||
order[position] = 'asc';
|
||||
}
|
||||
|
||||
sortPrevious = sort[position] = name;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue