From 54a1989a6d95f4ffd2eca44713433471b4df853c Mon Sep 17 00:00:00 2001 From: coderaiser Date: Sat, 14 Jul 2012 12:40:00 -0400 Subject: [PATCH 01/84] fixed bug: nodester do not have env varible HOME --- server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 78e63684..56a93fbf 100644 --- a/server.js +++ b/server.js @@ -167,8 +167,9 @@ CloudServer.start=function() CloudServer.IP; /* if Cloud Server started on jitsu */ - if(!process.env.HOME.indexOf('/opt/haibu')){ - this.IP = '0.0.0.0'; + if(process.env.HOME && + !process.env.HOME.indexOf('/opt/haibu')){ + this.IP = '0.0.0.0'; } /* server mode or testing mode */ if(!process.argv[2] && this.Config.server){ From 9af2137608169649079f8438566ab68058d4992e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Sat, 14 Jul 2012 15:16:50 -0400 Subject: [PATCH 02/84] minor changes --- ChangeLog | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dcc94e3e..c67c8d8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012.07.*, Version 0.1.3 + +* Fixed bug with nodester (jitsu env.HOME make him go done) + + 2012.07.14, Version 0.1.2 * Added suport of jitsu. diff --git a/package.json b/package.json index d6fdba5a..fce89f4f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudcmd", - "version": "0.1.2", + "version": "0.1.3", "author": "coderaiser (https://github.com/coderaiser)", "description": "Two-panels file manager, totally writed on js.", "homepage": "https://github.com/coderaiser/cloudcmd", From 9e3acd7ce946ccd6b6c06a2534e14240eb3a0bce Mon Sep 17 00:00:00 2001 From: coderaiser Date: Sat, 14 Jul 2012 15:31:31 -0400 Subject: [PATCH 03/84] minor changes --- lib/server/object.js | 2 +- node_modules/minify | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/server/object.js b/lib/server/object.js index 3db493aa..1bdc7629 100644 --- a/lib/server/object.js +++ b/lib/server/object.js @@ -101,7 +101,7 @@ exports.Minify={ lMinify = require('minify'); }catch(pError){ this._allowed={js:false,css:false,html:false}; - return console.log('Could not minify' + + return console.log('Could not minify ' + 'withou minify module\n' + 'for fixing type:\n' + 'git submodule init\n' + diff --git a/node_modules/minify b/node_modules/minify index d08b97db..24173f35 160000 --- a/node_modules/minify +++ b/node_modules/minify @@ -1 +1 @@ -Subproject commit d08b97db461c5e0227df178a699c376c963d48ee +Subproject commit 24173f35158113193847d744dacce0faf266b074 diff --git a/package.json b/package.json index fce89f4f..15b5a4d4 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "node": "0.6.17", "subdomain": "cloudcmd", "dependencies": { - "minify": "0.1.2" + "minify": "0.1.3" }, "devDependencies": {}, "engines": { From 85c3c965086007655fef30f14e54cbd2a170cd5b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 10:58:04 +0300 Subject: [PATCH 04/84] fixed bug: gzip do not working out, becouse accessible flag settet up to _controller object --- server.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server.js b/server.js index 56a93fbf..70610c36 100644 --- a/server.js +++ b/server.js @@ -264,9 +264,8 @@ CloudServer._controller=function(pReq, pRes) if (lAcceptEncoding && lAcceptEncoding.match(/\bgzip\b/) && Zlib){ - this.Gzip=true; - }else - this.Gzip=false; + CloudCommander.Gzip=true; + } /* путь в ссылке, который говорит * что js отключен */ From 02ccac6785c319e503c1298b2a252e0066e280c8 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 10:58:43 +0300 Subject: [PATCH 05/84] fixed bug: gzip do not working out, becouse accessible flag settet up to _controller object --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index c67c8d8a..678837ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2012.07.*, Version 0.1.3 * Fixed bug with nodester (jitsu env.HOME make him go done) +* Fixed bug: gzip do not working out, becouse accessible flag settet up to _controller object 2012.07.14, Version 0.1.2 From 95123624d48d9234522b94b349e47d5a78be75c7 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 11:00:09 +0300 Subject: [PATCH 06/84] minor changes --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 70610c36..49351c66 100644 --- a/server.js +++ b/server.js @@ -264,7 +264,7 @@ CloudServer._controller=function(pReq, pRes) if (lAcceptEncoding && lAcceptEncoding.match(/\bgzip\b/) && Zlib){ - CloudCommander.Gzip=true; + CloudServer.Gzip=true; } /* путь в ссылке, который говорит * что js отключен From 67ff143bc1396a464d2c44f95477da3cae514342 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 11:05:34 +0300 Subject: [PATCH 07/84] minor changes --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 15b5a4d4..fce89f4f 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "node": "0.6.17", "subdomain": "cloudcmd", "dependencies": { - "minify": "0.1.3" + "minify": "0.1.2" }, "devDependencies": {}, "engines": { From 482e4bc7861d3d88119cc86fb0b8443687aa697b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 12:09:50 +0300 Subject: [PATCH 08/84] To every panel added scrollbars wich is hiding if do not needed --- client.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/client.js b/client.js index cadd6682..11e2a0a1 100644 --- a/client.js +++ b/client.js @@ -330,20 +330,7 @@ CloudClient.init=(function() /* устанавливаем размер высоты таблицы файлов * исходя из размеров разрешения экрана */ - - /* формируем и округляем высоту экрана - * при разрешениии 1024x1280: - * 658 -> 700 - */ - - var lHeight=window.screen.height - (window.screen.height/3).toFixed(); - lHeight=(lHeight/100).toFixed()*100; - - var lFm=document.getElementById('fm'); - if(lFm)lFm.style.cssText='height:' + - lHeight + - 'px'; - + /* выделяем строку с первым файлом */ var lFmHeader=document.getElementsByClassName('fm_header'); if(lFmHeader && lFmHeader[0].nextSibling) @@ -357,9 +344,24 @@ CloudClient.init=(function() var lRight=document.getElementById('right'); if(lRight)lRight.className=lRight.className.replace('hidden',''); + /* формируем и округляем высоту экрана + * при разрешениии 1024x1280: + * 658 -> 700 + */ + + var lHeight=window.screen.height - (window.screen.height/3).toFixed(); + lHeight=(lHeight/100).toFixed()*100; + + /* + var lFm=document.getElementById('fm'); + if(lFm)lFm.style.cssText='height:' + + lHeight + + 'px'; + */ CloudClient.cssSet({id:'show_2panels', element:document.head, - inner:'#left{width:46%;}' + inner:'#left{width:46%;}' + + '.panel{height:' + lHeight +'px' }); }); From 080cc63d3ee04669bb55a20e250e018f21e7bdc4 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 12:19:28 +0300 Subject: [PATCH 09/84] To every panel added scroll bars which is hiding if do not needed --- css/style.css | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/css/style.css b/css/style.css index d2c2e876..3ff4366a 100644 --- a/css/style.css +++ b/css/style.css @@ -137,8 +137,7 @@ background:url(/img/panel_refresh.png) 0 -15px no-repeat; background-position: 0 0; } #fm{ - height:90%; - overflow-y: scroll; + height:90%; } .fm_header{ font-weight: bold; @@ -162,7 +161,7 @@ background:url(/img/panel_refresh.png) 0 -15px no-repeat; float:right; } .panel{ - display: table; + overflow-y: scroll; width:46%; } #keyspanel{ From 00d07134151b00d99e01b0b094fb5577ee2996a3 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 12:19:56 +0300 Subject: [PATCH 10/84] To every panel added scroll bars which is hiding if do not needed --- ChangeLog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 678837ab..a2c0eac4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,8 @@ 2012.07.*, Version 0.1.3 -* Fixed bug with nodester (jitsu env.HOME make him go done) -* Fixed bug: gzip do not working out, becouse accessible flag settet up to _controller object +* Fixed bug with nodester (jitsu env.HOME make him go done). +* Fixed bug: gzip do not working out, becouse accessible flag settet up to _controller object. +* To every panel added scroll bars which is hiding if do not needed. 2012.07.14, Version 0.1.2 From 7fc2e261897b426f3df3515c24f65609c37ac4d0 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 12:20:49 +0300 Subject: [PATCH 11/84] fixed bug with lFM varible name --- client.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/client.js b/client.js index 11e2a0a1..ead16d28 100644 --- a/client.js +++ b/client.js @@ -338,7 +338,7 @@ CloudClient.init=(function() /* показываем элементы, которые будут работать только, если есть js */ var lFM=document.getElementById('fm'); - if(lFM)lFm.className='localstorage'; + if(lFM)lFM.className='localstorage'; /* если есть js - показываем правую панель*/ var lRight=document.getElementById('right'); @@ -352,12 +352,6 @@ CloudClient.init=(function() var lHeight=window.screen.height - (window.screen.height/3).toFixed(); lHeight=(lHeight/100).toFixed()*100; - /* - var lFm=document.getElementById('fm'); - if(lFm)lFm.style.cssText='height:' + - lHeight + - 'px'; - */ CloudClient.cssSet({id:'show_2panels', element:document.head, inner:'#left{width:46%;}' + From 708e95f63d8844cd975b2fe24f50033d674f4356 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 12:22:27 +0300 Subject: [PATCH 12/84] changed overflow-y from scroll to auto --- css/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index 3ff4366a..71caa2f9 100644 --- a/css/style.css +++ b/css/style.css @@ -161,7 +161,7 @@ background:url(/img/panel_refresh.png) 0 -15px no-repeat; float:right; } .panel{ - overflow-y: scroll; + overflow-y: auto; width:46%; } #keyspanel{ From fc9860e5a94c0114389c4704e81506b82a4de60b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 12:45:02 +0300 Subject: [PATCH 13/84] fixed bug with initialization of lOptimizeParams --- lib/server/object.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/server/object.js b/lib/server/object.js index 1bdc7629..d268280b 100644 --- a/lib/server/object.js +++ b/lib/server/object.js @@ -81,10 +81,7 @@ exports.Minify={ */ setAllowed :(function(pAllowed){ if(pAllowed){ - this._allowed.css=pAllowed.css; - this._allowed.js=pAllowed.js; - this._allowed.html=pAllowed.html; - this._allowed.img=pAllowed.img; + this._allowed=pAllowed; } }), @@ -148,7 +145,7 @@ exports.Minify={ return pFinalCode; }; - var lOptimizeParams; + var lOptimizeParams = []; if (this._allowed.js) { lOptimizeParams=[{ From b3a54b20aac806d258a2d9378ec050d5479371b2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 12:48:23 +0300 Subject: [PATCH 14/84] fixed bug with setting up flag in config.json: do not minimize js --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index a2c0eac4..5c67e34a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * Fixed bug with nodester (jitsu env.HOME make him go done). * Fixed bug: gzip do not working out, becouse accessible flag settet up to _controller object. * To every panel added scroll bars which is hiding if do not needed. +* fixed bug with setting up flag in config.json: do not minimize js. 2012.07.14, Version 0.1.2 From f5d6bcaf092704efee8efe4206ad30238ef7e290 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 12:48:40 +0300 Subject: [PATCH 15/84] minor change --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5c67e34a..a0b38e1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,7 @@ * Fixed bug with nodester (jitsu env.HOME make him go done). * Fixed bug: gzip do not working out, becouse accessible flag settet up to _controller object. * To every panel added scroll bars which is hiding if do not needed. -* fixed bug with setting up flag in config.json: do not minimize js. +* Fixed bug with setting up flag in config.json: do not minimize js. 2012.07.14, Version 0.1.2 From 30fc55a94afeaa61780774afdf8a9415a1e09fd6 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 13:41:44 +0300 Subject: [PATCH 16/84] Code made more beautiful --- server.js | 60 +++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/server.js b/server.js index 49351c66..e86d7bbb 100644 --- a/server.js +++ b/server.js @@ -3,92 +3,92 @@ /* Обьект содержащий все функции и переменные * серверной части Cloud Commander'а */ -var CloudServer={ +var CloudServer = { /* main Cloud Commander configuration * readed from config.json if it's * exist */ - Config : { - "cache" : {"allowed" : true}, - "minification" : { - "js" : false, - "css" : false, - "html" : true, - "img" : false - }, - "server" : true + Config : { + "cache" : {"allowed" : true}, + "minification" : { + "js" : false, + "css" : false, + "html" : true, + "img" : false + }, + "server" : true }, /* функция, которая генерирует заголовки * файлов, отправляемые сервером клиенту */ - generateHeaders :function(){}, + generateHeaders : function () {}, /* функция высылает * данные клиенту */ - sendResponse :function(){}, + sendResponse : function () {}, /* Структура содержащая функции, * и переменные, в которых * говориться о поддерживаемых * браузером технологиях */ - BrowserSuport :{}, + BrowserSuport : {}, /* Обьект для работы с кэшем */ - Cashe :{}, + Cashe : {}, /* Обьект через который * выполняеться сжатие * скриптов и стилей */ - Minify :{}, + Minify : {}, /* Асоциативный масив обьектов для * работы с ответами сервера * высылаемыми на запрос о файле и * хранащий информацию в виде * Responces[name]=responce; */ - Responses :{}, + Responses : {}, /* ПЕРЕМЕННЫЕ */ /* Поддержка браузером JS*/ - NoJS :true, + NoJS : true, /* Поддержка gzip-сжатия * браузером */ - Gzip :undefined, + Gzip : undefined, /* КОНСТАНТЫ */ /* index.html */ - INDEX :'index.html', - LIBDIR :'./lib', - LIBDIRSERVER :'./lib/server', + INDEX : 'index.html', + LIBDIR : './lib', + LIBDIRSERVER : './lib/server', - Port :31337, /* server port */ - IP :'127.0.0.1' + Port : 31337, /* server port */ + IP : '127.0.0.1' }; -var LeftDir='/'; -var RightDir=LeftDir; +var LeftDir = '/'; +var RightDir = LeftDir; /* модуль для работы с путями*/ -var Path = require('path'); +var Path = require('path'); var Fs = require('fs'); /* модуль для работы с файловой системой*/ var Zlib; /* node v0.4 not contains zlib */ -try{ +try { Zlib = require('zlib'); /* модуль для сжатия данных gzip-ом*/ -}catch(error){ - Zlib=undefined; +} catch (error) { + Zlib = undefined; console.log('to use gzip-commpression' + 'you should install zlib module\n' + 'npm install zlib'); } /* добавляем модуль с функциями */ var CloudFunc; -try{ +try { CloudFunc = require(CloudServer.LIBDIR + '/cloudfunc'); From cb2dcdbfe126d0c01515285116ff63bac6c14cee Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 16 Jul 2012 13:47:34 +0300 Subject: [PATCH 17/84] minor changes --- server.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/server.js b/server.js index e86d7bbb..66805819 100644 --- a/server.js +++ b/server.js @@ -125,22 +125,22 @@ CloudServer.init=(function(){ * not created, just init and * all logs writed to screen */ - if(process.argv[2]==='test'){ + if (process.argv[2] === 'test') { console.log(process.argv); - this.Config.server=false; - this.Config.logs=false; + this.Config.server = false; + this.Config.logs = false; } - if(this.Config.logs){ + if (this.Config.logs) { console.log('log param setted up in config.json\n' + 'from now all logs will be writed to log.txt'); this.writeLogsToFile(); } - }catch(pError){ + } catch (pError) { console.log('warning: configureation file config.json not found...\n' + 'using default values...\n' + JSON.stringify(CloudServer.Config)); - } + } /* Переменная в которой храниться кэш*/ this.Cache.setAllowed(CloudServer.Config.cache.allowed); @@ -154,8 +154,7 @@ CloudServer.init=(function(){ /* создаём сервер на порту 31337 */ -CloudServer.start=function() -{ +CloudServer.start = function () { this.init(); this.Port = process.env.PORT || /* c9 */ @@ -168,17 +167,16 @@ CloudServer.start=function() /* if Cloud Server started on jitsu */ if(process.env.HOME && - !process.env.HOME.indexOf('/opt/haibu')){ + !process.env.HOME.indexOf('/opt/haibu')) { this.IP = '0.0.0.0'; } - /* server mode or testing mode */ - if(!process.argv[2] && this.Config.server){ + /* server mode or testing mode */ + if (!process.argv[2] && this.Config.server) { var http = require('http'); - try{ + try { http.createServer(this._controller).listen( - this.Port, - this.IP); + this.Port, this.IP); console.log('Cloud Commander server running at http://' + this.IP + From 5552c70d48cff1867b8022db2466c672017b8e28 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 11:07:46 +0300 Subject: [PATCH 18/84] fixed bug with uninitialized function in anyload in client.js --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index a0b38e1e..02924af7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ * Fixed bug: gzip do not working out, becouse accessible flag settet up to _controller object. * To every panel added scroll bars which is hiding if do not needed. * Fixed bug with setting up flag in config.json: do not minimize js. +* Fixed bug with uninitialized function in anyload in client.js. 2012.07.14, Version 0.1.2 From 386ac995f7547df1bcce14260f1ca47ec5ce8498 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 11:09:35 +0300 Subject: [PATCH 19/84] fixed bug with uninitialized function in anyload --- client.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/client.js b/client.js index ead16d28..4e1a98ab 100644 --- a/client.js +++ b/client.js @@ -588,13 +588,14 @@ CloudClient._anyload = function(pName,pSrc,pFunc,pStyle,pId,pElement) /* if passed arguments function * then it's onload by default */ - if(typeof pFunc === 'function'){ - element.onload=pFunc; - /* if object - then onload or onerror */ - }else if (typeof pFunc === 'object'){ - if(pFunc.onload)element.onload = pFunc.onload; - if(pFunc.onerror)element.onerror=pFunc.onerror; - } + if(pFunc) + if(typeof pFunc === 'function'){ + element.onload=pFunc; + /* if object - then onload or onerror */ + }else if (typeof pFunc === 'object'){ + if(pFunc.onload)element.onload = pFunc.onload; + if(pFunc.onerror)element.onerror=pFunc.onerror; + } if(arguments.length>=4){ element.style.cssText=pStyle; } From 60da915716c7478b690ca0514088a5803b661329 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 11:13:04 +0300 Subject: [PATCH 20/84] added function cssload --- client.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/client.js b/client.js index 4e1a98ab..b0a143f0 100644 --- a/client.js +++ b/client.js @@ -632,6 +632,22 @@ CloudClient.cssSet = function(pParams_o){ pParams_o.element?pParams_o.element:document.body); lElem.innerHTML=pParams_o.inner; }; +/* Function loads external css files + * @pParams_o - структура параметров, заполняеться таким + * образом: {src: ' ',func: '', id: '', element: '', inner: ''} + * все параметры опциональны + */ +CloudClient.cssLoad = function(pParams_o){ + var lElem=CloudClient._anyload('link', + pParams_o.src, + pParams_o.func, + pParams_o.style, + pParams_o.id, + pParams_o.element?pParams_o.element:document.body); + lElem.innerHTML=pParams_o.inner; +}; + + /* * Функция генерирует JSON из html-таблицы файлов From b099116ff6541aa973d74aebac875fae968e7bc3 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 11:40:32 +0300 Subject: [PATCH 21/84] fixed bug with empty pStyle and empty pElement in _anyload --- client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.js b/client.js index b0a143f0..046854a2 100644 --- a/client.js +++ b/client.js @@ -596,11 +596,11 @@ CloudClient._anyload = function(pName,pSrc,pFunc,pStyle,pId,pElement) if(pFunc.onload)element.onload = pFunc.onload; if(pFunc.onerror)element.onerror=pFunc.onerror; } - if(arguments.length>=4){ + if(arguments.length >= 4 && pStyle){ element.style.cssText=pStyle; } } - pElement.appendChild(element); + (pElement || document.body).appendChild(element); return element; } /* если js-файл уже загружен @@ -629,7 +629,7 @@ CloudClient.cssSet = function(pParams_o){ pParams_o.func, pParams_o.style, pParams_o.id, - pParams_o.element?pParams_o.element:document.body); + pParams_o.element || document.head); lElem.innerHTML=pParams_o.inner; }; /* Function loads external css files From be9d85efc26eef29e20b36bf0205a68e98189928 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 11:41:13 +0300 Subject: [PATCH 22/84] fixed bug with empty pStyle and empty pElement in _anyload --- ChangeLog | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 02924af7..ae978d34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,16 @@ 2012.07.*, Version 0.1.3 * Fixed bug with nodester (jitsu env.HOME make him go done). + * Fixed bug: gzip do not working out, becouse accessible flag settet up to _controller object. + * To every panel added scroll bars which is hiding if do not needed. + * Fixed bug with setting up flag in config.json: do not minimize js. -* Fixed bug with uninitialized function in anyload in client.js. + +* Fixed bug with uninitialized function in _anyload in client.js. + +* Fixed bug with empty pStyle and empty pElement in _anyload. 2012.07.14, Version 0.1.2 From 315eff1d37376209c93f5e796f58dd6f88107a37 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 11:46:33 +0300 Subject: [PATCH 23/84] fixed bug with adding external css files --- client.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client.js b/client.js index 046854a2..1c53aa71 100644 --- a/client.js +++ b/client.js @@ -582,7 +582,13 @@ CloudClient._anyload = function(pName,pSrc,pFunc,pStyle,pId,pElement) if(!document.getElementById(lID)) { var element = document.createElement(pName); - element.src = pSrc; + /* if working with external css + * using href in any other case + * using src + */ + pName === 'link' ? + element.href = pSrc + : element.src = pSrc; element.id=lID; if(arguments.length>=3){ /* if passed arguments function From 49df6fbe0c64fc64fce83effe36a412f129b6944 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 11:51:14 +0300 Subject: [PATCH 24/84] fixed bug with always setting up innerHtml in cssSet --- client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client.js b/client.js index 1c53aa71..aa3c7fa5 100644 --- a/client.js +++ b/client.js @@ -636,7 +636,9 @@ CloudClient.cssSet = function(pParams_o){ pParams_o.style, pParams_o.id, pParams_o.element || document.head); - lElem.innerHTML=pParams_o.inner; + + pParams_o.inner && + lElem.innerHTML = pParams_o.inner ; }; /* Function loads external css files * @pParams_o - структура параметров, заполняеться таким From 6aea54defea70f2abad969d6c1893e65532242ec Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 11:57:19 +0300 Subject: [PATCH 25/84] minor changes --- client.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client.js b/client.js index aa3c7fa5..991215e5 100644 --- a/client.js +++ b/client.js @@ -638,7 +638,7 @@ CloudClient.cssSet = function(pParams_o){ pParams_o.element || document.head); pParams_o.inner && - lElem.innerHTML = pParams_o.inner ; + (lElem.innerHTML = pParams_o.inner); }; /* Function loads external css files * @pParams_o - структура параметров, заполняеться таким @@ -651,8 +651,10 @@ CloudClient.cssLoad = function(pParams_o){ pParams_o.func, pParams_o.style, pParams_o.id, - pParams_o.element?pParams_o.element:document.body); - lElem.innerHTML=pParams_o.inner; + pParams_o.element || document.head); + + pParams_o.inner && + (lElem.innerHTML = pParams_o.inner); }; From 7760db9071952d839c6a35384eafe6b376a08d42 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 12:00:32 +0300 Subject: [PATCH 26/84] fixed bug with rel in cssLoad --- client.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client.js b/client.js index 991215e5..21535a0a 100644 --- a/client.js +++ b/client.js @@ -653,6 +653,8 @@ CloudClient.cssLoad = function(pParams_o){ pParams_o.id, pParams_o.element || document.head); + lElem.rel = "stylesheet"; + pParams_o.inner && (lElem.innerHTML = pParams_o.inner); }; From f3fc5ecdfddff6426660f1b5fad240dd6550c30a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 12:18:20 +0300 Subject: [PATCH 27/84] added function cssLoad to client.js --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae978d34..53fcb7a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,9 +8,9 @@ * Fixed bug with setting up flag in config.json: do not minimize js. -* Fixed bug with uninitialized function in _anyload in client.js. +* Fixed bugs many bugs in _anyload function (client.js). -* Fixed bug with empty pStyle and empty pElement in _anyload. +* Added function cssLoad to client.js 2012.07.14, Version 0.1.2 From 441e651f142935c60597eec186a5098bb38e1e7f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 05:30:28 -0700 Subject: [PATCH 28/84] added CodeMirror Editor module --- node_modules/minify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/minify b/node_modules/minify index 24173f35..8d386766 160000 --- a/node_modules/minify +++ b/node_modules/minify @@ -1 +1 @@ -Subproject commit 24173f35158113193847d744dacce0faf266b074 +Subproject commit 8d386766868e176add3772365e277e501b0a37dd From 85b3eeda5491766e74f0a006c2341c0abd7d794e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 05:30:44 -0700 Subject: [PATCH 29/84] added CodeMirror Editor module --- lib/client/editor.js | 75 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 lib/client/editor.js diff --git a/lib/client/editor.js b/lib/client/editor.js new file mode 100644 index 00000000..fe191531 --- /dev/null +++ b/lib/client/editor.js @@ -0,0 +1,75 @@ +var CloudCommander; +CloudCommander.Editor = { CloudMirror: undefined }; +CloudCommander.Editor.CloudMirror = { load: (function(){ + + CloudCommander.jsload('http://codemirror.net/lib/codemirror.js', load_all(this)); + + function load_all(pParent) { + return function(){ + CloudCommander.cssLoad({ + src : 'http://codemirror.net/lib/codemirror.css', + element : document.head + }); + + CloudCommander.cssLoad({ + src : 'http://codemirror.net/theme/night.css', + element : document.head + }); + + CloudCommander.cssSet({id:'editor', + inner:'.CodeMirror{'+ + 'font-family:\'Droid Sans Mono\';'+ + 'font-size:15px;'+ + 'resize:vertical;'+ 'margin:16px;'+'padding:20px;' + + '}'+ + '.CodeMirror-scroll{'+ + 'height: 660px;' + + '}' + + '.CodeMirror-scrollbar{'+ + 'overflow-y:auto' + + '}' + }); + + var lShowEditor_f = function (){ + if (!document.getElementById('CloudEditor')) { + var lEditor=document.createElement('div'); + lEditor.id ='CloudEditor'; + lEditor.className = 'hidden'; + fm.appendChild(lEditor); + + CodeMirror(lEditor,{ + mode : "xml", + htmlMode : true, + theme : 'night', + lineNumbers : true, + //переносим длинные строки + lineWrapping: true, + extraKeys: { + //Сохранение + "Esc": pParent.hide + }, + onLoad: pParent.show() + }); + + } + } + CloudCommander.jsload('http://codemirror.net/mode/xml/xml.js', lShowEditor_f) + } + } +}), + show : (function(){ + /* removing keyBinding if set */ + CloudCommander.keyBinded = false; + left.className = 'panel hidden'; + CloudEditor.className = ''; + }), + + + + + hide :(function() { + CloudCommander.keyBinded = true; + CloudEditor.className='hidden'; + left.className = 'panel'; + }) +}; \ No newline at end of file From 2a7b0bb83a5cfb9b9af2126560c7be4a61f48d96 Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Tue, 17 Jul 2012 05:40:07 -0700 Subject: [PATCH 30/84] added client side CodeMirror library --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 53fcb7a7..3cc0a1a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ * Added function cssLoad to client.js +* Added Client Side CodeMirror library. + 2012.07.14, Version 0.1.2 From 4da252c441de37ade63408424fd0ec54633e448f Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Tue, 17 Jul 2012 07:05:14 -0700 Subject: [PATCH 31/84] added output for pressed keys --- lib/client/editor.js | 12 ++++++------ lib/client/keyBinding.js | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index fe191531..cec1d745 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -1,5 +1,5 @@ var CloudCommander; -CloudCommander.Editor = { CloudMirror: undefined }; +CloudCommander.Editor = {}; CloudCommander.Editor.CloudMirror = { load: (function(){ CloudCommander.jsload('http://codemirror.net/lib/codemirror.js', load_all(this)); @@ -52,12 +52,12 @@ CloudCommander.Editor.CloudMirror = { load: (function(){ }); } - } - CloudCommander.jsload('http://codemirror.net/mode/xml/xml.js', lShowEditor_f) - } + }; + CloudCommander.jsload('http://codemirror.net/mode/xml/xml.js', lShowEditor_f); + }; } }), - show : (function(){ + show : (function(){ /* removing keyBinding if set */ CloudCommander.keyBinded = false; left.className = 'panel hidden'; @@ -67,7 +67,7 @@ CloudCommander.Editor.CloudMirror = { load: (function(){ - hide :(function() { + hide :(function() { CloudCommander.keyBinded = true; CloudEditor.className='hidden'; left.className = 'panel'; diff --git a/lib/client/keyBinding.js b/lib/client/keyBinding.js index a441671f..06fcc140 100644 --- a/lib/client/keyBinding.js +++ b/lib/client/keyBinding.js @@ -26,6 +26,7 @@ CloudCommander.keyBinding=(function(){ * мы были на левой и * наоборот */ + console.log(event.keyCode); if(event.keyCode===9){ console.log('Tab pressed'); try{ From f2cc685d87f89c715fd9d88639b87cc8751d33fd Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Tue, 17 Jul 2012 07:15:36 -0700 Subject: [PATCH 32/84] added event listener on f4 key pressed --- lib/client/editor.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index cec1d745..29314290 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -58,6 +58,9 @@ CloudCommander.Editor.CloudMirror = { load: (function(){ } }), show : (function(){ + /* if CloudEditor is not loaded - loading him */ + document.getElementById('CloudEditor') || + this.load(); /* removing keyBinding if set */ CloudCommander.keyBinded = false; left.className = 'panel hidden'; @@ -72,4 +75,23 @@ CloudCommander.Editor.CloudMirror = { load: (function(){ CloudEditor.className='hidden'; left.className = 'panel'; }) -}; \ No newline at end of file +}; +CloudCommander.Editor.Keys = (function(){ + "use strict"; + var key_event=function(event){ + /* если клавиши можно обрабатывать*/ + if(CloudCommander.keyBinded){ + /* if f4 pressed */ + if(event.keyCode===115){ + CloudCommander.Edititor.CloudMirror.show(); + } + } + }; + + /* добавляем обработчик клавишь */ + if(document.addEventListener) + document.addEventListener('exec_editor', key_event,false); + else document.onkeypress=key_event; + /* клавиши назначены*/ + CloudCommander.keyBinded=true; +}); \ No newline at end of file From 7d5eb8ac798bc3bf5336c2e5dcf989fd425c7b75 Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Tue, 17 Jul 2012 07:17:43 -0700 Subject: [PATCH 33/84] removed output for pressed keys --- lib/client/keyBinding.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/client/keyBinding.js b/lib/client/keyBinding.js index 06fcc140..10ebe29b 100644 --- a/lib/client/keyBinding.js +++ b/lib/client/keyBinding.js @@ -14,8 +14,7 @@ CloudCommander.keyBinding=(function(){ * контент снова (js,css) в готовой версии нет * необходимости. * - */ - //console.log(event.keyCode); + */ var lCurrentFile; var lName; /* если клавиши можно обрабатывать*/ @@ -26,7 +25,6 @@ CloudCommander.keyBinding=(function(){ * мы были на левой и * наоборот */ - console.log(event.keyCode); if(event.keyCode===9){ console.log('Tab pressed'); try{ From 11c9b7b56d31e049269f0a7fabb6acc020796799 Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Tue, 17 Jul 2012 07:23:28 -0700 Subject: [PATCH 34/84] editor.js now minimizing and loading --- client.js | 9 ++++++++- lib/server/object.js | 14 ++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/client.js b/client.js index 21535a0a..701b8f1f 100644 --- a/client.js +++ b/client.js @@ -356,7 +356,14 @@ CloudClient.init=(function() element:document.head, inner:'#left{width:46%;}' + '.panel{height:' + lHeight +'px' - }); + }); + + /* loading CloudMirror plagin */ + CloudClient.jsload(CloudClient.LIBDIR+'editor.js',{ + onload:(function(){ + CloudCommander.Editor.CloudMirror.load(); + }) + }); }); /* функция меняет ссыки на ajax-овые */ diff --git a/lib/server/object.js b/lib/server/object.js index d268280b..29355925 100644 --- a/lib/server/object.js +++ b/lib/server/object.js @@ -137,11 +137,12 @@ exports.Minify={ 'client.js' + ' changed. size:', (pFinalCode = pFinalCode - .replace('cloudfunc.js','cloudfunc.min.js') - .replace('keyBinding.js','keyBinding.min.js') - .replace('/lib/', lMinFolder) - .replace('/lib/client/', - lMinFolder)).length); + .replace('editor.js','editor.min.js') + .replace('cloudfunc.js','cloudfunc.min.js') + .replace('keyBinding.js','keyBinding.min.js') + .replace('/lib/', lMinFolder) + .replace('/lib/client/', + lMinFolder)).length); return pFinalCode; }; @@ -151,7 +152,8 @@ exports.Minify={ lOptimizeParams=[{ 'client.js': lPostProcessing_f}, 'lib/cloudfunc.js', - 'lib/client/keyBinding.js']; + 'lib/client/keyBinding.js', + 'lib/client/editor.js']; } if (this._allowed.html) From 3f96bf4a9d92c4889580c72d68c9de6ce30efbc3 Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Tue, 17 Jul 2012 07:28:27 -0700 Subject: [PATCH 35/84] fixed bug with distanation of editor.js --- client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.js b/client.js index 701b8f1f..47b18f08 100644 --- a/client.js +++ b/client.js @@ -359,7 +359,7 @@ CloudClient.init=(function() }); /* loading CloudMirror plagin */ - CloudClient.jsload(CloudClient.LIBDIR+'editor.js',{ + CloudClient.jsload(CloudClient.LIBDIRCLIENT + 'editor.js',{ onload:(function(){ CloudCommander.Editor.CloudMirror.load(); }) From 12752900f3263379460c0dcd644a81f5874f138d Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Tue, 17 Jul 2012 07:30:39 -0700 Subject: [PATCH 36/84] fixed bug with binding editors key --- client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.js b/client.js index 47b18f08..5ae47eeb 100644 --- a/client.js +++ b/client.js @@ -361,7 +361,7 @@ CloudClient.init=(function() /* loading CloudMirror plagin */ CloudClient.jsload(CloudClient.LIBDIRCLIENT + 'editor.js',{ onload:(function(){ - CloudCommander.Editor.CloudMirror.load(); + CloudCommander.Editor.Keys(); }) }); }); From fa8e4ce047a62bd6624df8f2de3cd446ec7c523a Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Tue, 17 Jul 2012 07:37:07 -0700 Subject: [PATCH 37/84] moved editor loading functoin to editor function --- client.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/client.js b/client.js index 5ae47eeb..f0f5c66d 100644 --- a/client.js +++ b/client.js @@ -17,6 +17,7 @@ var CloudClient={ init :function(){}, keyBinding :function(){},/* функция нажатий обработки клавишь */ + Editor :function(){},/* function loads and shows editor */ keyBinded :false,/* оброботка нажатий клавишь установлена*/ _loadDir :function(){}, /* @@ -137,7 +138,15 @@ CloudClient.keyBinding=(function(){ }); }); - +/* function loads and shows editor */ +CloudClient.Editor = (function(){ + /* loading CloudMirror plagin */ + CloudClient.jsload(CloudClient.LIBDIRCLIENT + 'editor.js',{ + onload:(function(){ + CloudCommander.Editor.Keys(); + }) + }); +} /* * Функция привязываеться ко всем ссылкам и * загружает содержимое каталогов @@ -356,14 +365,7 @@ CloudClient.init=(function() element:document.head, inner:'#left{width:46%;}' + '.panel{height:' + lHeight +'px' - }); - - /* loading CloudMirror plagin */ - CloudClient.jsload(CloudClient.LIBDIRCLIENT + 'editor.js',{ - onload:(function(){ - CloudCommander.Editor.Keys(); - }) - }); + }); }); /* функция меняет ссыки на ajax-овые */ @@ -748,6 +750,7 @@ try{ CloudCommander.init(); /* привязываем клавиши к функциям */ CloudCommander.keyBinding(); + CloudCommander.Editor(); }; } catch(err){} \ No newline at end of file From b2b12ed86315d50f4b1ef34261efc111608953b0 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 17:41:16 +0300 Subject: [PATCH 38/84] minor changes --- client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.js b/client.js index f0f5c66d..8db092ac 100644 --- a/client.js +++ b/client.js @@ -146,7 +146,7 @@ CloudClient.Editor = (function(){ CloudCommander.Editor.Keys(); }) }); -} +}); /* * Функция привязываеться ко всем ссылкам и * загружает содержимое каталогов From bde746d9d04aef316f3c2b91699dad1ecf8f561b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 17:50:58 +0300 Subject: [PATCH 39/84] fixed bug with event name --- lib/client/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index 29314290..029f44b1 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -90,7 +90,7 @@ CloudCommander.Editor.Keys = (function(){ /* добавляем обработчик клавишь */ if(document.addEventListener) - document.addEventListener('exec_editor', key_event,false); + document.addEventListener('keydown', key_event,false); else document.onkeypress=key_event; /* клавиши назначены*/ CloudCommander.keyBinded=true; From 0cc8ef7f8dbc38f77ad712d2d719f08958cd1cdb Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 17:54:29 +0300 Subject: [PATCH 40/84] minor changes --- lib/client/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index 029f44b1..69925c2d 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -83,7 +83,7 @@ CloudCommander.Editor.Keys = (function(){ if(CloudCommander.keyBinded){ /* if f4 pressed */ if(event.keyCode===115){ - CloudCommander.Edititor.CloudMirror.show(); + CloudCommander.Editor.CloudMirror.show(); } } }; From faa3b3bc0e7cca3de30bdca95bdff1df1ea392eb Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 13:27:50 -0400 Subject: [PATCH 41/84] added getById function to CloudCommander object --- lib/client/editor.js | 153 +++++++++++++++++++++++++------------------ node_modules/minify | 2 +- 2 files changed, 89 insertions(+), 66 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index 69925c2d..c1e47e58 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -1,80 +1,100 @@ -var CloudCommander; +var CloudCommander, CodeMirror; CloudCommander.Editor = {}; -CloudCommander.Editor.CloudMirror = { load: (function(){ +CloudCommander.Editor.CloudMirror = { + load: (function(){ - CloudCommander.jsload('http://codemirror.net/lib/codemirror.js', load_all(this)); - - function load_all(pParent) { - return function(){ - CloudCommander.cssLoad({ - src : 'http://codemirror.net/lib/codemirror.css', - element : document.head - }); - - CloudCommander.cssLoad({ - src : 'http://codemirror.net/theme/night.css', - element : document.head - }); - - CloudCommander.cssSet({id:'editor', - inner:'.CodeMirror{'+ - 'font-family:\'Droid Sans Mono\';'+ - 'font-size:15px;'+ - 'resize:vertical;'+ 'margin:16px;'+'padding:20px;' + - '}'+ - '.CodeMirror-scroll{'+ - 'height: 660px;' + - '}' + - '.CodeMirror-scrollbar{'+ - 'overflow-y:auto' + - '}' - }); - - var lShowEditor_f = function (){ - if (!document.getElementById('CloudEditor')) { - var lEditor=document.createElement('div'); - lEditor.id ='CloudEditor'; - lEditor.className = 'hidden'; - fm.appendChild(lEditor); - - CodeMirror(lEditor,{ - mode : "xml", - htmlMode : true, - theme : 'night', - lineNumbers : true, - //переносим длинные строки - lineWrapping: true, - extraKeys: { - //Сохранение - "Esc": pParent.hide - }, - onLoad: pParent.show() - }); - - } + CloudCommander.jsload('http://codemirror.net/lib/codemirror.js', load_all(this)); + + function load_all(pParent) { + return function(){ + CloudCommander.cssLoad({ + src : 'http://codemirror.net/lib/codemirror.css', + element : document.head + }); + + CloudCommander.cssLoad({ + src : 'http://codemirror.net/theme/night.css', + element : document.head + }); + + CloudCommander.cssSet({id:'editor', + inner:'.CodeMirror{'+ + 'font-family:\'Droid Sans Mono\';'+ + 'font-size:15px;'+ + 'resize:vertical;'+ 'margin:16px;'+'padding:20px;' + + '}'+ + '.CodeMirror-scroll{'+ + 'height: 660px;' + + '}' + + '.CodeMirror-scrollbar{'+ + 'overflow-y:auto' + + '}' + }); + + var lShowEditor_f = function (){ + if (!document.getElementById('CloudEditor')) { + var lEditor=document.createElement('div'); + lEditor.id ='CloudEditor'; + lEditor.className = 'hidden'; + var lFM = document.getElementById('fm'); + + if(lFM){ + lFM.appendChild(lEditor); + + CodeMirror(lEditor,{ + mode : "xml", + htmlMode : true, + theme : 'night', + lineNumbers : true, + //переносим длинные строки + lineWrapping: true, + extraKeys: { + //Сохранение + "Esc": pParent.hide + }, + onLoad: pParent.show() + }); + }else console.log('Error. Something went wrong FM not found'); + } + }; + CloudCommander.jsload('http://codemirror.net/mode/xml/xml.js', lShowEditor_f); }; - CloudCommander.jsload('http://codemirror.net/mode/xml/xml.js', lShowEditor_f); - }; - } -}), + } + }), show : (function(){ /* if CloudEditor is not loaded - loading him */ document.getElementById('CloudEditor') || this.load(); /* removing keyBinding if set */ - CloudCommander.keyBinded = false; - left.className = 'panel hidden'; - CloudEditor.className = ''; + CloudCommander.keyBinded = false; + + var lLeft = this.getById('left'); + var lCloudEditor = this.getById('CloudEditor'); + + lLeft && + lLeft.className = 'panel hidden'; + + lCloudEditor && + lCloudEditor + .className = ''; }), - hide :(function() { + hide :(function() { CloudCommander.keyBinded = true; - CloudEditor.className='hidden'; - left.className = 'panel'; - }) + + var lLeft = this.getById('left'); + var lCloudEditor = this.getById('CloudEditor'); + + lCloudEditor && + lCloudEditor.className = 'hidden'; + + lLeft && + lLeft.className = 'panel'; + }), + getById: function(pId){return document.getElementById(pId)} }; CloudCommander.Editor.Keys = (function(){ "use strict"; @@ -89,9 +109,12 @@ CloudCommander.Editor.Keys = (function(){ }; /* добавляем обработчик клавишь */ - if(document.addEventListener) + if (document.addEventListener) document.addEventListener('keydown', key_event,false); - else document.onkeypress=key_event; + + else + document.onkeypress=key_event; + /* клавиши назначены*/ CloudCommander.keyBinded=true; }); \ No newline at end of file diff --git a/node_modules/minify b/node_modules/minify index 8d386766..24173f35 160000 --- a/node_modules/minify +++ b/node_modules/minify @@ -1 +1 @@ -Subproject commit 8d386766868e176add3772365e277e501b0a37dd +Subproject commit 24173f35158113193847d744dacce0faf266b074 From 2b545346d980d5d678a97912ef63782bbd956da5 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 13:30:07 -0400 Subject: [PATCH 42/84] fixed bug in conditions --- lib/client/editor.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index c1e47e58..331cd157 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -72,11 +72,10 @@ CloudCommander.Editor.CloudMirror = { var lCloudEditor = this.getById('CloudEditor'); lLeft && - lLeft.className = 'panel hidden'; + (lLeft.className = 'panel hidden'); lCloudEditor && - lCloudEditor - .className = ''; + (lCloudEditor.className = ''); }), @@ -89,12 +88,12 @@ CloudCommander.Editor.CloudMirror = { var lCloudEditor = this.getById('CloudEditor'); lCloudEditor && - lCloudEditor.className = 'hidden'; + (lCloudEditor.className = 'hidden'); lLeft && - lLeft.className = 'panel'; + (lLeft.className = 'panel'); }), - getById: function(pId){return document.getElementById(pId)} + getById: function(pId){return document.getElementById(pId);} }; CloudCommander.Editor.Keys = (function(){ "use strict"; From 4429e2a3e900b53405cf402a56ecebefd665d752 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 13:33:48 -0400 Subject: [PATCH 43/84] fixed bug parent object of function hide --- lib/client/editor.js | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index 331cd157..798bd978 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -76,23 +76,20 @@ CloudCommander.Editor.CloudMirror = { lCloudEditor && (lCloudEditor.className = ''); - }), - - - - - hide :(function() { - CloudCommander.keyBinded = true; - - var lLeft = this.getById('left'); - var lCloudEditor = this.getById('CloudEditor'); - - lCloudEditor && - (lCloudEditor.className = 'hidden'); - - lLeft && - (lLeft.className = 'panel'); - }), + }), + hide :(function(pParent) { + return function(){ + CloudCommander.keyBinded = true; + + var lLeft = pParent.getById('left'); + var lCloudEditor = pParent.getById('CloudEditor'); + + lCloudEditor && + (lCloudEditor.className = 'hidden'); + + lLeft && + (lLeft.className = 'panel'); + }}), getById: function(pId){return document.getElementById(pId);} }; CloudCommander.Editor.Keys = (function(){ From 14f5f6a9f40c6956fc63c507af7163cb3e0f7b3e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 13:35:10 -0400 Subject: [PATCH 44/84] fixed bug parent object of function hide --- lib/client/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index 798bd978..b2d8a9b5 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -50,7 +50,7 @@ CloudCommander.Editor.CloudMirror = { lineWrapping: true, extraKeys: { //Сохранение - "Esc": pParent.hide + "Esc": pParent.hide(pParent) }, onLoad: pParent.show() }); From ccb0ed59aefd20f5f0e77764f7ab7bea4c4b4689 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 14:04:20 -0400 Subject: [PATCH 45/84] add margin top, because of aesthetic experience --- lib/client/editor.js | 25 ++++++++++++++----------- node_modules/minify | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index b2d8a9b5..f30be963 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -18,17 +18,20 @@ CloudCommander.Editor.CloudMirror = { }); CloudCommander.cssSet({id:'editor', - inner:'.CodeMirror{'+ - 'font-family:\'Droid Sans Mono\';'+ - 'font-size:15px;'+ - 'resize:vertical;'+ 'margin:16px;'+'padding:20px;' + - '}'+ - '.CodeMirror-scroll{'+ - 'height: 660px;' + - '}' + - '.CodeMirror-scrollbar{'+ - 'overflow-y:auto' + - '}' + inner : '.CodeMirror{' + + 'font-family:\'Droid Sans Mono\';' + + 'font-size:15px;' + + 'resize:vertical;' + + 'margin:16px;' + + 'margin-top: 0px;' + + 'padding:20px;' + + '}' + + '.CodeMirror-scroll{' + + 'height: 660px;' + + '}' + + '.CodeMirror-scrollbar{' + + 'overflow-y:auto' + + '}' }); var lShowEditor_f = function (){ diff --git a/node_modules/minify b/node_modules/minify index 24173f35..329024d7 160000 --- a/node_modules/minify +++ b/node_modules/minify @@ -1 +1 @@ -Subproject commit 24173f35158113193847d744dacce0faf266b074 +Subproject commit 329024d730ac1f19cde818da82eb335ce7e4f796 From 0a8990b64ec605bf7c82b58f29586c0893a246b3 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 14:20:35 -0400 Subject: [PATCH 46/84] css margins removed --- lib/client/editor.js | 2 -- node_modules/minify | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index f30be963..d9d3b59b 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -22,8 +22,6 @@ CloudCommander.Editor.CloudMirror = { 'font-family:\'Droid Sans Mono\';' + 'font-size:15px;' + 'resize:vertical;' + - 'margin:16px;' + - 'margin-top: 0px;' + 'padding:20px;' + '}' + '.CodeMirror-scroll{' + diff --git a/node_modules/minify b/node_modules/minify index 329024d7..94c98692 160000 --- a/node_modules/minify +++ b/node_modules/minify @@ -1 +1 @@ -Subproject commit 329024d730ac1f19cde818da82eb335ce7e4f796 +Subproject commit 94c98692e6b684d02e1e4be4dbe41590e8a53601 From cfa0dfcd805d8229c3ff9330630e549f6c72db68 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 14:47:29 -0400 Subject: [PATCH 47/84] added preliminary loading, so CodeMirror must work faster --- lib/client/editor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index d9d3b59b..92bd05e3 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -33,7 +33,7 @@ CloudCommander.Editor.CloudMirror = { }); var lShowEditor_f = function (){ - if (!document.getElementById('CloudEditor')) { + if (!document.getElementById('CloudEditor')) { var lEditor=document.createElement('div'); lEditor.id ='CloudEditor'; lEditor.className = 'hidden'; @@ -95,6 +95,10 @@ CloudCommander.Editor.CloudMirror = { }; CloudCommander.Editor.Keys = (function(){ "use strict"; + + /* loading js and css of CodeMirror */ + CloudCommander.Editor.CloudMirror.load(); + var key_event=function(event){ /* если клавиши можно обрабатывать*/ if(CloudCommander.keyBinded){ From 920b9c9ac8afa48d85a8cc2a608e6794f6e054e6 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 14:52:14 -0400 Subject: [PATCH 48/84] removed onLoad property, it doesn't work properly anyway, just confusing --- lib/client/editor.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index 92bd05e3..522c1a2e 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -52,8 +52,7 @@ CloudCommander.Editor.CloudMirror = { extraKeys: { //Сохранение "Esc": pParent.hide(pParent) - }, - onLoad: pParent.show() + } }); }else console.log('Error. Something went wrong FM not found'); } From 288eb205d487175ec4960701fdd9b5936a6320f9 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 15:02:35 -0400 Subject: [PATCH 49/84] added getPanel function, left is not the only panel, thet could be using for text editing --- lib/client/editor.js | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index 522c1a2e..0272b364 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -77,20 +77,29 @@ CloudCommander.Editor.CloudMirror = { lCloudEditor && (lCloudEditor.className = ''); }), - hide :(function(pParent) { - return function(){ - CloudCommander.keyBinded = true; - - var lLeft = pParent.getById('left'); - var lCloudEditor = pParent.getById('CloudEditor'); - - lCloudEditor && - (lCloudEditor.className = 'hidden'); - - lLeft && - (lLeft.className = 'panel'); - }}), - getById: function(pId){return document.getElementById(pId);} + hide : (function(pParent) { + return function(){ + CloudCommander.keyBinded = true; + + var lLeft = pParent.getById('left'); + var lCloudEditor = pParent.getById('CloudEditor'); + + lCloudEditor && + (lCloudEditor.className = 'hidden'); + + lLeft && + (lLeft.className = 'panel'); + }; + }), + getById: function(pId){return document.getElementById(pId);}, + + getPanel: function(){ + var lCurrent = document.getElementsByClassName('current-file'); + lCurrent.length && + (lCurrent = lCurrent[0].parentElement); + + return lCurrent && lCurrent.id; + } }; CloudCommander.Editor.Keys = (function(){ "use strict"; From f5bc7ca7fdde3b457095e1658541b93abc4bfe33 Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Wed, 18 Jul 2012 00:32:49 -0700 Subject: [PATCH 50/84] hidded minify module --- .gitignore | 3 +++ README.md | 11 +++++++++-- node_modules/minify | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 64d11554..0b7b6935 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,6 @@ node_modules/* #hashes file hashes.json + +#hiding git modules for travis work out +.gitignore diff --git a/README.md b/README.md index 3f9aaa81..c4d26ef4 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,7 @@ assingned (and installed) module: [Minify] (https://github.com/coderaiser/minify Install addtitional modules: - git submodule init - git submodule update + npm i **Cloud Commander's Client Side** use module jquery for ajaxing. We could not use this module, but this way is fast: @@ -94,4 +93,12 @@ If you would like to contribute - send pull request to dev branch. Getting dev version of **Cloud Commander**: git clone cloudcmd --recursive + git checkout dev + +It is possible thet dev version 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 \ No newline at end of file diff --git a/node_modules/minify b/node_modules/minify index 94c98692..8d386766 160000 --- a/node_modules/minify +++ b/node_modules/minify @@ -1 +1 @@ -Subproject commit 94c98692e6b684d02e1e4be4dbe41590e8a53601 +Subproject commit 8d386766868e176add3772365e277e501b0a37dd From 2d3c050e9058fb29341cd16c3ae5ec034f6b97aa Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Wed, 18 Jul 2012 00:41:00 -0700 Subject: [PATCH 51/84] minor changes --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c4d26ef4..00f0d856 100644 --- a/README.md +++ b/README.md @@ -42,9 +42,14 @@ There is a short list: Installing --------------- **Cloud Commander** installing is very easy. All you need it's just clone -repository from github. Install and start, just 3 commands: +repository from github. Just 2 commands: - git clone git://github.com/coderaiser/cloudcmd.git --recursive + git clone git://github.com/coderaiser/cloudcmd.git + cd cloudcmd +or + + npm i cloudcmd + mv node_modules/cloudcmd ./cloudcmd Starting --------------- From 3f8e876f7b76a96da1a230ea20812026f2589a0d Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Wed, 18 Jul 2012 02:03:04 -0700 Subject: [PATCH 52/84] added install dev script --- install-dev.bat | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 install-dev.bat diff --git a/install-dev.bat b/install-dev.bat new file mode 100644 index 00000000..f3774051 --- /dev/null +++ b/install-dev.bat @@ -0,0 +1,6 @@ +git checkout dev +cd cloudcmd/node_modules +git clone git://github.com/coderaiser/minify +cd minify +cd ../../ +git checkout dev \ No newline at end of file From 54130049b499dd23a506877f10e63186751018ba Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 12:08:28 +0300 Subject: [PATCH 53/84] minor changes --- install-dev.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install-dev.bat b/install-dev.bat index f3774051..3e8d299d 100644 --- a/install-dev.bat +++ b/install-dev.bat @@ -1,6 +1,6 @@ git checkout dev -cd cloudcmd/node_modules +cd node_modules git clone git://github.com/coderaiser/minify -cd minify -cd ../../ -git checkout dev \ No newline at end of file +cd minify +git checkout dev +cd ../../ \ No newline at end of file From 77205a071bcb78f7d5973a466a9387f1129e2743 Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Wed, 18 Jul 2012 02:15:37 -0700 Subject: [PATCH 54/84] changed name of install-dev --- install-dev.bat | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 install-dev.bat diff --git a/install-dev.bat b/install-dev.bat deleted file mode 100644 index 3e8d299d..00000000 --- a/install-dev.bat +++ /dev/null @@ -1,6 +0,0 @@ -git checkout dev -cd node_modules -git clone git://github.com/coderaiser/minify -cd minify -git checkout dev -cd ../../ \ No newline at end of file From 864b73dcb3be39d0109fb3560b9269165ab6ff4c Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Wed, 18 Jul 2012 02:17:26 -0700 Subject: [PATCH 55/84] changed name of install-dev --- install-dev | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 install-dev diff --git a/install-dev b/install-dev new file mode 100644 index 00000000..3e8d299d --- /dev/null +++ b/install-dev @@ -0,0 +1,6 @@ +git checkout dev +cd node_modules +git clone git://github.com/coderaiser/minify +cd minify +git checkout dev +cd ../../ \ No newline at end of file From 77fac251ffa3b63550e30dc6e5fd1dfda83b8966 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 13:02:17 +0300 Subject: [PATCH 56/84] fixed bug with processing key pressing of Cloud Editor if it's window is hidden. --- lib/client/editor.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index 0272b364..b6b87d2a 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -108,8 +108,15 @@ CloudCommander.Editor.Keys = (function(){ CloudCommander.Editor.CloudMirror.load(); var key_event=function(event){ - /* если клавиши можно обрабатывать*/ - if(CloudCommander.keyBinded){ + + /* getting CloudEditor element */ + var lEditorHidden= CloudCommander.Editor.CloudMirror.getById('CloudEditor'); + lEditorHidden && + lEditorHidden = lEditorHidden.className; + /* если клавиши можно обрабатывать + * и CloudEditor не спрятан + */ + if(CloudCommander.keyBinded && !lEditorHidden){ /* if f4 pressed */ if(event.keyCode===115){ CloudCommander.Editor.CloudMirror.show(); From 8f6211a35b2bdecd98758f205fbfca8146225df8 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 13:03:05 +0300 Subject: [PATCH 57/84] fixed bug with processing key pressing of Cloud Editor if it's window is hidden --- ChangeLog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3cc0a1a7..a524d742 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,7 +12,9 @@ * Added function cssLoad to client.js -* Added Client Side CodeMirror library. +* Added Client Side CodeMirror library with name Cloud Editor. + +* Fixed bug with processing key pressing of Cloud Editor if it's window is hidden 2012.07.14, Version 0.1.2 From c04c2bc3c61cdbb7dc44d5603b0685ba9a880020 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 13:05:56 +0300 Subject: [PATCH 58/84] minor changes --- lib/client/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index b6b87d2a..1dfa7dff 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -112,7 +112,7 @@ CloudCommander.Editor.Keys = (function(){ /* getting CloudEditor element */ var lEditorHidden= CloudCommander.Editor.CloudMirror.getById('CloudEditor'); lEditorHidden && - lEditorHidden = lEditorHidden.className; + (lEditorHidden = lEditorHidden.className); /* если клавиши можно обрабатывать * и CloudEditor не спрятан */ From 7a0d1708826995fb0e4648012dc974c230a42dd1 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 13:08:45 +0300 Subject: [PATCH 59/84] changes back to previous state because they have no sense --- lib/client/editor.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index 1dfa7dff..5a5ff18e 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -109,14 +109,8 @@ CloudCommander.Editor.Keys = (function(){ var key_event=function(event){ - /* getting CloudEditor element */ - var lEditorHidden= CloudCommander.Editor.CloudMirror.getById('CloudEditor'); - lEditorHidden && - (lEditorHidden = lEditorHidden.className); - /* если клавиши можно обрабатывать - * и CloudEditor не спрятан - */ - if(CloudCommander.keyBinded && !lEditorHidden){ + /* если клавиши можно обрабатывать */ + if(CloudCommander.keyBinded){ /* if f4 pressed */ if(event.keyCode===115){ CloudCommander.Editor.CloudMirror.show(); From 4d9679c180d7566250452efe0446957f96ec9d10 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 13:09:08 +0300 Subject: [PATCH 60/84] changes back to previous state because they have no sense --- ChangeLog | 2 -- 1 file changed, 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a524d742..4dd094b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,8 +14,6 @@ * Added Client Side CodeMirror library with name Cloud Editor. -* Fixed bug with processing key pressing of Cloud Editor if it's window is hidden - 2012.07.14, Version 0.1.2 From 7ecc4e2909298b6ee5f3b4acf4c23a5b8e584bcc Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 14:29:38 +0300 Subject: [PATCH 61/84] removed unneeded code --- lib/client/keyBinding.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/client/keyBinding.js b/lib/client/keyBinding.js index 10ebe29b..7f007e55 100644 --- a/lib/client/keyBinding.js +++ b/lib/client/keyBinding.js @@ -107,17 +107,6 @@ CloudCommander.keyBinding=(function(){ var lATag=lName[0].getElementsByTagName('a'); /* если нету - выходим */ if(!lATag)return false; - /* получаем ссылку на каталог, - * что на уровень выше - */ - /* получаем имя каталога в котором находимся*/ - var lHref; - try{ - lHref=lCurrentFile.parentElement.getElementsByClassName('path')[0].textContent; - }catch(error){console.log('error');} - lHref=CloudFunc.removeLastSlash(lHref); - var lSubstr=lHref.substr(lHref,lHref.lastIndexOf('/')); - lHref=lHref.replace(lSubstr+'/',''); /* вызываем ajaxload привязанный через changelinks * пробулем нажать на ссылку, если не получиться From 723bb9f9c326a65236ba3803e78a2a916766d20a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 15:10:17 +0300 Subject: [PATCH 62/84] fixed bug with building file table from json data, when we go around and come back to root dir --- client.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/client.js b/client.js index 8db092ac..ccb50bb6 100644 --- a/client.js +++ b/client.js @@ -697,7 +697,20 @@ CloudClient._getJSONfromFileTable=function() var lIsDir=lLI[i].getElementsByClassName('mini-icon')[0] .className.replace('mini-icon ','')==='directory'?true:false; - var lName=lLI[i].getElementsByClassName('name')[0].textContent; + var lName=lLI[i].getElementsByClassName('name')[0] + lName && + (lName = lName.getElementsByTagName('a') + /* if found link to folder + * cheking is it a full name + * or short + */ + lName.length && + (lName = lName.title); + /* if short we got title + * if full - getting textConent + */ + lName || + (lName = lName.textContent); /* если это папка - выводим слово dir вместо размера*/ var lSize=lIsDir?'dir':lLI[i].getElementsByClassName('size')[0].textContent; var lMode=lLI[i].getElementsByClassName('mode')[0].textContent; From 729cff791ddad48c190dee9487f62f0ed1f91910 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 15:13:35 +0300 Subject: [PATCH 63/84] fixed bug with building file table from json data, when we go around and come back to root dir --- ChangeLog | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4dd094b1..6a67c1b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,8 @@ * Fixed bug with nodester (jitsu env.HOME make him go done). -* Fixed bug: gzip do not working out, becouse accessible flag settet up to _controller object. +* Fixed bug: gzip do not working out, becouse accessible flag settet +up to _controller object. * To every panel added scroll bars which is hiding if do not needed. @@ -14,6 +15,14 @@ * Added Client Side CodeMirror library with name Cloud Editor. +* Fixed bug with building file table from json data, when we go around +and come back to root dir. +If name of a file or directory is more then 16 charactes it shows +like 'VERY-LONG-NAME..', so becaouse of on first came we load page +like no js, so json building from file table thet was genereted on +server. So if file to long we should take it's name from title +parameter of tag. + 2012.07.14, Version 0.1.2 From a1c8bc69b5f86a9631eb75167da50b1d1e4b1d38 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 15:26:55 +0300 Subject: [PATCH 64/84] minor changes --- ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6a67c1b6..0117687f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,7 +21,8 @@ If name of a file or directory is more then 16 charactes it shows like 'VERY-LONG-NAME..', so becaouse of on first came we load page like no js, so json building from file table thet was genereted on server. So if file to long we should take it's name from title -parameter of tag. +parameter of tag, it's wasn't, so folder navigation not every +time was possible. 2012.07.14, Version 0.1.2 From c4166e26588d2dc44dbe64e71fa8095bde415792 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 15:29:20 +0300 Subject: [PATCH 65/84] minor changes --- client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client.js b/client.js index ccb50bb6..f96389c3 100644 --- a/client.js +++ b/client.js @@ -697,9 +697,9 @@ CloudClient._getJSONfromFileTable=function() var lIsDir=lLI[i].getElementsByClassName('mini-icon')[0] .className.replace('mini-icon ','')==='directory'?true:false; - var lName=lLI[i].getElementsByClassName('name')[0] + var lName=lLI[i].getElementsByClassName('name')[0]; lName && - (lName = lName.getElementsByTagName('a') + (lName = lName.getElementsByTagName('a')); /* if found link to folder * cheking is it a full name * or short From a3079d493523cffd242673ff3f86e7da926ade0f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 15:31:49 +0300 Subject: [PATCH 66/84] minor changes --- client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.js b/client.js index f96389c3..dda89d66 100644 --- a/client.js +++ b/client.js @@ -705,7 +705,7 @@ CloudClient._getJSONfromFileTable=function() * or short */ lName.length && - (lName = lName.title); + (lName = lName[0].title); /* if short we got title * if full - getting textConent */ From 124c895eb40845184fe228013e07f67552a43eda Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 15:33:42 +0300 Subject: [PATCH 67/84] minor changes --- client.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.js b/client.js index dda89d66..4d71ce4e 100644 --- a/client.js +++ b/client.js @@ -705,7 +705,8 @@ CloudClient._getJSONfromFileTable=function() * or short */ lName.length && - (lName = lName[0].title); + lName[0].title && + (lName = lName[0].title); /* if short we got title * if full - getting textConent */ From 84b3500707e0d2f79a8d9d255196fba642aa0ec2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 15:38:09 +0300 Subject: [PATCH 68/84] minor changes --- client.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client.js b/client.js index 4d71ce4e..d6a14f20 100644 --- a/client.js +++ b/client.js @@ -697,21 +697,21 @@ CloudClient._getJSONfromFileTable=function() var lIsDir=lLI[i].getElementsByClassName('mini-icon')[0] .className.replace('mini-icon ','')==='directory'?true:false; - var lName=lLI[i].getElementsByClassName('name')[0]; + var lName=lLI[i].getElementsByClassName('name')[0]; lName && (lName = lName.getElementsByTagName('a')); /* if found link to folder * cheking is it a full name * or short - */ - lName.length && - lName[0].title && - (lName = lName[0].title); - /* if short we got title + */ + /* if short we got title * if full - getting textConent */ - lName || - (lName = lName.textContent); + (lName.length && + lName[0].title && + (lName = lName[0].title)) || + (lName = lName.textContent); + /* если это папка - выводим слово dir вместо размера*/ var lSize=lIsDir?'dir':lLI[i].getElementsByClassName('size')[0].textContent; var lMode=lLI[i].getElementsByClassName('mode')[0].textContent; From d9655861c5eb35da6f4d8c7feb13a6de196bab9d Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 15:41:07 +0300 Subject: [PATCH 69/84] minor changes --- client.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client.js b/client.js index d6a14f20..01dfb1a7 100644 --- a/client.js +++ b/client.js @@ -708,9 +708,10 @@ CloudClient._getJSONfromFileTable=function() * if full - getting textConent */ (lName.length && - lName[0].title && - (lName = lName[0].title)) || - (lName = lName.textContent); + (lName = lName[0]) + (lName.title && + (lName = lName.title)) || + (lName = lName.textContent); /* если это папка - выводим слово dir вместо размера*/ var lSize=lIsDir?'dir':lLI[i].getElementsByClassName('size')[0].textContent; From 6b71831b69f15fd605cb47927e91d5ca0c05e703 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 15:41:54 +0300 Subject: [PATCH 70/84] minor changes --- client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.js b/client.js index 01dfb1a7..9d79f1d6 100644 --- a/client.js +++ b/client.js @@ -707,7 +707,7 @@ CloudClient._getJSONfromFileTable=function() /* if short we got title * if full - getting textConent */ - (lName.length && + lName.length && (lName = lName[0]) (lName.title && (lName = lName.title)) || From 9f35478128b673641545d11e785b15959312a137 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 15:48:28 +0300 Subject: [PATCH 71/84] minor changes --- client.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client.js b/client.js index 9d79f1d6..d4dde19a 100644 --- a/client.js +++ b/client.js @@ -708,10 +708,10 @@ CloudClient._getJSONfromFileTable=function() * if full - getting textConent */ lName.length && - (lName = lName[0]) - (lName.title && - (lName = lName.title)) || - (lName = lName.textContent); + (lName = lName[0]); + lName.title && + (lName = lName.title) || + (lName = lName.textContent); /* если это папка - выводим слово dir вместо размера*/ var lSize=lIsDir?'dir':lLI[i].getElementsByClassName('size')[0].textContent; From a57532108442e1174bd582c69e1aa84fe15f3e01 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 18:01:07 +0300 Subject: [PATCH 72/84] fixed bug with undefined size on root directory of Cloud Commander --- lib/cloudfunc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index 43136dd8..e80af6d8 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -159,7 +159,7 @@ CloudFunc.convertPermissionsToNumberic= function(pPerm_s){ */ CloudFunc.getShortedSize=function(pSize){ /* if pSize=0 - return it */ - if(!pSize)return pSize; + if(!pSize || (pSize != pSize-0))return pSize; /* Константы размеров, что используются * внутри функции From e76bc41631a7c735f1f9816b806366bf39cb988d Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 18:01:26 +0300 Subject: [PATCH 73/84] fixed bug with undefined size on root directory of Cloud Commander --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 0117687f..9227315c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ server. So if file to long we should take it's name from title parameter of tag, it's wasn't, so folder navigation not every time was possible. +* Fixed bug with undefined size on root directory of Cloud Commander. 2012.07.14, Version 0.1.2 From b31a830680c0a3700ac902ff53ac19cf7e8b2648 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Jul 2012 10:46:37 +0300 Subject: [PATCH 74/84] pSize can be 0 in getShortedSize --- lib/cloudfunc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index e80af6d8..ff34beb1 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -159,7 +159,7 @@ CloudFunc.convertPermissionsToNumberic= function(pPerm_s){ */ CloudFunc.getShortedSize=function(pSize){ /* if pSize=0 - return it */ - if(!pSize || (pSize != pSize-0))return pSize; + if (pSize != pSize-0) return pSize; /* Константы размеров, что используются * внутри функции From 15c914c0349f72f679aa9be60fde1c4fecd5fce2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Jul 2012 10:51:05 +0300 Subject: [PATCH 75/84] Now Cloud Commander writes size 0, if can't get size, and besides will setted b char: "0b". --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9227315c..cb0e1a9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,9 @@ parameter of tag, it's wasn't, so folder navigation not every time was possible. * Fixed bug with undefined size on root directory of Cloud Commander. +Now Cloud Commander writes size 0, if can't get size, and besides will +setted b char: "0b". + 2012.07.14, Version 0.1.2 From d9f2040b386dec1e1916c527abb90decb901405d Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Jul 2012 11:50:49 +0300 Subject: [PATCH 76/84] fixed spaces view in folder name on clients console --- client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.js b/client.js index d4dde19a..a7602090 100644 --- a/client.js +++ b/client.js @@ -439,7 +439,7 @@ CloudClient._changeLinks = function(pPanelID) CloudClient._ajaxLoad=function(path, pNeedRefresh) { /* Отображаем красивые пути */ - var lPath=path; + var lPath=CloudFunc.replaceSpaces(path); var lFS_s=CloudFunc.FS; if(lPath.indexOf(lFS_s)===0){ lPath=lPath.replace(lFS_s,''); From 7665f2a37ce1ff16aa0ea0a7a5bdcaf17eaba421 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Jul 2012 12:07:56 +0300 Subject: [PATCH 77/84] added supporting of Russian language in directory names --- client.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client.js b/client.js index a7602090..eb6dbcf7 100644 --- a/client.js +++ b/client.js @@ -437,9 +437,10 @@ CloudClient._changeLinks = function(pPanelID) * @pNeedRefresh - необходимость обновить данные о каталоге */ CloudClient._ajaxLoad=function(path, pNeedRefresh) -{ - /* Отображаем красивые пути */ - var lPath=CloudFunc.replaceSpaces(path); +{ + /* Отображаем красивые пути */ + /* added supporting of russian language */ + var lPath=decodeUri(path); var lFS_s=CloudFunc.FS; if(lPath.indexOf(lFS_s)===0){ lPath=lPath.replace(lFS_s,''); From 0219beaa67ede57086c41bdfeb7dc8a1d36f80e5 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Jul 2012 12:10:00 +0300 Subject: [PATCH 78/84] added supporting of Russian language in directory names --- server.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/server.js b/server.js index 66805819..d9880c31 100644 --- a/server.js +++ b/server.js @@ -367,17 +367,12 @@ CloudServer._controller=function(pReq, pRes) /* если в итоге путь пустой * делаем его корневым */ - if(pathname==='')pathname='/'; + if (pathname==='') + pathname = '/'; - RightDir=pathname; - LeftDir=pathname; - - /* если встретиться пробел - - * меня код символа пробела на пробел - */ - - LeftDir=CloudFunc.replaceSpaces(LeftDir); - RightDir=CloudFunc.replaceSpaces(RightDir); + /* added supporting of Russian language in directory names */ + LeftDir = querystring.unescape(pathname); + RightDir = LeftDir; /* Проверяем с папкой ли мы имеем дело */ From 0a17ba92d9c3481fa4be86a5783db2e7450ee655 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Jul 2012 12:10:25 +0300 Subject: [PATCH 79/84] added supporting of Russian language in directory names --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index cb0e1a9d..b4e62c3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,8 @@ time was possible. Now Cloud Commander writes size 0, if can't get size, and besides will setted b char: "0b". +* Added supporting of Russian language in directory names. + 2012.07.14, Version 0.1.2 From f4e1f6f2d61db66d30611a339b84484b16061909 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Jul 2012 12:11:56 +0300 Subject: [PATCH 80/84] removed replaceSpaces function, in client and server changed to decodeURI and querystring.unescape --- lib/cloudfunc.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index ff34beb1..fac98396 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -32,19 +32,6 @@ CloudFunc.removeLastSlash = function(pPath){ pPath.substr(pPath, pPath.length-1):pPath; else return pPath; }; -/* - * Функция меняет код символа пробела на пробел - * в переданной строке - * @pPath - строка - */ -CloudFunc.replaceSpaces = function(pPath){ - if(pPath.indexOf('%20')>0){ - do{ - pPath=pPath.replace('%20',' '); - }while(pPath.indexOf('%20')>0); - } - return pPath; -}; /* Функция возвращает заголовок веб страницы */ CloudFunc.setTitle = function(){ From 006d4748445b94564cdc338cdddc242d5855db9f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Jul 2012 12:13:46 +0300 Subject: [PATCH 81/84] minor changes --- server.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server.js b/server.js index d9880c31..035b422a 100644 --- a/server.js +++ b/server.js @@ -72,9 +72,8 @@ var LeftDir = '/'; var RightDir = LeftDir; /* модуль для работы с путями*/ var Path = require('path'); - var Fs = require('fs'); /* модуль для работы с файловой системой*/ - +var Querystring = require('querystring'); var Zlib; /* node v0.4 not contains zlib */ @@ -371,7 +370,7 @@ CloudServer._controller=function(pReq, pRes) pathname = '/'; /* added supporting of Russian language in directory names */ - LeftDir = querystring.unescape(pathname); + LeftDir = Querystring.unescape(pathname); RightDir = LeftDir; /* Проверяем с папкой ли мы имеем дело */ From 3dfd8fc182c8ec517752968d217bc285931b6ebf Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Jul 2012 12:14:36 +0300 Subject: [PATCH 82/84] minor changes --- client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.js b/client.js index eb6dbcf7..fe393801 100644 --- a/client.js +++ b/client.js @@ -440,7 +440,7 @@ CloudClient._ajaxLoad=function(path, pNeedRefresh) { /* Отображаем красивые пути */ /* added supporting of russian language */ - var lPath=decodeUri(path); + var lPath=decodeURI(path); var lFS_s=CloudFunc.FS; if(lPath.indexOf(lFS_s)===0){ lPath=lPath.replace(lFS_s,''); From 44195df58d27de7077ca29099d9d2783f6e193d8 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Jul 2012 12:18:29 +0300 Subject: [PATCH 83/84] minor changes --- server.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server.js b/server.js index 035b422a..8effda22 100644 --- a/server.js +++ b/server.js @@ -250,7 +250,10 @@ CloudServer._controller=function(pReq, pRes) */ var url = require("url"); var pathname = url.parse(pReq.url).pathname; - console.log('pathname: '+pathname); + + /* added supporting of Russian language in directory names */ + pathname = Querystring.unescape(pathname); + console.log('pathname: ' + pathname); /* получаем поддерживаемые браузером кодировки*/ var lAcceptEncoding = pReq.headers['accept-encoding']; @@ -368,9 +371,8 @@ CloudServer._controller=function(pReq, pRes) */ if (pathname==='') pathname = '/'; - - /* added supporting of Russian language in directory names */ - LeftDir = Querystring.unescape(pathname); + + LeftDir = pathname; RightDir = LeftDir; /* Проверяем с папкой ли мы имеем дело */ From 281f0e3e504772c1036f654e43e3cd254c0a4799 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Jul 2012 13:05:41 +0300 Subject: [PATCH 84/84] changed to minify version 0.1.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fce89f4f..15b5a4d4 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "node": "0.6.17", "subdomain": "cloudcmd", "dependencies": { - "minify": "0.1.2" + "minify": "0.1.3" }, "devDependencies": {}, "engines": {