diff --git a/HELP.md b/HELP.md index e3f4de55..02a00269 100644 --- a/HELP.md +++ b/HELP.md @@ -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 */ diff --git a/bin/cloudcmd.js b/bin/cloudcmd.js index 8933e436..d2d4d40b 100755 --- a/bin/cloudcmd.js +++ b/bin/cloudcmd.js @@ -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']); diff --git a/client/cloudcmd.js b/client/cloudcmd.js index 9fc6ccf8..42d48eee 100644 --- a/client/cloudcmd.js +++ b/client/cloudcmd.js @@ -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'); diff --git a/client/dom/dialog.js b/client/dom/dialog.js index 7d1ff41c..97a65db2 100644 --- a/client/dom/dialog.js +++ b/client/dom/dialog.js @@ -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!'); +}; diff --git a/client/dom/index.js b/client/dom/index.js index 09a3d8b8..e76f5524 100644 --- a/client/dom/index.js +++ b/client/dom/index.js @@ -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; diff --git a/json/config.json b/json/config.json index f5c4db6d..d610e960 100644 --- a/json/config.json +++ b/json/config.json @@ -18,7 +18,6 @@ "root": "/", "prefix": "", "progress": true, - "htmlDialogs": true, "contact": true, "confirmCopy": true, "confirmMove": true, diff --git a/man/cloudcmd.1 b/man/cloudcmd.1 index 4a4dbca4..87d2a8f2 100644 --- a/man/cloudcmd.1 +++ b/man/cloudcmd.1 @@ -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