mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-29 02:30:28 +00:00
chore: client: lint
This commit is contained in:
parent
2fc503f71f
commit
d8da7922d9
12 changed files with 71 additions and 101 deletions
|
|
@ -11,6 +11,7 @@ const load = require('load.js');
|
|||
const {MAX_FILE_SIZE: maxSize} = require('../../common/cloudfunc');
|
||||
|
||||
const {time, timeEnd} = require('../../common/util');
|
||||
const getEditor = () => editor;
|
||||
const isFn = (a) => typeof a === 'function';
|
||||
const loadJS = load.js;
|
||||
|
||||
|
|
@ -91,10 +92,6 @@ module.exports.show = (options) => {
|
|||
|
||||
module.exports.getEditor = getEditor;
|
||||
|
||||
function getEditor() {
|
||||
return editor;
|
||||
}
|
||||
|
||||
module.exports.getElement = () => Element;
|
||||
|
||||
module.exports.hide = () => {
|
||||
|
|
|
|||
|
|
@ -46,22 +46,18 @@ module.exports.clear = () => {
|
|||
konsole.clear();
|
||||
};
|
||||
|
||||
function getPrefix() {
|
||||
return CloudCmd.prefix + '/console';
|
||||
}
|
||||
const getPrefix = () => CloudCmd.prefix + '/console';
|
||||
|
||||
function getPrefixSocket() {
|
||||
return CloudCmd.prefixSocket + '/console';
|
||||
}
|
||||
|
||||
function getEnv() {
|
||||
return {
|
||||
ACTIVE_DIR: DOM.getCurrentDirPath.bind(DOM),
|
||||
PASSIVE_DIR: DOM.getNotCurrentDirPath.bind(DOM),
|
||||
CURRENT_NAME: DOM.getCurrentName.bind(DOM),
|
||||
CURRENT_PATH: () => Info.path,
|
||||
};
|
||||
}
|
||||
const getEnv = () => ({
|
||||
ACTIVE_DIR: DOM.getCurrentDirPath.bind(DOM),
|
||||
PASSIVE_DIR: DOM.getNotCurrentDirPath.bind(DOM),
|
||||
CURRENT_NAME: DOM.getCurrentName.bind(DOM),
|
||||
CURRENT_PATH: () => Info.path,
|
||||
});
|
||||
|
||||
async function onPath(path) {
|
||||
if (Info.dirPath === path)
|
||||
|
|
|
|||
|
|
@ -226,9 +226,7 @@ function beforeShow(callback, params) {
|
|||
return isShow;
|
||||
}
|
||||
|
||||
function beforeClick(name) {
|
||||
return MenuShowedName !== name;
|
||||
}
|
||||
const beforeClick = (name) => MenuShowedName !== name;
|
||||
|
||||
async function _uploadTo(nameModule) {
|
||||
const [error, data] = await Info.getData();
|
||||
|
|
|
|||
|
|
@ -75,22 +75,18 @@ function hide() {
|
|||
CloudCmd.View.hide();
|
||||
}
|
||||
|
||||
function getPrefix() {
|
||||
return CloudCmd.prefix + '/gritty';
|
||||
}
|
||||
const getPrefix = () => CloudCmd.prefix + '/gritty';
|
||||
|
||||
function getPrefixSocket() {
|
||||
return CloudCmd.prefixSocket + '/gritty';
|
||||
}
|
||||
|
||||
function getEnv() {
|
||||
return {
|
||||
ACTIVE_DIR: DOM.getCurrentDirPath,
|
||||
PASSIVE_DIR: DOM.getNotCurrentDirPath,
|
||||
CURRENT_NAME: DOM.getCurrentName,
|
||||
CURRENT_PATH: DOM.getCurrentPath,
|
||||
};
|
||||
}
|
||||
const getEnv = () => ({
|
||||
ACTIVE_DIR: DOM.getCurrentDirPath,
|
||||
PASSIVE_DIR: DOM.getNotCurrentDirPath,
|
||||
CURRENT_NAME: DOM.getCurrentName,
|
||||
CURRENT_PATH: DOM.getCurrentPath,
|
||||
});
|
||||
|
||||
function create(createOptions) {
|
||||
const {
|
||||
|
|
|
|||
|
|
@ -57,22 +57,18 @@ function hide() {
|
|||
CloudCmd.View.hide();
|
||||
}
|
||||
|
||||
function getPrefix() {
|
||||
return CloudCmd.prefix + '/gritty';
|
||||
}
|
||||
const getPrefix = () => CloudCmd.prefix + '/gritty';
|
||||
|
||||
function getPrefixSocket() {
|
||||
return CloudCmd.prefixSocket + '/gritty';
|
||||
}
|
||||
|
||||
function getEnv() {
|
||||
return {
|
||||
ACTIVE_DIR: DOM.getCurrentDirPath,
|
||||
PASSIVE_DIR: DOM.getNotCurrentDirPath,
|
||||
CURRENT_NAME: DOM.getCurrentName,
|
||||
CURRENT_PATH: DOM.getCurrentPath,
|
||||
};
|
||||
}
|
||||
const getEnv = () => ({
|
||||
ACTIVE_DIR: DOM.getCurrentDirPath,
|
||||
PASSIVE_DIR: DOM.getNotCurrentDirPath,
|
||||
CURRENT_NAME: DOM.getCurrentName,
|
||||
CURRENT_PATH: DOM.getCurrentPath,
|
||||
});
|
||||
|
||||
function create() {
|
||||
const options = {
|
||||
|
|
|
|||
|
|
@ -45,9 +45,7 @@ function isMedia(name) {
|
|||
return isAudio(name) || isVideo(name);
|
||||
}
|
||||
|
||||
function isAudio(name) {
|
||||
return /\.(mp3|ogg|m4a)$/i.test(name);
|
||||
}
|
||||
const isAudio = (name) => /\.(mp3|ogg|m4a)$/i.test(name);
|
||||
|
||||
function isVideo(name) {
|
||||
return /\.(mp4|avi|webm)$/i.test(name);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,10 @@ CloudCmd[Name] = module.exports;
|
|||
|
||||
const Info = DOM.CurrentInfo;
|
||||
const {Key} = CloudCmd;
|
||||
const basename = (a) => a.split('/').pop();
|
||||
|
||||
const basename = (a) => a
|
||||
.split('/')
|
||||
.pop();
|
||||
|
||||
let El;
|
||||
let TemplateAudio;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
const {extname} = require('node:path');
|
||||
const currify = require('currify');
|
||||
const isAudio = (name) => /\.(mp3|ogg|m4a)$/i.test(name);
|
||||
const testRegExp = currify((name, reg) => reg.test(name));
|
||||
const getRegExp = (ext) => RegExp(`\\.${ext}$`, 'i');
|
||||
|
||||
|
|
@ -53,9 +54,6 @@ function isMedia(name) {
|
|||
}
|
||||
|
||||
module.exports.isAudio = isAudio;
|
||||
function isAudio(name) {
|
||||
return /\.(mp3|ogg|m4a)$/i.test(name);
|
||||
}
|
||||
|
||||
function isVideo(name) {
|
||||
return /\.(mp4|avi|webm)$/i.test(name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue