From e7467199f2086af4ea47295d3d77a130bd1af8fc Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 18 Oct 2016 19:05:53 +0300 Subject: [PATCH] feature(cloudcmd) add deepword --- HELP.md | 3 ++- lib/cloudcmd.js | 16 ++++++++++++++++ lib/server/validate.js | 4 ++-- package.json | 1 + tmpl/config.hbs | 1 + 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/HELP.md b/HELP.md index bd122bb5..d102d2ec 100644 --- a/HELP.md +++ b/HELP.md @@ -10,6 +10,7 @@ [DWORD]: https://github.com/cloudcmd/dword "Editor based on CodeMirror" [EDWARD]: https://github.com/cloudcmd/edward "Editor based on Ace" +[DEEPWORD]: https://github.com/cloudcmd/deepword "Editor based on Monaco" [EDWARD_KEYS]: https://github.com/cloudcmd/edward/#hot-keys "Edward Hot keys" [TERMUX]: https://termux.com "Termux" **Cloud Commander** orthodox web file manager with console and editor. Will help you manage the server and work with files, directories and programs in browser from any computer, mobile or tablet. @@ -26,7 +27,7 @@ Benefits - Server works on **Windows**, **Linux**, **Mac OS** and **Android** (with help of [Termux][TERMUX]). - Could be used local or remotely. - Adapting to screen size. -- **2 built-in editors** with support of **syntax highlighting**: [Dword][DWORD] and [Edward][EDWARD]. +- **3 built-in editors** with support of **syntax highlighting**: [Dword][DWORD], [Edward][EDWARD] and [Deepword][DEEPWORD]. - [Console](https://github.com/cloudcmd/console "Console") with support of default OS command line. - Written in **JavaScript/Node.js**. diff --git a/lib/cloudcmd.js b/lib/cloudcmd.js index 4dcf71fb..96d93f79 100644 --- a/lib/cloudcmd.js +++ b/lib/cloudcmd.js @@ -21,6 +21,7 @@ var DIR = __dirname + '/', webconsole = require('console-io'), edward = require('edward'), dword = require('dword'), + deepword = require('deepword/legacy'), spero = require('spero'), remedy = require('remedy'), ishtar = require('ishtar'), @@ -127,6 +128,13 @@ function listen(prefix, socket) { authCheck: authCheck }); + deepword.listen(socket, { + size: size, + root: root, + prefix: prefix + '/deepword', + authCheck: authCheck + }); + spero.listen(socket, { root: root, prefix: prefix + '/spero', @@ -184,6 +192,14 @@ function cloudcmd(prefix) { zip : isZip }), + deepword({ + prefix : prefix + '/deepword', + minify : isMinify, + online : isOnline, + diff : isDiff, + zip : isZip + }), + spero({ prefix : prefix + '/spero', minify : isMinify, diff --git a/lib/server/validate.js b/lib/server/validate.js index 5466267c..526ed793 100644 --- a/lib/server/validate.js +++ b/lib/server/validate.js @@ -22,10 +22,10 @@ } function editor(name) { - var reg = /^(dword|edward)$/; + var reg = /^(dword|edward|deepword)$/; if (!reg.test(name)) - exit('cloudcmd --editor: could be "dword" or "edward" only'); + exit('cloudcmd --editor: could be "dword", "edward" or "deepword" only'); } })(); diff --git a/package.json b/package.json index fc1c3334..b39f6e36 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "console-io": "^2.7.1", "copymitter": "^1.8.0", "criton": "^1.0.0", + "deepword": "^1.1.2", "dword": "^3.2.0", "edward": "^3.2.0", "execon": "^1.2.0", diff --git a/tmpl/config.hbs b/tmpl/config.hbs index bf83cdae..9afda97c 100644 --- a/tmpl/config.hbs +++ b/tmpl/config.hbs @@ -45,6 +45,7 @@