diff --git a/lib/client/dom.js b/lib/client/dom.js index 93d1e810..f2632656 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1,4 +1,4 @@ -var CloudCommander, $, Util, DOM, CloudFunc; +var CloudCommander, Util, DOM, CloudFunc; (function(){ "use strict"; @@ -15,6 +15,8 @@ var CloudCommander, $, Util, DOM, CloudFunc; * private function thet unset currentfile */ function UnSetCurrentFile(pCurrentFile){ + var lRet_b = DOM.isCurrentFile(pCurrentFile); + if(!pCurrentFile) DOM.addCloudStatus({ code : -1, @@ -23,8 +25,6 @@ var CloudCommander, $, Util, DOM, CloudFunc; 'could not be none' }); - var lRet_b = DOM.isCurrentFile(pCurrentFile); - if(lRet_b) DOM.removeClass(pCurrentFile, getCurrentFile()); @@ -129,9 +129,10 @@ var CloudCommander, $, Util, DOM, CloudFunc; XMLHTTP.open(lType, pParams.url, true); XMLHTTP.send(lData); - if( !Util.isFunction(lSuccess_f) ) - console.log('error in DOM.ajax onSuccess:', pParams) && + if( !Util.isFunction(lSuccess_f) ){ + console.log('error in DOM.ajax onSuccess:', pParams); console.log(pParams); + } XMLHTTP.onreadystatechange = function(pEvent){ if (XMLHTTP.readyState === 4 /* Complete */){ diff --git a/lib/client/ie.js b/lib/client/ie.js index e64f715a..010db487 100644 --- a/lib/client/ie.js +++ b/lib/client/ie.js @@ -112,8 +112,8 @@ var Util, DOM, $; parentBorderLeftWidth + pElement.clientWidth / 2; - if ( (overTop || overBottom || overLeft || overRight) - && !centerIfNeeded) + if ( (overTop || overBottom || overLeft || overRight) && + !centerIfNeeded) pElement.scrollIntoView(alignWithTop); }; diff --git a/lib/client/keyBinding.js b/lib/client/keyBinding.js index df9c3a92..084a7f01 100644 --- a/lib/client/keyBinding.js +++ b/lib/client/keyBinding.js @@ -236,11 +236,11 @@ var CloudCommander, Util, DOM; var lC = lCurrentFile, tryCatch = function(pCurrentFile){ Util.tryCatch(function(){ - pCurrentFile - .previousSibling + return pCurrentFile .previousSibling .previousSibling - .previousSibling; + .previousSibling + .previousSibling; }); }; diff --git a/lib/client/socket.js b/lib/client/socket.js index 168f97f5..89a730ac 100644 --- a/lib/client/socket.js +++ b/lib/client/socket.js @@ -82,14 +82,14 @@ var CloudCommander, DOM, Util, io; } Messages = []; } - + lStdout = pMsg.stdout; lStderr = pMsg.stderr; if(lStdout) lResult = lTerm.echo(lStdout); - if(lStderr && lStderr.code != 1) + if(lStderr && lStderr.code !== 1) lResult = lTerm.error(lStderr.toString()); } else{ diff --git a/lib/client/storage/_github.js b/lib/client/storage/_github.js index f1219223..c56be6b1 100644 --- a/lib/client/storage/_github.js +++ b/lib/client/storage/_github.js @@ -18,7 +18,7 @@ var CloudCommander, Util, DOM, $, Github, cb; cloudcmd.Storage = {}; - cb = function (err, data){ console.log(err || data);} + cb = function (err, data){ console.log(err || data);}; /* PRIVATE FUNCTIONS */ diff --git a/lib/client/viewer.js b/lib/client/viewer.js index 73fe9e5e..3e973f51 100644 --- a/lib/client/viewer.js +++ b/lib/client/viewer.js @@ -87,7 +87,7 @@ var CloudCommander, Util, DOM, CloudFunc, $; }, padding : 0 }; - }; + } /** * function loads css and js of FancyBox diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index 0605850b..35be329b 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -248,7 +248,7 @@ var CloudFunc, exports; lFS_s + lNoJS_s + lTitle + - '"/"' + + '/' + _l + '/' + lHrefEnd; @@ -430,7 +430,7 @@ var CloudFunc, exports; '' : ' target="_blank"') + ' title="' + files[i].name +'"' + - 'draggable=true>' + files[i].name + + ' draggable=true>' + files[i].name + "" + ''; /* если папка - не выводим размер */ diff --git a/lib/util.js b/lib/util.js index 14a1a412..5c6c968a 100644 --- a/lib/util.js +++ b/lib/util.js @@ -31,7 +31,7 @@ var Util, exports; */ Util.strCmp = function (pStr1, pStr2){ return this.isContainStr(pStr1, pStr2) && - pStr1.length == pStr2.length; + pStr1.length === pStr2.length; }; /** diff --git a/test/test.js b/test/test.js index 7d7d5584..242d48d8 100644 --- a/test/test.js +++ b/test/test.js @@ -1,8 +1,12 @@ -var CloudFunc = require('../lib/cloudfunc'); -var assert = require('assert'); - -try{ - var lJSON = [{ +(function(){ + "use strict"; + + var DIR = process.cwd() + '/', + main = require(DIR + 'lib/server/main'), + + CloudFunc = main.cloudfunc, + + lJSON = [{ "path": "/etc/X11/", "size": "dir" }, { @@ -17,8 +21,10 @@ try{ "mode": "100755" }]; - console.time('CloudFunc.buildFromJSON'); + start(); var lResult = CloudFunc.buildFromJSON(lJSON); + end(); + var lExpect = '