From 745e9b732cc2171b3b243f78bbab869fd6db43e8 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 26 Jul 2017 18:05:05 +0300 Subject: [PATCH] feature(cloudcmd) showKeysPanel -> keysPanel --- HELP.md | 6 +++++- app.json | 10 ++++++++++ bin/cloudcmd.js | 3 +++ json/config.json | 2 +- json/help.json | 2 ++ man/cloudcmd.1 | 2 ++ server/route.js | 2 +- test/server/route.js | 4 ++-- tmpl/config.hbs | 4 ++-- 9 files changed, 28 insertions(+), 7 deletions(-) diff --git a/HELP.md b/HELP.md index 01dffde0..a13f0b75 100644 --- a/HELP.md +++ b/HELP.md @@ -93,6 +93,7 @@ Cloud Commander supports command line parameters: | `--terminal` | enable terminal | `--terminal-path` | set terminal path | `--vim` | enable vim hot keys +| `--keys-panel` | show keys panel | `--columns` | set visible columns | `--no-server` | do not start server | `--no-auth` | disable authorization @@ -110,6 +111,7 @@ Cloud Commander supports command line parameters: | `--no-sync-console-path` | do not sync console path | `--no-terminal` | disable terminal | `--no-vim` | disable vim hot keys +| `--no-keys-panel` | hide keys panel | `--no-columns` | set visible default columns If no parameters given Cloud Commander reads information from `~/.cloudcmd.json` and use @@ -364,7 +366,7 @@ Here is description of options: "online" : true, /* load js files from cdn or local path */ "open" : false /* open web browser when server started */ "cache" : true, /* add cache-control */ - "showKeysPanel" : true, /* show classic panel with buttons of keys */ + "keysPanel" : true, /* show classic panel with buttons of keys */ "port" : 8000, /* http port */ "ip" : null, /* ip or null(default) */ "root" : "/", /* root directory */ @@ -399,6 +401,8 @@ Some config options can be overridden with `environment variables` such: - `CLOUDCMD_SYNC_CONSOLE_PATH` - sync console path - `CLOUDCMD_TERMINAL` - enable terminal - `CLOUDCMD_TERMINAL_PATH` - set terminal path +- `CLOUDCMD_CONFIG_DIALOG` - enable config dialog +- `CLOUDCMD_KEYS_PANEL` - show keys panel - `CLOUDCMD_AUTH` - enable authentication - `CLOUDCMD_USERNAME` - set username - `CLOUDCMD_PASSWORD` - set password diff --git a/app.json b/app.json index 7aef64bf..8a71c68e 100644 --- a/app.json +++ b/app.json @@ -52,6 +52,16 @@ "value": "gritty", "required": false }, + "CLOUDCMD_CONFIG_DIALOG": { + "description": "show config dialog", + "value": "false", + "required": false + }, + "CLOUDCMD_KEYS_PANEL": { + "description": "show keys panel", + "value": "true", + "required": false + }, "CLOUDCMD_NAME": { "description": "set tab name in web browser", "value": "", diff --git a/bin/cloudcmd.js b/bin/cloudcmd.js index 8631bc0d..4a985c04 100755 --- a/bin/cloudcmd.js +++ b/bin/cloudcmd.js @@ -50,6 +50,7 @@ const args = require('minimist')(argv.slice(2), { 'html-dialogs', 'show-config', 'vim', + 'keys-panel', ], default: { server : true, @@ -78,6 +79,7 @@ const args = require('minimist')(argv.slice(2), { 'html-dialogs': config('htmlDialogs'), 'vim': choose(env.bool('vim'), config('vim')), 'columns': env('columns') || config('columns') || '', + 'keys-panel': env.bool('keys_panel') || config('keysPanel'), }, alias: { v: 'version', @@ -130,6 +132,7 @@ function main() { config('confirmMove', args['confirm-move']); config('onePanelMode', args['one-panel-mode']); config('configDialog', args['config-dialog']); + config('keysPanel', args['keys-panel']); readConfig(args.config); diff --git a/json/config.json b/json/config.json index 3508a98f..efce05f4 100644 --- a/json/config.json +++ b/json/config.json @@ -14,7 +14,7 @@ "online": true, "open": false, "cache": true, - "showKeysPanel": true, + "keysPanel": true, "port": 8000, "ip": null, "root": "/", diff --git a/json/help.json b/json/help.json index 20b0732d..f3078ed0 100644 --- a/json/help.json +++ b/json/help.json @@ -28,6 +28,7 @@ "--terminal-path ": "set terminal path", "--vim ": "enable vim hot keys", "--columns ": "set visible columns", + "--keys-panel ": "show keys panel", "--no-server ": "do not start server", "--no-auth ": "disable authorization", "--no-online ": "load scripts from local server", @@ -44,5 +45,6 @@ "--no-contact ": "disable contact", "--no-terminal ": "disable terminal", "--no-vim ": "disable vim hot keys", + "--no-keys-panel ": "hide keys panel", "--no-columns ": "set default visible columns" } diff --git a/man/cloudcmd.1 b/man/cloudcmd.1 index 4a9a03cd..a60c5225 100644 --- a/man/cloudcmd.1 +++ b/man/cloudcmd.1 @@ -51,6 +51,7 @@ programs in browser from any computer, mobile or tablet device. --terminal-path set terminal path --vim enable vim hot keys --columns set visible columns + --keys-panel show keys panel --no-auth disable authorization --no-server do not start server --no-online load scripts from local server @@ -68,6 +69,7 @@ programs in browser from any computer, mobile or tablet device. --no-terminal disable terminal --no-vim disable vim hot keys --no-columns set visible default columns + --no-keys-panel hide keys panel .SH RESOURCES AND DOCUMENTATION diff --git a/server/route.js b/server/route.js index 507aaa22..bce2ce19 100644 --- a/server/route.js +++ b/server/route.js @@ -49,7 +49,7 @@ function indexProcessing(options) { let data = options.data; - if (!config('showKeysPanel')) + if (!config('keysPanel')) data = hideKeysPanel(data); if (isOnePanel) diff --git a/test/server/route.js b/test/server/route.js index 5bfe2c79..13b6cd65 100644 --- a/test/server/route.js +++ b/test/server/route.js @@ -157,7 +157,7 @@ test('cloudcmd: route: buttons: one panel mode: move', (t) => { test('cloudcmd: route: keys panel: hide', (t) => { const config = { - showKeysPanel: false + keysPanel: false }; before({config}, (port, after) => { @@ -172,7 +172,7 @@ test('cloudcmd: route: keys panel: hide', (t) => { test('cloudcmd: route: keys panel', (t) => { const config = { - showKeysPanel: true + keysPanel: true }; before({config}, (port, after) => { diff --git a/tmpl/config.hbs b/tmpl/config.hbs index 0fd6adb0..282ece0a 100644 --- a/tmpl/config.hbs +++ b/tmpl/config.hbs @@ -107,8 +107,8 @@