From 6f72282b22261ed1d1e81206e0d4750be69a8cc0 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Sep 2013 10:55:14 +0300 Subject: [PATCH 01/69] docs(readme) configuration: add assume-unchanged --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 0c869487..0479b2d8 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,16 @@ All main configuration could be done via config.json. } ``` +If you had changed **config** and want to keep updating via git, +you should execute next command in root directory of **Cloud Commander**: +``` +git update-index --assume-unchanged json/config.json +``` +To get back to tracking: +``` +git update-index --no-assume-unchanged json/config.json +``` + Server --------------- Standard practices say no non-root process gets to talk to From 14d01c1c8621752fca7b7ba38dcc3260997e399c Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Sep 2013 10:57:23 +0300 Subject: [PATCH 02/69] docs(readme) configuration: add config.json link --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0479b2d8..f7b40c95 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ or install in npm: Configuration --------------- -All main configuration could be done via config.json. +All main configuration could be done via [config.json](json/config.json "Config"). ```js { "api_url" :"/api/v1", @@ -252,7 +252,7 @@ To start **Cloud Commander** only one command needed: or on win platform just cloudcmd -After that Cloud Commander reads port information from config file [config.json](json/config.json#L17) and start server +After that Cloud Commander reads port information from config file [config.json](json/config.json#L17 "Config") and start server on this port ( **8000** by default ), if none of port varibles ( *cloud9*, *cloudfoundry* and *nodester* ) isn't exist. Then type in browser From a6d1631ae5da09ade2b19f7cfedb284d586ac042 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Sep 2013 11:12:40 +0300 Subject: [PATCH 03/69] docs(readme) server nginx: limit of uploading data --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index f7b40c95..6c456a5d 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,12 @@ ln -s ./sites-enabled/io.cloudcmd.io ./sites-available /etc/init.d/nginx restart ``` +If you will want to upload files, you should add next line in **http** section of **nginx.conf**: +``` +#limit of uploading data +client_max_body_size 100m; +``` + To run Cloud Commander as daemon in linux you could set **log** to true in config and do something like this: From 4c4ce704baab604a81ea7d6c1f2170793fae25c6 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Sep 2013 11:14:08 +0300 Subject: [PATCH 04/69] docs(readme) server nginx: nginx.conf -> /etc/nginx/nginx.conf --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c456a5d..3a72f07f 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,7 @@ ln -s ./sites-enabled/io.cloudcmd.io ./sites-available /etc/init.d/nginx restart ``` -If you will want to upload files, you should add next line in **http** section of **nginx.conf**: +If you will want to upload files, you should add next line in **http** section of **/etc/nginx/nginx.conf**: ``` #limit of uploading data client_max_body_size 100m; From a1b8d0d53670869a6e6936ca14fe73dc371e1268 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Sep 2013 08:25:47 +0000 Subject: [PATCH 05/69] refactor(cloudcmd) writeLogsToFile --- cloudcmd.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cloudcmd.js b/cloudcmd.js index 65d35322..40da7413 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -343,13 +343,11 @@ /* function sets stdout to file log.txt */ - function writeLogsToFile(){ - var stdo = fs.createWriteStream('./log.txt'); + function writeLogsToFile() { + var stdout = process.stdout, + writeFile = fs.createWriteStream('log.txt'), + write = writeFile.write.bind(writeFile); - process.stdout.write = (function(write) { - return function(string, encoding, fd) { - stdo.write(string); - }; - })(process.stdout.write); + stdout.write = write; } })(); \ No newline at end of file From 144e1af79fc14ebfc09ad7bca773fbfd2c70578f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Sep 2013 17:06:19 +0300 Subject: [PATCH 06/69] docs(readme) varibles -> variables --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a72f07f..9d627eb7 100644 --- a/README.md +++ b/README.md @@ -259,7 +259,7 @@ or on win platform just cloudcmd After that Cloud Commander reads port information from config file [config.json](json/config.json#L17 "Config") and start server -on this port ( **8000** by default ), if none of port varibles ( *cloud9*, *cloudfoundry* and *nodester* ) isn't exist. +on this port ( **8000** by default ), if none of port variables ( *cloud9*, *cloudfoundry* and *nodester* ) isn't exist. Then type in browser http://127.0.0.1:8000 From 77fe8dc107847a8209bbdb56ab1123355bfb13ac Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 1 Oct 2013 10:03:16 +0300 Subject: [PATCH 07/69] docs(readme) mv flattr under the logo --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d627eb7..bd33486e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ Cloud Commander v0.4.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] =============== ###[Main][MainURL] [Blog][BlogURL] [Demo][DemoURL] -[![Flattr][FlattrIMGURL]][FlattrURL] [NPMIMGURL]: https://badge.fury.io/js/cloudcmd.png [BuildStatusIMGURL]: https://secure.travis-ci.org/coderaiser/cloudcmd.png?branch=master [DependencyStatusIMGURL]: https://gemnasium.com/coderaiser/cloudcmd.png @@ -19,7 +18,7 @@ Cloud Commander v0.4.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status] **Cloud Commander** - cloud file manager with console and editor. ![Cloud Commander](/img/logo/cloudcmd.png "Cloud Commander") - +[![Flattr][FlattrIMGURL]][FlattrURL] Benefits --------------- - full browser compatibility *(ie6+,chrome,safari,opera,firefox)*; From 59a7ceb7028e9b522e7083ade2f12cf8187fd7b3 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 1 Oct 2013 10:03:58 +0300 Subject: [PATCH 08/69] docs(readme) add "\n" --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bd33486e..3798f8a7 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,9 @@ Cloud Commander v0.4.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status] **Cloud Commander** - cloud file manager with console and editor. ![Cloud Commander](/img/logo/cloudcmd.png "Cloud Commander") + [![Flattr][FlattrIMGURL]][FlattrURL] + Benefits --------------- - full browser compatibility *(ie6+,chrome,safari,opera,firefox)*; From c5575bca4602e6badc15b41263f312a6e2fccf45 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 1 Oct 2013 10:07:59 +0300 Subject: [PATCH 09/69] docs(readme) NPMURL: badge.fury.io/js/cloudcmd -> npmjs.org/package/cloudcmd --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3798f8a7..d8c88441 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Cloud Commander v0.4.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status] [DependencyStatusIMGURL]: https://gemnasium.com/coderaiser/cloudcmd.png [FlattrIMGURL]: http://api.flattr.com/button/flattr-badge-large.png [NPM_INFO_IMG]: https://nodei.co/npm/cloudcmd.png?downloads=true&&stars -[NPMURL]: http://badge.fury.io/js/cloudcmd +[NPMURL]: https://npmjs.org/package/cloudcmd [BuildStatusURL]: http://travis-ci.org/coderaiser/cloudcmd "Build Status" [DependencyStatusURL]: https://gemnasium.com/coderaiser/cloudcmd "Dependency Status" [FlattrURL]: https://flattr.com/submit/auto?user_id=coderaiser&url=github.com/coderaiser/cloudcmd&title=cloudcmd&language=&tags=github&category=software "flattr" From eb13dd1d5dbcce2f62381e0a9df1dcef9ac27873 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 1 Oct 2013 10:27:21 +0300 Subject: [PATCH 10/69] docs(ChangeLog) fix date: 2012 -> 2013 --- ChangeLog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 950d2320..449a947b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2012.09.27, v0.4.0 +2013.09.27, v0.4.0 feature: - (edit) add showMessage @@ -104,7 +104,7 @@ inside: - (css) rm !important - (css) path-icon: rm font-family, font-size -2012.07.01, v0.3.0 +2013.07.01, v0.3.0 * Changed jquery cdn to one with https suport jquery.com -> google cdn. @@ -255,7 +255,7 @@ getJSONfromFileTable. * chore(minify) v0.2.0 -> v0.2.1 -2012.04.22, v0.2.0 +2013.04.22, v0.2.0 * Added alerting about errors. @@ -351,7 +351,7 @@ query other then json on /fs url. directory where file was removed. -2012.03.01, v0.1.9 +2013.03.01, v0.1.9 * Changed the way of getting github application id (now it's just from config, rest api removed). From ca71cf0a3dcc24d80f9fd69be1aa9ef532798314 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 1 Oct 2013 07:35:58 +0000 Subject: [PATCH 11/69] docs(readme, changelog) fix date v0.3.0: 2013.07.01 -> 2013.08.01 --- ChangeLog | 2 +- ChangeLog.rus.md | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 449a947b..782cb656 100644 --- a/ChangeLog +++ b/ChangeLog @@ -104,7 +104,7 @@ inside: - (css) rm !important - (css) path-icon: rm font-family, font-size -2013.07.01, v0.3.0 +2013.08.01, v0.3.0 * Changed jquery cdn to one with https suport jquery.com -> google cdn. diff --git a/ChangeLog.rus.md b/ChangeLog.rus.md index 370d48af..0952eb49 100644 --- a/ChangeLog.rus.md +++ b/ChangeLog.rus.md @@ -1,4 +1,4 @@ -2012.07.01, v0.3.0 +2012.08.01, v0.3.0 =============== Уже прошла середина лета и, благодаря легкому похолоданию, мы, кажется, начали больше ценить эту волшебную пору года. Через месяц детишки пойдут в школу, в город нахлынут толпы жаждущих новых знаний студентов, и город плавно войдет в привычный ритм. С момента прошлого релиза прошло уже больше трёх месяцев, а это значит пора выкатывать новый релиз. В нём будет очень много нового и интересного. У командира наконецто появилась новая иконка, терминал и редактор были полностью заменены и привязаны к вьеру. Код значительно упрощен и оптимизирован. Далее подробнее. diff --git a/README.md b/README.md index d8c88441..a6c19edf 100644 --- a/README.md +++ b/README.md @@ -333,7 +333,7 @@ so to get it you should type a couple more commands: Version history --------------- - *2013.09.27*, **[v0.4.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.4.0.zip)** -- *2013.07.01*, **[v0.3.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.3.0.zip)** +- *2013.08.01*, **[v0.3.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.3.0.zip)** - *2013.04.22*, **[v0.2.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.2.0.zip)** - *2013.03.01*, **[v0.1.9](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.9.zip)** - *2012.12.12*, **[v0.1.8](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.8.zip)** From c6ade9a4af02626813c7fe66dcd0e54761fe302c Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 1 Oct 2013 07:48:40 +0000 Subject: [PATCH 12/69] feature(package) minify: v0.2.1 -> v0.2.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0d2eaf0c..113949a1 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "subdomain": "cloudcmd", "dependencies": { "dropbox": "0.10.1", - "minify": "0.2.1", + "minify": "0.2.2", "socket.io": "0.9.16" }, "devDependencies": {}, From 75c7b2849b61d5c473ce191f1aa4a98c7846242d Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 1 Oct 2013 13:26:29 +0300 Subject: [PATCH 13/69] docs(readme) rm "automated minification *client js-files and onstart-reading Cloud manager files on server starting.*" --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a6c19edf..ee901c88 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,6 @@ Benefits definitely will can work with cached copy of directory listings)*; - key binding - disabled js support *(working in limited mode)*. -- automated minification *client js-files and onstart-reading Cloud manager files on server starting.* **Cloud Commander** uses all benefits of js, so if js is disabled, we go to *limited mode*. From 9412071926999fb4744a05e49fbae1a997476bcd Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 2 Oct 2013 13:05:16 +0000 Subject: [PATCH 14/69] feature(config) add online --- README.md | 1 + lib/client/dom.js | 43 ++++++++++++++++++++++++----------------- lib/client/listeners.js | 5 ++++- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index ee901c88..5c0689e6 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ All main configuration could be done via [config.json](json/config.json "Config" "html" : true, "img" : false }, + "online" : true, /* load js files from cdn or local path */ "cache" : true, "logs" : false, /* logs or console ouput */ "show_keys_panel" : true, /* show classic panel with buttons of keys */ diff --git a/lib/client/dom.js b/lib/client/dom.js index f98fc816..2d78f7d5 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1053,26 +1053,33 @@ var CloudCmd, Util, DOM, CloudFunc; * @param pCallBack */ this.jqueryLoad = function(pCallBack) { - Loader.jquery({ - onload: pCallBack, + CloudCmd.getConfig(function(config) { + var online = config.online; - onerror: function() { - Loader.jsload('/lib/client/jquery.js', { - onload: pCallBack + Util.ifExec(!online, + function() { + Loader.jsload('/lib/client/jquery.js', { + onload: pCallBack + }); + + /* if could not load jquery from google server + * maybe we offline, load font from local + * directory */ + Loader.cssSet({ + id :'local-droids-font', + element : document.head, + inner : '@font-face {font-family: "Droid Sans Mono";' + + 'font-style: normal;font-weight: normal;' + + 'src: local("Droid Sans Mono"), local("DroidSansMono"),'+ + ' url("/font/DroidSansMono.woff") format("woff");}' + }); + }, + function(callback) { + Loader.jquery({ + onload: pCallBack, + onerror: callback + }); }); - - /* if could not load jquery from google server - * maybe we offline, load font from local - * directory */ - Loader.cssSet({ - id :'local-droids-font', - element : document.head, - inner : '@font-face {font-family: "Droid Sans Mono";' + - 'font-style: normal;font-weight: normal;' + - 'src: local("Droid Sans Mono"), local("DroidSansMono"),'+ - ' url("/font/DroidSansMono.woff") format("woff");}' - }); - } }); }; diff --git a/lib/client/listeners.js b/lib/client/listeners.js index f74dbcb9..6aa2f731 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -12,7 +12,10 @@ var Util, DOM, CloudCmd; this.analytics = function() { getConfig(function(config) { - if (config.analytics) { + var analytics = config.analytics, + online = config.online; + + if (analytics && online) { Events.addOneTime('mousemove', function(){ var FIVE_SECONDS = 5000, lUrl = CloudCmd.LIBDIRCLIENT + 'analytics.js'; From 026a8b53b3b5b5f45513892571bd740d368e8ca4 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 2 Oct 2013 13:14:28 +0000 Subject: [PATCH 15/69] feature(config) add online --- json/config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/json/config.json b/json/config.json index 4b910d41..c91da350 100644 --- a/json/config.json +++ b/json/config.json @@ -9,6 +9,7 @@ "html" : true, "img" : true }, + "online" : true, "cache" : true, "logs" : false, "show_keys_panel" : true, From b973e2541a353039d73bbb65bf2c540ac478e9c3 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 2 Oct 2013 13:24:27 +0000 Subject: [PATCH 16/69] refactor(dom) mv set font to listeners --- lib/client/dom.js | 12 ------------ lib/client/listeners.js | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index 2d78f7d5..4689a7c1 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1061,18 +1061,6 @@ var CloudCmd, Util, DOM, CloudFunc; Loader.jsload('/lib/client/jquery.js', { onload: pCallBack }); - - /* if could not load jquery from google server - * maybe we offline, load font from local - * directory */ - Loader.cssSet({ - id :'local-droids-font', - element : document.head, - inner : '@font-face {font-family: "Droid Sans Mono";' + - 'font-style: normal;font-weight: normal;' + - 'src: local("Droid Sans Mono"), local("DroidSansMono"),'+ - ' url("/font/DroidSansMono.woff") format("woff");}' - }); }, function(callback) { Loader.jquery({ diff --git a/lib/client/listeners.js b/lib/client/listeners.js index 6aa2f731..939f924c 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -34,6 +34,7 @@ var Util, DOM, CloudCmd; dragndrop(); unload(); pop(); + online(); }; this.initKeysPanel = function() { @@ -289,6 +290,22 @@ var Util, DOM, CloudCmd; }); } + function online() { + var cssSet = Util.retExec(DOM.cssSet, { + id :'local-droids-font', + element : document.head, + inner : '@font-face {font-family: "Droid Sans Mono";' + + 'font-style: normal;font-weight: normal;' + + 'src: local("Droid Sans Mono"), local("DroidSansMono"),'+ + ' url("/font/DroidSansMono.woff") format("woff");}' + }); + + if (navigator.onLine) + Events.addOneTime('offline', cssSet); + else + cssSet(); + } + } })(Util, DOM); From 46469972622b4ce502ef86f17d8df3102e0b49ef Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 2 Oct 2013 13:27:20 +0000 Subject: [PATCH 17/69] fix(dom) Loader: this -> Loader --- lib/client/dom.js | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index 4689a7c1..e63937bc 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -730,8 +730,6 @@ var CloudCmd, Util, DOM, CloudFunc; * @param pFunc - onload function */ this.anyLoadOnLoad = function(pParams_a, pFunc) { - var lRet = this; - if ( Util.isArray(pParams_a) ) { var lParam = pParams_a.pop(), lFunc = function() { @@ -742,19 +740,19 @@ var CloudCmd, Util, DOM, CloudFunc; lParam = { src : lParam }; else if ( Util.isArray(lParam) ) { - this.anyLoadInParallel(lParam, lFunc); + Loader.anyLoadInParallel(lParam, lFunc); } if (lParam && !lParam.func) { lParam.func = lFunc; - this.anyload(lParam); + Loader.anyload(lParam); }else Util.exec(pFunc); } - return lRet; + return Loader; }; /** @@ -766,8 +764,7 @@ var CloudCmd, Util, DOM, CloudFunc; * @param pFunc - onload function */ this.anyLoadInParallel = function(pParams_a, pFunc) { - var lRet = this, - lDone = [], + var lDone = [], lDoneFunc = function (pCallBack) { Util.exec(pCallBack); @@ -792,11 +789,11 @@ var CloudCmd, Util, DOM, CloudFunc; var lFunc = lParam.func; lParam.func = Util.retExec(lDoneFunc, lFunc); - this.anyload(lParam); + Loader.anyload(lParam); } } - return lRet; + return Loader; }; /** @@ -853,7 +850,7 @@ var CloudCmd, Util, DOM, CloudFunc; } /* убираем путь к файлу, оставляя только название файла */ if (!lID && lSrc) - lID = this.getIdBySrc(lSrc); + lID = DOM.getIdBySrc(lSrc); var lElement = DOMTree.getById(lID); @@ -953,7 +950,7 @@ var CloudCmd, Util, DOM, CloudFunc; * @param pFunc */ this.jsload = function(pSrc, pFunc) { - var lRet = this.anyload({ + var lRet = Loader.anyload({ name : 'script', src : pSrc, func : pFunc @@ -984,7 +981,7 @@ var CloudCmd, Util, DOM, CloudFunc; pParams_o.name = 'style'; pParams_o.parent = pParams_o.parent || document.head; - return this.anyload(pParams_o); + return Loader.anyload(pParams_o); }, /** @@ -1000,7 +997,7 @@ var CloudCmd, Util, DOM, CloudFunc; pParams_o[i].parent = pParams_o.parent || document.head; } - return this.anyload(pParams_o); + return Loader.anyload(pParams_o); } else if ( Util.isString(pParams_o) ) @@ -1009,7 +1006,7 @@ var CloudCmd, Util, DOM, CloudFunc; pParams_o.name = 'link'; pParams_o.parent = pParams_o.parent || document.head; - return this.anyload(pParams_o); + return Loader.anyload(pParams_o); }; /** From d5adbd3b1f69d77c11d89f45eb9b9c3538748668 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 2 Oct 2013 13:32:41 +0000 Subject: [PATCH 18/69] feature(dom) Cmd jqueryLoad: add navigator.onLine --- lib/client/dom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index e63937bc..452bc40d 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1051,7 +1051,7 @@ var CloudCmd, Util, DOM, CloudFunc; */ this.jqueryLoad = function(pCallBack) { CloudCmd.getConfig(function(config) { - var online = config.online; + var online = config.online && navigator.onLine; Util.ifExec(!online, function() { From b3b0e1da1ac1b17f3b5e0f6173c92d0eaafffb1b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 2 Oct 2013 13:53:17 +0000 Subject: [PATCH 19/69] refactor(key) Tab: add " " --- lib/client/key.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/client/key.js b/lib/client/key.js index 85ac4ff7..2924e958 100644 --- a/lib/client/key.js +++ b/lib/client/key.js @@ -52,7 +52,6 @@ var CloudCmd, Util, DOM; lTabPanel = { left : 0, right : 0 - }; this.isBind = function() {return Binded;}; @@ -80,18 +79,20 @@ var CloudCmd, Util, DOM; switch (lKeyCode) { case Key.TAB: /* changing parent panel of curent-file */ - var lPanel = DOM.getPanel(), - lId = lPanel.id; + var lFirstFileOnList, + lPanel = DOM.getPanel(), + lId = lPanel.id; - lTabPanel[lId] = lCurrent; + lTabPanel[lId] = lCurrent; - lPanel = DOM.getPanel({active:false}); - lId = lPanel.id; + lPanel = DOM.getPanel({active:false}); + lId = lPanel.id; - if (lTabPanel[lId]) - DOM.setCurrentFile(lTabPanel[lId]); - else{ - var lFirstFileOnList = DOM.getByTag('li', lPanel)[2]; + lCurrent = lTabPanel[lId]; + if (lCurrent) + DOM.setCurrentFile(lCurrent); + else { + lFirstFileOnList = DOM.getByTag('li', lPanel)[2]; DOM.setCurrentFile(lFirstFileOnList); } From f41b3f021d841575511937b3da70633a2ba02f74 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 2 Oct 2013 13:53:53 +0000 Subject: [PATCH 20/69] fix(key) current -> current && current.parent; --- lib/client/key.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/key.js b/lib/client/key.js index 2924e958..d813883f 100644 --- a/lib/client/key.js +++ b/lib/client/key.js @@ -89,7 +89,7 @@ var CloudCmd, Util, DOM; lId = lPanel.id; lCurrent = lTabPanel[lId]; - if (lCurrent) + if (lCurrent && lCurrent.parentElement) DOM.setCurrentFile(lCurrent); else { lFirstFileOnList = DOM.getByTag('li', lPanel)[2]; From 143bcd65b6a2b7ef9615611f84137b30b480e28f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 3 Oct 2013 11:27:26 +0000 Subject: [PATCH 21/69] feature(menu) add "(Un)Select All" --- README.md | 1 + lib/client/dom.js | 14 ++++++++++++++ lib/client/key.js | 10 ++-------- lib/client/menu.js | 1 + 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5c0689e6..e1d5172a 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ Right mouse click button shows context menu with items: - Rename - Delete - Zip file +- (Un)Select All - Upload to (Dropbox, Github, GDrive) - Download - New (File, Dir, from cloud) diff --git a/lib/client/dom.js b/lib/client/dom.js index 452bc40d..f476fdfa 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1478,6 +1478,20 @@ var CloudCmd, Util, DOM, CloudFunc; return this; }; + this.toggleAllSelectedFiles = function(pCurrent) { + var i, n, + isStr = Util.isString(pCurrent), + lCurrent = !isStr && pCurrent || Cmd.getCurrentFile(), + lParent = lCurrent.parentElement, + lNodes = lParent.childNodes; + + /* not path and fm_header */ + for (i = 2, n = lNodes.length; i < n; i++) + DOM.toggleSelectedFile( lNodes[i] ); + + return Cmd; + }; + /** * setting history wrapper diff --git a/lib/client/key.js b/lib/client/key.js index d813883f..ef6ef032 100644 --- a/lib/client/key.js +++ b/lib/client/key.js @@ -269,14 +269,8 @@ var CloudCmd, Util, DOM; case Key.A: if (pEvent.ctrlKey) { - var lParent = lCurrent.parentElement, - lNodes = lParent.childNodes; - - /* not path and fm_header */ - for (i = 2, n = lNodes.length; i < n; i++) - DOM.toggleSelectedFile( lNodes[i] ); - - DOM.preventDefault(pEvent); + DOM .toggleAllSelectedFiles(lCurrent) + .preventDefault(pEvent); } break; diff --git a/lib/client/menu.js b/lib/client/menu.js index 24a04b7c..d35f51bb 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -180,6 +180,7 @@ var CloudCmd, Util, DOM, CloudFunc, $; setTimeout( Util.retExec(DOM.renameCurrent), 100); }, 'Delete' : Util.retExec(DOM.promptDeleteSelected), + '(Un)Select All': DOM.toggleAllSelectedFiles, 'Zip file' : DOM.zipFile }; From 5e96e2f1684593d4ce35b4c7d8575dd7416aeb2b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 3 Oct 2013 17:50:56 +0300 Subject: [PATCH 22/69] docs(readme) add "\n" --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index e1d5172a..87328134 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Hot keys --------------- In all modern web browsers (but not in IE, becouse he special) hot keys works. There is a short list: + - **F1** - help - **F2** - rename current file - **F3** - view @@ -144,6 +145,7 @@ or install in npm: Configuration --------------- All main configuration could be done via [config.json](json/config.json "Config"). + ```js { "api_url" :"/api/v1", @@ -172,10 +174,13 @@ All main configuration could be done via [config.json](json/config.json "Config" If you had changed **config** and want to keep updating via git, you should execute next command in root directory of **Cloud Commander**: + ``` git update-index --assume-unchanged json/config.json ``` + To get back to tracking: + ``` git update-index --no-assume-unchanged json/config.json ``` @@ -188,12 +193,14 @@ to start Cloud Commander as non-root. How it could be solved? There is a couple easy and fast ways. One of them is port forwarding. ###Iptables Just run [shell/addtables.sh](shell/addtables.sh) for default options. + ```sh @:/tmp/cloudcmd (dev) $ sudo iptables -t nat -L # look rules before @:/tmp/cloudcmd (dev) $ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000 @:/tmp/cloudcmd (dev) $ sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 4430 @:/tmp/cloudcmd (dev) $ sudo iptables -t nat -L # look rules after ``` + You should see something like this ( **8000** and **4430** should be in config as **port** and **sslPort** ) target prot opt source destination @@ -210,11 +217,14 @@ in your list they could differ). ###nginx Get [nginx](http://nginx.org/ "nginx"). On linux it could be done like that + ```sh sudo apt-get install nginx #for ubuntu and debian ``` + Than make host file **/etc/nginx/sites-enabled/io.cloudcmd.io** ( *io.cloudcmd.io* is your domain name) with content: + ```sh server { listen 80; @@ -225,6 +235,7 @@ server { } } ``` + ```sh # create symlink of this file ln -s ./sites-enabled/io.cloudcmd.io ./sites-available @@ -233,6 +244,7 @@ ln -s ./sites-enabled/io.cloudcmd.io ./sites-available ``` If you will want to upload files, you should add next line in **http** section of **/etc/nginx/nginx.conf**: + ``` #limit of uploading data client_max_body_size 100m; From 30c7b0cec262275b3c93982eeb5841db7892360a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 06:39:52 +0000 Subject: [PATCH 23/69] chore(main) sendError: add " " --- lib/server/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/server/main.js b/lib/server/main.js index 269e7b4b..47fe4233 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -325,7 +325,7 @@ p.status = FILE_NOT_FOUND; if (!p.data && pError) p.data = pError.toString(); - + sendResponse(p); } } From 9ee9211ae00c00ee9863a491ff8d2e09060cbfd1 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 06:40:41 +0000 Subject: [PATCH 24/69] chore(main) sendError: add " " --- lib/server/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/server/main.js b/lib/server/main.js index 47fe4233..80429b18 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -318,13 +318,14 @@ * send error response */ function sendError(pParams, pError) { - var lRet = checkParams(pParams); + var p, lRet = checkParams(pParams); - if(lRet){ - var p = pParams; + if (lRet) { + p = pParams; p.status = FILE_NOT_FOUND; + if (!p.data && pError) - p.data = pError.toString(); + p.data = pError.toString(); sendResponse(p); } From 109e412ae7f7f3c29843f636f3b78e1274ba159f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 07:10:01 +0000 Subject: [PATCH 25/69] refactor(main) MOVED_PERMANENTLY --- lib/server/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/server/main.js b/lib/server/main.js index 80429b18..49c5d2bf 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -13,7 +13,7 @@ ext, path, fs, zlib, url, pipe, - OK, FILE_NOT_FOUND, MOVED_PERMANENTLY = 301, + OK, FILE_NOT_FOUND, MOVED_PERMANENTLY, REQUEST, RESPONSE, Config = { @@ -25,6 +25,7 @@ /* Consts */ exports.OK = OK = 200; + MOVED_PERMANENTLY = 301; exports.FILE_NOT_FOUND = FILE_NOT_FOUND = 404; exports.REQUEST = REQUEST = 'request'; From beca4c609faf591f827f25678ee549230229b9d2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 08:24:15 +0000 Subject: [PATCH 26/69] refactor(pipe) create: add ifExec --- lib/server/pipe.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/server/pipe.js b/lib/server/pipe.js index 45e3ead1..c52ae9b8 100644 --- a/lib/server/pipe.js +++ b/lib/server/pipe.js @@ -45,15 +45,12 @@ lWrite.on('error', lError); lRead.on('error', lError); - if (lIsFsWrite) - lWrite.on('open', function() { - lRead.pipe(lWrite); - lRead.on('end', Util.retExec(p.callback)); - }); - else { + Util.ifExec(!lIsFsWrite, function() { lRead.pipe(lWrite); lRead.on('end', Util.retExec(p.callback)); - } + }, function(pCallBack) { + lWrite.on('open', pCallBack); + }); } }; From 01b923ee6549ea2892a496242eefdc93c61bc4ec Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 08:38:45 +0000 Subject: [PATCH 27/69] chore(pipe) create: rm " " --- lib/server/pipe.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/server/pipe.js b/lib/server/pipe.js index c52ae9b8..cb33d3f2 100644 --- a/lib/server/pipe.js +++ b/lib/server/pipe.js @@ -37,9 +37,9 @@ }; if (p.zip) { - lZlib = zlib.createGzip(); + lZlib = zlib.createGzip(); lRead.on('error', lError); - lRead = lRead.pipe(lZlib); + lRead = lRead.pipe(lZlib); } lWrite.on('error', lError); From e1745646662f16d2a525a86d4ac4638da88f6f2b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 10:18:40 +0000 Subject: [PATCH 28/69] chore(rest) put: add log --- lib/server/rest.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/server/rest.js b/lib/server/rest.js index abb1910c..ea27d266 100644 --- a/lib/server/rest.js +++ b/lib/server/rest.js @@ -151,8 +151,10 @@ callback : function(pError) { var lName; - if (pError) + if (pError) { + Util.log(pError); main.sendError(pParams, pError); + } else { lName = path.basename(p.name); sendMsg(pParams, 'save', lName); From 2effa50a765e793cd57dc06d9691885ca96d6d88 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 10:19:00 +0000 Subject: [PATCH 29/69] chore(pipe) create: add " " --- lib/server/pipe.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/server/pipe.js b/lib/server/pipe.js index cb33d3f2..a5770b36 100644 --- a/lib/server/pipe.js +++ b/lib/server/pipe.js @@ -18,10 +18,10 @@ exports.create = function(pParams) { var lZlib, lError, lMsg, lRead, lWrite, lIsFsWrite, - p = pParams; + p = pParams; if (p) { - lRead = p.read || fs.createReadStream(p.from, { + lRead = p.read || fs.createReadStream(p.from, { bufferSize: 4 * 1024 }); From 0336677d9ca87c14b7bde9904870f41a09fe86be Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 10:35:15 +0000 Subject: [PATCH 30/69] fix(listeners) pop: ajaxLoad -> CloudCmd.ajaxLoad --- lib/client.js | 4 ++-- lib/client/listeners.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/client.js b/lib/client.js index 4d18c7ea..719bcecf 100644 --- a/lib/client.js +++ b/lib/client.js @@ -47,7 +47,7 @@ var Util, DOM, CloudFunc, CloudCmd; DOM.Images.showLoad(pNeedRefresh ? {top:true} : null); /* загружаем содержимое каталога */ - ajaxLoad(lLink, { refresh: pNeedRefresh }); + CloudCmd.ajaxLoad(lLink, { refresh: pNeedRefresh }); } DOM.preventDefault(pEvent); @@ -338,7 +338,7 @@ var Util, DOM, CloudFunc, CloudCmd; * @param pOptions * { refresh, nohistory } - необходимость обновить данные о каталоге */ - function ajaxLoad(pPath, pOptions){ + CloudCmd.ajaxLoad = function(pPath, pOptions){ if(!pOptions) pOptions = {}; diff --git a/lib/client/listeners.js b/lib/client/listeners.js index 939f924c..a509ec0e 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -282,7 +282,7 @@ var Util, DOM, CloudCmd; if (pEvent.state) { lPath = pEvent.state + '?json'; - ajaxLoad(lPath, {nohistory: true}); + CloudCmd.ajaxLoad(lPath, {nohistory: true}); } else CloudCmd.route(location.hash); From 9589d1175813c9948e14d716525e3f9852ad9c73 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 10:44:16 +0000 Subject: [PATCH 31/69] fix(appcache) addFiles: pFilesNames -> pFileNames --- lib/server/appcache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/server/appcache.js b/lib/server/appcache.js index a0a24901..7cbdc5d4 100644 --- a/lib/server/appcache.js +++ b/lib/server/appcache.js @@ -45,7 +45,7 @@ /* if a couple files */ if (Util.isArray(pFileNames)) { - n = pFilesNames.length; + n = pFileNames.length; for (i = 0; i < n; i++) { /* if fallback setted up */ From 92898e535b05fb128e641645dc58e30a88800a17 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 10:49:05 +0000 Subject: [PATCH 32/69] refactor(style) .error: set correct order --- css/style.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/css/style.css b/css/style.css index e0c627bf..c19f8650 100644 --- a/css/style.css +++ b/css/style.css @@ -66,12 +66,12 @@ body { } .error::before { - position: relative; - font-size: 14px; + position : relative; font-family : 'Fontello'; - color: rgb(222, 41, 41); - cursor :default; - content: '\2757'; + font-size : 14px; + color : rgb(222, 41, 41); + cursor : default; + content : '\2757'; } .loading { From 2aeee68d30a917179e10cdf94709229fca0c6ed2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 10:55:48 +0000 Subject: [PATCH 33/69] refactor(style) .loading: set correct order --- css/style.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/css/style.css b/css/style.css index c19f8650..fe602edb 100644 --- a/css/style.css +++ b/css/style.css @@ -75,12 +75,12 @@ body { } .loading { + position : relative; + top : 1px; display : inline-block; width : 15px; height : 14.8px; - position:relative; - top:1px; - background:url(/img/spinner.gif); + background : url(/img/spinner.gif); } .refresh-icon { From b8f8c8aefd58f00045bc808dc4d9233e9909d3c6 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 10:57:19 +0000 Subject: [PATCH 34/69] chore(client) ajaxLoad: add ";" --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index 719bcecf..76c94959 100644 --- a/lib/client.js +++ b/lib/client.js @@ -404,7 +404,7 @@ var Util, DOM, CloudFunc, CloudCmd; Cache.set(lCleanPath, lJSON_s); } }); - } + }; /** * Функция строит файловую таблицу From 7b577e9a39451bc4dd33508fa12922cc9ad9c48b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Oct 2013 14:06:06 +0300 Subject: [PATCH 35/69] docs(readme) Edit: add Ace keyboard shortcuts --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 87328134..a2e70f44 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,8 @@ Edit - **Ctrl + s** - save - **Esc** - close +For more details see [Ace keyboard shortcuts](https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts "Ace keyboard shortcuts"). + Console --------------- [Demo](http://io.cloudcmd.io#/console "Console") From 0168f9fe6f875d261ce61dcca38e238a2f156757 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 7 Oct 2013 15:55:14 +0300 Subject: [PATCH 36/69] docs(readme) add "\n" --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a2e70f44..7bb0dee2 100644 --- a/README.md +++ b/README.md @@ -313,6 +313,7 @@ Extensions --------------- **Cloud Commander** desinged to easily porting extensions. For extend main functionality Cloud Commander use next modules: + - [Ace] [AceURL] - [FancyBox] [FancyBoxURL] - [jQuery-contextMenu] [jQuery-contextMenuURL] From 6b8bffebdfd34797550d4d6faa61fb05ce66fa79 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 8 Oct 2013 16:04:24 +0300 Subject: [PATCH 37/69] docs(readme) mv client_max_body_size to server section --- README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index 7bb0dee2..19576514 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,7 @@ Than make host file **/etc/nginx/sites-enabled/io.cloudcmd.io** ```sh server { listen 80; + client_max_body_size 100m; server_name io.cloudcmd.io; access_log /var/log/nginx/io.cloudcmd.io.access.log; location / { @@ -245,13 +246,6 @@ ln -s ./sites-enabled/io.cloudcmd.io ./sites-available /etc/init.d/nginx restart ``` -If you will want to upload files, you should add next line in **http** section of **/etc/nginx/nginx.conf**: - -``` -#limit of uploading data -client_max_body_size 100m; -``` - To run Cloud Commander as daemon in linux you could set **log** to true in config and do something like this: From 90b33370f3ecfac893e99a9690e7c114d37b946a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 8 Oct 2013 15:20:04 +0000 Subject: [PATCH 38/69] fix(socket) max reconnection attempts: Math.pow(2, 64) -> Math.pow(2, 32) --- lib/client/socket.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/socket.js b/lib/client/socket.js index a513fea1..f3ac82fe 100644 --- a/lib/client/socket.js +++ b/lib/client/socket.js @@ -19,7 +19,7 @@ var CloudCmd, Util, DOM, io; socket = io.connect(CloudCmd.HOST, { 'reconnect' : true, 'reconnection delay' : 500, - 'max reconnection attempts' : Math.pow(2, 64), + 'max reconnection attempts' : Math.pow(2, 32), 'reconnect_failed' : function() { Util.log('Could not reconnect. Reload page.'); } From db6bb751d7e8b1f5614bc40f44d482f531df061e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 11 Oct 2013 08:29:05 +0000 Subject: [PATCH 39/69] feature(css) rm button width:10% --- css/style.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/css/style.css b/css/style.css index fe602edb..8f250198 100644 --- a/css/style.css +++ b/css/style.css @@ -228,10 +228,6 @@ body { cursor: default; } -button { - width:10%; -} - a { text-decoration:none; } From 0b74d6cd2245c54c7535d6913051f2ae916f2804 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 11 Oct 2013 09:37:15 +0000 Subject: [PATCH 40/69] fix(util) copyObj --- lib/util.js | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/util.js b/lib/util.js index 38efa4d3..3fb29946 100644 --- a/lib/util.js +++ b/lib/util.js @@ -170,26 +170,24 @@ Util = exports || {}; * @param pProps */ Util.copyObj = function(pFromObj, pToObj, pProps) { - var lRet; - - if (!pToObj) - lRet = pToObj = {}; - - function copy(pI) { - var lName = pProps ? pProps[pI] : pI, - lValue = pFromObj[lName]; + var lRet = pToObj || pProps || {}, + copy = function(name, obj) { + var value = obj[name]; - if (lValue) - pToObj[lName] = pFromObj[lName]; - } + if (value) + pToObj[name] = obj[name]; + }, + forIn = function(obj) { + Util.forIn(obj, function(name) { + copy(name, obj); + }); + }; - if ( Util.isObject(pFromObj) ) { - if (!pProps) - Util.forIn(pFromObj, copy); - else - Util.fori(pProps.length, copy); + if (Util.isObject(pFromObj)) { + if (pProps) + forIn(pProps); - lRet = lRet || true; + forIn(pFromObj); } return lRet; From 46be594356c600e1348148aa9de16705d04f39c2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 11 Oct 2013 09:38:30 +0000 Subject: [PATCH 41/69] feature(util) retFunc: add any count of params --- lib/util.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/util.js b/lib/util.js index 3fb29946..b0462483 100644 --- a/lib/util.js +++ b/lib/util.js @@ -707,12 +707,13 @@ Util = exports || {}; /** * return function wich exec function in params - * @param pCallBack - * @param pArg + * @param arguments: callback, args */ - Util.retFunc = function(pCallBack, pArg) { + Util.retFunc = function() { + var args = arguments; + return function() { - return Util.exec(pCallBack, pArg); + return Util.exec.apply(null, args); }; }; From 77469928ab2c6c8b361edb6b420c63d359b00ebf Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 11 Oct 2013 09:58:50 +0000 Subject: [PATCH 42/69] feature(util) retExec: add any count of params --- lib/util.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/util.js b/lib/util.js index b0462483..4fcc299b 100644 --- a/lib/util.js +++ b/lib/util.js @@ -697,11 +697,22 @@ Util = exports || {}; * @param pCallBack * @param pArg */ - Util.retExec = function(pCallBack, pArg) { - return function(pArgument) { - if ( !Util.isUndefined(pArg) ) - pArgument = pArg; - Util.exec(pCallBack, pArgument); + Util.retExec = function() { + var args = arguments; + + return function() { + var argsLocal, callback, + n = arguments.length; + + if (!n) + argsLocal = args; + else { + callback = args[0]; + argsLocal = arguments; + [].unshift.call(argsLocal, callback); + } + + Util.exec.apply(null, argsLocal); }; }; From 6749b7c37828f92ceae935b03b4fb185aee367e5 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 08:16:36 +0000 Subject: [PATCH 43/69] fix(util) retExec: if param was - use it --- lib/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util.js b/lib/util.js index 4fcc299b..47b9ca18 100644 --- a/lib/util.js +++ b/lib/util.js @@ -702,9 +702,9 @@ Util = exports || {}; return function() { var argsLocal, callback, - n = arguments.length; + n = args.length; - if (!n) + if (n) argsLocal = args; else { callback = args[0]; From 5c4209196d64b1fb56c15448a76ff96b62c8df84 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 08:26:29 +0000 Subject: [PATCH 44/69] docs(readme) readme -> help --- HELP.md | 366 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 346 +----------------------------------------- lib/client/help.js | 2 +- 3 files changed, 368 insertions(+), 346 deletions(-) create mode 100644 HELP.md diff --git a/HELP.md b/HELP.md new file mode 100644 index 00000000..19576514 --- /dev/null +++ b/HELP.md @@ -0,0 +1,366 @@ +Cloud Commander v0.4.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] +=============== +###[Main][MainURL] [Blog][BlogURL] [Demo][DemoURL] +[NPMIMGURL]: https://badge.fury.io/js/cloudcmd.png +[BuildStatusIMGURL]: https://secure.travis-ci.org/coderaiser/cloudcmd.png?branch=master +[DependencyStatusIMGURL]: https://gemnasium.com/coderaiser/cloudcmd.png +[FlattrIMGURL]: http://api.flattr.com/button/flattr-badge-large.png +[NPM_INFO_IMG]: https://nodei.co/npm/cloudcmd.png?downloads=true&&stars +[NPMURL]: https://npmjs.org/package/cloudcmd +[BuildStatusURL]: http://travis-ci.org/coderaiser/cloudcmd "Build Status" +[DependencyStatusURL]: https://gemnasium.com/coderaiser/cloudcmd "Dependency Status" +[FlattrURL]: https://flattr.com/submit/auto?user_id=coderaiser&url=github.com/coderaiser/cloudcmd&title=cloudcmd&language=&tags=github&category=software "flattr" +[NPM_INFO_URL]: https://npmjs.org/package/cloudcmd "npm" +[MainURL]: http://cloudcmd.io "Main" +[BlogURL]: http://blog.cloudcmd.io "Blog" +[DemoURL]: http://io.cloudcmd.io "Demo" + +**Cloud Commander** - cloud file manager with console and editor. + +![Cloud Commander](/img/logo/cloudcmd.png "Cloud Commander") + +[![Flattr][FlattrIMGURL]][FlattrURL] + +Benefits +--------------- +- full browser compatibility *(ie6+,chrome,safari,opera,firefox)*; +- responsible design +- one full page loading, *and then just one-time json-dir-listings loading +(with refresh opportunity).* +- caching read directories *to localStorage (for now) +(so if network will disconnected or something happens with a signal, we +definitely will can work with cached copy of directory listings)*; +- key binding +- disabled js support *(working in limited mode)*. + +**Cloud Commander** uses all benefits of js, so if js is disabled, +we go to *limited mode*. + +Limited-mode features +--------------- +- no keybinding +- no local caching +- full loading of all web page(with styles, js-scripts, html-page etc). + +Hot keys +--------------- +In all modern web browsers (but not in IE, becouse he special) hot keys works. +There is a short list: + +- **F1** - help +- **F2** - rename current file +- **F3** - view +- **F4** - edit +- **F5** - copy +- **F6** - rename/move +- **F7** - new dir +- **F8, Delete** - remove current file +- **F9** - menu +- **Ctrl + r** - reload dir content +- **Ctrl + d** - clear local cache (wich contains dir contents) +- **Alt + q** - disable key bindings +- **Alt + s** - get all key bindings back +- **Ctrl + a** - select all files in a panel +- **up, down, enter** - filesystem navigation +- **Tab** - move via panels +- **Page Up** - up on one page +- **Page Down** - down on one page +- **Home** - to begin of list +- **End** - to end of list +- **Shift + Delete** - remove without prompt +- **Insert** - select current file +- **Shift + F10** - context menu +- **~** - console + +Edit +--------------- +[Demo](http://io.cloudcmd.io/fs/etc#/edit/passwd "Edit") +![Edit](/img/screenshot/edit.png "Edit") + +###Hot keys +- **F4** - open +- **Ctrl + s** - save +- **Esc** - close + +For more details see [Ace keyboard shortcuts](https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts "Ace keyboard shortcuts"). + +Console +--------------- +[Demo](http://io.cloudcmd.io#/console "Console") +![Console](/img/screenshot/console.png "Console") + +###Hot keys +- **~** - open +- **Esc** - close + +Menu +--------------- +[Demo](http://io.cloudcmd.io#/menu "Menu") +![Menu](/img/screenshot/menu.png "Menu") +Right mouse click button shows context menu with items: +- View +- Edit +- Rename +- Delete +- Zip file +- (Un)Select All +- Upload to (Dropbox, Github, GDrive) +- Download +- New (File, Dir, from cloud) + +###Hot keys +- **F9** - open +- **Esc** - close + +Menu +--------------- +Right mouse click button shows context menu with items: +- View +- Edit +- Rename +- Delete +- Upload to (Dropbox, Github, GDrive) +- Download +- New (File, Dir, from cloud) + +Install +--------------- +[![NPM_INFO][NPM_INFO_IMG]][NPM_INFO_URL] + +Installing **Cloud Commander** is very simple. +All you need is +- install [node.js](http://nodejs.org/ "node.js") +- [download](https://github.com/coderaiser/cloudcmd/archive/master.zip) +and unpack or just clone repository from github: + +``` + git clone git://github.com/coderaiser/cloudcmd.git + cd cloudcmd + node cloudcmd +``` +or install in npm: +``` + npm i cloudcmd -g + cloudcmd +``` + +Configuration +--------------- +All main configuration could be done via [config.json](json/config.json "Config"). + +```js +{ + "api_url" :"/api/v1", + "appcache" : false, /* cache files for offline use */ + "analytics" : true, /* google analytics suport */ + "localStorage" : true, /* cache directory data */ + "minification" : { /* minification of js,css,html and img */ + "js" : false, /* minify module needed */ + "css" : false, /* npm i minify */ + "html" : true, + "img" : false + }, + "online" : true, /* load js files from cdn or local path */ + "cache" : true, + "logs" : false, /* logs or console ouput */ + "show_keys_panel" : true, /* show classic panel with buttons of keys */ + "server" : true, /* server mode or testing mode */ + "socket" : true /* enable web sockets */ + "port" : 8000, /* http port or null(default) */ + "sslPort" : 443, /* https port or null(default) */ + "ip" : null, /* ip or null(default) */ + "ssl" : false /* should use https? */ + "rest" : true /* enable rest interface */ +} +``` + +If you had changed **config** and want to keep updating via git, +you should execute next command in root directory of **Cloud Commander**: + +``` +git update-index --assume-unchanged json/config.json +``` + +To get back to tracking: + +``` +git update-index --no-assume-unchanged json/config.json +``` + +Server +--------------- +Standard practices say no non-root process gets to talk to +the Internet on a port less than 1024. Anyway I suggest you +to start Cloud Commander as non-root. How it could be solved? +There is a couple easy and fast ways. One of them is port forwarding. +###Iptables +Just run [shell/addtables.sh](shell/addtables.sh) for default options. + +```sh +@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -L # look rules before +@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000 +@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 4430 +@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -L # look rules after +``` + +You should see something like this ( **8000** and **4430** should be in config as **port** and **sslPort** ) + + target prot opt source destination + REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8000 + REDIRECT tcp -- anywhere anywhere tcp dpt:https redir ports 4430 + +If you would want to get things back just clear rules ( **1** and **2** it's rule numbers, +in your list they could differ). + +```sh +@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -D PREROUTING 2 +@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -D PREROUTING 1 +``` + +###nginx +Get [nginx](http://nginx.org/ "nginx"). On linux it could be done like that + +```sh +sudo apt-get install nginx #for ubuntu and debian +``` + +Than make host file **/etc/nginx/sites-enabled/io.cloudcmd.io** +( *io.cloudcmd.io* is your domain name) with content: + +```sh +server { + listen 80; + client_max_body_size 100m; + server_name io.cloudcmd.io; + access_log /var/log/nginx/io.cloudcmd.io.access.log; + location / { + proxy_pass http://127.0.0.1:8000/; + } +} +``` + +```sh +# create symlink of this file +ln -s ./sites-enabled/io.cloudcmd.io ./sites-available +# restart nginx +/etc/init.d/nginx restart +``` + +To run Cloud Commander as daemon in linux you could set **log** to true in config and +do something like this: + + nohup node cloudcmd + +Authorization +--------------- +Cloud Commander could authorize clients on GitHub via openID. +All things that should be done is must be added **id** and **secret** of application +from github settings page and added to [modules.json](json/modules.json) (id just) and env variable (secret) +with names: *github_id*, *github_secret*, *dropbox_key*, *dropbox_secret* etc in +[secret.bat](shell/secret.bat) *(on win32)* or [secret.sh](shell/secret.sh) *(on nix)*. + + +Start +--------------- +To start **Cloud Commander** only one command needed: + + node cloudcmd +or on win platform just + + cloudcmd +After that Cloud Commander reads port information from config file [config.json](json/config.json#L17 "Config") and start server +on this port ( **8000** by default ), if none of port variables ( *cloud9*, *cloudfoundry* and *nodester* ) isn't exist. +Then type in browser + + http://127.0.0.1:8000 +or + + http://localhost:8000 +Update +--------------- +**Cloud Commander** is very often updates. +Update is doing automagically but it could be done also manualy +by typing a few commands in cloudcmd directory: + + git pull +or check new version on npm + + npm info cloudcmd + +and then, if there is new version + + npm r cloudcmd + npm i cloudcmd + +Additional modules +--------------- +**Cloud Commander's Server Side** not using additional modules for main functionality. +But for minification and optimization tricks optional can be +assingned (and installed) modules: [Minify] (https://github.com/coderaiser/minify "Minify") +and [socket.io] (https://github.com/LearnBoost/socket.io "Socket.IO"). + +Install addtitional modules (type in **Cloud Commander** directory): + + npm i + +Extensions +--------------- +**Cloud Commander** desinged to easily porting extensions. +For extend main functionality Cloud Commander use next modules: + +- [Ace] [AceURL] +- [FancyBox] [FancyBoxURL] +- [jQuery-contextMenu] [jQuery-contextMenuURL] +- [jq-console] [jq-consoleURL] +- [github] [githubURL] +- [dropbox-js] [dropbox-jsURL] +- [jquery] [jqueryURL] + +[AceURL]: //ace.ajax.org/ "Ace" +[FancyBoxURL]: //github.com/fancyapps/fancyBox "FancyBox" +[jQuery-contextMenuURL]: //github.com/medialize/jQuery-contextMenu "jQuery-contextMenu" +[jq-consoleURL]: //github.com/replit/jq-console‎ "jq-console" +[githubURL]: //github.com/michael/github "github" +[dropbox-jsURL]: //github.com/dropbox/dropbox-js "dropbox-js" +[jqueryURL]: //jquery.com + +Contributing +--------------- +If you would like to contribute - send pull request to dev branch. +Getting dev version of **Cloud Commander**: + + git clone git://github.com/coderaiser/cloudcmd.git + git checkout dev + +It is possible that dev version of Cloud Commander will needed dev version of Minify, +so to get it you should type a couple more commands: + + cd node_modules + rm -rf minify + git clone git://github.com/coderaiser/minify + git checkout dev + +Version history +--------------- +- *2013.09.27*, **[v0.4.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.4.0.zip)** +- *2013.08.01*, **[v0.3.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.3.0.zip)** +- *2013.04.22*, **[v0.2.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.2.0.zip)** +- *2013.03.01*, **[v0.1.9](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.9.zip)** +- *2012.12.12*, **[v0.1.8](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.8.zip)** +- *2012.10.01*, **[v0.1.7](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.7.zip)** +- *2012.08.24*, **[v0.1.6](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.6.zip)** +- *2012.08.06*, **[v0.1.5](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.5.zip)** +- *2012.07.27*, **[v0.1.4](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.4.zip)** +- *2012.07.19*, **[v0.1.3](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.3.zip)** +- *2012.07.14*, **[v0.1.2](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.2.zip)** +- *2012.07.11*, **[v0.1.1](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.1.zip)** +- *2012.00.00*, **[v0.1.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.0.zip)** + +License +--------------- +MIT [license](LICENSE "license"). + +Special Thanks +--------------- +- [Polietilena](http://polietilena.github.io/ "Polietilena") for [logo](img/logo/cloudcmd.png "logo") and [favicon](img/favicon/favicon.png "favicon"). +- [Elec-ua](https://github.com/elec-ua) for [ru](http://ru.cloudcmd.io "Cloud Commander in Russian") and [ua](http://ua.cloudcmd.io "Cloud Commander in Ukrainian") translations. diff --git a/README.md b/README.md index 19576514..9f2c1cf8 100644 --- a/README.md +++ b/README.md @@ -19,348 +19,4 @@ Cloud Commander v0.4.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status] ![Cloud Commander](/img/logo/cloudcmd.png "Cloud Commander") -[![Flattr][FlattrIMGURL]][FlattrURL] - -Benefits ---------------- -- full browser compatibility *(ie6+,chrome,safari,opera,firefox)*; -- responsible design -- one full page loading, *and then just one-time json-dir-listings loading -(with refresh opportunity).* -- caching read directories *to localStorage (for now) -(so if network will disconnected or something happens with a signal, we -definitely will can work with cached copy of directory listings)*; -- key binding -- disabled js support *(working in limited mode)*. - -**Cloud Commander** uses all benefits of js, so if js is disabled, -we go to *limited mode*. - -Limited-mode features ---------------- -- no keybinding -- no local caching -- full loading of all web page(with styles, js-scripts, html-page etc). - -Hot keys ---------------- -In all modern web browsers (but not in IE, becouse he special) hot keys works. -There is a short list: - -- **F1** - help -- **F2** - rename current file -- **F3** - view -- **F4** - edit -- **F5** - copy -- **F6** - rename/move -- **F7** - new dir -- **F8, Delete** - remove current file -- **F9** - menu -- **Ctrl + r** - reload dir content -- **Ctrl + d** - clear local cache (wich contains dir contents) -- **Alt + q** - disable key bindings -- **Alt + s** - get all key bindings back -- **Ctrl + a** - select all files in a panel -- **up, down, enter** - filesystem navigation -- **Tab** - move via panels -- **Page Up** - up on one page -- **Page Down** - down on one page -- **Home** - to begin of list -- **End** - to end of list -- **Shift + Delete** - remove without prompt -- **Insert** - select current file -- **Shift + F10** - context menu -- **~** - console - -Edit ---------------- -[Demo](http://io.cloudcmd.io/fs/etc#/edit/passwd "Edit") -![Edit](/img/screenshot/edit.png "Edit") - -###Hot keys -- **F4** - open -- **Ctrl + s** - save -- **Esc** - close - -For more details see [Ace keyboard shortcuts](https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts "Ace keyboard shortcuts"). - -Console ---------------- -[Demo](http://io.cloudcmd.io#/console "Console") -![Console](/img/screenshot/console.png "Console") - -###Hot keys -- **~** - open -- **Esc** - close - -Menu ---------------- -[Demo](http://io.cloudcmd.io#/menu "Menu") -![Menu](/img/screenshot/menu.png "Menu") -Right mouse click button shows context menu with items: -- View -- Edit -- Rename -- Delete -- Zip file -- (Un)Select All -- Upload to (Dropbox, Github, GDrive) -- Download -- New (File, Dir, from cloud) - -###Hot keys -- **F9** - open -- **Esc** - close - -Menu ---------------- -Right mouse click button shows context menu with items: -- View -- Edit -- Rename -- Delete -- Upload to (Dropbox, Github, GDrive) -- Download -- New (File, Dir, from cloud) - -Install ---------------- -[![NPM_INFO][NPM_INFO_IMG]][NPM_INFO_URL] - -Installing **Cloud Commander** is very simple. -All you need is -- install [node.js](http://nodejs.org/ "node.js") -- [download](https://github.com/coderaiser/cloudcmd/archive/master.zip) -and unpack or just clone repository from github: - -``` - git clone git://github.com/coderaiser/cloudcmd.git - cd cloudcmd - node cloudcmd -``` -or install in npm: -``` - npm i cloudcmd -g - cloudcmd -``` - -Configuration ---------------- -All main configuration could be done via [config.json](json/config.json "Config"). - -```js -{ - "api_url" :"/api/v1", - "appcache" : false, /* cache files for offline use */ - "analytics" : true, /* google analytics suport */ - "localStorage" : true, /* cache directory data */ - "minification" : { /* minification of js,css,html and img */ - "js" : false, /* minify module needed */ - "css" : false, /* npm i minify */ - "html" : true, - "img" : false - }, - "online" : true, /* load js files from cdn or local path */ - "cache" : true, - "logs" : false, /* logs or console ouput */ - "show_keys_panel" : true, /* show classic panel with buttons of keys */ - "server" : true, /* server mode or testing mode */ - "socket" : true /* enable web sockets */ - "port" : 8000, /* http port or null(default) */ - "sslPort" : 443, /* https port or null(default) */ - "ip" : null, /* ip or null(default) */ - "ssl" : false /* should use https? */ - "rest" : true /* enable rest interface */ -} -``` - -If you had changed **config** and want to keep updating via git, -you should execute next command in root directory of **Cloud Commander**: - -``` -git update-index --assume-unchanged json/config.json -``` - -To get back to tracking: - -``` -git update-index --no-assume-unchanged json/config.json -``` - -Server ---------------- -Standard practices say no non-root process gets to talk to -the Internet on a port less than 1024. Anyway I suggest you -to start Cloud Commander as non-root. How it could be solved? -There is a couple easy and fast ways. One of them is port forwarding. -###Iptables -Just run [shell/addtables.sh](shell/addtables.sh) for default options. - -```sh -@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -L # look rules before -@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000 -@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 4430 -@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -L # look rules after -``` - -You should see something like this ( **8000** and **4430** should be in config as **port** and **sslPort** ) - - target prot opt source destination - REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8000 - REDIRECT tcp -- anywhere anywhere tcp dpt:https redir ports 4430 - -If you would want to get things back just clear rules ( **1** and **2** it's rule numbers, -in your list they could differ). - -```sh -@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -D PREROUTING 2 -@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -D PREROUTING 1 -``` - -###nginx -Get [nginx](http://nginx.org/ "nginx"). On linux it could be done like that - -```sh -sudo apt-get install nginx #for ubuntu and debian -``` - -Than make host file **/etc/nginx/sites-enabled/io.cloudcmd.io** -( *io.cloudcmd.io* is your domain name) with content: - -```sh -server { - listen 80; - client_max_body_size 100m; - server_name io.cloudcmd.io; - access_log /var/log/nginx/io.cloudcmd.io.access.log; - location / { - proxy_pass http://127.0.0.1:8000/; - } -} -``` - -```sh -# create symlink of this file -ln -s ./sites-enabled/io.cloudcmd.io ./sites-available -# restart nginx -/etc/init.d/nginx restart -``` - -To run Cloud Commander as daemon in linux you could set **log** to true in config and -do something like this: - - nohup node cloudcmd - -Authorization ---------------- -Cloud Commander could authorize clients on GitHub via openID. -All things that should be done is must be added **id** and **secret** of application -from github settings page and added to [modules.json](json/modules.json) (id just) and env variable (secret) -with names: *github_id*, *github_secret*, *dropbox_key*, *dropbox_secret* etc in -[secret.bat](shell/secret.bat) *(on win32)* or [secret.sh](shell/secret.sh) *(on nix)*. - - -Start ---------------- -To start **Cloud Commander** only one command needed: - - node cloudcmd -or on win platform just - - cloudcmd -After that Cloud Commander reads port information from config file [config.json](json/config.json#L17 "Config") and start server -on this port ( **8000** by default ), if none of port variables ( *cloud9*, *cloudfoundry* and *nodester* ) isn't exist. -Then type in browser - - http://127.0.0.1:8000 -or - - http://localhost:8000 -Update ---------------- -**Cloud Commander** is very often updates. -Update is doing automagically but it could be done also manualy -by typing a few commands in cloudcmd directory: - - git pull -or check new version on npm - - npm info cloudcmd - -and then, if there is new version - - npm r cloudcmd - npm i cloudcmd - -Additional modules ---------------- -**Cloud Commander's Server Side** not using additional modules for main functionality. -But for minification and optimization tricks optional can be -assingned (and installed) modules: [Minify] (https://github.com/coderaiser/minify "Minify") -and [socket.io] (https://github.com/LearnBoost/socket.io "Socket.IO"). - -Install addtitional modules (type in **Cloud Commander** directory): - - npm i - -Extensions ---------------- -**Cloud Commander** desinged to easily porting extensions. -For extend main functionality Cloud Commander use next modules: - -- [Ace] [AceURL] -- [FancyBox] [FancyBoxURL] -- [jQuery-contextMenu] [jQuery-contextMenuURL] -- [jq-console] [jq-consoleURL] -- [github] [githubURL] -- [dropbox-js] [dropbox-jsURL] -- [jquery] [jqueryURL] - -[AceURL]: //ace.ajax.org/ "Ace" -[FancyBoxURL]: //github.com/fancyapps/fancyBox "FancyBox" -[jQuery-contextMenuURL]: //github.com/medialize/jQuery-contextMenu "jQuery-contextMenu" -[jq-consoleURL]: //github.com/replit/jq-console‎ "jq-console" -[githubURL]: //github.com/michael/github "github" -[dropbox-jsURL]: //github.com/dropbox/dropbox-js "dropbox-js" -[jqueryURL]: //jquery.com - -Contributing ---------------- -If you would like to contribute - send pull request to dev branch. -Getting dev version of **Cloud Commander**: - - git clone git://github.com/coderaiser/cloudcmd.git - git checkout dev - -It is possible that dev version of Cloud Commander will needed dev version of Minify, -so to get it you should type a couple more commands: - - cd node_modules - rm -rf minify - git clone git://github.com/coderaiser/minify - git checkout dev - -Version history ---------------- -- *2013.09.27*, **[v0.4.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.4.0.zip)** -- *2013.08.01*, **[v0.3.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.3.0.zip)** -- *2013.04.22*, **[v0.2.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.2.0.zip)** -- *2013.03.01*, **[v0.1.9](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.9.zip)** -- *2012.12.12*, **[v0.1.8](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.8.zip)** -- *2012.10.01*, **[v0.1.7](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.7.zip)** -- *2012.08.24*, **[v0.1.6](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.6.zip)** -- *2012.08.06*, **[v0.1.5](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.5.zip)** -- *2012.07.27*, **[v0.1.4](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.4.zip)** -- *2012.07.19*, **[v0.1.3](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.3.zip)** -- *2012.07.14*, **[v0.1.2](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.2.zip)** -- *2012.07.11*, **[v0.1.1](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.1.zip)** -- *2012.00.00*, **[v0.1.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.0.zip)** - -License ---------------- -MIT [license](LICENSE "license"). - -Special Thanks ---------------- -- [Polietilena](http://polietilena.github.io/ "Polietilena") for [logo](img/logo/cloudcmd.png "logo") and [favicon](img/favicon/favicon.png "favicon"). -- [Elec-ua](https://github.com/elec-ua) for [ru](http://ru.cloudcmd.io "Cloud Commander in Russian") and [ua](http://ua.cloudcmd.io "Cloud Commander in Ukrainian") translations. +[![Flattr][FlattrIMGURL]][FlattrURL] \ No newline at end of file diff --git a/lib/client/help.js b/lib/client/help.js index ae35146b..e6a54f28 100644 --- a/lib/client/help.js +++ b/lib/client/help.js @@ -24,7 +24,7 @@ var CloudCmd, Util, DOM; this.show = function(){ Images.showLoad({top:true}); DOM.ajax({ - url: '/README.md', + url: '/HELP.md', success: function (pData){ var lData = {text: pData}; DOM.ajax({ From 46d8a91f7c3cca553ba5fffcca177557e988b51c Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 11:45:21 +0300 Subject: [PATCH 45/69] docs(help) Benefits: rewrite; rm Limited-mode --- HELP.md | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/HELP.md b/HELP.md index 19576514..b3744940 100644 --- a/HELP.md +++ b/HELP.md @@ -23,24 +23,12 @@ Cloud Commander v0.4.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status] Benefits --------------- -- full browser compatibility *(ie6+,chrome,safari,opera,firefox)*; -- responsible design -- one full page loading, *and then just one-time json-dir-listings loading -(with refresh opportunity).* -- caching read directories *to localStorage (for now) -(so if network will disconnected or something happens with a signal, we -definitely will can work with cached copy of directory listings)*; -- key binding -- disabled js support *(working in limited mode)*. - -**Cloud Commander** uses all benefits of js, so if js is disabled, -we go to *limited mode*. - -Limited-mode features ---------------- -- no keybinding -- no local caching -- full loading of all web page(with styles, js-scripts, html-page etc). +- Open Source. +- Has 2 classic ortodox panels. +- Works on Windows, Linux and Mac OS. +- Could be used local or remotly. +- Has nice console and editor. +- Writed on JavaScript/Node.js. Hot keys --------------- From 99a34cde0d377218f19530ae70ed0b0b5d854efa Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 11:51:04 +0300 Subject: [PATCH 46/69] docs(help) mv Install to up --- HELP.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/HELP.md b/HELP.md index b3744940..d97860be 100644 --- a/HELP.md +++ b/HELP.md @@ -30,6 +30,27 @@ Benefits - Has nice console and editor. - Writed on JavaScript/Node.js. +Install +--------------- +[![NPM_INFO][NPM_INFO_IMG]][NPM_INFO_URL] + +Installing **Cloud Commander** is very simple. +All you need is +- install [node.js](http://nodejs.org/ "node.js") +- [download](https://github.com/coderaiser/cloudcmd/archive/master.zip) +and unpack or just clone repository from github: + +``` + git clone git://github.com/coderaiser/cloudcmd.git + cd cloudcmd + node cloudcmd +``` +or install in npm: +``` + npm i cloudcmd -g + cloudcmd +``` + Hot keys --------------- In all modern web browsers (but not in IE, becouse he special) hot keys works. @@ -111,27 +132,6 @@ Right mouse click button shows context menu with items: - Download - New (File, Dir, from cloud) -Install ---------------- -[![NPM_INFO][NPM_INFO_IMG]][NPM_INFO_URL] - -Installing **Cloud Commander** is very simple. -All you need is -- install [node.js](http://nodejs.org/ "node.js") -- [download](https://github.com/coderaiser/cloudcmd/archive/master.zip) -and unpack or just clone repository from github: - -``` - git clone git://github.com/coderaiser/cloudcmd.git - cd cloudcmd - node cloudcmd -``` -or install in npm: -``` - npm i cloudcmd -g - cloudcmd -``` - Configuration --------------- All main configuration could be done via [config.json](json/config.json "Config"). From 8b779c92049f8a687fe8760c4e75bcab85d27817 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 13:03:37 +0300 Subject: [PATCH 47/69] docs(help) Hot keys: rm description --- HELP.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/HELP.md b/HELP.md index d97860be..ce9c5ff1 100644 --- a/HELP.md +++ b/HELP.md @@ -53,8 +53,6 @@ or install in npm: Hot keys --------------- -In all modern web browsers (but not in IE, becouse he special) hot keys works. -There is a short list: - **F1** - help - **F2** - rename current file From da0a2a549d88d70d48f5e337dfa111cbf94ac6ea Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 13:57:54 +0000 Subject: [PATCH 48/69] feature(json) rm " " --- json/config.json | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/json/config.json b/json/config.json index c91da350..97ecac32 100644 --- a/json/config.json +++ b/json/config.json @@ -1,23 +1,23 @@ -{ - "api_url" : "/api/v1", - "appcache" : false, - "analytics" : true, - "localStorage" : true, - "minification" : { - "js" : true, - "css" : true, - "html" : true, - "img" : true - }, - "online" : true, - "cache" : true, - "logs" : false, - "show_keys_panel" : true, - "server" : true, - "socket" : true, - "port" : 8000, - "sslPort" : 4430, - "ip" : null, - "ssl" : false, - "rest" : true -} +{ + "api_url": "/api/v1", + "appcache": false, + "analytics": true, + "localStorage": true, + "minification": { + "js": true, + "css": true, + "html": true, + "img": true + }, + "online": true, + "cache": true, + "logs": false, + "show_keys_panel": true, + "server": true, + "socket": true, + "port": 31337, + "sslPort": 4430, + "ip": null, + "ssl": false, + "rest": true +} From a479b73cf20ba87ff8132bda0f8a4c6a15c37ee5 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 13:58:31 +0000 Subject: [PATCH 49/69] feature(json) 31337 -> 8000 --- json/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json/config.json b/json/config.json index 97ecac32..196aa398 100644 --- a/json/config.json +++ b/json/config.json @@ -15,7 +15,7 @@ "show_keys_panel": true, "server": true, "socket": true, - "port": 31337, + "port": 8000, "sslPort": 4430, "ip": null, "ssl": false, From cb5a529fb477f74e4d4a45e9b0784b8272e44ea4 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 14:02:20 +0000 Subject: [PATCH 50/69] feature(config) minification -> minify: {} -> true --- HELP.md | 7 +---- cloudcmd.js | 61 +++++++++++++++++++++----------------------- json/config.json | 7 +---- lib/server.js | 6 ++--- lib/server/minify.js | 24 +++++------------ 5 files changed, 39 insertions(+), 66 deletions(-) diff --git a/HELP.md b/HELP.md index ce9c5ff1..106a377e 100644 --- a/HELP.md +++ b/HELP.md @@ -140,12 +140,7 @@ All main configuration could be done via [config.json](json/config.json "Config" "appcache" : false, /* cache files for offline use */ "analytics" : true, /* google analytics suport */ "localStorage" : true, /* cache directory data */ - "minification" : { /* minification of js,css,html and img */ - "js" : false, /* minify module needed */ - "css" : false, /* npm i minify */ - "html" : true, - "img" : false - }, + "minify" : true /* minification of js,css,html and img */ "online" : true, /* load js files from cdn or local path */ "cache" : true, "logs" : false, /* logs or console ouput */ diff --git a/cloudcmd.js b/cloudcmd.js index 40da7413..5ea7050e 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -44,7 +44,7 @@ /** * additional processing of index file */ - function indexProcessing(pData){ + function indexProcessing(pData) { var lPath, lReplace, lKeysPanel, lData = pData.data, lAdditional = pData.additional; @@ -54,31 +54,31 @@ * меняем в index.html обычные css на * минифицированый */ - if (Minify.allowed.css){ + if (Minify.allowed) { lPath = '/' + Util.removeStr(Minify.MinFolder, DIR); lReplace = ''; lData = Util.removeStr(lData, lReplace) .replace('/css/style.css', lPath + 'all.min.css'); } + if (!Config.appcache) + lData = Util.removeStr(lData, [ + /* min */ + 'manifest=/cloudcmd.appcache', + /* normal */ + 'manifest="/cloudcmd.appcache"' + ]); + + if (!Config.show_keys_panel) { + lKeysPanel = '
' + ''; diff --git a/json/config.json b/json/config.json index 196aa398..2119fe5e 100644 --- a/json/config.json +++ b/json/config.json @@ -3,12 +3,7 @@ "appcache": false, "analytics": true, "localStorage": true, - "minification": { - "js": true, - "css": true, - "html": true, - "img": true - }, + "minify": true, "online": true, "cache": true, "logs": false, diff --git a/lib/server.js b/lib/server.js index 48cfdb0e..a9eaad10 100644 --- a/lib/server.js +++ b/lib/server.js @@ -32,7 +32,7 @@ /* базовая инициализация */ function init(pAppCachProcessing) { var lConfig = main.config, - lMinifyAllowed = lConfig.minification; + lMinifyAllowed = lConfig.minify; /* Change default parameters of * js/css/html minification @@ -179,9 +179,7 @@ lName = Path.join(DIR, lName); lMin = Minify.allowed, lExt = Util.getExtension(lName), - lResult = lExt === '.js' && lMin.js || - lExt === '.css' && lMin.css || - lExt === '.html' && lMin.html; + lResult = lMin && Util.strCmp(lExt, ['.js', '.css', '.html']); Util.ifExec(!lResult, function(pParams) { diff --git a/lib/server/minify.js b/lib/server/minify.js index 3279ef1e..9e971e6b 100644 --- a/lib/server/minify.js +++ b/lib/server/minify.js @@ -29,12 +29,7 @@ /* pathes to directories */ INDEX : HTMLDIR + 'index.html', /* приватный переключатель минимизации */ - allowed : { - css : true, - js : true, - html : true, - img : true - }, + allowed : true, /* функция разрешает или * запрещает минимизировать @@ -47,19 +42,16 @@ * и сохранение их в css-файл */ setAllowed :function(pAllowed) { - this.allowed = pAllowed && Minify ? pAllowed : { - js : false, - css : false, - html : false - }; + this.allowed = pAllowed && Minify; }, optimize: function(pName, pParams) { var lRet; + if (Minify) { pParams.name = Minify.getName(pName); - lRet = this.allowed.css || this.allowed.js || this.allowed.html; + lRet = this.allowed; if(!this.MinFolder) this.MinFolder = Minify.MinFolder; @@ -75,12 +67,8 @@ }); } else { - this.allowed = { - js : false, - css : false, - html : false - }; - + this.allowed = false; + Util.log(COULD_NOT_MINIFY); } From 5dfae75f87ff53d65dc50acffe288332ab685008 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 14:07:46 +0000 Subject: [PATCH 51/69] docs(readme) Configuration: add " ", cache --- HELP.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/HELP.md b/HELP.md index 106a377e..42c15a04 100644 --- a/HELP.md +++ b/HELP.md @@ -141,17 +141,17 @@ All main configuration could be done via [config.json](json/config.json "Config" "analytics" : true, /* google analytics suport */ "localStorage" : true, /* cache directory data */ "minify" : true /* minification of js,css,html and img */ - "online" : true, /* load js files from cdn or local path */ - "cache" : true, - "logs" : false, /* logs or console ouput */ - "show_keys_panel" : true, /* show classic panel with buttons of keys */ - "server" : true, /* server mode or testing mode */ - "socket" : true /* enable web sockets */ - "port" : 8000, /* http port or null(default) */ - "sslPort" : 443, /* https port or null(default) */ - "ip" : null, /* ip or null(default) */ - "ssl" : false /* should use https? */ - "rest" : true /* enable rest interface */ + "online" : true, /* load js files from cdn or local path */ + "cache" : true, /* add cache-control */ + "logs" : false, /* logs or console ouput */ + "show_keys_panel" : true, /* show classic panel with buttons of keys */ + "server" : true, /* server mode or testing mode */ + "socket" : true /* enable web sockets */ + "port" : 8000, /* http port or null(default) */ + "sslPort" : 443, /* https port or null(default) */ + "ip" : null, /* ip or null(default) */ + "ssl" : false /* should use https? */ + "rest" : true /* enable rest interface */ } ``` From deb13c3870a48fe67543d8fb91d63e78c152808e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 14:11:10 +0000 Subject: [PATCH 52/69] fix(cloudcmd) indexProcessing: "manifest" -> " manifest" --- cloudcmd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudcmd.js b/cloudcmd.js index 5ea7050e..3007fec2 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -64,9 +64,9 @@ if (!Config.appcache) lData = Util.removeStr(lData, [ /* min */ - 'manifest=/cloudcmd.appcache', + ' manifest=/cloudcmd.appcache', /* normal */ - 'manifest="/cloudcmd.appcache"' + ' manifest="/cloudcmd.appcache"' ]); if (!Config.show_keys_panel) { From e77f6ff56045ebd5a6b542b4e2bba390fc720437 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 17:16:04 +0300 Subject: [PATCH 53/69] docs(help) Menu: add "\n" --- HELP.md | 1 + 1 file changed, 1 insertion(+) diff --git a/HELP.md b/HELP.md index 42c15a04..75717c6a 100644 --- a/HELP.md +++ b/HELP.md @@ -122,6 +122,7 @@ Right mouse click button shows context menu with items: Menu --------------- Right mouse click button shows context menu with items: + - View - Edit - Rename From 9ecddd7eba01fc4528a10cf5b9bf10bb17b0b38d Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 14:25:46 +0000 Subject: [PATCH 54/69] chore(config) rm win "\n" --- json/config.json | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/json/config.json b/json/config.json index 2119fe5e..48fdfa67 100644 --- a/json/config.json +++ b/json/config.json @@ -1,18 +1,18 @@ -{ - "api_url": "/api/v1", - "appcache": false, - "analytics": true, - "localStorage": true, - "minify": true, - "online": true, - "cache": true, - "logs": false, - "show_keys_panel": true, - "server": true, - "socket": true, - "port": 8000, - "sslPort": 4430, - "ip": null, - "ssl": false, - "rest": true -} +{ + "api_url": "/api/v1", + "appcache": false, + "analytics": true, + "localStorage": true, + "minify": false, + "online": true, + "cache": true, + "logs": false, + "show_keys_panel": true, + "server": true, + "socket": true, + "port": 8000, + "sslPort": 4430, + "ip": null, + "ssl": false, + "rest": true +} From 6afd64a7fe8e5974c5bc8bfe89c6c7094d22f8f2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 14:33:57 +0000 Subject: [PATCH 55/69] fix(util) retExec if: "n" -> "n > 1" --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index 47b9ca18..9cae22a6 100644 --- a/lib/util.js +++ b/lib/util.js @@ -704,7 +704,7 @@ Util = exports || {}; var argsLocal, callback, n = args.length; - if (n) + if (n > 1) argsLocal = args; else { callback = args[0]; From f8c1813c77be4fe7b0f60905b0ed293b44664c57 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 14:37:07 +0000 Subject: [PATCH 56/69] chore(dom) Loader.ajax: isFunction -> exec --- lib/client/dom.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index f476fdfa..eed2f535 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -699,9 +699,8 @@ var CloudCmd, Util, DOM, CloudFunc; /* If it's json - parse it as json */ if (lType && Util.isContainStr(lType, TYPE_JSON) ) lData = Util.parseJSON(lJqXHR.response) || lJqXHR.response; - - if ( Util.isFunction(p.success) ) - p.success(lData, lJqXHR.statusText, lJqXHR); + + Util.exec(p.success, lData, lJqXHR.statusText, lJqXHR); } /* file not found or connection lost */ else{ From 8207ef07f3a68b008940f881c79d0652274abdbd Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 16 Oct 2013 14:54:24 +0000 Subject: [PATCH 57/69] feature(package) description --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 113949a1..6df195ff 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "cloudcmd", "version": "0.4.0", "author": "coderaiser (https://github.com/coderaiser)", - "description": "User friendly cloud file manager.", + "description": "Cloud Commander - file manager with console and editor", "homepage": "https://github.com/coderaiser/cloudcmd", "repository": { "type": "git", From 72ab8741c03729fcb4285c309b4a7a8e5d64babb Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 07:23:00 +0000 Subject: [PATCH 58/69] feature(config) minify: false -> true --- json/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json/config.json b/json/config.json index 48fdfa67..feeb326b 100644 --- a/json/config.json +++ b/json/config.json @@ -3,7 +3,7 @@ "appcache": false, "analytics": true, "localStorage": true, - "minify": false, + "minify": true, "online": true, "cache": true, "logs": false, From d647a44e963c44c08d3c258e8870e4783dae2cca Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 07:28:00 +0000 Subject: [PATCH 59/69] feature(index) robots: add noindex, nofollow --- html/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/html/index.html b/html/index.html index 7ee9cec4..a8123050 100644 --- a/html/index.html +++ b/html/index.html @@ -2,6 +2,7 @@ + From aea63e7827f56dc9e03bd350a426f276c0e81c21 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 11:17:50 +0300 Subject: [PATCH 60/69] feature(util) replaceStr: add pNotEscape --- lib/util.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/util.js b/lib/util.js index 9cae22a6..2c15e775 100644 --- a/lib/util.js +++ b/lib/util.js @@ -513,13 +513,15 @@ Util = exports || {}; * @pStr * @pFrom * @pTo + * @pNotEscape */ - - Util.replaceStr = function(pStr, pFrom, pTo) { + Util.replaceStr = function(pStr, pFrom, pTo, pNotEscape) { var lRet = pStr; if (pStr && pFrom) { - pFrom = Util.escapeRegExp(pFrom); + if (!pNotEscape) + pFrom = Util.escapeRegExp(pFrom); + lRet = pStr.replace(new RegExp(pFrom, 'g'), pTo); } @@ -1035,4 +1037,4 @@ Util = exports || {}; return lRet; }; -})(Util, exports); \ No newline at end of file +})(Util, exports); From a6e8ebab39bb5c539bacd5f40bf3dfabe9504d33 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 08:26:01 +0000 Subject: [PATCH 61/69] feature(util) render: rm param, it is default --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index 2c15e775..c198141f 100644 --- a/lib/util.js +++ b/lib/util.js @@ -544,7 +544,7 @@ Util = exports || {}; * @pView */ Util.render = function(pTempl, pView) { - var lRet = Util.ownRender(pTempl, pView, ['{', '}']); + var lRet = Util.ownRender(pTempl, pView); return lRet; }; From 2674a0d57a8824c89d74f2f7cd6bb46006ce1e18 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 08:46:21 +0000 Subject: [PATCH 62/69] feature(util) ownRedner: { } -> {{ }} --- html/file.html | 10 +++++----- html/index.html | 4 ++-- html/path.html | 2 +- lib/util.js | 8 +++++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/html/file.html b/html/file.html index 7b957541..65ac7926 100644 --- a/html/file.html +++ b/html/file.html @@ -1,8 +1,8 @@
  • - + - {name} + {{ name }} - {size}{owner} - {mode} -
  • \ No newline at end of file + {{ size }}{{ owner }} + {{ mode }} + diff --git a/html/index.html b/html/index.html index a8123050..2b8cb2d1 100644 --- a/html/index.html +++ b/html/index.html @@ -8,14 +8,14 @@ - {title} + {{ title }} -
    {fm}
    +
    {{ fm }}
    diff --git a/html/path.html b/html/path.html index a262144f..bc22a2c2 100644 --- a/html/path.html +++ b/html/path.html @@ -1 +1 @@ -
  • {path}
  • \ No newline at end of file +
  • {{ path }}
  • diff --git a/lib/util.js b/lib/util.js index c198141f..9ed142a2 100644 --- a/lib/util.js +++ b/lib/util.js @@ -556,9 +556,11 @@ Util = exports || {}; * @pSymbols */ Util.ownRender = function(pTempl, pView, pSymbols) { + var SPACES = '\\s*'; + if (!pSymbols) - pSymbols = ['{', '}']; - + pSymbols = ['{{' + SPACES, SPACES + '}}']; + var lRet = pTempl, lFirstChar, lSecondChar; @@ -570,7 +572,7 @@ Util = exports || {}; var lStr = pView[lVar]; lStr = Util.exec(lStr) || lStr; - lRet = Util.replaceStr(lRet, lFirstChar + lVar + lSecondChar, lStr); + lRet = Util.replaceStr(lRet, lFirstChar + lVar + lSecondChar, lStr, true); } return lRet; From 859f98610b4d8e867136c785fc2978777afcfdea Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 08:50:55 +0000 Subject: [PATCH 63/69] fix(html) rm "\n" --- html/file.html | 2 +- html/path.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html/file.html b/html/file.html index 65ac7926..00e2c31d 100644 --- a/html/file.html +++ b/html/file.html @@ -5,4 +5,4 @@ {{ size }}{{ owner }} {{ mode }} - + \ No newline at end of file diff --git a/html/path.html b/html/path.html index bc22a2c2..08ac9edf 100644 --- a/html/path.html +++ b/html/path.html @@ -1 +1 @@ -
  • {{ path }}
  • +
  • {{ path }}
  • \ No newline at end of file From ff00c83ea2302b05badeae6257597b49ae4d2747 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 08:56:05 +0000 Subject: [PATCH 64/69] docs(changelog) add "\n" --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 782cb656..6afe9f5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -104,6 +104,7 @@ inside: - (css) rm !important - (css) path-icon: rm font-family, font-size + 2013.08.01, v0.3.0 * Changed jquery cdn to one with https suport jquery.com -> google cdn. From 44b332776358d644ca60b9d4141ceb7589428032 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 09:08:45 +0000 Subject: [PATCH 65/69] feature(view) rm fancybox spinner --- lib/client/view.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/client/view.js b/lib/client/view.js index 403ea2ae..d550280d 100644 --- a/lib/client/view.js +++ b/lib/client/view.js @@ -137,6 +137,11 @@ var CloudCmd, Util, DOM, CloudFunc, $; */ 'background: #b3d4fc;' + 'text-shadow: none;' + + '}' + + '#fancybox-loading div {' + + 'background: none;' + + 'width: 0;' + + 'height: 0' + '}' }); From 05f5a07f05b1e0074655e74e49ae19fb208b0569 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 09:12:20 +0000 Subject: [PATCH 66/69] feature(cloudcmd) v0.4.0 -> v0.5.0 --- ChangeLog | 37 +++++++++++++++++++++++++++++++++++++ HELP.md | 2 +- README.md | 2 +- package.json | 2 +- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6afe9f5c..51974a12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,40 @@ +2013.10.16, v0.5.0 + +feature: +- (view) rm fancybox spinner +- (util) ownRedner: { } -> {{ }} +- (util) render: rm param, it is default +- (util) replaceStr: add pNotEscape +- (index) robots: add noindex, nofollow +- (config) minification -> minify: {} -> true +- (json) rm " " +- (util) retExec: add any count of params +- (util) retFunc: add any count of params +- (css) rm button width:10% +- (menu) add "(Un)Select All" +- (dom) Cmd jqueryLoad: add navigator.onLine +- (config) add online + +upadate: +- minify: v0.2.1 -> v0.2.2* + +fix: +- (util) retExec: if param was - use it +- (util) copyObj +- (socket) max reconnection attempts: Math.pow(2, 64) -> Math.pow(2, 32) +- (appcache) addFiles: pFilesNames -> pFileNames +- (listeners) pop: ajaxLoad -> CloudCmd.ajaxLoad +- (key) current -> current && current.parent; +- (dom) Loader: this -> Loader +- (util) retExec if: "n" -> "n > 1" + +refactor: +- (pipe) create: add ifExec +- (main) MOVED_PERMANENTLY +- (key) Tab: add " " +- (dom) mv set font to listeners +- (cloudcmd) writeLogsToFile + 2013.09.27, v0.4.0 feature: diff --git a/HELP.md b/HELP.md index 75717c6a..7d03a034 100644 --- a/HELP.md +++ b/HELP.md @@ -1,4 +1,4 @@ -Cloud Commander v0.4.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] +Cloud Commander v0.5.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] =============== ###[Main][MainURL] [Blog][BlogURL] [Demo][DemoURL] [NPMIMGURL]: https://badge.fury.io/js/cloudcmd.png diff --git a/README.md b/README.md index 9f2c1cf8..e115f3e6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Cloud Commander v0.4.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] +Cloud Commander v0.5.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] =============== ###[Main][MainURL] [Blog][BlogURL] [Demo][DemoURL] [NPMIMGURL]: https://badge.fury.io/js/cloudcmd.png diff --git a/package.json b/package.json index 6df195ff..cbdedebf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudcmd", - "version": "0.4.0", + "version": "0.5.0", "author": "coderaiser (https://github.com/coderaiser)", "description": "Cloud Commander - file manager with console and editor", "homepage": "https://github.com/coderaiser/cloudcmd", From 7bfe38b4cacc91ef7890a1fb86164f48ad33262d Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 09:13:51 +0000 Subject: [PATCH 67/69] docs(changelog) v0.5.0: fix date --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 51974a12..470a7bd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2013.10.16, v0.5.0 +2013.10.17, v0.5.0 feature: - (view) rm fancybox spinner From f513ab9fdbde6aa8d6d78361d3a57d888d403c9f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 09:14:20 +0000 Subject: [PATCH 68/69] docs(help) add v0.5.0 --- HELP.md | 1 + 1 file changed, 1 insertion(+) diff --git a/HELP.md b/HELP.md index 7d03a034..4a0a55a1 100644 --- a/HELP.md +++ b/HELP.md @@ -324,6 +324,7 @@ so to get it you should type a couple more commands: Version history --------------- +- *2013.10.17*, **[v0.5.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.5.0.zip)** - *2013.09.27*, **[v0.4.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.4.0.zip)** - *2013.08.01*, **[v0.3.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.3.0.zip)** - *2013.04.22*, **[v0.2.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.2.0.zip)** From 4aff4316fe56909f656970bf19bad16e55759f97 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 09:15:12 +0000 Subject: [PATCH 69/69] docs(changelog) add "\n" --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 470a7bd6..888f6c01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,7 @@ refactor: - (dom) mv set font to listeners - (cloudcmd) writeLogsToFile + 2013.09.27, v0.4.0 feature: