Skip to content

Commit

Permalink
feature(config) rm htmlDialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Apr 27, 2018
1 parent 9f0d3b2 commit 18027fa
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 35 deletions.
3 changes: 0 additions & 3 deletions HELP.md
Expand Up @@ -82,7 +82,6 @@ Cloud Commander supports command line parameters:
| `--progress` | show progress of file operations
| `--confirm-copy` | confirm copy
| `--confirm-move` | confirm move
| `--html-dialogs` | use html dialogs
| `--open` | open web browser when server started
| `--name` | set tab name in web browser
| `--one-panel-mode` | set one panel mode
Expand All @@ -105,7 +104,6 @@ Cloud Commander supports command line parameters:
| `--no-progress` | do not show progress of file operations
| `--no-confirm-copy` | do not confirm copy
| `--no-confirm-move` | do not confirm move
| `--no-html-dialogs` | do not use html dialogs
| `--no-contact` | disable contact
| `--no-config-dialog` | disable config dialog
| `--no-console` | disable console
Expand Down Expand Up @@ -376,7 +374,6 @@ Here is description of options:
"progress" : true, /* show progress of file operations */
"confirmCopy" : true, /* confirm copy */
"confirmMove" : true, /* confirm move */
"htmlDialogs" : true, /* use html dialogs */
"showConfig" : false, /* show config at startap */
"onePanelMode" : false, /* set one panel mode */
"contact" : true, /* enable contact */
Expand Down
3 changes: 0 additions & 3 deletions bin/cloudcmd.js
Expand Up @@ -48,7 +48,6 @@ const args = require('minimist')(argv.slice(2), {
'one-panel-mode',
'confirm-copy',
'confirm-move',
'html-dialogs',
'show-config',
'vim',
'keys-panel',
Expand Down Expand Up @@ -78,7 +77,6 @@ const args = require('minimist')(argv.slice(2), {
'one-panel-mode': choose(env.bool('one_panel_mode'), config('onePanelMode')),
'confirm-copy': choose(env.bool('confirm_copy'), config('confirmCopy')),
'confirm-move': choose(env.bool('confirm_move'), config('confirmMove')),
'html-dialogs': config('htmlDialogs'),
'vim': choose(env.bool('vim'), config('vim')),
'columns': env('columns') || config('columns') || '',
'keys-panel': env.bool('keys_panel') || config('keysPanel'),
Expand Down Expand Up @@ -130,7 +128,6 @@ function main() {
config('root', args.root);
config('vim', args.vim);
config('columns', args.columns);
config('htmlDialogs', args['html-dialogs']);
config('confirmCopy', args['confirm-copy']);
config('confirmMove', args['confirm-move']);
config('onePanelMode', args['one-panel-mode']);
Expand Down
29 changes: 3 additions & 26 deletions client/dom/dialog.js
@@ -1,39 +1,16 @@
/* global DOM */
/* global smalltalk */

'use strict';

module.exports = Dialog;

const smalltack = require('smalltalk');

function Dialog(prefix, config) {
if (!(this instanceof Dialog))
return new Dialog(prefix, config);

load(config.htmlDialogs);

function getJsName(htmlDialogs) {
const is = window.Promise;
const js = '.min.js';
const jsName = is ? js : '.poly' + js;

if (!htmlDialogs)
return '.native' + jsName;

return jsName;
}

function load(htmlDialogs) {
const noop = () => {};
const name = 'smalltalk';
const dir = '/modules/' + name + '/dist/';
const jsName = getJsName(htmlDialogs);

const names = [jsName, '.min.css'].map((ext) => {
return prefix + dir + name + ext;
});

DOM.load.parallel(names, noop);
}
const {htmlDialogs} = config;

const alert = (title, message) => {
return smalltalk.alert(title, message);
Expand Down
1 change: 0 additions & 1 deletion json/config.json
Expand Up @@ -20,7 +20,6 @@
"root": "/",
"prefix": "",
"progress": true,
"htmlDialogs": true,
"contact": true,
"confirmCopy": true,
"confirmMove": true,
Expand Down
2 changes: 0 additions & 2 deletions man/cloudcmd.1
Expand Up @@ -39,7 +39,6 @@ programs in browser from any computer, mobile or tablet device.
--progress show progress of file operations
--confirm-copy confirm copy
--confirm-move confirm move
--html-dialogs use html dialogs
--open open web browser when server started
--name set tab name in web browser
--one-panel-mode set one panel mode
Expand All @@ -62,7 +61,6 @@ programs in browser from any computer, mobile or tablet device.
--no-progress do not show progress of file operations
--no-confirm-copy do not confirm copy
--no-confirm-move do not confirm move
--no-html-dialogs do not use html dialogs
--no-contact disable contact
--no-config-dialog disable config dialog
--no-console disable console
Expand Down

0 comments on commit 18027fa

Please sign in to comment.