feature(config) rm option: htmlDialogs

This commit is contained in:
coderaiser 2018-04-27 15:42:10 +03:00
parent 234f7bcac0
commit dc781a04c0
7 changed files with 16 additions and 44 deletions

View file

@ -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` | show one file panel (**deprecated**: use `--one-file-panel` instead)
@ -107,7 +106,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
@ -377,7 +375,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 */
"contact" : true, /* enable contact */
"configDialog" : true, /* enable config dialog */

View file

@ -51,7 +51,6 @@ const args = require('minimist')(argv.slice(2), {
'one-panel-mode',
'confirm-copy',
'confirm-move',
'html-dialogs',
'show-config',
'vim',
'keys-panel',
@ -81,7 +80,6 @@ const args = require('minimist')(argv.slice(2), {
'one-panel-mode': '',
'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'),
@ -132,7 +130,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-file-panel']);

View file

@ -18,14 +18,7 @@ module.exports = window.CloudCmd = (config) => {
window.DOM = DOM;
window.CloudCmd = require('./client');
const Dialog = require('./dom/dialog');
const prefix = getPrefix(config.prefix);
const {htmlDialogs} = config;
DOM.Dialog = Dialog(prefix, {
htmlDialogs
});
require('./listeners');
require('./key');

View file

@ -1,33 +1,19 @@
'use strict';
module.exports = Dialog;
const {
alert,
prompt,
confirm,
}= require('smalltalk');
const sm = require('smalltalk');
const smNative = require('smalltalk/native');
module.exports = {
alert,
prompt,
confirm,
};
function Dialog(prefix, config) {
if (!(this instanceof Dialog))
return new Dialog(prefix, config);
const {htmlDialogs} = config;
const smalltalk = htmlDialogs ? sm : smNative;
const alert = (title, message) => {
return smalltalk.alert(title, message);
};
this.alert = alert;
this.prompt = (title, message, value, options) => {
return smalltalk.prompt(title, message, value, options);
};
this.confirm = (title, message, options) => {
return smalltalk.confirm(title, message, options);
};
this.alert.noFiles = (title) => {
return alert(title, 'No files selected!');
};
}
module.exports.alert.noFiles = (title) => {
return alert(title, 'No files selected!');
};

View file

@ -12,6 +12,7 @@ const load = require('./load');
const Files = require('./files');
const RESTful = require('./rest');
const Storage = require('./storage');
const Dialog = require('./dialog');
const currentFile = require('./current-file');
const DOMTree = require('./dom-tree');
@ -27,6 +28,7 @@ DOM.load = load;
DOM.Files = Files;
DOM.RESTful = RESTful;
DOM.Storage = Storage;
DOM.Dialog = Dialog;
module.exports = DOM;

View file

@ -18,7 +18,6 @@
"root": "/",
"prefix": "",
"progress": true,
"htmlDialogs": true,
"contact": true,
"confirmCopy": true,
"confirmMove": true,

View file

@ -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-panele-mode show one file panel (deprecated use --one-file-panel instead)
@ -63,7 +62,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