From 08b5c6b2b5db6021c03f3729c7cb5b3f29fcf2ff Mon Sep 17 00:00:00 2001 From: coderiaser Date: Mon, 1 Sep 2025 20:03:11 +0300 Subject: [PATCH 001/150] feature: client: menu: aleman: add --- .webpack/js.js | 3 ++- HELP.md | 2 ++ bin/cloudcmd.mjs | 4 ++++ client/cloudcmd.js | 7 ++++++ client/listeners/index.js | 5 ++++- client/modules/config/index.js | 2 ++ client/modules/menu/cloudmenu.mjs | 26 ++++++++++++++++++++++ client/modules/{menu.js => menu/index.js} | 27 +++++++++++++---------- json/config.json | 1 + json/help.json | 1 + man/cloudcmd.1 | 1 + package.json | 1 + server/cloudcmd.mjs | 2 +- server/validate.mjs | 7 ++++++ tmpl/config.hbs | 6 +++++ 15 files changed, 80 insertions(+), 15 deletions(-) create mode 100644 client/modules/menu/cloudmenu.mjs rename client/modules/{menu.js => menu/index.js} (92%) diff --git a/.webpack/js.js b/.webpack/js.js index 66f333b3..d666780d 100644 --- a/.webpack/js.js +++ b/.webpack/js.js @@ -54,6 +54,7 @@ const plugins = [ new NormalModuleReplacementPlugin(/^node:/, (resource) => { resource.request = resource.request.replace(/^node:/, ''); }), + new NormalModuleReplacementPlugin(/^putout$/, '@putout/bundle'), new EnvironmentPlugin({ NODE_ENV, }), @@ -125,7 +126,7 @@ module.exports = { [`${modules}/edit-file-vim`]: `${dirModules}/edit-file-vim.js`, [`${modules}/edit-names`]: `${dirModules}/edit-names.js`, [`${modules}/edit-names-vim`]: `${dirModules}/edit-names-vim.js`, - [`${modules}/menu`]: `${dirModules}/menu.js`, + [`${modules}/menu`]: `${dirModules}/menu/index.js`, [`${modules}/view`]: `${dirModules}/view/index.js`, [`${modules}/help`]: `${dirModules}/help.js`, [`${modules}/markdown`]: `${dirModules}/markdown.js`, diff --git a/HELP.md b/HELP.md index 75c34407..ce0778c9 100644 --- a/HELP.md +++ b/HELP.md @@ -82,6 +82,7 @@ Cloud Commander supports the following command-line parameters: | `--confirm-move` | confirm move | `--open` | open web browser when server starts | `--name` | set tab name in web browser +| `--menu` | set menu: "supermenu" or "aleman" | `--one-file-panel` | show one file panel | `--keys-panel` | show keys panel | `--contact` | enable contact @@ -434,6 +435,7 @@ Some config options can be overridden with environment variables, such as: - `CLOUDCMD_EDITOR` - set editor - `CLOUDCMD_COLUMNS` - set visible themes - `CLOUDCMD_THEME` - set themes "light" or "dark" +- `CLOUDCMD_MENU` - set menu "supermenu" or "aleman" - `CLOUDCMD_CONTACT` - enable contact - `CLOUDCMD_CONFIG_DIALOG` - enable config dialog - `CLOUDCMD_CONFIG_AUTH` - enable auth change in config dialog diff --git a/bin/cloudcmd.mjs b/bin/cloudcmd.mjs index c8759719..11dabd3d 100755 --- a/bin/cloudcmd.mjs +++ b/bin/cloudcmd.mjs @@ -62,6 +62,7 @@ const yargsOptions = { 'terminal-path', 'terminal-command', 'columns', + 'menu', 'theme', 'import-url', 'import-token', @@ -106,6 +107,7 @@ const yargsOptions = { 'online': config('online'), 'open': choose(env.bool('open'), config('open')), 'editor': env('editor') || config('editor'), + 'menu': env('menu') || config('menu'), 'packer': config('packer') || 'tar', 'zip': config('zip'), 'username': env('username') || config('username'), @@ -199,6 +201,7 @@ async function main() { config('terminalCommand', args.terminalCommand); config('terminalAutoRestart', args.terminalAutoRestart); config('editor', args.editor); + config('menu', args.menu); config('prefix', prefixer(args.prefix)); config('prefixSocket', prefixer(args.prefixSocket)); config('root', args.root || '/'); @@ -232,6 +235,7 @@ async function main() { prefixSocket: config('prefixSocket'), columns: config('columns'), theme: config('theme'), + menu: config('menu'), }; const password = env('password') || args.password; diff --git a/client/cloudcmd.js b/client/cloudcmd.js index 9703c6b6..49379e4d 100644 --- a/client/cloudcmd.js +++ b/client/cloudcmd.js @@ -26,6 +26,12 @@ module.exports = async (config) => { const prefix = getPrefix(config.prefix); window.CloudCmd.init(prefix, config); + + if (window.CloudCmd.config('menu') === 'aleman') + setTimeout(() => { + import('https://esm.sh/@putout/processor-html'); + import('https://esm.sh/@putout/bundle'); + }, 100); }; window.CloudCmd = module.exports; @@ -61,3 +67,4 @@ async function register(config) { listenSW(sw, 'updatefound', onUpdateFound(config)); } + diff --git a/client/listeners/index.js b/client/listeners/index.js index c500242f..c6a94c11 100644 --- a/client/listeners/index.js +++ b/client/listeners/index.js @@ -111,7 +111,10 @@ module.exports.initKeysPanel = () => { if (!keysElement) return; - Events.addClick(keysElement, ({target}) => { + Events.addClick(keysElement, (event) => { + event.stopPropagation(); + + const {target} = event; const {id} = target; const operation = (name) => { const {Operation} = CloudCmd; diff --git a/client/modules/config/index.js b/client/modules/config/index.js index f8f3e4f3..759ea85d 100644 --- a/client/modules/config/index.js +++ b/client/modules/config/index.js @@ -135,6 +135,7 @@ async function fillTemplate() { const { editor, + menu, packer, columns, theme, @@ -142,6 +143,7 @@ async function fillTemplate() { ...obj } = input.convert(config); + obj[`${menu}-selected`] = 'selected'; obj[`${editor}-selected`] = 'selected'; obj[`${packer}-selected`] = 'selected'; obj[`${columns}-selected`] = 'selected'; diff --git a/client/modules/menu/cloudmenu.mjs b/client/modules/menu/cloudmenu.mjs new file mode 100644 index 00000000..9529b309 --- /dev/null +++ b/client/modules/menu/cloudmenu.mjs @@ -0,0 +1,26 @@ +import supermenu from 'supermenu'; + +const noop = () => {}; +const {CloudCmd} = globalThis; + +export const createCloudMenu = async (fm, options, menuData) => { + const createMenu = await loadMenu(); + const menu = await createMenu(fm, options, menuData); + + menu.addContextMenuListener = menu.addContextMenuListener || noop; + + return menu; +}; + +async function loadMenu() { + if (CloudCmd.config('menu') === 'aleman') { + const {host, protocol} = window.location; + const url = `${protocol}//${host}/node_modules/aleman/menu/menu.js`; + const {createMenu} = await import(/* webpackIgnore: true */url); + + return createMenu; + } + + return supermenu; +} + diff --git a/client/modules/menu.js b/client/modules/menu/index.js similarity index 92% rename from client/modules/menu.js rename to client/modules/menu/index.js index c68bed67..5cedd5ff 100644 --- a/client/modules/menu.js +++ b/client/modules/menu/index.js @@ -4,12 +4,11 @@ const exec = require('execon'); const wrap = require('wraptile'); -const supermenu = require('supermenu'); const createElement = require('@cloudcmd/create-element'); -const {FS} = require('../../common/cloudfunc'); -const {getIdBySrc} = require('../dom/load'); -const RESTful = require('../dom/rest'); +const {FS} = require('../../../common/cloudfunc'); +const {getIdBySrc} = require('../../dom/load'); +const RESTful = require('../../dom/rest'); const {config, Key} = CloudCmd; @@ -32,7 +31,7 @@ module.exports.ENABLED = false; CloudCmd.Menu = exports; -module.exports.init = () => { +module.exports.init = async () => { const {isAuth, menuDataFile} = getFileMenuData(); const fm = DOM.getFM(); @@ -46,8 +45,9 @@ module.exports.init = () => { type: 'file', }); - MenuContext = supermenu(fm, options, menuData); - MenuContextFile = supermenu(fm, optionsFile, menuDataFile); + const {createCloudMenu} = await import('./cloudmenu.mjs'); + MenuContext = await createCloudMenu(fm, options, menuData); + MenuContextFile = await createCloudMenu(fm, optionsFile, menuDataFile); MenuContext.addContextMenuListener(); MenuContextFile.addContextMenuListener(); @@ -107,6 +107,7 @@ function getOptions({type}) { const options = { icon: true, beforeClose: Key.setBind, + beforeHide: Key.setBind, beforeShow: exec.with(beforeShow, func), beforeClick, name, @@ -198,16 +199,17 @@ function isPath(x, y) { const el = document.elementFromPoint(x, y); const elements = panel.querySelectorAll('[data-name="js-path"] *'); - return ~[].indexOf.call(elements, el); + return !~[].indexOf.call(elements, el); } function beforeShow(callback, params) { Key.unsetBind(); - const {name} = params; + const {name, position = {x: params.x, y: params.y}} = params; + const {x, y} = position; const el = DOM.getCurrentByPosition({ - x: params.x, - y: params.y, + x, + y, }); const menuName = getMenuNameByEl(el); @@ -223,7 +225,7 @@ function beforeShow(callback, params) { exec(callback); if (isShow) - isShow = isPath(params.x, params.y); + isShow = isPath(x, y); return isShow; } @@ -341,3 +343,4 @@ function listener(event) { event.preventDefault(); } } + diff --git a/json/config.json b/json/config.json index e65f41ee..baa78418 100644 --- a/json/config.json +++ b/json/config.json @@ -5,6 +5,7 @@ "password": "2b64f2e3f9fee1942af9ff60d40aa5a719db33b8ba8dd4864bb4f11e25ca2bee00907de32a59429602336cac832c8f2eeff5177cc14c864dd116c8bf6ca5d9a9", "algo": "sha512WithRSAEncryption", "editor": "edward", + "menu": "supermenu", "packer": "tar", "diff": true, "zip": true, diff --git a/json/help.json b/json/help.json index 6289a2d2..f8ff0bf8 100644 --- a/json/help.json +++ b/json/help.json @@ -20,6 +20,7 @@ "--confirm-move ": "confirm move", "--open ": "open web browser when server started", "--name ": "set tab name in web browser", + "--menu ": "set menu: \"supermenu\" or \"aleman\"", "--one-file-panel ": "show one file panel", "--keys-panel ": "show keys panel", "--config-dialog ": "enable config dialog", diff --git a/man/cloudcmd.1 b/man/cloudcmd.1 index 607ff241..fe2122b7 100644 --- a/man/cloudcmd.1 +++ b/man/cloudcmd.1 @@ -34,6 +34,7 @@ programs in browser from any computer, mobile or tablet device. --show-dot-files show dot files --show-file-name show file name in view and edit modes --editor set editor: "dword", "edward" or "deepword" + --menu set menu: "supermenu" or "aleman" --packer set packer: "tar" or "zip" --root set root directory --prefix set url prefix diff --git a/package.json b/package.json index b7beecc9..0cb2023d 100644 --- a/package.json +++ b/package.json @@ -89,6 +89,7 @@ "@cloudcmd/move-files": "^8.0.0", "@cloudcmd/read-files-sync": "^2.0.0", "@putout/cli-validate-args": "^2.0.0", + "aleman": "^1.0.15", "apart": "^2.0.0", "chalk": "^5.3.0", "compression": "^1.7.4", diff --git a/server/cloudcmd.mjs b/server/cloudcmd.mjs index 62414a83..1305dd14 100644 --- a/server/cloudcmd.mjs +++ b/server/cloudcmd.mjs @@ -64,7 +64,7 @@ function cloudcmd(params) { if (/root/.test(name)) validate.root(value, config); - if (/editor|packer|themes/.test(name)) + if (/editor|packer|themes|menu/.test(name)) validate[name](value); if (/prefix/.test(name)) diff --git a/server/validate.mjs b/server/validate.mjs index fa67a321..4694ca16 100644 --- a/server/validate.mjs +++ b/server/validate.mjs @@ -34,6 +34,13 @@ export const editor = (name, {exit = _exit} = {}) => { exit('cloudcmd --editor: could be "dword", "edward" or "deepword" only'); }; +export const menu = (name, {exit = _exit} = {}) => { + const reg = /^(supermenu|aleman)$/; + + if (!reg.test(name)) + exit('cloudcmd --menu: could be "supermenu" or "aleman" only'); +}; + export const packer = (name, {exit = _exit} = {}) => { const reg = /^(tar|zip)$/; diff --git a/tmpl/config.hbs b/tmpl/config.hbs index d6ac231c..4c698e3c 100644 --- a/tmpl/config.hbs +++ b/tmpl/config.hbs @@ -72,6 +72,12 @@ Vim +
  • + +
  • From c963ffefeec0d87635d5f20d147530b02bea7c37 Mon Sep 17 00:00:00 2001 From: coderiaser Date: Sun, 14 Sep 2025 22:10:54 +0300 Subject: [PATCH 038/150] chore: cloudcmd: v19.0.1 --- ChangeLog | 8 ++++++++ HELP.md | 3 ++- README.md | 2 +- package.json | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ceaa937..11c4b5b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2025.09.14, v19.0.1 + +fix: +- fc6304a1 tmpl: config: aleman, supermenu + +feature: +- a05ecdb4 cloudcmd: aleman v1.10.0 + 2025.09.14, v19.0.0 feature: diff --git a/HELP.md b/HELP.md index 3ea1adcc..4ab8fc6d 100644 --- a/HELP.md +++ b/HELP.md @@ -1,4 +1,4 @@ -# Cloud Commander v19.0.0 +# Cloud Commander v19.0.1 ### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL] @@ -1111,6 +1111,7 @@ There are a lot of ways to be involved in `Cloud Commander` development: ## Version history +- *2025.09.14*, **[v19.0.1](//github.com/coderaiser/cloudcmd/releases/tag/v19.0.1)** - *2025.09.14*, **[v19.0.0](//github.com/coderaiser/cloudcmd/releases/tag/v19.0.0)** - *2025.09.14*, **[v18.8.11](//github.com/coderaiser/cloudcmd/releases/tag/v18.8.11)** - *2025.09.14*, **[v18.8.10](//github.com/coderaiser/cloudcmd/releases/tag/v18.8.10)** diff --git a/README.md b/README.md index 406eec50..bf5cfd4b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Cloud Commander v19.0.0 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL] +# Cloud Commander v19.0.1 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL] ### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL] diff --git a/package.json b/package.json index 87e7aae4..835266f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudcmd", - "version": "19.0.0", + "version": "19.0.1", "type": "commonjs", "author": "coderaiser (https://github.com/coderaiser)", "description": "File manager for the web with console and editor", From 511347d3ef9803e05ef422b503af0fb0ac35fe6a Mon Sep 17 00:00:00 2001 From: coderiaser Date: Sun, 14 Sep 2025 22:22:04 +0300 Subject: [PATCH 039/150] feature: cloudcmd: aleman v1.11.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 835266f5..b3d66bcb 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "@cloudcmd/move-files": "^8.0.0", "@cloudcmd/read-files-sync": "^2.0.0", "@putout/cli-validate-args": "^2.0.0", - "aleman": "^1.10.0", + "aleman": "^1.11.0", "apart": "^2.0.0", "chalk": "^5.3.0", "compression": "^1.7.4", From 1537fa73fc6d038aa6e24ac2017c91f331d7dbc9 Mon Sep 17 00:00:00 2001 From: coderiaser Date: Sun, 14 Sep 2025 22:22:41 +0300 Subject: [PATCH 040/150] chore: cloudcmd: v19.0.2 --- ChangeLog | 5 +++++ HELP.md | 3 ++- README.md | 2 +- package.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11c4b5b9..f7d41318 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025.09.14, v19.0.2 + +feature: +- 511347d3 cloudcmd: aleman v1.11.0 + 2025.09.14, v19.0.1 fix: diff --git a/HELP.md b/HELP.md index 4ab8fc6d..392387e6 100644 --- a/HELP.md +++ b/HELP.md @@ -1,4 +1,4 @@ -# Cloud Commander v19.0.1 +# Cloud Commander v19.0.2 ### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL] @@ -1111,6 +1111,7 @@ There are a lot of ways to be involved in `Cloud Commander` development: ## Version history +- *2025.09.14*, **[v19.0.2](//github.com/coderaiser/cloudcmd/releases/tag/v19.0.2)** - *2025.09.14*, **[v19.0.1](//github.com/coderaiser/cloudcmd/releases/tag/v19.0.1)** - *2025.09.14*, **[v19.0.0](//github.com/coderaiser/cloudcmd/releases/tag/v19.0.0)** - *2025.09.14*, **[v18.8.11](//github.com/coderaiser/cloudcmd/releases/tag/v18.8.11)** diff --git a/README.md b/README.md index bf5cfd4b..4873d9c3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Cloud Commander v19.0.1 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL] +# Cloud Commander v19.0.2 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL] ### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL] diff --git a/package.json b/package.json index b3d66bcb..0e15731c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudcmd", - "version": "19.0.1", + "version": "19.0.2", "type": "commonjs", "author": "coderaiser (https://github.com/coderaiser)", "description": "File manager for the web with console and editor", From c5aed16f630d48cac71517802da7e89842b2ba35 Mon Sep 17 00:00:00 2001 From: coderiaser Date: Mon, 15 Sep 2025 17:48:40 +0300 Subject: [PATCH 041/150] feature: cloudcmd: aleman v1.12.2 --- html/index.html | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html/index.html b/html/index.html index b2a735cb..439d4634 100644 --- a/html/index.html +++ b/html/index.html @@ -45,7 +45,7 @@