diff --git a/.webpack/css.js b/.webpack/css.js index 398116b19e..f28fa100be 100644 --- a/.webpack/css.js +++ b/.webpack/css.js @@ -69,7 +69,7 @@ function extract(extractPlugin) { test: RegExp(`css/${filename}`), use: extractPlugin.extract([ 'css-loader', - ]) + ]), }; } diff --git a/.webpack/js.js b/.webpack/js.js index 7087b8ecac..e2e7ba2307 100644 --- a/.webpack/js.js +++ b/.webpack/js.js @@ -32,7 +32,7 @@ const babelDev = { plugins: [ 'module:babel-plugin-macros', '@babel/plugin-proposal-object-rest-spread', - ] + ], }; const rules = clean([ @@ -45,12 +45,12 @@ const rules = clean([ test: /sw\.js$/, exclude: /node_modules/, loader: 'babel-loader', - options: babelDev + options: babelDev, }]); const plugins = [ new EnvironmentPlugin({ - NODE_ENV: 'production' + NODE_ENV: 'production', }), new ServiceWorkerWebpackPlugin({ @@ -66,7 +66,7 @@ const splitChunks = { module.exports = { resolve: { - symlinks: false + symlinks: false, }, devtool, optimization: { @@ -100,7 +100,7 @@ module.exports = { publicPath: '/dist/', }, externals: [ - externals + externals, ], module: { rules, diff --git a/bin/cloudcmd.js b/bin/cloudcmd.js index 041f8d9bc6..d9f8a043c8 100755 --- a/bin/cloudcmd.js +++ b/bin/cloudcmd.js @@ -126,11 +126,11 @@ const args = require('minimist')(argv.slice(2), { u: 'username', s: 'save', a: 'auth', - c: 'config' + c: 'config', }, unknown: (cmd) => { exit('\'%s\' is not a cloudcmd option. See \'cloudcmd --help\'.', cmd); - } + }, }); if (args.version) @@ -266,7 +266,7 @@ function readConfig(name) { const forEachKey = require('for-each-key'); const readjsonSync = (name) => jju.parse(fs.readFileSync(name, 'utf8'), { - mode: 'json' + mode: 'json', }); const [error, data] = tryCatch(readjsonSync, name); diff --git a/bin/release.js b/bin/release.js index a95813a84f..b5de64cce9 100755 --- a/bin/release.js +++ b/bin/release.js @@ -34,7 +34,7 @@ function main(callback) { replaceVersion('HELP.md', version, versionNew, () => { const historyNew = history + rendy(template, { date : shortdate(), - version : versionNew + version : versionNew, }); replaceVersion('HELP.md', history, historyNew, callback); diff --git a/client/client.js b/client/client.js index 57774a5fe9..77eb673f1e 100644 --- a/client/client.js +++ b/client/client.js @@ -56,7 +56,7 @@ function CloudCmdProto(DOM) { const { Storage, - Files + Files, } = DOM; this.log = log; @@ -103,7 +103,7 @@ function CloudCmdProto(DOM) { panel, history, noCurrent, - currentName + currentName, } = p; let panelChanged; @@ -231,7 +231,7 @@ function CloudCmdProto(DOM) { loadModule({ path, - func + func, }); }); @@ -273,7 +273,7 @@ function CloudCmdProto(DOM) { // when hash is present // it should be handled with this.route // overwre otherwise - history: !location.hash + history: !location.hash, }); const dirPath = DOM.getCurrentDirPath(); @@ -446,8 +446,8 @@ function CloudCmdProto(DOM) { file : templFile, path : templPath, pathLink : templPathLink, - link : templLink - } + link : templLink, + }, }); Listeners.setOnPanel(panel); @@ -517,7 +517,7 @@ function CloudCmdProto(DOM) { const { dir, dirPath, - parentDirPath + parentDirPath, } = Info; if (dirPath === parentDirPath) @@ -531,7 +531,7 @@ function CloudCmdProto(DOM) { const first = DOM.getFiles(panel)[0]; DOM.setCurrentFile(current || first, { - history + history, }); }); }; diff --git a/client/dom/buffer.js b/client/dom/buffer.js index b52fdb0118..3b12e918e2 100644 --- a/client/dom/buffer.js +++ b/client/dom/buffer.js @@ -21,7 +21,7 @@ function BufferProto() { cut : callIfEnabled.bind(null, cut), copy : callIfEnabled.bind(null, copy), clear : callIfEnabled.bind(null, clear), - paste : callIfEnabled.bind(null, paste) + paste : callIfEnabled.bind(null, paste), }; function showMessage(msg) { diff --git a/client/dom/current-file.js b/client/dom/current-file.js index f859942026..a167f34394 100644 --- a/client/dom/current-file.js +++ b/client/dom/current-file.js @@ -126,7 +126,7 @@ module.exports.getParentDirPath = (panel) => { */ module.exports.getNotCurrentDirPath = () => { const panel = DOM.getPanel({ - active: false + active: false, }); return DOM.getCurrentDirPath(panel); @@ -267,7 +267,7 @@ module.exports.setTitle = (name) => { if (!Title) Title = DOM.getByTag('title')[0] || createElement('title', { innerHTML: name, - parent: document.head + parent: document.head, }); Title.textContent = name; diff --git a/client/dom/current-file.spec.js b/client/dom/current-file.spec.js index c8b7456e02..e5995fa8f4 100644 --- a/client/dom/current-file.spec.js +++ b/client/dom/current-file.spec.js @@ -88,7 +88,7 @@ test('current-file: setCurrentName: return', (t) => { const link = {}; global.DOM = getDOM({ - link + link, }); global.CloudCmd = getCloudCmd(); @@ -153,7 +153,7 @@ test('current-file: isCurrentFile', (t) => { const isContainClass = stub(); global.DOM = getDOM({ - isContainClass + isContainClass, }); global.CloudCmd = getCloudCmd(); @@ -190,7 +190,7 @@ function getDOM({ CurrentInfo: { link, dirPath: '/', - } + }, }; } diff --git a/client/dom/events/index.js b/client/dom/events/index.js index 199c7b11ff..52947415fe 100644 --- a/client/dom/events/index.js +++ b/client/dom/events/index.js @@ -13,7 +13,7 @@ function EventsProto() { return false; return { - passive: true + passive: true, }; }; diff --git a/client/dom/files.js b/client/dom/files.js index 3d358208c0..fe64eb9f03 100644 --- a/client/dom/files.js +++ b/client/dom/files.js @@ -107,7 +107,7 @@ function getSystemFile(file, callback) { load.ajax({ url, success, - error + error, }); }); diff --git a/client/dom/images.js b/client/dom/images.js index 8f6c5ded0b..68cff451b0 100644 --- a/client/dom/images.js +++ b/client/dom/images.js @@ -40,7 +40,7 @@ function getElement() { id: 'js-status-image', className: 'icon', dataName: 'progress', - notAppend: true + notAppend: true, }); } diff --git a/client/dom/index.js b/client/dom/index.js index d16e4721ea..c6b83a5f91 100644 --- a/client/dom/index.js +++ b/client/dom/index.js @@ -47,7 +47,7 @@ function CmdProto() { const TITLE = 'Cloud Commander'; const TabPanel = { 'js-left' : null, - 'js-right' : null + 'js-right' : null, }; this.loadRemote = (name, options, callback) => { @@ -57,7 +57,7 @@ function CmdProto() { this.loadSocket = function(callback) { DOM.loadRemote('socket', { - name : 'io' + name : 'io', }, callback); return DOM; @@ -117,7 +117,7 @@ function CmdProto() { const currentName = name; CloudCmd.refresh({ - currentName + currentName, }); }); }); @@ -686,7 +686,7 @@ function CmdProto() { */ this.hidePanel = (active) => { const panel = DOM.getPanel({ - active + active, }); if (!panel) @@ -769,7 +769,7 @@ function CmdProto() { const files = { from : dirPath + from, - to : dirPath + to + to : dirPath + to, }; RESTful.mv(files, (error) => { @@ -815,7 +815,7 @@ function CmdProto() { CloudCmd.emit('passive-dir', Info.dirPath); const panelPassive = DOM.getPanel({ - active: false + active: false, }); let name = DOM.getCurrentName(); @@ -848,7 +848,7 @@ function CmdProto() { } DOM.setCurrentFile(current, { - history: true + history: true, }); CloudCmd.emit('active-dir', Info.dirPath); @@ -869,7 +869,7 @@ function CmdProto() { const {Dialog} = DOM; const cancel = false; const setPath = (path) => ({ - path + path, }); Dialog.prompt(TITLE, msg, path, {cancel}) @@ -905,7 +905,7 @@ function CmdProto() { panel, files, element, - panelPassive + panelPassive, } = Info; const dirPath = DOM.getCurrentDirPath(); @@ -916,12 +916,12 @@ function CmdProto() { CloudCmd.loadDir({ path: dirPath, panel: panelPassive, - noCurrent: true + noCurrent: true, }); CloudCmd.loadDir({ path: dirPathPassive, - panel + panel, }, () => { const {files} = Info; const length = files.length - 1; @@ -944,7 +944,7 @@ function CmdProto() { const panel = files.parentElement; const panelPassive = DOM.getPanel({ - active: false + active: false, }); const filesPassive = DOM.getFiles(panelPassive); diff --git a/client/dom/load-remote.js b/client/dom/load-remote.js index c20b7a0d41..5a2c4dfaa8 100644 --- a/client/dom/load-remote.js +++ b/client/dom/load-remote.js @@ -43,7 +43,7 @@ module.exports = (name, options, callback = options) => { const remoteURL = remoteTmpls.map((tmpl) => { return rendy(tmpl, { - version + version, }); }); diff --git a/client/dom/rest.js b/client/dom/rest.js index aa0db07ee2..c12e4b42b7 100644 --- a/client/dom/rest.js +++ b/client/dom/rest.js @@ -26,7 +26,7 @@ function RESTful() { url : FS + url, data, callback, - imgPosition : { top: !!data } + imgPosition : { top: !!data }, }); }; @@ -39,7 +39,7 @@ function RESTful() { } const imgPosition = { - top: true + top: true, }; sendRequest({ @@ -64,7 +64,7 @@ function RESTful() { url: FS + url, data, callback, - imgPosition : { top: true } + imgPosition : { top: true }, }); }; @@ -95,7 +95,7 @@ function RESTful() { url: '/cp', data, callback, - imgPosition : { top: true } + imgPosition : { top: true }, }); }; @@ -113,7 +113,7 @@ function RESTful() { method : 'PUT', url : '/extract', data, - callback + callback, }); }; @@ -123,7 +123,7 @@ function RESTful() { url : '/mv', data, callback, - imgPosition : { top: true } + imgPosition : { top: true }, }); }; @@ -134,7 +134,7 @@ function RESTful() { url : '/config', callback, imgPosition : { top: true }, - notLog : true + notLog : true, }); }, @@ -144,9 +144,9 @@ function RESTful() { url : '/config', data, callback, - imgPosition : { top: true } + imgPosition : { top: true }, }); - } + }, }; this.Markdown = { @@ -156,7 +156,7 @@ function RESTful() { url : '/markdown' + url, callback, imgPosition : { top: true }, - notLog : true + notLog : true, }); }, @@ -167,9 +167,9 @@ function RESTful() { data, callback, imgPosition : { top: true }, - notLog : true + notLog : true, }); - } + }, }; function sendRequest(params) { @@ -195,7 +195,7 @@ function RESTful() { const { statusText, - status + status, } = jqXHR; const text = status === 404 ? response : statusText; @@ -216,7 +216,7 @@ function RESTful() { CloudCmd.log(data); p.callback(null, data); - } + }, }); } } diff --git a/client/dom/upload-files.js b/client/dom/upload-files.js index 0d56480405..9faddeaf19 100644 --- a/client/dom/upload-files.js +++ b/client/dom/upload-files.js @@ -38,7 +38,7 @@ module.exports = (dir, files) => { function _onEnd(currentName) { CloudCmd.refresh({ - currentName + currentName, }); } diff --git a/client/input.js b/client/input.js index 44d97d8816..e475e77fa3 100644 --- a/client/input.js +++ b/client/input.js @@ -27,7 +27,7 @@ module.exports.getName = (element) => { module.exports.convert = (config) => { const result = { - ...config + ...config, }; const array = Object.keys(result); diff --git a/client/key/index.js b/client/key/index.js index 9d592a1327..7916d56d1e 100644 --- a/client/key/index.js +++ b/client/key/index.js @@ -125,7 +125,7 @@ function KeyProto() { name, panel, path, - isDir + isDir, } = Info; const {Operation} = CloudCmd; @@ -386,7 +386,7 @@ function KeyProto() { case Key.ENTER: if (Info.isDir) CloudCmd.loadDir({ - path: path === '/' ? '/' : path + '/' + path: path === '/' ? '/' : path + '/', }); break; @@ -398,7 +398,7 @@ function KeyProto() { case Key.BACKSLASH: if (ctrlMeta) CloudCmd.loadDir({ - path: '/' + path: '/', }); break; diff --git a/client/key/key.js b/client/key/key.js index 197e521eb9..8db26d126f 100644 --- a/client/key/key.js +++ b/client/key/key.js @@ -76,6 +76,6 @@ module.exports = { TRA : 192, /* Typewritten Reverse Apostrophe (`) */ BACKSLASH : 220, - BRACKET_CLOSE: 221 + BRACKET_CLOSE: 221, }; diff --git a/client/key/vim/globals.fixture.js b/client/key/vim/globals.fixture.js index 81994ecfb7..2fa928a79e 100644 --- a/client/key/vim/globals.fixture.js +++ b/client/key/vim/globals.fixture.js @@ -14,7 +14,7 @@ module.exports.getDOM = () => { }; const Dialog = { - prompt: resolve + prompt: resolve, }; return { @@ -36,8 +36,8 @@ module.exports.getCloudCmd = () => { return { Operation: { - show - } + show, + }, }; }; diff --git a/client/key/vim/index.spec.js b/client/key/vim/index.spec.js index 28ad3596e2..f5b5e10443 100644 --- a/client/key/vim/index.spec.js +++ b/client/key/vim/index.spec.js @@ -45,7 +45,7 @@ test('cloudcmd: client: key: set next file: no', (t) => { test('cloudcmd: client: key: set next file current', (t) => { const nextSibling = 'hello'; const element = { - nextSibling + nextSibling, }; const setCurrentFile = stub(); @@ -63,7 +63,7 @@ test('cloudcmd: client: key: set next file current', (t) => { test('cloudcmd: client: key: set next file current', (t) => { const nextSibling = 'hello'; const element = { - nextSibling + nextSibling, }; const setCurrentFile = stub(); @@ -83,7 +83,7 @@ test('cloudcmd: client: key: set next file current', (t) => { test('cloudcmd: client: key: set next file current: g', (t) => { const nextSibling = 'hello'; const element = { - nextSibling + nextSibling, }; const setCurrentFile = stub(); @@ -102,10 +102,10 @@ test('cloudcmd: client: key: set next file current: g', (t) => { test('cloudcmd: client: key: set +2 file current', (t) => { const last = {}; const nextSibling = { - nextSibling: last + nextSibling: last, }; const element = { - nextSibling + nextSibling, }; const setCurrentFile = stub(); @@ -126,10 +126,10 @@ test('cloudcmd: client: key: set +2 file current', (t) => { test('cloudcmd: client: key: select +2 files from current before delete', (t) => { const last = {}; const nextSibling = { - nextSibling: last + nextSibling: last, }; const element = { - nextSibling + nextSibling, }; const setCurrentFile = stub(); @@ -154,10 +154,10 @@ test('cloudcmd: client: key: select +2 files from current before delete', (t) => test('cloudcmd: client: key: delete +2 files from current', (t) => { const last = {}; const nextSibling = { - nextSibling: last + nextSibling: last, }; const element = { - nextSibling + nextSibling, }; const setCurrentFile = stub(); @@ -183,7 +183,7 @@ test('cloudcmd: client: key: delete +2 files from current', (t) => { test('cloudcmd: client: key: set previous file current', (t) => { const previousSibling = 'hello'; const element = { - previousSibling + previousSibling, }; const setCurrentFile = stub(); @@ -277,10 +277,10 @@ test('cloudcmd: client: key: selectFile', (t) => { test('cloudcmd: client: key: set last file current', (t) => { const last = 'last'; const nextSibling = { - nextSibling: last + nextSibling: last, }; const element = { - nextSibling + nextSibling, }; const setCurrentFile = stub(); @@ -298,11 +298,11 @@ test('cloudcmd: client: key: set last file current', (t) => { test('cloudcmd: client: key: set first file current', (t) => { const first = 'first'; const previousSibling= { - previousSibling: first + previousSibling: first, }; const element = { - previousSibling + previousSibling, }; const setCurrentFile = stub(); @@ -344,7 +344,7 @@ test('cloudcmd: client: key: ESC', (t) => { global.DOM.unselectFiles = unselectFiles ; vim('', { - keyCode: KEY.ESC + keyCode: KEY.ESC, }); t.ok(unselectFiles.calledWith(), 'should toggle selection'); @@ -355,7 +355,7 @@ test('cloudcmd: client: key: ESC', (t) => { test('cloudcmd: client: key: Enter', (t) => { const nextSibling = 'hello'; const element = { - nextSibling + nextSibling, }; const setCurrentFile = stub(); @@ -364,7 +364,7 @@ test('cloudcmd: client: key: Enter', (t) => { DOM.setCurrentFile = setCurrentFile; vim('', { - keyCode: KEY.ENTER + keyCode: KEY.ENTER, }); vim('j', {}); @@ -382,7 +382,7 @@ test('cloudcmd: client: key: /', (t) => { DOM.getCurrentName = () => ''; vim('/', { - preventDefault + preventDefault, }); t.ok(preventDefault.calledWith(), 'should call preventDefault'); diff --git a/client/listeners/index.js b/client/listeners/index.js index 60b448d885..8358f0a934 100644 --- a/client/listeners/index.js +++ b/client/listeners/index.js @@ -201,7 +201,7 @@ function onPathElementClick(panel, event) { if (attr === 'js-refresh') return CloudCmd.refresh({ panel, - noCurrent + noCurrent, }); if (attr !== 'js-path-link') @@ -213,7 +213,7 @@ function onPathElementClick(panel, event) { CloudCmd.loadDir({ path, isRefresh: false, - panel: noCurrent ? panel : Info.panel + panel: noCurrent ? panel : Info.panel, }); } @@ -271,7 +271,7 @@ function onDblClick(event) { if (isDir) { CloudCmd.loadDir({ - path: path === '/' ? '/' : path + '/' + path: path === '/' ? '/' : path + '/', }); event.preventDefault(); @@ -291,7 +291,7 @@ function onTouch(event) { return; CloudCmd.loadDir({ - path: DOM.getCurrentPath(current) + path: DOM.getCurrentPath(current), }); } @@ -344,7 +344,7 @@ function setCurrentFileByEvent(event) { alt: event.altKey, ctrl: event.ctrlKey, meta: event.metaKey, - shift: event.shiftKey + shift: event.shiftKey, }; const element = getLIElement(event.target); @@ -381,7 +381,7 @@ function contextMenu() { Events.addOnce('contextmenu', fm, (event) => { CloudCmd.Menu.show({ x: event.clientX, - y: event.clientY + y: event.clientY, }); }); @@ -407,7 +407,7 @@ function dragndrop() { const onDrop = (event) => { const { files, - items + items, } = event.dataTransfer; const {length: filesCount} = files; diff --git a/client/modules/config.js b/client/modules/config.js index c5fc06e15d..5ef4f66092 100644 --- a/client/modules/config.js +++ b/client/modules/config.js @@ -59,7 +59,7 @@ module.exports.init = async () => { const { config, - Key + Key, } = CloudCmd; let Element; @@ -84,7 +84,7 @@ function initSocket() { const socket = io.connect(href + prefixSocket + '/config', { reconnectionAttempts: Infinity, reconnectionDelay: ONE_MINUTE, - path: prefix + '/socket.io' + path: prefix + '/socket.io', }); const save = (data) => { @@ -237,7 +237,7 @@ function onAuthChange(checked) { function onNameChange(name) { setTitle(getTitle({ - name + name, })); } diff --git a/client/modules/edit-file-vim.js b/client/modules/edit-file-vim.js index 6846c7f35c..60ce4a65fe 100644 --- a/client/modules/edit-file-vim.js +++ b/client/modules/edit-file-vim.js @@ -13,7 +13,7 @@ const ConfigView = { beforeClose: () => { Events.rmKey(listener); CloudCmd.EditFile.isChanged(); - } + }, }; module.exports.init = async () => { diff --git a/client/modules/edit-file.js b/client/modules/edit-file.js index 0727dedee5..cc514cb87b 100644 --- a/client/modules/edit-file.js +++ b/client/modules/edit-file.js @@ -13,7 +13,7 @@ const Info = DOM.CurrentInfo; const { Dialog, - Images + Images, } = DOM; const {config} = CloudCmd; @@ -29,7 +29,7 @@ const ConfigView = { beforeClose: () => { exec.ifExist(Menu, 'hide'); isChanged(); - } + }, }; module.exports.init = async () => { @@ -118,7 +118,7 @@ function authCheck(spawn) { function setMenu(event) { const position = { x: event.clientX, - y: event.clientY + y: event.clientY, }; event.preventDefault(); @@ -136,7 +136,7 @@ function setMenu(event) { CloudCmd.Edit .getEditor() .focus(); - } + }, }; const element = CloudCmd.Edit.getElement(); @@ -178,7 +178,7 @@ function getMenuData() { }, 'Close Esc' : () => { hide(); - } + }, }; } diff --git a/client/modules/edit-names-vim.js b/client/modules/edit-names-vim.js index a12af0d1ea..75aef6992e 100644 --- a/client/modules/edit-names-vim.js +++ b/client/modules/edit-names-vim.js @@ -12,7 +12,7 @@ const ConfigView = { beforeClose: () => { Events.rmKey(listener); CloudCmd.EditNames.isChanged(); - } + }, }; module.exports.init = async () => { diff --git a/client/modules/edit-names.js b/client/modules/edit-names.js index 1c9db6ceb7..dbf85e094f 100644 --- a/client/modules/edit-names.js +++ b/client/modules/edit-names.js @@ -26,7 +26,7 @@ const ConfigView = { exec.ifExist(Menu, 'hide'); DOM.Events.remove('keydown', keyListener); isChanged(); - } + }, }; module.exports.init = async () => { @@ -39,7 +39,7 @@ module.exports.init = async () => { module.exports.show = (options) => { const names = getActiveNames().join('\n'); const config = { - ...ConfigView, + ...ConfigView, ...options, }; @@ -111,7 +111,7 @@ function _refresh(to, nameIndex, res) { const currentName = to[nameIndex]; CloudCmd.refresh({ - currentName + currentName, }); } @@ -133,14 +133,14 @@ function _rename(path, from, to, root) { from, to, dir, - }) + }), }); } function setMenu(event) { const position = { x: event.clientX, - y: event.clientY + y: event.clientY, }; event.preventDefault(); @@ -157,7 +157,7 @@ function setMenu(event) { afterClick: () => { editor.focus(); - } + }, }; const menuData = { @@ -185,7 +185,7 @@ function setMenu(event) { }, 'Close Esc' : () => { EditNames.hide(); - } + }, }; const element = CloudCmd.Edit.getElement(); diff --git a/client/modules/edit.js b/client/modules/edit.js index 1c42c6256c..7fb1ab19d4 100644 --- a/client/modules/edit.js +++ b/client/modules/edit.js @@ -26,7 +26,7 @@ const ConfigView = { editor .moveCursorTo(0, 0) .focus(); - } + }, }; module.exports.init = async () => { @@ -42,7 +42,7 @@ function create() { 'width : 100%;' + 'height : 100%;' + 'font-family: "Droid Sans Mono";', - notAppend: true + notAppend: true, }); Element = element; diff --git a/client/modules/konsole.js b/client/modules/konsole.js index 9ab097a9c8..2eed9988d0 100644 --- a/client/modules/konsole.js +++ b/client/modules/konsole.js @@ -67,7 +67,7 @@ function getEnv() { CURRENT_NAME: DOM.getCurrentName.bind(DOM), CURRENT_PATH: () => { return Info.path; - } + }, }; } @@ -111,7 +111,7 @@ const create = async () => { const path = DOM.getCurrentDirPath(); konsole.setPromptText(command + path); - } + }, }); }; @@ -134,7 +134,7 @@ module.exports.show = (callback) => { afterShow: () => { konsole.focus(); exec(callback); - } + }, }); }; @@ -150,7 +150,7 @@ const load = async () => { if (error) return Dialog.alert(TITLE, error.message, { - cancel: false + cancel: false, }); }; diff --git a/client/modules/menu.js b/client/modules/menu.js index 141e19623d..3b551c67fc 100644 --- a/client/modules/menu.js +++ b/client/modules/menu.js @@ -13,14 +13,14 @@ const RESTful = require('../dom/rest'); const { config, - Key + Key, } = CloudCmd; const { Buffer, Events, Dialog, - Images + Images, } = DOM; const Info = DOM.CurrentInfo; @@ -116,13 +116,13 @@ function getMenuData(isAuth) { 'Paste': Buffer.paste, 'New': { 'File': DOM.promptNewFile, - 'Directory': DOM.promptNewDir + 'Directory': DOM.promptNewDir, }, 'Upload': () => { CloudCmd.Upload.show(); }, 'Upload From Cloud': uploadFromCloud, - '(Un)Select All': DOM.toggleAllSelectedFiles + '(Un)Select All': DOM.toggleAllSelectedFiles, }; if (isAuth) @@ -199,7 +199,7 @@ function beforeShow(callback, params) { const {name} = params; const el = DOM.getCurrentByPosition({ x: params.x, - y: params.y + y: params.y, }); const menuName = getMenuNameByEl(el); @@ -311,7 +311,7 @@ function getCurrentPosition() { const position = { x: Math.round(rect.left + rect.width / 3), - y: Math.round(rect.top) + y: Math.round(rect.top), }; return position; @@ -320,7 +320,7 @@ function getCurrentPosition() { function listener(event) { const { F9, - ESC + ESC, } = Key; const key = event.keyCode; diff --git a/client/modules/operation/index.js b/client/modules/operation/index.js index 23cd66b2d6..1249695db9 100644 --- a/client/modules/operation/index.js +++ b/client/modules/operation/index.js @@ -75,7 +75,7 @@ module.exports.init = promisify((callback) => { Loaded = true; Images.hide(); callback(); - } + }, ], callback); }); @@ -179,7 +179,7 @@ Operation.copy = processFiles({ }); Operation.move = processFiles({ - type: 'move' + type: 'move', }); Operation.delete = () => { @@ -391,7 +391,7 @@ function twopack(operation, type) { const { path, - dirPath + dirPath, } = Info; const activeFiles = DOM.getActiveFiles(); @@ -408,7 +408,7 @@ function twopack(operation, type) { fileFrom = { from: path, - to: dirPath + to: dirPath, }; currentName = removeExtension(currentName); @@ -435,7 +435,7 @@ function twopack(operation, type) { op(fileFrom, (error) => { !error && CloudCmd.refresh({ - currentName + currentName, }); }); } diff --git a/client/modules/operation/set-listeners.js b/client/modules/operation/set-listeners.js index 5f7d3e3444..1f29b8ae70 100644 --- a/client/modules/operation/set-listeners.js +++ b/client/modules/operation/set-listeners.js @@ -55,7 +55,7 @@ module.exports = (options, callback) => (emitter) => { }, () => { emitter.abort(); }); - } + }, }; forEachKey(on, listeners); diff --git a/client/modules/polyfill.js b/client/modules/polyfill.js index 8d9c121e7a..e4fe9fcf87 100644 --- a/client/modules/polyfill.js +++ b/client/modules/polyfill.js @@ -6,6 +6,6 @@ require('domtokenlist-shim'); const scrollIntoViewIfNeeded = require('scroll-into-view-if-needed').default; DOM.scrollIntoViewIfNeeded = (el) => scrollIntoViewIfNeeded(el, { - block: 'nearest' + block: 'nearest', }); diff --git a/client/modules/polyfill.spec.js b/client/modules/polyfill.spec.js index bbfb4653e0..d9bdf244d6 100644 --- a/client/modules/polyfill.spec.js +++ b/client/modules/polyfill.spec.js @@ -12,7 +12,7 @@ test('cloudcmd: client: polyfill: scrollIntoViewIfNeaded', (t) => { global.DOM = {}; mockRequire('scroll-into-view-if-needed', { - default: scroll + default: scroll, }); mockRequire.reRequire('./polyfill'); diff --git a/client/modules/terminal.js b/client/modules/terminal.js index bae9759713..e8463fd1a2 100644 --- a/client/modules/terminal.js +++ b/client/modules/terminal.js @@ -19,7 +19,7 @@ const TITLE = 'Terminal'; const {Dialog} = DOM; const { Key, - config + config, } = CloudCmd; CloudCmd.Terminal = exports; @@ -121,7 +121,7 @@ function show(callback) { Terminal.focus(); exec(callback); - } + }, }); } diff --git a/client/modules/upload.js b/client/modules/upload.js index 3397817d72..3d021fa470 100644 --- a/client/modules/upload.js +++ b/client/modules/upload.js @@ -37,7 +37,7 @@ function show() { '"Droid Sans Mono"', '"Ubuntu Mono"', '"Consolas"', - 'monospace' + 'monospace', ].join(', '); createElement('style', { @@ -46,7 +46,7 @@ function show() { `font-family: ${fontFamily};` + 'font-size: 20px;' + 'width: 97%' + - '}' + '}', }); } diff --git a/client/modules/view.js b/client/modules/view.js index 5e91a35a06..ac7b1e85d4 100644 --- a/client/modules/view.js +++ b/client/modules/view.js @@ -130,8 +130,8 @@ function viewMedia(path) { element .querySelector('audio, video') .focus(); - } - } + }, + }, }; modal.open(element, allConfig); @@ -158,7 +158,7 @@ function viewFile() { function initConfig(Config, options) { const config = { - ...Config + ...Config, }; if (!options) @@ -209,8 +209,8 @@ function viewImage(prefixURL) { arrows : true, keys : true, helpers : { - title : {} - } + title : {}, + }, }; const config = { @@ -229,7 +229,7 @@ function isImage(name) { 'bmp', 'webp', 'svg', - 'ico' + 'ico', ]; return images @@ -311,7 +311,7 @@ async function loadAll() { function onOverlayClick(event) { const position = { x: event.clientX, - y: event.clientY + y: event.clientY, }; setCurrentByPosition(position); diff --git a/client/sort.js b/client/sort.js index cfbad8b780..f46f61a206 100644 --- a/client/sort.js +++ b/client/sort.js @@ -7,7 +7,7 @@ const Info = DOM.CurrentInfo; const { sort, - order + order, } = CloudCmd; const position = DOM.getPanelPosition(); diff --git a/client/sw/sw.js b/client/sw/sw.js index db2f0b4743..eef1e63fac 100644 --- a/client/sw/sw.js +++ b/client/sw/sw.js @@ -39,7 +39,7 @@ const date = codegen`module.exports = '"' + Date() + '"'`; const NAME = `cloudcmd: ${date}`; const createRequest = (a) => new Request(a, { - credentials: 'same-origin' + credentials: 'same-origin', }); const getRequest = (a, request) => { @@ -82,7 +82,7 @@ async function onFetch(event) { return response; const [e, resp] = await tryToCatch(fetch, newRequest, { - credentials: 'same-origin' + credentials: 'same-origin', }); if (e) diff --git a/common/cloudfunc.js b/common/cloudfunc.js index a2b79f5266..aef0a2f0e7 100644 --- a/common/cloudfunc.js +++ b/common/cloudfunc.js @@ -109,7 +109,7 @@ const getDataName = (name) => { module.exports.buildFromJSON = (params) => { const { prefix, - template + template, } = params; const templateFile = template.file; @@ -168,7 +168,7 @@ module.exports.buildFromJSON = (params) => { const linkResult = rendy(template.link, { link, title : '..', - name : '..' + name : '..', }); const dataName = 'data-name="js-file-.." '; @@ -184,7 +184,7 @@ module.exports.buildFromJSON = (params) => { size : '<dir>', date : '--.--.----', owner : '.', - mode : '--- --- ---' + mode : '--- --- ---', }); } @@ -194,7 +194,7 @@ module.exports.buildFromJSON = (params) => { const { type, - mode + mode, } = file; const size = getSize(file); @@ -205,7 +205,7 @@ module.exports.buildFromJSON = (params) => { link, title: name, name, - attribute: getAttribute(file.type) + attribute: getAttribute(file.type), }); const dataName = getDataName(file.name); diff --git a/cssnano.config.js b/cssnano.config.js index b5b4d7b261..588d0e4672 100644 --- a/cssnano.config.js +++ b/cssnano.config.js @@ -9,7 +9,7 @@ module.exports = defaultPreset({ plugins: [ {convertPathData: false}, {convertShapeToPath: false}, - ] - } + ], + }, }); diff --git a/server/auth.js b/server/auth.js index 39e30d737f..ce1251705a 100644 --- a/server/auth.js +++ b/server/auth.js @@ -9,7 +9,7 @@ const config = require('./config'); module.exports = () => { const auth = httpAuth.basic({ - realm: 'Cloud Commander' + realm: 'Cloud Commander', }, check); return middle(auth); diff --git a/server/cloudcmd.js b/server/cloudcmd.js index 81703d4185..40b9c04327 100644 --- a/server/cloudcmd.js +++ b/server/cloudcmd.js @@ -220,16 +220,16 @@ function cloudcmd(prefix, plugins, modules) { restafary({ prefix: cloudfunc.apiURL + '/fs', - root + root, }), rest, route({ - html: defaultHtml + html: defaultHtml, }), pluginer(plugins), - ponseStatic + ponseStatic, ]); return funcs; diff --git a/server/cloudcmd.spec.js b/server/cloudcmd.spec.js index 5bee6a70f4..92b6c599c4 100644 --- a/server/cloudcmd.spec.js +++ b/server/cloudcmd.spec.js @@ -21,7 +21,7 @@ const {request} = require('serve-once')(cloudcmd, { config: { auth: false, dropbox: false, - } + }, }); test('cloudcmd: args: no', (t) => { @@ -33,7 +33,7 @@ test('cloudcmd: args: no', (t) => { test('cloudcmd: args: plugins: error', (t) => { const fn = () => cloudcmd({ - plugins: '' + plugins: '', }); t.throws(fn, /plugins should be an array!/, 'should throw when plugins not an array'); diff --git a/server/config.js b/server/config.js index 00704144b7..946c9efe4c 100644 --- a/server/config.js +++ b/server/config.js @@ -39,7 +39,7 @@ const ConfigHome = path.join(HOME, '.cloudcmd.json'); const readjsonSync = (name) => { return jju.parse(fs.readFileSync(name, 'utf8'), { - mode: 'json' + mode: 'json', }); }; @@ -172,7 +172,7 @@ function get(request, response) { name : 'config.json', request, response, - cache : false + cache : false, }); } diff --git a/server/config.spec.js b/server/config.spec.js index fb0a7abb5a..7c656dcbcd 100644 --- a/server/config.spec.js +++ b/server/config.spec.js @@ -22,7 +22,7 @@ test('config: manage: get', async (t) => { const editor = 'deepword'; const {done} = await connect({ - config: {editor} + config: {editor}, }); done(); @@ -34,7 +34,7 @@ test('config: manage: get', async (t) => { test('config: manage: get', async (t) => { const editor = 'deepword'; const conf = { - editor + editor, }; const {done} = await connect({config: conf}); @@ -103,7 +103,7 @@ test('config: middle: no', (t) => { const method = 'POST'; const req = { url, - method + method, }; middle(req, res, next); diff --git a/server/distribute/export.js b/server/distribute/export.js index cce470c26c..4bfc84ce36 100644 --- a/server/distribute/export.js +++ b/server/distribute/export.js @@ -16,7 +16,7 @@ const { makeColor, getMessage, getDescription, - logWraped + logWraped, } = log; const omitList = [ @@ -72,7 +72,7 @@ function getHost(socket) { const { name, port, - color + color, } = socket.handshake.query; if (!name) diff --git a/server/distribute/export.spec.js b/server/distribute/export.spec.js index bd28872bf7..d984adaf65 100644 --- a/server/distribute/export.spec.js +++ b/server/distribute/export.spec.js @@ -16,7 +16,7 @@ test('distribute: export', async (t) => { }; const {port, done} = await connect({ - config: defaultConfig + config: defaultConfig, }); const url = `http://localhost:${port}/distribute?port=${1111}`; @@ -49,7 +49,7 @@ test('distribute: export: config', async (t) => { }; const {port, done} = await connect({ - config: defaultConfig + config: defaultConfig, }); const url = `http://localhost:${port}/distribute?port=${1111}`; diff --git a/server/distribute/import.js b/server/distribute/import.js index a4ffa9a943..ba671579ce 100644 --- a/server/distribute/import.js +++ b/server/distribute/import.js @@ -21,7 +21,7 @@ const { stringToRGB, getMessage, getDescription, - logWraped + logWraped, } = log; const equal = (a, b) => `${a}=${b}`; @@ -54,7 +54,7 @@ const canceled = (f) => f(null, { }); const done = wraptile((fn, store) => fn(null, { - status: store() + status: store(), })); const emitAuth = wraptile((importUrl, socket) => { diff --git a/server/distribute/import.spec.js b/server/distribute/import.spec.js index be8d8c7ee8..e06eff3d05 100644 --- a/server/distribute/import.spec.js +++ b/server/distribute/import.spec.js @@ -16,7 +16,7 @@ test('distribute: import: canceled', async (t) => { import: false, importListen: false, log: false, - } + }, }); const {status} = await distribute.import(); @@ -34,7 +34,7 @@ test('distribute: import: received: no error', async (t) => { importListen: false, export: true, log: false, - } + }, }); config('importUrl', `http://localhost:${port}`); @@ -57,7 +57,7 @@ test('distribute: import: received', async (t) => { export: true, importListen: false, log: false, - } + }, }); config('importUrl', `http://localhost:${port}`); @@ -79,7 +79,7 @@ test('distribute: import: received: auth: reject', async (t) => { export: true, importListen: false, log: false, - } + }, }); config('importUrl', `http://localhost:${port}`); @@ -101,7 +101,7 @@ test('distribute: import: received: auth: accept', async (t) => { export: true, importListen: false, log: false, - } + }, }); config('importUrl', `http://localhost:${port}`); @@ -121,7 +121,7 @@ test('distribute: import: received: no name', async (t) => { export: true, importListen: false, log: false, - } + }, }); config('importUrl', `http://localhost:${port}`); @@ -140,7 +140,7 @@ test('distribute: import: error', async (t) => { export: false, importListen: false, log: false, - } + }, }); config('importUrl', `http://localhost:0`); @@ -162,7 +162,7 @@ test('distribute: import: config:change: no export', async (t) => { export: false, importListen: true, log: false, - } + }, }); const {status} = await distribute.import({ diff --git a/server/distribute/log.spec.js b/server/distribute/log.spec.js index 91a01a13d5..962700b766 100644 --- a/server/distribute/log.spec.js +++ b/server/distribute/log.spec.js @@ -15,7 +15,7 @@ test('distribute: log: getMessage', (t) => { test('distribute: log: getMessage: message', (t) => { const message = 'hello'; const result = log.getMessage({ - message + message, }); t.equal(result, message, 'should equal'); diff --git a/server/repl.js b/server/repl.js index 0fd8dbf7ef..43497a1460 100644 --- a/server/repl.js +++ b/server/repl.js @@ -13,7 +13,7 @@ module.exports = net.createServer((socket) => { input: socket, output: socket, terminal: true, - useGlobal: false + useGlobal: false, }); r.on('exit', () => { diff --git a/server/rest/index.js b/server/rest/index.js index dcddad0bdb..08d16034a4 100644 --- a/server/rest/index.js +++ b/server/rest/index.js @@ -121,7 +121,7 @@ function onGET(params, callback) { default: callback({ - message: 'Not Found' + message: 'Not Found', }); break; } @@ -139,7 +139,7 @@ function streamPack(cmd, response) { const filename = cmd.replace(getPackReg(), ''); const dir = path.dirname(filename); const names = [ - path.basename(filename) + path.basename(filename), ]; operation('pack', dir, response, names, noop); @@ -230,7 +230,7 @@ function pack(from, to, names, fn) { if (!names) { names = [ - path.basename(from) + path.basename(from), ]; from = path.dirname(from); @@ -264,7 +264,7 @@ function operation(op, from, to, names, fn) { if (!fn) { fn = names; names = [ - path.basename(from) + path.basename(from), ]; } diff --git a/server/root.spec.js b/server/root.spec.js index 28b02b25b6..783145c4da 100644 --- a/server/root.spec.js +++ b/server/root.spec.js @@ -27,7 +27,7 @@ test('cloudcmd: root: mellow', (t) => { const pathToWin = stub(); const mellow = { - pathToWin + pathToWin, }; mockRequire('mellow', mellow); diff --git a/server/route.js b/server/route.js index 003f6f711a..1995a99b7e 100644 --- a/server/route.js +++ b/server/route.js @@ -25,7 +25,7 @@ const prefix = squad(prefixer, apart(config, 'prefix')); const sendIndex = (params, data) => { const ponseParams = { ...params, - name: 'index.html' + name: 'index.html', }; ponse.send(data, ponseParams); @@ -97,7 +97,7 @@ async function route(options, request, response) { ponse.sendFile({ ...p, name: realPathError ? name : pathReal, - gzip: false + gzip: false, }); } @@ -142,7 +142,7 @@ function indexProcessing(options) { const left = rendy(Template.panel, { side : 'left', content : panel, - className : !oneFilePanel ? '' : 'panel-single' + className : !oneFilePanel ? '' : 'panel-single', }); let right = ''; @@ -150,7 +150,7 @@ function indexProcessing(options) { right = rendy(Template.panel, { side : 'right', content : panel, - className : '' + className : '', }); const name = config('name'); @@ -187,11 +187,11 @@ function hideKeysPanel(html) { const keysPanelRegExp = '