cloudcmd 18.0.2 → 18.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog +11 -0
- package/HELP.md +127 -122
- package/README.md +1 -1
- package/bin/cloudcmd.mjs +3 -0
- package/common/cloudfunc.js +11 -0
- package/dist/cloudcmd.common.js +3 -3
- package/dist/cloudcmd.common.js.map +1 -1
- package/dist/cloudcmd.css +1 -1
- package/dist/cloudcmd.js +1 -1
- package/dist/cloudcmd.js.map +1 -1
- package/dist/modules/cloud.js +1 -1
- package/dist/modules/cloud.js.map +1 -1
- package/dist/modules/command-line.js +1 -1
- package/dist/modules/command-line.js.map +1 -1
- package/dist/modules/config.js +1 -1
- package/dist/modules/config.js.map +1 -1
- package/dist/modules/contact.js +1 -1
- package/dist/modules/contact.js.map +1 -1
- package/dist/modules/edit-file-vim.js +1 -1
- package/dist/modules/edit-file-vim.js.map +1 -1
- package/dist/modules/edit-file.js +1 -1
- package/dist/modules/edit-file.js.map +1 -1
- package/dist/modules/edit-names-vim.js +1 -1
- package/dist/modules/edit-names-vim.js.map +1 -1
- package/dist/modules/edit-names.js +1 -1
- package/dist/modules/edit-names.js.map +1 -1
- package/dist/modules/edit.js +1 -1
- package/dist/modules/edit.js.map +1 -1
- package/dist/modules/help.js +1 -1
- package/dist/modules/help.js.map +1 -1
- package/dist/modules/konsole.js +1 -1
- package/dist/modules/konsole.js.map +1 -1
- package/dist/modules/markdown.js +1 -1
- package/dist/modules/markdown.js.map +1 -1
- package/dist/modules/menu.js +1 -1
- package/dist/modules/menu.js.map +1 -1
- package/dist/modules/operation.js +1 -1
- package/dist/modules/operation.js.map +1 -1
- package/dist/modules/polyfill.js +1 -1
- package/dist/modules/polyfill.js.map +1 -1
- package/dist/modules/terminal-run.js +1 -1
- package/dist/modules/terminal-run.js.map +1 -1
- package/dist/modules/terminal.js +1 -1
- package/dist/modules/terminal.js.map +1 -1
- package/dist/modules/upload.js +1 -1
- package/dist/modules/upload.js.map +1 -1
- package/dist/modules/user-menu.js +1 -1
- package/dist/modules/user-menu.js.map +1 -1
- package/dist/modules/view.js +1 -1
- package/dist/modules/view.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist-dev/cloudcmd.common.js +4 -132
- package/dist-dev/cloudcmd.css +11 -6
- package/dist-dev/cloudcmd.js +2 -2
- package/dist-dev/modules/menu.js +1 -1
- package/dist-dev/modules/terminal-run.js +1 -1
- package/dist-dev/sw.js +1 -1
- package/font/fontello.eot +0 -0
- package/font/fontello.json +6 -0
- package/font/fontello.svg +2 -0
- package/font/fontello.ttf +0 -0
- package/font/fontello.woff +0 -0
- package/font/fontello.woff2 +0 -0
- package/json/config.json +1 -0
- package/json/help.json +2 -0
- package/man/cloudcmd.1 +2 -0
- package/package.json +3 -3
- package/server/route.mjs +1 -0
- package/server/user-menu.mjs +5 -5
- package/tmpl/config.hbs +6 -0
package/dist-dev/cloudcmd.js
CHANGED
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
/***/ (function(module, exports, __webpack_require__) {
|
|
164
164
|
|
|
165
165
|
"use strict";
|
|
166
|
-
eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n\n/* global DOM */\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst {\n addSlashToEnd\n} = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\nconst pascalCase = __webpack_require__(/*! just-pascal-case */ \"./node_modules/just-pascal-case/index.cjs\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst Images = __webpack_require__(/*! ./dom/images */ \"./client/dom/images.js\");\nconst {\n unregisterSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst getJsonFromFileTable = __webpack_require__(/*! ./get-json-from-file-table */ \"./client/get-json-from-file-table.js\");\nconst Key = __webpack_require__(/*! ./key */ \"./client/key/index.js\");\nconst {\n apiURL,\n formatMsg,\n buildFromJSON\n} = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst loadModule = __webpack_require__(/*! ./load-module */ \"./client/load-module.js\");\nconst noJS = a => a.replace(/.js$/, '');\nconst isDev = process.env.NODE_ENV === 'development';\ninherits(CloudCmdProto, Emitify);\nmodule.exports = new CloudCmdProto(DOM);\nload.addErrorListener((e, src) => {\n const msg = `file ${src} could not be loaded`;\n Images.show.error(msg);\n});\nfunction CloudCmdProto(DOM) {\n let Listeners;\n Emitify.call(this);\n const CloudCmd = this;\n const Info = DOM.CurrentInfo;\n const {\n Storage,\n Files\n } = DOM;\n this.log = (...a) => {\n if (!isDev) return;\n console.log(...a);\n };\n this.prefix = '';\n this.prefixSocket = '';\n this.prefixURL = '';\n this.MIN_ONE_PANEL_WIDTH = 1155;\n this.HOST = location.origin || location.protocol + '//' + location.host;\n this.TITLE = 'Cloud Commander';\n this.sort = {\n left: 'name',\n right: 'name'\n };\n this.order = {\n left: 'asc',\n right: 'asc'\n };\n this.changeDir = async (path, overrides = {}) => {\n const {\n isRefresh,\n panel,\n history = true,\n noCurrent,\n currentName\n } = overrides;\n const refresh = isRefresh;\n let panelChanged;\n if (!noCurrent && panel && panel !== Info.panel) {\n DOM.changePanel();\n panelChanged = true;\n }\n let imgPosition;\n if (panelChanged || refresh || !history) imgPosition = 'top';\n Images.show.load(imgPosition, panel);\n /* загружаем содержимое каталога */\n await ajaxLoad(addSlashToEnd(path), {\n refresh,\n history,\n noCurrent,\n currentName\n }, panel);\n };\n\n /**\n * Конструктор CloudClient, который\n * выполняет весь функционал по\n * инициализации\n */\n this.init = async (prefix, config) => {\n CloudCmd.prefix = prefix;\n CloudCmd.prefixURL = `${prefix}${apiURL}`;\n CloudCmd.prefixSocket = config.prefixSocket;\n CloudCmd.DIR_DIST = `${prefix}/dist`;\n CloudCmd.DIR_MODULES = `${this.DIR_DIST}/modules`;\n CloudCmd.config = key => config[key];\n CloudCmd.config.if = currify((key, fn, a) => config[key] && fn(a));\n CloudCmd._config = (key, value) => {\n /*\n * should be called from config.js only\n * after successful update on server\n */\n if (key === 'password') return;\n config[key] = value;\n };\n if (config.oneFilePanel) CloudCmd.MIN_ONE_PANEL_WIDTH = Infinity;\n if (!document.body.scrollIntoViewIfNeeded) await load.js(`${CloudCmd.DIR_MODULES}/polyfill.js`);\n await initModules();\n await baseInit();\n await loadStyle();\n CloudCmd.route(location.hash);\n };\n async function loadStyle() {\n const {\n prefix\n } = CloudCmd;\n const name = `${prefix}/dist/cloudcmd.common.css`;\n await load.css(name);\n }\n this.route = path => {\n const query = path.split('/');\n if (!path) return;\n const [kebabModule] = query;\n const module = noJS(pascalCase(kebabModule.slice(1)));\n const file = query[1];\n const current = DOM.getCurrentByName(file);\n if (file && !current) {\n const msg = formatMsg('set current file', file, 'error');\n CloudCmd.log(msg);\n return;\n }\n DOM.setCurrentFile(current);\n CloudCmd.execFromModule(module, 'show');\n };\n this.logOut = async () => {\n const url = CloudCmd.prefix + '/logout';\n const error = () => document.location.reload();\n const {\n prefix\n } = CloudCmd;\n await DOM.Storage.clear();\n unregisterSW(prefix);\n DOM.load.ajax({\n url,\n error\n });\n };\n const initModules = async () => {\n CloudCmd.Key = Key;\n CloudCmd.Key.bind();\n const [, modules] = await tryToCatch(Files.get, 'modules');\n const showLoad = Images.show.load;\n const doBefore = {\n edit: showLoad,\n menu: showLoad\n };\n const load = (name, path, dobefore) => {\n loadModule({\n name,\n path,\n dobefore\n });\n };\n if (!modules) return;\n for (const module of modules.local) {\n load(null, module, doBefore[module]);\n }\n };\n async function saveCurrentName(currentName) {\n await Storage.set('current-name', currentName);\n }\n async function baseInit() {\n const files = DOM.getFiles();\n CloudCmd.on('current-file', DOM.updateCurrentInfo);\n CloudCmd.on('current-name', saveCurrentName);\n const name = await Storage.get('current-name');\n const currentFile = name && DOM.getCurrentByName(name) || files[0];\n\n /* выделяем строку с первым файлом */\n if (files) DOM.setCurrentFile(currentFile, {\n // when hash is present\n // it should be handled with this.route\n // overwre otherwise\n history: !location.hash\n });\n const dirPath = DOM.getCurrentDirPath();\n Listeners = CloudCmd.Listeners;\n Listeners.init();\n const panels = getPanels();\n panels.forEach(Listeners.setOnPanel);\n Listeners.initKeysPanel();\n if (!CloudCmd.config('dirStorage')) return;\n const data = await Storage.get(dirPath);\n if (!data) await Storage.setJson(dirPath, getJsonFromFileTable());\n }\n function getPanels() {\n const panels = ['left'];\n if (CloudCmd.config('oneFilePanel')) return panels;\n return [...panels, 'right'];\n }\n this.execFromModule = async (moduleName, funcName, ...args) => {\n await CloudCmd[moduleName]();\n const func = CloudCmd[moduleName][funcName];\n func(...args);\n };\n this.refresh = async (options = {}) => {\n const {\n panel = Info.panel,\n currentName\n } = options;\n const path = DOM.getCurrentDirPath(panel);\n const isRefresh = true;\n const history = false;\n const noCurrent = options === null || options === void 0 ? void 0 : options.noCurrent;\n await CloudCmd.changeDir(path, {\n isRefresh,\n history,\n panel,\n noCurrent,\n currentName\n });\n };\n\n /**\n * Функция загружает json-данные о Файловой Системе\n * через ajax-запрос.\n * @param path - каталог для чтения\n * @param options\n * { refresh, history } - необходимость обновить данные о каталоге\n * @param panel\n * @param callback\n *\n */\n async function ajaxLoad(path, options = {}, panel) {\n const {\n RESTful\n } = DOM;\n CloudCmd.log(`reading dir: \"${path}\";`);\n const dirStorage = CloudCmd.config('dirStorage');\n const json = dirStorage && (await Storage.getJson(path));\n const name = options.currentName || Info.name;\n const {\n noCurrent,\n refresh\n } = options;\n if (!refresh && json) return await createFileTable(json, panel, options);\n const position = DOM.getPanelPosition(panel);\n const sort = CloudCmd.sort[position];\n const order = CloudCmd.order[position];\n const query = rendy('?sort={{ sort }}&order={{ order }}', {\n sort,\n order\n });\n const [, newObj] = await RESTful.read(path + query, 'json');\n if (!newObj)\n // that's OK, error handled by RESTful\n return;\n options.sort = sort;\n options.order = order;\n await createFileTable(newObj, panel, options);\n if (refresh && !noCurrent) DOM.setCurrentByName(name);\n if (!CloudCmd.config('dirStorage')) return;\n Storage.setJson(path, newObj);\n }\n\n /**\n * Функция строит файловую таблицу\n * @param json - данные о файлах\n * @param panelParam\n * @param history\n * @param callback\n */\n async function createFileTable(data, panelParam, options) {\n const {\n history,\n noCurrent\n } = options;\n const names = ['file', 'path', 'link', 'pathLink'];\n const [error, [file, path, link, pathLink]] = await tryToCatch(Files.get, names);\n if (error) return DOM.Dialog.alert(error.responseText);\n const panel = panelParam || DOM.getPanel();\n const {\n prefix\n } = CloudCmd;\n const {\n dir,\n name\n } = Info;\n const {\n childNodes\n } = panel;\n let i = childNodes.length;\n while (i--) panel.removeChild(panel.lastChild);\n panel.innerHTML = buildFromJSON({\n sort: options.sort,\n order: options.order,\n data,\n id: panel.id,\n prefix,\n template: {\n file,\n path,\n pathLink,\n link\n }\n });\n Listeners.setOnPanel(panel);\n if (!noCurrent) {\n let current;\n if (name === '..' && dir !== '/') current = DOM.getCurrentByName(dir);\n if (!current) [current] = DOM.getFiles(panel);\n DOM.setCurrentFile(current, {\n history\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n }\n }\n this.goToParentDir = async () => {\n const {\n dir,\n dirPath,\n parentDirPath,\n panel\n } = Info;\n if (dirPath === parentDirPath) return;\n const path = parentDirPath;\n await CloudCmd.changeDir(path);\n const current = DOM.getCurrentByName(dir);\n const [first] = DOM.getFiles(panel);\n DOM.setCurrentFile(current || first, {\n history\n });\n };\n}\n\n//# sourceURL=file://cloudcmd/client/client.js");
|
|
166
|
+
eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n\n/* global DOM */\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst {\n addSlashToEnd\n} = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\nconst pascalCase = __webpack_require__(/*! just-pascal-case */ \"./node_modules/just-pascal-case/index.cjs\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst Images = __webpack_require__(/*! ./dom/images */ \"./client/dom/images.js\");\nconst {\n unregisterSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst getJsonFromFileTable = __webpack_require__(/*! ./get-json-from-file-table */ \"./client/get-json-from-file-table.js\");\nconst Key = __webpack_require__(/*! ./key */ \"./client/key/index.js\");\nconst {\n apiURL,\n formatMsg,\n buildFromJSON\n} = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst loadModule = __webpack_require__(/*! ./load-module */ \"./client/load-module.js\");\nconst noJS = a => a.replace(/.js$/, '');\nconst isDev = process.env.NODE_ENV === 'development';\ninherits(CloudCmdProto, Emitify);\nmodule.exports = new CloudCmdProto(DOM);\nload.addErrorListener((e, src) => {\n const msg = `file ${src} could not be loaded`;\n Images.show.error(msg);\n});\nfunction CloudCmdProto(DOM) {\n let Listeners;\n Emitify.call(this);\n const CloudCmd = this;\n const Info = DOM.CurrentInfo;\n const {\n Storage,\n Files\n } = DOM;\n this.log = (...a) => {\n if (!isDev) return;\n console.log(...a);\n };\n this.prefix = '';\n this.prefixSocket = '';\n this.prefixURL = '';\n this.MIN_ONE_PANEL_WIDTH = 1155;\n this.HOST = location.origin || location.protocol + '//' + location.host;\n this.TITLE = 'Cloud Commander';\n this.sort = {\n left: 'name',\n right: 'name'\n };\n this.order = {\n left: 'asc',\n right: 'asc'\n };\n this.changeDir = async (path, overrides = {}) => {\n const {\n isRefresh,\n panel,\n history = true,\n noCurrent,\n currentName\n } = overrides;\n const refresh = isRefresh;\n let panelChanged;\n if (!noCurrent && panel && panel !== Info.panel) {\n DOM.changePanel();\n panelChanged = true;\n }\n let imgPosition;\n if (panelChanged || refresh || !history) imgPosition = 'top';\n Images.show.load(imgPosition, panel);\n /* загружаем содержимое каталога */\n await ajaxLoad(addSlashToEnd(path), {\n refresh,\n history,\n noCurrent,\n currentName,\n showDotFiles: CloudCmd.config('showDotFiles')\n }, panel);\n };\n\n /**\n * Конструктор CloudClient, который\n * выполняет весь функционал по\n * инициализации\n */\n this.init = async (prefix, config) => {\n CloudCmd.prefix = prefix;\n CloudCmd.prefixURL = `${prefix}${apiURL}`;\n CloudCmd.prefixSocket = config.prefixSocket;\n CloudCmd.DIR_DIST = `${prefix}/dist`;\n CloudCmd.DIR_MODULES = `${this.DIR_DIST}/modules`;\n CloudCmd.config = key => config[key];\n CloudCmd.config.if = currify((key, fn, a) => config[key] && fn(a));\n CloudCmd._config = (key, value) => {\n /*\n * should be called from config.js only\n * after successful update on server\n */\n if (key === 'password') return;\n config[key] = value;\n };\n if (config.oneFilePanel) CloudCmd.MIN_ONE_PANEL_WIDTH = Infinity;\n if (!document.body.scrollIntoViewIfNeeded) await load.js(`${CloudCmd.DIR_MODULES}/polyfill.js`);\n await initModules();\n await baseInit();\n await loadStyle();\n CloudCmd.route(location.hash);\n };\n async function loadStyle() {\n const {\n prefix\n } = CloudCmd;\n const name = `${prefix}/dist/cloudcmd.common.css`;\n await load.css(name);\n }\n this.route = path => {\n const query = path.split('/');\n if (!path) return;\n const [kebabModule] = query;\n const module = noJS(pascalCase(kebabModule.slice(1)));\n const file = query[1];\n const current = DOM.getCurrentByName(file);\n if (file && !current) {\n const msg = formatMsg('set current file', file, 'error');\n CloudCmd.log(msg);\n return;\n }\n DOM.setCurrentFile(current);\n CloudCmd.execFromModule(module, 'show');\n };\n this.logOut = async () => {\n const url = CloudCmd.prefix + '/logout';\n const error = () => document.location.reload();\n const {\n prefix\n } = CloudCmd;\n await DOM.Storage.clear();\n unregisterSW(prefix);\n DOM.load.ajax({\n url,\n error\n });\n };\n const initModules = async () => {\n CloudCmd.Key = Key;\n CloudCmd.Key.bind();\n const [, modules] = await tryToCatch(Files.get, 'modules');\n const showLoad = Images.show.load;\n const doBefore = {\n edit: showLoad,\n menu: showLoad\n };\n const load = (name, path, dobefore) => {\n loadModule({\n name,\n path,\n dobefore\n });\n };\n if (!modules) return;\n for (const module of modules.local) {\n load(null, module, doBefore[module]);\n }\n };\n async function saveCurrentName(currentName) {\n await Storage.set('current-name', currentName);\n }\n async function baseInit() {\n const files = DOM.getFiles();\n CloudCmd.on('current-file', DOM.updateCurrentInfo);\n CloudCmd.on('current-name', saveCurrentName);\n const name = await Storage.get('current-name');\n const currentFile = name && DOM.getCurrentByName(name) || files[0];\n\n /* выделяем строку с первым файлом */\n if (files) DOM.setCurrentFile(currentFile, {\n // when hash is present\n // it should be handled with this.route\n // overwre otherwise\n history: !location.hash\n });\n const dirPath = DOM.getCurrentDirPath();\n Listeners = CloudCmd.Listeners;\n Listeners.init();\n const panels = getPanels();\n panels.forEach(Listeners.setOnPanel);\n Listeners.initKeysPanel();\n if (!CloudCmd.config('dirStorage')) return;\n const data = await Storage.get(dirPath);\n if (!data) await Storage.setJson(dirPath, getJsonFromFileTable());\n }\n function getPanels() {\n const panels = ['left'];\n if (CloudCmd.config('oneFilePanel')) return panels;\n return [...panels, 'right'];\n }\n this.execFromModule = async (moduleName, funcName, ...args) => {\n await CloudCmd[moduleName]();\n const func = CloudCmd[moduleName][funcName];\n func(...args);\n };\n this.refresh = async (options = {}) => {\n const {\n panel = Info.panel,\n currentName\n } = options;\n const path = DOM.getCurrentDirPath(panel);\n const isRefresh = true;\n const history = false;\n const noCurrent = options === null || options === void 0 ? void 0 : options.noCurrent;\n await CloudCmd.changeDir(path, {\n isRefresh,\n history,\n panel,\n noCurrent,\n currentName\n });\n };\n\n /**\n * Функция загружает json-данные о Файловой Системе\n * через ajax-запрос.\n * @param path - каталог для чтения\n * @param options\n * { refresh, history } - необходимость обновить данные о каталоге\n * @param panel\n *\n */\n async function ajaxLoad(path, options = {}, panel) {\n const {\n RESTful\n } = DOM;\n CloudCmd.log(`reading dir: \"${path}\";`);\n const dirStorage = CloudCmd.config('dirStorage');\n const json = dirStorage && (await Storage.getJson(path));\n const name = options.currentName || Info.name;\n const {\n noCurrent,\n refresh\n } = options;\n if (!refresh && json) return await createFileTable(json, panel, options);\n const position = DOM.getPanelPosition(panel);\n const sort = CloudCmd.sort[position];\n const order = CloudCmd.order[position];\n const query = rendy('?sort={{ sort }}&order={{ order }}', {\n sort,\n order\n });\n const [, newObj] = await RESTful.read(path + query, 'json');\n if (!newObj)\n // that's OK, error handled by RESTful\n return;\n options.sort = sort;\n options.order = order;\n await createFileTable(newObj, panel, options);\n if (refresh && !noCurrent) DOM.setCurrentByName(name);\n if (!CloudCmd.config('dirStorage')) return;\n Storage.setJson(path, newObj);\n }\n\n /**\n * Функция строит файловую таблицу\n * @param data - данные о файлах\n * @param panelParam\n * @param options - history, noCurrent, showDotFiles\n */\n async function createFileTable(data, panelParam, options) {\n const {\n history,\n noCurrent,\n showDotFiles\n } = options;\n const names = ['file', 'path', 'link', 'pathLink'];\n const [error, [file, path, link, pathLink]] = await tryToCatch(Files.get, names);\n if (error) return DOM.Dialog.alert(error.responseText);\n const panel = panelParam || DOM.getPanel();\n const {\n prefix\n } = CloudCmd;\n const {\n dir,\n name\n } = Info;\n const {\n childNodes\n } = panel;\n let i = childNodes.length;\n while (i--) panel.removeChild(panel.lastChild);\n panel.innerHTML = buildFromJSON({\n sort: options.sort,\n order: options.order,\n data,\n id: panel.id,\n prefix,\n showDotFiles,\n template: {\n file,\n path,\n pathLink,\n link\n }\n });\n Listeners.setOnPanel(panel);\n if (!noCurrent) {\n let current;\n if (name === '..' && dir !== '/') current = DOM.getCurrentByName(dir);\n if (!current) [current] = DOM.getFiles(panel);\n DOM.setCurrentFile(current, {\n history\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n }\n }\n this.goToParentDir = async () => {\n const {\n dir,\n dirPath,\n parentDirPath,\n panel\n } = Info;\n if (dirPath === parentDirPath) return;\n const path = parentDirPath;\n await CloudCmd.changeDir(path);\n const current = DOM.getCurrentByName(dir);\n const [first] = DOM.getFiles(panel);\n DOM.setCurrentFile(current || first, {\n history\n });\n };\n}\n\n//# sourceURL=file://cloudcmd/client/client.js");
|
|
167
167
|
|
|
168
168
|
/***/ }),
|
|
169
169
|
|
|
@@ -223,7 +223,7 @@ eval("\n\nmodule.exports.createBinder = () => {\n let binded = false;\n return
|
|
|
223
223
|
/***/ (function(module, exports, __webpack_require__) {
|
|
224
224
|
|
|
225
225
|
"use strict";
|
|
226
|
-
eval("\n\n/* global CloudCmd, DOM */\nconst clipboard = __webpack_require__(/*! @cloudcmd/clipboard */ \"./node_modules/@cloudcmd/clipboard/lib/clipboard.js\");\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst Buffer = __webpack_require__(/*! ../dom/buffer */ \"./client/dom/buffer.js\");\nconst Events = __webpack_require__(/*! ../dom/events */ \"./client/dom/events/index.js\");\nconst KEY = __webpack_require__(/*! ./key */ \"./client/key/key.js\");\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/index.js\");\nconst setCurrentByChar = __webpack_require__(/*! ./set-current-by-char */ \"./client/key/set-current-by-char.js\");\nconst {\n createBinder\n} = __webpack_require__(/*! ./binder */ \"./client/key/binder.js\");\nconst Info = DOM.CurrentInfo;\nconst Chars = fullstore();\nconst toggleVim = keyCode => {\n const {\n _config,\n config\n } = CloudCmd;\n if (keyCode === KEY.ESC) _config('vim', !config('vim'));\n};\nconst isUndefined = a => typeof a === 'undefined';\nChars([]);\nconst {\n assign\n} = Object;\nconst binder = createBinder();\nmodule.exports = assign(binder, KEY);\nmodule.exports.bind = () => {\n Events.addKey(listener, true);\n binder.setBind();\n};\nmodule.exports._listener = listener;\nfunction getChar(event) {\n /*\n * event.keyIdentifier deprecated in chrome v51\n * but event.key is absent in chrome <= v51\n */\n const {\n key,\n shift,\n keyCode,\n keyIdentifier\n } = event;\n const char = key || fromCharCode(keyIdentifier);\n const symbol = getSymbol(shift, keyCode);\n return [symbol, char];\n}\nasync function listener(event) {\n const {\n keyCode\n } = event;\n\n // strange chrome bug calles listener twice\n // in second time event misses a lot fields\n if (isUndefined(event.altKey)) return;\n const alt = event.altKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const isBetween = keyCode >= KEY.ZERO && keyCode <= KEY.Z;\n const isNumpad = /Numpad/.test(event.code);\n const [symbol, char] = getChar(event);\n if (!binder.isBind()) return;\n toggleVim(keyCode);\n const isVim = CloudCmd.config('vim');\n if (!isVim && !isNumpad && !alt && !ctrl && !meta && (isBetween || symbol)) return setCurrentByChar(char, Chars);\n Chars([]);\n await switchKey(event);\n if (keyCode >= KEY.F1 && keyCode <= KEY.F10) return;\n if (isVim) vim(char, event);\n}\nfunction getSymbol(shift, keyCode) {\n switch (keyCode) {\n case KEY.DOT:\n return '.';\n case KEY.HYPHEN:\n return shift ? '_' : '-';\n case KEY.EQUAL:\n return shift ? '+' : '=';\n }\n return '';\n}\nfunction fromCharCode(keyIdentifier) {\n const code = keyIdentifier.substring(2);\n const hex = parseInt(code, 16);\n return String.fromCharCode(hex);\n}\nasync function switchKey(event) {\n let i;\n let isSelected;\n let prev;\n let next;\n let current = Info.element;\n let dataName;\n const {\n name,\n panel,\n path,\n isDir\n } = Info;\n const {\n Operation,\n changeDir,\n config\n } = CloudCmd;\n const {\n keyCode\n } = event;\n const alt = event.altKey;\n const shift = event.shiftKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n if (current) {\n prev = current.previousSibling;\n next = current.nextSibling;\n }\n switch (keyCode) {\n case KEY.TAB:\n DOM.changePanel();\n event.preventDefault();\n break;\n case KEY.INSERT:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n case KEY.INSERT_MAC:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n case KEY.DELETE:\n if (shift) Operation.show('delete:silent');else Operation.show('delete');\n break;\n case KEY.ASTERISK:\n DOM.toggleAllSelectedFiles(current);\n break;\n case KEY.PLUS:\n DOM.expandSelection();\n event.preventDefault();\n break;\n case KEY.MINUS:\n DOM.shrinkSelection();\n event.preventDefault();\n break;\n case KEY.F1:\n CloudCmd.Help.show();\n event.preventDefault();\n break;\n case KEY.F2:\n CloudCmd.UserMenu.show();\n break;\n case KEY.F3:\n event.preventDefault();\n if (Info.isDir) await changeDir(path);else if (shift) CloudCmd.View.show(null, {\n raw: true\n });else if (ctrlMeta) CloudCmd.sortPanel('name');else CloudCmd.View.show();\n break;\n case KEY.F4:\n if (config('vim')) CloudCmd.EditFileVim.show();else CloudCmd.EditFile.show();\n event.preventDefault();\n break;\n case KEY.F5:\n if (ctrlMeta) CloudCmd.sortPanel('date');else if (alt) Operation.show('pack');else Operation.show('copy');\n event.preventDefault();\n break;\n case KEY.F6:\n if (ctrlMeta) CloudCmd.sortPanel('size');else if (shift) DOM.renameCurrent(current);else Operation.show('move');\n event.preventDefault();\n break;\n case KEY.F7:\n if (shift) DOM.promptNewFile();else DOM.promptNewDir();\n event.preventDefault();\n break;\n case KEY.F8:\n Operation.show('delete');\n event.preventDefault();\n break;\n case KEY.F9:\n if (alt) Operation.show('extract');else CloudCmd.Menu.show();\n event.preventDefault();\n break;\n case KEY.F10:\n CloudCmd.Config.show();\n event.preventDefault();\n break;\n case KEY.TRA:\n event.preventDefault();\n if (shift) return CloudCmd.Terminal.show();\n CloudCmd.Konsole.show();\n break;\n case KEY.BRACKET_CLOSE:\n CloudCmd.Konsole.show();\n event.preventDefault();\n break;\n case KEY.SPACE:\n event.preventDefault();\n if (!isDir || name === '..') isSelected = true;else isSelected = DOM.isSelected(current);\n if (!isSelected) await DOM.loadCurrentSize(current);\n DOM.toggleSelectedFile(current);\n break;\n case KEY.U:\n if (ctrlMeta) {\n DOM.swapPanels();\n event.preventDefault();\n }\n break;\n\n /* navigation on file table: *\n * in case of pressing button 'up', *\n * select previous row */\n case KEY.UP:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(prev);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'down', *\n * select next row */\n case KEY.DOWN:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(next);\n event.preventDefault();\n break;\n case KEY.LEFT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-right') DOM.duplicatePanel();\n break;\n case KEY.RIGHT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-left') DOM.duplicatePanel();\n break;\n\n /* in case of pressing button 'Home', *\n * go to top element */\n case KEY.HOME:\n DOM.setCurrentFile(Info.first);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'End', select last element */\n case KEY.END:\n DOM.setCurrentFile(Info.last);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page down проматываем экран */\n case KEY.PAGE_DOWN:\n DOM.scrollByPages(panel, 1);\n for (i = 0; i < 30; i++) {\n if (!current.nextSibling) break;\n current = current.nextSibling;\n }\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page up проматываем экран */\n case KEY.PAGE_UP:\n DOM.scrollByPages(panel, -1);\n for (i = 0; i < 30; i++) {\n if (!current.previousSibling) break;\n current = current.previousSibling;\n }\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n case KEY.ENTER:\n if (Info.isDir) await changeDir(path);else CloudCmd.View.show();\n break;\n case KEY.BACKSPACE:\n CloudCmd.goToParentDir();\n event.preventDefault();\n break;\n case KEY.BACKSLASH:\n if (ctrlMeta) await changeDir('/');\n break;\n case KEY.A:\n if (ctrlMeta) {\n DOM.selectAllFiles();\n event.preventDefault();\n }\n break;\n case KEY.G:\n if (alt) {\n DOM.goToDirectory();\n event.preventDefault();\n }\n break;\n case KEY.M:\n if (ctrlMeta) {\n if (config('vim')) CloudCmd.EditNamesVim.show();else CloudCmd.EditNames.show();\n event.preventDefault();\n }\n break;\n case KEY.P:\n if (!ctrlMeta) return;\n event.preventDefault();\n clipboard.writeText(Info.dirPath).catch(CloudCmd.log);\n break;\n\n /**\n * обновляем страницу,\n * загружаем содержимое каталога\n * при этом данные берём всегда с\n * сервера, а не из кэша\n * (обновляем кэш)\n */\n case KEY.R:\n if (ctrlMeta) {\n CloudCmd.log('reloading page...\\n');\n CloudCmd.refresh();\n event.preventDefault();\n }\n break;\n case KEY.C:\n if (ctrlMeta) Buffer.copy();\n break;\n case KEY.X:\n if (ctrlMeta) Buffer.cut();\n break;\n case KEY.V:\n if (ctrlMeta) Buffer.paste();\n break;\n case KEY.Z:\n if (ctrlMeta) Buffer.clear();\n break;\n case KEY.COLON:\n CloudCmd.CommandLine.show();\n event.preventDefault();\n break;\n\n /* чистим хранилище */\n case KEY.D:\n if (ctrlMeta) {\n CloudCmd.log('clearing storage...');\n await DOM.Storage.clear();\n CloudCmd.log('storage cleared');\n event.preventDefault();\n }\n break;\n }\n}\n\n//# sourceURL=file://cloudcmd/client/key/index.js");
|
|
226
|
+
eval("\n\n/* global CloudCmd, DOM */\nconst clipboard = __webpack_require__(/*! @cloudcmd/clipboard */ \"./node_modules/@cloudcmd/clipboard/lib/clipboard.js\");\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst Buffer = __webpack_require__(/*! ../dom/buffer */ \"./client/dom/buffer.js\");\nconst Events = __webpack_require__(/*! ../dom/events */ \"./client/dom/events/index.js\");\nconst KEY = __webpack_require__(/*! ./key */ \"./client/key/key.js\");\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/index.js\");\nconst setCurrentByChar = __webpack_require__(/*! ./set-current-by-char */ \"./client/key/set-current-by-char.js\");\nconst {\n createBinder\n} = __webpack_require__(/*! ./binder */ \"./client/key/binder.js\");\nconst Info = DOM.CurrentInfo;\nconst Chars = fullstore();\nconst toggleVim = keyCode => {\n const {\n _config,\n config\n } = CloudCmd;\n if (keyCode === KEY.ESC) _config('vim', !config('vim'));\n};\nconst isUndefined = a => typeof a === 'undefined';\nChars([]);\nconst {\n assign\n} = Object;\nconst binder = createBinder();\nmodule.exports = assign(binder, KEY);\nmodule.exports.bind = () => {\n Events.addKey(listener, true);\n binder.setBind();\n};\nmodule.exports._listener = listener;\nfunction getChar(event) {\n /*\n * event.keyIdentifier deprecated in chrome v51\n * but event.key is absent in chrome <= v51\n */\n const {\n key,\n shift,\n keyCode,\n keyIdentifier\n } = event;\n const char = key || fromCharCode(keyIdentifier);\n const symbol = getSymbol(shift, keyCode);\n return [symbol, char];\n}\nasync function listener(event) {\n const {\n keyCode\n } = event;\n\n // strange chrome bug calles listener twice\n // in second time event misses a lot fields\n if (isUndefined(event.altKey)) return;\n const alt = event.altKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const isBetween = keyCode >= KEY.ZERO && keyCode <= KEY.Z;\n const isNumpad = /Numpad/.test(event.code);\n const [symbol, char] = getChar(event);\n if (!binder.isBind()) return;\n toggleVim(keyCode);\n const isVim = CloudCmd.config('vim');\n if (!isVim && !isNumpad && !alt && !ctrl && !meta && (isBetween || symbol)) return setCurrentByChar(char, Chars);\n Chars([]);\n await switchKey(event);\n if (keyCode >= KEY.F1 && keyCode <= KEY.F10) return;\n if (isVim) vim(char, event);\n}\nfunction getSymbol(shift, keyCode) {\n switch (keyCode) {\n case KEY.DOT:\n return '.';\n case KEY.HYPHEN:\n return shift ? '_' : '-';\n case KEY.EQUAL:\n return shift ? '+' : '=';\n }\n return '';\n}\nfunction fromCharCode(keyIdentifier) {\n const code = keyIdentifier.substring(2);\n const hex = parseInt(code, 16);\n return String.fromCharCode(hex);\n}\nasync function switchKey(event) {\n let i;\n let isSelected;\n let prev;\n let next;\n let current = Info.element;\n let dataName;\n const {\n name,\n panel,\n path,\n isDir\n } = Info;\n const {\n Operation,\n changeDir,\n config\n } = CloudCmd;\n const {\n keyCode\n } = event;\n const alt = event.altKey;\n const shift = event.shiftKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n if (current) {\n prev = current.previousSibling;\n next = current.nextSibling;\n }\n switch (keyCode) {\n case KEY.TAB:\n DOM.changePanel();\n event.preventDefault();\n break;\n case KEY.INSERT:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n case KEY.INSERT_MAC:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n case KEY.DELETE:\n if (shift) Operation.show('delete:silent');else Operation.show('delete');\n break;\n case KEY.ASTERISK:\n DOM.toggleAllSelectedFiles(current);\n break;\n case KEY.PLUS:\n DOM.expandSelection();\n event.preventDefault();\n break;\n case KEY.MINUS:\n DOM.shrinkSelection();\n event.preventDefault();\n break;\n case KEY.F1:\n CloudCmd.Help.show();\n event.preventDefault();\n break;\n case KEY.F2:\n CloudCmd.UserMenu.show();\n break;\n case KEY.F3:\n event.preventDefault();\n if (Info.isDir) await changeDir(path);else if (shift) CloudCmd.View.show(null, {\n raw: true\n });else if (ctrlMeta) CloudCmd.sortPanel('name');else CloudCmd.View.show();\n break;\n case KEY.F4:\n if (config('vim')) CloudCmd.EditFileVim.show();else CloudCmd.EditFile.show();\n event.preventDefault();\n break;\n case KEY.F5:\n if (ctrlMeta) CloudCmd.sortPanel('date');else if (alt) Operation.show('pack');else Operation.show('copy');\n event.preventDefault();\n break;\n case KEY.F6:\n if (ctrlMeta) CloudCmd.sortPanel('size');else if (shift) DOM.renameCurrent(current);else Operation.show('move');\n event.preventDefault();\n break;\n case KEY.F7:\n if (shift) DOM.promptNewFile();else DOM.promptNewDir();\n event.preventDefault();\n break;\n case KEY.F8:\n Operation.show('delete');\n event.preventDefault();\n break;\n case KEY.F9:\n if (alt) Operation.show('extract');else CloudCmd.Menu.show();\n event.preventDefault();\n break;\n case KEY.F10:\n CloudCmd.Config.show();\n event.preventDefault();\n break;\n case KEY.TRA:\n event.preventDefault();\n if (shift) return CloudCmd.Terminal.show();\n CloudCmd.Konsole.show();\n break;\n case KEY.BRACKET_CLOSE:\n CloudCmd.Konsole.show();\n event.preventDefault();\n break;\n case KEY.SPACE:\n event.preventDefault();\n if (!isDir || name === '..') isSelected = true;else isSelected = DOM.isSelected(current);\n if (!isSelected) await DOM.loadCurrentSize(current);\n DOM.toggleSelectedFile(current);\n break;\n case KEY.U:\n if (ctrlMeta) {\n DOM.swapPanels();\n event.preventDefault();\n }\n break;\n\n /* navigation on file table: *\n * in case of pressing button 'up', *\n * select previous row */\n case KEY.UP:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(prev);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'down', *\n * select next row */\n case KEY.DOWN:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(next);\n event.preventDefault();\n break;\n case KEY.LEFT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-right') DOM.duplicatePanel();\n break;\n case KEY.RIGHT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-left') DOM.duplicatePanel();\n break;\n\n /* in case of pressing button 'Home', *\n * go to top element */\n case KEY.HOME:\n DOM.setCurrentFile(Info.first);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'End', select last element */\n case KEY.END:\n DOM.setCurrentFile(Info.last);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page down проматываем экран */\n case KEY.PAGE_DOWN:\n DOM.scrollByPages(panel, 1);\n for (i = 0; i < 30; i++) {\n if (!current.nextSibling) break;\n current = current.nextSibling;\n }\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page up проматываем экран */\n case KEY.PAGE_UP:\n DOM.scrollByPages(panel, -1);\n for (i = 0; i < 30; i++) {\n if (!current.previousSibling) break;\n current = current.previousSibling;\n }\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n case KEY.ENTER:\n if (Info.isDir) await changeDir(path);else CloudCmd.View.show();\n break;\n case KEY.BACKSPACE:\n CloudCmd.goToParentDir();\n event.preventDefault();\n break;\n case KEY.BACKSLASH:\n if (ctrlMeta) await changeDir('/');\n break;\n case KEY.A:\n if (ctrlMeta) {\n DOM.selectAllFiles();\n event.preventDefault();\n }\n break;\n case KEY.G:\n if (alt) {\n DOM.goToDirectory();\n event.preventDefault();\n }\n break;\n case KEY.M:\n if (ctrlMeta) {\n if (config('vim')) CloudCmd.EditNamesVim.show();else CloudCmd.EditNames.show();\n event.preventDefault();\n }\n break;\n case KEY.P:\n if (!ctrlMeta) return;\n event.preventDefault();\n clipboard.writeText(Info.dirPath).catch(CloudCmd.log);\n break;\n\n /**\n * обновляем страницу,\n * загружаем содержимое каталога\n * при этом данные берём всегда с\n * сервера, а не из кэша\n * (обновляем кэш)\n */\n case KEY.R:\n if (ctrlMeta) {\n CloudCmd.log('reloading page...\\n');\n CloudCmd.refresh();\n event.preventDefault();\n }\n break;\n case KEY.C:\n if (ctrlMeta) Buffer.copy();\n break;\n case KEY.X:\n if (ctrlMeta) Buffer.cut();\n break;\n case KEY.V:\n if (ctrlMeta) Buffer.paste();\n break;\n case KEY.Z:\n if (ctrlMeta) Buffer.clear();\n break;\n case KEY.COLON:\n CloudCmd.CommandLine.show();\n event.preventDefault();\n break;\n\n /* чистим хранилище */\n case KEY.D:\n if (ctrlMeta) {\n CloudCmd.log('clearing storage...');\n await DOM.Storage.clear();\n CloudCmd.log('storage cleared');\n event.preventDefault();\n }\n break;\n case KEY.DOT:\n if (meta && shift) {\n const showDotFiles = !CloudCmd.config('showDotFiles');\n CloudCmd._config('showDotFiles', showDotFiles);\n CloudCmd.refresh();\n await DOM.RESTful.Config.write({\n showDotFiles\n });\n }\n break;\n }\n}\n\n//# sourceURL=file://cloudcmd/client/key/index.js");
|
|
227
227
|
|
|
228
228
|
/***/ }),
|
|
229
229
|
|
package/dist-dev/modules/menu.js
CHANGED
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
/***/ (function(module, exports, __webpack_require__) {
|
|
164
164
|
|
|
165
165
|
"use strict";
|
|
166
|
-
eval("/* global CloudCmd, DOM */\n\n\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst wrap = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n getIdBySrc\n} = __webpack_require__(/*! ../dom/load */ \"./client/dom/load.js\");\nconst RESTful = __webpack_require__(/*! ../dom/rest */ \"./client/dom/rest.js\");\nconst {\n config,\n Key\n} = CloudCmd;\nconst {\n Buffer,\n Events,\n Dialog,\n Images\n} = DOM;\nconst Info = DOM.CurrentInfo;\nconst alertNoFiles = Dialog.alert.noFiles;\nconst uploadTo = wrap(_uploadTo);\nlet MenuShowedName;\nlet MenuContext;\nlet MenuContextFile;\nmodule.exports.ENABLED = false;\nCloudCmd.Menu = exports;\nmodule.exports.init = () => {\n const {\n isAuth,\n menuDataFile\n } = getFileMenuData();\n const fm = DOM.getFM();\n const menuData = getMenuData(isAuth);\n const options = getOptions({\n type: 'context'\n });\n const optionsFile = getOptions({\n type: 'file'\n });\n MenuContext = supermenu(fm, options, menuData);\n MenuContextFile = supermenu(fm, optionsFile, menuDataFile);\n MenuContext.addContextMenuListener();\n MenuContextFile.addContextMenuListener();\n Events.addKey(listener);\n};\nmodule.exports.hide = hide;\nfunction hide() {\n MenuContext.hide();\n MenuContextFile.hide();\n}\nmodule.exports.show = position => {\n const {\n x,\n y\n } = getPosition(position);\n MenuContext.show(x, y);\n MenuContextFile.show(x, y);\n Images.hide();\n};\nfunction getPosition(position) {\n if (position) return {\n x: position.x,\n y: position.y\n };\n return getCurrentPosition();\n}\nfunction getMenuNameByEl(el) {\n if (!el) return 'context';\n const name = DOM.getCurrentName(el);\n if (name === '..') return 'context';\n return 'contextFile';\n}\nfunction getOptions({\n type\n}) {\n let name;\n let func;\n if (type === 'context') {\n name = 'context';\n func = Key.unsetBind;\n } else if (type === 'file') {\n name = 'contextFile';\n }\n const options = {\n icon: true,\n beforeClose: Key.setBind,\n beforeShow: exec.with(beforeShow, func),\n beforeClick,\n name\n };\n return options;\n}\nfunction getMenuData(isAuth) {\n const menu = {\n 'Paste': Buffer.paste,\n 'New': {\n File: DOM.promptNewFile,\n Directory: DOM.promptNewDir\n },\n 'Upload': () => {\n CloudCmd.Upload.show();\n },\n 'Upload From Cloud': uploadFromCloud,\n '(Un)Select All': DOM.toggleAllSelectedFiles\n };\n if (isAuth) menu['Log Out'] = CloudCmd.logOut;\n return menu;\n}\nfunction getFileMenuData() {\n const isAuth = CloudCmd.config('auth');\n const menuBottom = getMenuData(isAuth);\n const menuTop = {\n 'View': () => {\n CloudCmd.View.show();\n },\n 'Edit': () => {\n const name = config('vim') ? 'EditFileVim' : 'EditFile';\n CloudCmd[name].show();\n },\n 'Rename': () => {\n setTimeout(DOM.renameCurrent, 100);\n },\n 'Delete': () => {\n CloudCmd.Operation.show('delete');\n },\n 'Pack': () => {\n CloudCmd.Operation.show('pack');\n },\n 'Extract': () => {\n CloudCmd.Operation.show('extract');\n },\n 'Download': preDownload,\n 'Upload To Cloud': uploadTo('Cloud'),\n 'Cut': () => {\n isCurrent(Buffer.cut, alertNoFiles);\n },\n 'Copy': () => {\n isCurrent(Buffer.copy, alertNoFiles);\n }\n };\n const menuDataFile = {\n ...menuTop,\n ...menuBottom\n };\n return {\n isAuth,\n menuDataFile\n };\n}\nfunction isCurrent(yesFn, noFn) {\n if (Info.name !== '..') return yesFn();\n noFn();\n}\nfunction isPath(x, y) {\n const {\n panel\n } = Info;\n const isEmptyRoot = !panel;\n if (isEmptyRoot) return false;\n const el = document.elementFromPoint(x, y);\n const elements = panel.querySelectorAll('[data-name=\"js-path\"] *');\n return ~[].indexOf.call(elements, el);\n}\nfunction beforeShow(callback, params) {\n const {\n name\n } = params;\n const el = DOM.getCurrentByPosition({\n x: params.x,\n y: params.y\n });\n const menuName = getMenuNameByEl(el);\n let isShow = menuName !== 'contextFile';\n if (params.name === 'contextFile') isShow = !isShow;\n if (isShow) MenuShowedName = name;\n exec(callback);\n if (isShow) isShow = isPath(params.x, params.y);\n return isShow;\n}\nfunction beforeClick(name) {\n return MenuShowedName !== name;\n}\nasync function _uploadTo(nameModule) {\n const [error, data] = await Info.getData();\n if (error) return;\n const {\n name\n } = Info;\n CloudCmd.execFromModule(nameModule, 'uploadFile', name, data);\n CloudCmd.log(`Uploading to ${name}...`);\n}\nfunction uploadFromCloud() {\n Images.show.load('top');\n CloudCmd.execFromModule('Cloud', 'saveFile', async (currentName, data) => {\n const path = DOM.getCurrentDirPath() + currentName;\n const [e] = await RESTful.write(path, data);\n if (e) return;\n await CloudCmd.refresh({\n currentName\n });\n });\n}\nfunction preDownload() {\n download(config('packer'));\n}\nfunction download(type) {\n const TIME = 30 * 1000;\n const {\n prefixURL\n } = CloudCmd;\n const PACK = '/pack';\n const date = Date.now();\n const files = DOM.getActiveFiles();\n if (!files.length) return alertNoFiles();\n for (const file of files) {\n const selected = DOM.isSelected(file);\n const isDir = DOM.isCurrentIsDir(file);\n const path = DOM.getCurrentPath(file);\n CloudCmd.log(`downloading file ${path}...`);\n /*\n * if we send ajax request -\n * no need in hash so we escape #\n * and all other characters, like \"%\"\n */\n const encodedPath = encodeURI(path).replace(/#/g, '%23');\n const id = getIdBySrc(path);\n let src;\n if (isDir) src = prefixURL + PACK + encodedPath + DOM.getPackerExt(type);else src = prefixURL + FS + encodedPath + '?download';\n const element = createElement('iframe', {\n id: id + '-' + date,\n async: false,\n className: 'hidden',\n src\n });\n const {\n body\n } = document;\n const removeChild = body.removeChild.bind(body, element);\n setTimeout(removeChild, TIME);\n if (selected) DOM.toggleSelectedFile(file);\n }\n}\nfunction getCurrentPosition() {\n const current = Info.element;\n const rect = current.getBoundingClientRect();\n const position = {\n x: Math.round(rect.left + rect.width / 3),\n y: Math.round(rect.top)\n };\n return position;\n}\nfunction listener(event) {\n const {\n F9,\n ESC\n } = Key;\n const key = event.keyCode;\n const isBind = Key.isBind();\n if (!isBind) return;\n if (key === ESC) return hide();\n if (key === F9) {\n const position = getCurrentPosition();\n MenuContext.show(position.x, position.y);\n event.preventDefault();\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/menu.js");
|
|
166
|
+
eval("/* global CloudCmd, DOM */\n\n\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst wrap = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n getIdBySrc\n} = __webpack_require__(/*! ../dom/load */ \"./client/dom/load.js\");\nconst RESTful = __webpack_require__(/*! ../dom/rest */ \"./client/dom/rest.js\");\nconst {\n config,\n Key\n} = CloudCmd;\nconst {\n Buffer,\n Events,\n Dialog,\n Images\n} = DOM;\nconst Info = DOM.CurrentInfo;\nconst alertNoFiles = Dialog.alert.noFiles;\nconst uploadTo = wrap(_uploadTo);\nlet MenuShowedName;\nlet MenuContext;\nlet MenuContextFile;\nmodule.exports.ENABLED = false;\nCloudCmd.Menu = exports;\nmodule.exports.init = () => {\n const {\n isAuth,\n menuDataFile\n } = getFileMenuData();\n const fm = DOM.getFM();\n const menuData = getMenuData(isAuth);\n const options = getOptions({\n type: 'context'\n });\n const optionsFile = getOptions({\n type: 'file'\n });\n MenuContext = supermenu(fm, options, menuData);\n MenuContextFile = supermenu(fm, optionsFile, menuDataFile);\n MenuContext.addContextMenuListener();\n MenuContextFile.addContextMenuListener();\n Events.addKey(listener);\n};\nmodule.exports.hide = hide;\nfunction hide() {\n MenuContext.hide();\n MenuContextFile.hide();\n}\nmodule.exports.show = position => {\n const {\n x,\n y\n } = getPosition(position);\n MenuContext.show(x, y);\n MenuContextFile.show(x, y);\n Images.hide();\n};\nfunction getPosition(position) {\n if (position) return {\n x: position.x,\n y: position.y\n };\n return getCurrentPosition();\n}\nfunction getMenuNameByEl(el) {\n if (!el) return 'context';\n const name = DOM.getCurrentName(el);\n if (name === '..') return 'context';\n return 'contextFile';\n}\nfunction getOptions({\n type\n}) {\n let name;\n let func;\n if (type === 'context') {\n name = 'context';\n func = Key.unsetBind;\n } else if (type === 'file') {\n name = 'contextFile';\n }\n const options = {\n icon: true,\n beforeClose: Key.setBind,\n beforeShow: exec.with(beforeShow, func),\n beforeClick,\n name\n };\n return options;\n}\nfunction getMenuData(isAuth) {\n const menu = {\n 'Paste': Buffer.paste,\n 'New': {\n File: DOM.promptNewFile,\n Directory: DOM.promptNewDir\n },\n 'Upload': () => {\n CloudCmd.Upload.show();\n },\n 'Upload From Cloud': uploadFromCloud,\n 'Toggle File Selection': DOM.toggleSelectedFile,\n '(Un)Select All': DOM.toggleAllSelectedFiles\n };\n if (isAuth) menu['Log Out'] = CloudCmd.logOut;\n return menu;\n}\nfunction getFileMenuData() {\n const isAuth = CloudCmd.config('auth');\n const menuBottom = getMenuData(isAuth);\n const menuTop = {\n 'View': () => {\n CloudCmd.View.show();\n },\n 'Edit': () => {\n const name = config('vim') ? 'EditFileVim' : 'EditFile';\n CloudCmd[name].show();\n },\n 'Rename': () => {\n setTimeout(DOM.renameCurrent, 100);\n },\n 'Delete': () => {\n CloudCmd.Operation.show('delete');\n },\n 'Pack': () => {\n CloudCmd.Operation.show('pack');\n },\n 'Extract': () => {\n CloudCmd.Operation.show('extract');\n },\n 'Download': preDownload,\n 'Upload To Cloud': uploadTo('Cloud'),\n 'Cut': () => {\n isCurrent(Buffer.cut, alertNoFiles);\n },\n 'Copy': () => {\n isCurrent(Buffer.copy, alertNoFiles);\n }\n };\n const menuDataFile = {\n ...menuTop,\n ...menuBottom\n };\n return {\n isAuth,\n menuDataFile\n };\n}\nfunction isCurrent(yesFn, noFn) {\n if (Info.name !== '..') return yesFn();\n noFn();\n}\nfunction isPath(x, y) {\n const {\n panel\n } = Info;\n const isEmptyRoot = !panel;\n if (isEmptyRoot) return false;\n const el = document.elementFromPoint(x, y);\n const elements = panel.querySelectorAll('[data-name=\"js-path\"] *');\n return ~[].indexOf.call(elements, el);\n}\nfunction beforeShow(callback, params) {\n const {\n name\n } = params;\n const el = DOM.getCurrentByPosition({\n x: params.x,\n y: params.y\n });\n const menuName = getMenuNameByEl(el);\n let isShow = menuName !== 'contextFile';\n if (params.name === 'contextFile') isShow = !isShow;\n if (isShow) MenuShowedName = name;\n exec(callback);\n if (isShow) isShow = isPath(params.x, params.y);\n return isShow;\n}\nfunction beforeClick(name) {\n return MenuShowedName !== name;\n}\nasync function _uploadTo(nameModule) {\n const [error, data] = await Info.getData();\n if (error) return;\n const {\n name\n } = Info;\n CloudCmd.execFromModule(nameModule, 'uploadFile', name, data);\n CloudCmd.log(`Uploading to ${name}...`);\n}\nfunction uploadFromCloud() {\n Images.show.load('top');\n CloudCmd.execFromModule('Cloud', 'saveFile', async (currentName, data) => {\n const path = DOM.getCurrentDirPath() + currentName;\n const [e] = await RESTful.write(path, data);\n if (e) return;\n await CloudCmd.refresh({\n currentName\n });\n });\n}\nfunction preDownload() {\n download(config('packer'));\n}\nfunction download(type) {\n const TIME = 30 * 1000;\n const {\n prefixURL\n } = CloudCmd;\n const PACK = '/pack';\n const date = Date.now();\n const files = DOM.getActiveFiles();\n if (!files.length) return alertNoFiles();\n for (const file of files) {\n const selected = DOM.isSelected(file);\n const isDir = DOM.isCurrentIsDir(file);\n const path = DOM.getCurrentPath(file);\n CloudCmd.log(`downloading file ${path}...`);\n /*\n * if we send ajax request -\n * no need in hash so we escape #\n * and all other characters, like \"%\"\n */\n const encodedPath = encodeURI(path).replace(/#/g, '%23');\n const id = getIdBySrc(path);\n let src;\n if (isDir) src = prefixURL + PACK + encodedPath + DOM.getPackerExt(type);else src = prefixURL + FS + encodedPath + '?download';\n const element = createElement('iframe', {\n id: id + '-' + date,\n async: false,\n className: 'hidden',\n src\n });\n const {\n body\n } = document;\n const removeChild = body.removeChild.bind(body, element);\n setTimeout(removeChild, TIME);\n if (selected) DOM.toggleSelectedFile(file);\n }\n}\nfunction getCurrentPosition() {\n const current = Info.element;\n const rect = current.getBoundingClientRect();\n const position = {\n x: Math.round(rect.left + rect.width / 3),\n y: Math.round(rect.top)\n };\n return position;\n}\nfunction listener(event) {\n const {\n F9,\n ESC\n } = Key;\n const key = event.keyCode;\n const isBind = Key.isBind();\n if (!isBind) return;\n if (key === ESC) return hide();\n if (key === F9) {\n const position = getCurrentPosition();\n MenuContext.show(position.x, position.y);\n event.preventDefault();\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/menu.js");
|
|
167
167
|
|
|
168
168
|
/***/ })
|
|
169
169
|
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
/***/ (function(module, exports, __webpack_require__) {
|
|
164
164
|
|
|
165
165
|
"use strict";
|
|
166
|
-
eval("\n\n/* global CloudCmd, gritty */\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n__webpack_require__(/*! ../../css/terminal.css */ \"./css/terminal.css\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst DOM = __webpack_require__(/*! ../dom */ \"./client/dom/index.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst {\n Dialog\n} = DOM;\nconst {\n Key,\n config\n} = CloudCmd;\nCloudCmd.TerminalRun = exports;\nlet Loaded;\nlet Terminal;\nlet Socket;\nconst exitCodeStore = fullstore();\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await tryToCatch(load.parallel, [js, css]);\n if (e) {\n const src = e.target.src.replace(window.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n Loaded = true;\n};\nmodule.exports.init = async () => {\n if (!config('terminal')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await loadAll();\n};\nmodule.exports.show = promisify((options = {}, fn) => {\n if (!Loaded) return fn(null, -1);\n if (!config('terminal')) return;\n create(options);\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n },\n afterClose: (
|
|
166
|
+
eval("\n\n/* global CloudCmd, gritty */\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n__webpack_require__(/*! ../../css/terminal.css */ \"./css/terminal.css\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst DOM = __webpack_require__(/*! ../dom */ \"./client/dom/index.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst {\n Dialog\n} = DOM;\nconst {\n Key,\n config\n} = CloudCmd;\nCloudCmd.TerminalRun = exports;\nlet Loaded;\nlet Terminal;\nlet Socket;\nconst exitCodeStore = fullstore();\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await tryToCatch(load.parallel, [js, css]);\n if (e) {\n const src = e.target.src.replace(window.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n Loaded = true;\n};\nmodule.exports.init = async () => {\n if (!config('terminal')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await loadAll();\n};\nmodule.exports.show = promisify((options = {}, fn) => {\n if (!Loaded) return fn(null, -1);\n if (!config('terminal')) return;\n create(options);\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n },\n afterClose: (/* exec.series args */\n ) => {\n fn(null, exitCodeStore());\n }\n });\n});\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nfunction getPrefix() {\n return CloudCmd.prefix + '/gritty';\n}\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/gritty';\n}\nfunction getEnv() {\n return {\n ACTIVE_DIR: DOM.getCurrentDirPath,\n PASSIVE_DIR: DOM.getNotCurrentDirPath,\n CURRENT_NAME: DOM.getCurrentName,\n CURRENT_PATH: DOM.getCurrentPath\n };\n}\nfunction create(createOptions) {\n const {\n cwd = DOM.getCurrentDirPath(),\n command,\n autoClose,\n closeMessage = 'Press any key to close Terminal...'\n } = createOptions;\n const options = {\n cwd,\n env: getEnv(),\n prefix: getPrefixSocket(),\n socketPath: CloudCmd.prefix,\n fontFamily: 'Droid Sans Mono',\n command,\n autoRestart: false\n };\n let commandExit = false;\n const {\n socket,\n terminal\n } = gritty(document.body, options);\n Socket = socket;\n Terminal = terminal;\n Terminal.onKey(({\n domEvent\n }) => {\n const {\n keyCode,\n shiftKey\n } = domEvent;\n if (commandExit) hide();\n if (shiftKey && keyCode === Key.ESC) hide();\n });\n Socket.on('exit', code => {\n exitCodeStore(code);\n if (autoClose) return hide();\n terminal.write(`\\n${closeMessage}`);\n commandExit = true;\n });\n Socket.on('connect', exec.with(authCheck, socket));\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\n\n//# sourceURL=file://cloudcmd/client/modules/terminal-run.js");
|
|
167
167
|
|
|
168
168
|
/***/ })
|
|
169
169
|
|
package/dist-dev/sw.js
CHANGED
|
@@ -103,7 +103,7 @@ var serviceWorkerOption = {
|
|
|
103
103
|
/***/ (function(module, exports, __webpack_require__) {
|
|
104
104
|
|
|
105
105
|
"use strict";
|
|
106
|
-
eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"
|
|
106
|
+
eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Sun Oct 27 2024 12:06:15 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/sw.js");
|
|
107
107
|
|
|
108
108
|
/***/ }),
|
|
109
109
|
|
package/font/fontello.eot
CHANGED
|
Binary file
|
package/font/fontello.json
CHANGED
|
@@ -192,6 +192,12 @@
|
|
|
192
192
|
"code": 59422,
|
|
193
193
|
"src": "fontawesome"
|
|
194
194
|
},
|
|
195
|
+
{
|
|
196
|
+
"uid": "12f4ece88e46abd864e40b35e05b11cd",
|
|
197
|
+
"css": "ok",
|
|
198
|
+
"code": 59423,
|
|
199
|
+
"src": "fontawesome"
|
|
200
|
+
},
|
|
195
201
|
{
|
|
196
202
|
"uid": "60617c8adc1e7eb3c444a5491dd13f57",
|
|
197
203
|
"css": "attention-circled-1",
|
package/font/fontello.svg
CHANGED
|
@@ -67,6 +67,8 @@
|
|
|
67
67
|
<glyph glyph-name="link-ext" unicode="" d="M786 332v-178q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h393q7 0 12-5t5-13v-36q0-8-5-13t-12-5h-393q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v178q0 8 5 13t13 5h36q8 0 13-5t5-13z m214 482v-285q0-15-11-25t-25-11-25 11l-98 98-364-364q-5-6-13-6t-12 6l-64 64q-6 5-6 12t6 13l364 364-98 98q-11 11-11 25t11 25 25 11h285q15 0 25-11t11-25z" horiz-adv-x="1000" />
|
|
68
68
|
|
|
69
69
|
<glyph glyph-name="link-ext-alt" unicode="" d="M714 332v268q0 15-10 25t-25 11h-268q-24 0-33-22-10-23 8-39l80-80-298-298q-11-11-11-26t11-25l57-57q11-10 25-10t25 10l298 298 81-80q10-11 25-11 6 0 14 3 21 10 21 33z m143 286v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
|
|
70
|
+
|
|
71
|
+
<glyph glyph-name="ok" unicode="" d="M933 534q0-22-16-38l-404-404-76-76q-16-15-38-15t-38 15l-76 76-202 202q-15 16-15 38t15 38l76 76q16 16 38 16t38-16l164-165 366 367q16 16 38 16t38-16l76-76q16-15 16-38z" horiz-adv-x="1000" />
|
|
70
72
|
</font>
|
|
71
73
|
</defs>
|
|
72
74
|
</svg>
|
package/font/fontello.ttf
CHANGED
|
Binary file
|
package/font/fontello.woff
CHANGED
|
Binary file
|
package/font/fontello.woff2
CHANGED
|
Binary file
|
package/json/config.json
CHANGED
package/json/help.json
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"-p, --password ": "set password",
|
|
9
9
|
"-c, --config ": "configuration file path",
|
|
10
10
|
"--show-config ": "show config values",
|
|
11
|
+
"--show-dot-files ": "show dot files",
|
|
11
12
|
"--show-file-name ": "show file name in view and edit",
|
|
12
13
|
"--editor ": "set editor: \"dword\", \"edward\" or \"deepword\"",
|
|
13
14
|
"--packer ": "set packer: \"tar\" or \"zip\"",
|
|
@@ -65,6 +66,7 @@
|
|
|
65
66
|
"--no-export ": "disable export config through a server",
|
|
66
67
|
"--no-import ": "disable import of config",
|
|
67
68
|
"--no-import-listen ": "disable listen on config updates from import server",
|
|
69
|
+
"--no-show-dot-files ": "do not show dot files",
|
|
68
70
|
"--no-show-file-name ": "do not show file name in view and edit",
|
|
69
71
|
"--no-dropbox ": "disable dropbox integration",
|
|
70
72
|
"--no-dropbox-token ": "unset dropbox token",
|
package/man/cloudcmd.1
CHANGED
|
@@ -31,6 +31,7 @@ programs in browser from any computer, mobile or tablet device.
|
|
|
31
31
|
-p, --password set password
|
|
32
32
|
-c, --config configuration file path
|
|
33
33
|
--show-config show config values
|
|
34
|
+
--show-dot-files show dot files
|
|
34
35
|
--show-file-name show file name in view and edit modes
|
|
35
36
|
--editor set editor: "dword", "edward" or "deepword"
|
|
36
37
|
--packer set packer: "tar" or "zip"
|
|
@@ -66,6 +67,7 @@ programs in browser from any computer, mobile or tablet device.
|
|
|
66
67
|
--dropbox-token set dropbox token
|
|
67
68
|
--log enable logging
|
|
68
69
|
--no-show-config do not show config values
|
|
70
|
+
--no-show-dot-files do not show dot files
|
|
69
71
|
--no-server do not start server
|
|
70
72
|
--no-auth disable authorization
|
|
71
73
|
--no-online load scripts from local server
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcmd",
|
|
3
|
-
"version": "18.0
|
|
3
|
+
"version": "18.2.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "File manager for the web with console and editor",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"funding": "https://opencollective.com/cloudcmd",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git://github.com/coderaiser/cloudcmd.git"
|
|
11
|
+
"url": "git+https://github.com/coderaiser/cloudcmd.git"
|
|
12
12
|
},
|
|
13
13
|
"main": "server/cloudcmd.mjs",
|
|
14
14
|
"keywords": [
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"emitify": "^4.0.1",
|
|
174
174
|
"eslint": "^8.0.1",
|
|
175
175
|
"eslint-plugin-n": "^17.0.0-4",
|
|
176
|
-
"eslint-plugin-putout": "^
|
|
176
|
+
"eslint-plugin-putout": "^23.1.0",
|
|
177
177
|
"extract-text-webpack-plugin": "^4.0.0-alpha.0",
|
|
178
178
|
"gritty": "^8.0.0",
|
|
179
179
|
"gunzip-maybe": "^1.3.1",
|
package/server/route.mjs
CHANGED
package/server/user-menu.mjs
CHANGED
|
@@ -79,11 +79,11 @@ async function onGET({req, res, menuName, readFile}) {
|
|
|
79
79
|
|
|
80
80
|
function getError(error, source) {
|
|
81
81
|
return montag`
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
const e = Error(\`<pre>${codeframe({
|
|
83
|
+
error,
|
|
84
|
+
source,
|
|
85
|
+
highlightCode: false,
|
|
86
|
+
})}</pre>\`);
|
|
87
87
|
|
|
88
88
|
e.code = 'frame';
|
|
89
89
|
|
package/tmpl/config.hbs
CHANGED
|
@@ -135,6 +135,12 @@
|
|
|
135
135
|
placeholder="Port"
|
|
136
136
|
class="form-control">
|
|
137
137
|
</li>
|
|
138
|
+
<li title="Show DotFiles">
|
|
139
|
+
<label>
|
|
140
|
+
<input data-name="js-showDotFiles" type="checkbox" {{ showDotFiles }}>
|
|
141
|
+
Show DotFiles
|
|
142
|
+
</label>
|
|
143
|
+
</li>
|
|
138
144
|
<li title="Show file name while Viewing a file">
|
|
139
145
|
<label>
|
|
140
146
|
<input data-name="js-showFileName" type="checkbox" {{ showFileName }}>
|