mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
fixed tests
This commit is contained in:
parent
020096d151
commit
f8843e7f5a
4 changed files with 43 additions and 22 deletions
17
cloudcmd.js
17
cloudcmd.js
|
|
@ -134,13 +134,6 @@
|
|||
readConfig();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
server.start({
|
||||
appcache : appCacheProcessing,
|
||||
minimize : minimize,
|
||||
rest : rest,
|
||||
route : route
|
||||
});
|
||||
|
||||
if(update)
|
||||
update.get();
|
||||
|
|
@ -171,8 +164,7 @@
|
|||
lArg = lArg[lArg.length - 1];
|
||||
if ( lArg === 'test' || lArg === 'test\r') {
|
||||
Util.log(process.argv);
|
||||
Config.server =
|
||||
Config.logs = false;
|
||||
Config.server = false;
|
||||
}
|
||||
|
||||
if (Config.logs) {
|
||||
|
|
@ -181,6 +173,13 @@
|
|||
writeLogsToFile();
|
||||
}
|
||||
}
|
||||
|
||||
server.start({
|
||||
appcache : appCacheProcessing,
|
||||
minimize : minimize,
|
||||
rest : rest,
|
||||
route : route
|
||||
});
|
||||
}
|
||||
|
||||
function readConfig(pCallBack){
|
||||
|
|
|
|||
|
|
@ -62,11 +62,10 @@ body{
|
|||
}
|
||||
.error::before{
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
color:rgb(222, 41, 41);
|
||||
cursor:default;
|
||||
/* content:'\f013'; */
|
||||
content: '\2757';
|
||||
font-size:14px;
|
||||
}
|
||||
.loading{
|
||||
position:relative;
|
||||
|
|
|
|||
29
lib/util.js
29
lib/util.js
|
|
@ -311,6 +311,30 @@ Util = exports || {};
|
|||
Util.removeStr = function(pStr, pSubStr){
|
||||
var lRet = Util.isString(pStr) && pSubStr;
|
||||
|
||||
if( lRet ){
|
||||
var n = pSubStr.length;
|
||||
|
||||
if( Util.isArray(pSubStr) )
|
||||
Util.fori(n, function(i){
|
||||
lRet = pStr = Util.replaceStr(pStr, pSubStr[i], '');
|
||||
});
|
||||
else
|
||||
lRet = Util.replaceStr(pStr, pSubStr, '');
|
||||
}
|
||||
else
|
||||
lRet = pStr;
|
||||
|
||||
return lRet;
|
||||
};
|
||||
|
||||
/**
|
||||
* function remove substring from string one time
|
||||
* @param pStr
|
||||
* @param pSubStr
|
||||
*/
|
||||
Util.removeStrOneTime = function(pStr, pSubStr){
|
||||
var lRet = Util.isString(pStr) && pSubStr;
|
||||
|
||||
if( lRet ){
|
||||
var n = pSubStr.length;
|
||||
|
||||
|
|
@ -327,7 +351,6 @@ Util = exports || {};
|
|||
return lRet;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* function replase pFrom to pTo in pStr
|
||||
* @pStr
|
||||
|
|
@ -336,9 +359,9 @@ Util = exports || {};
|
|||
*/
|
||||
|
||||
Util.replaceStr = function(pStr, pFrom, pTo){
|
||||
var lRet;
|
||||
var lRet = pStr;
|
||||
|
||||
if(pStr && pFrom && pTo)
|
||||
if(pStr && pFrom)
|
||||
lRet = pStr.replace(new RegExp(pFrom, 'g'), pTo);
|
||||
|
||||
return lRet;
|
||||
|
|
|
|||
16
test/test.js
16
test/test.js
|
|
@ -1,5 +1,5 @@
|
|||
(function(){
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
var DIR = process.cwd() + '/',
|
||||
main = require(DIR + 'lib/server/main'),
|
||||
|
|
@ -31,10 +31,10 @@
|
|||
'id=clear-cache title="clear cache (Ctrl+D)">' +
|
||||
'</span>' +
|
||||
'<span class="path-icon refresh-icon" title="refresh (Ctrl+R)">'+
|
||||
'<a href="/fs/no-js/etc/X11"></a></span>' +
|
||||
'<a href="/fs/etc/X11"></a></span>' +
|
||||
'<span>' +
|
||||
'<a class=links href="/fs/no-js" title="/">/</a>' +
|
||||
'<a class=links href="/fs/no-js/etc" title="/etc">' +
|
||||
'<a class=links href="/fs" title="/">/</a>' +
|
||||
'<a class=links href="/fs/etc" title="/etc">' +
|
||||
'etc' +
|
||||
'</a>/X11/' +
|
||||
'</span>' +
|
||||
|
|
@ -46,10 +46,10 @@
|
|||
'<span class=owner>owner</span>' +
|
||||
'<span class=mode>mode</span>' +
|
||||
'</li>' +
|
||||
'<li draggable class=current-file>' +
|
||||
'<li draggable class' +
|
||||
'<span class="mini-icon directory"></span>' +
|
||||
'<span class=name>' +
|
||||
'<a href="/fs/no-js/etc" draggable=true>..</a>' +
|
||||
'<a href="/fs/etc" draggable=true>..</a>' +
|
||||
'</span>' +
|
||||
'<span class=size><dir></span>' +
|
||||
'<span class=owner>.</span>' +
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
'<li draggable class>' +
|
||||
'<span draggable class="mini-icon directory"></span>' +
|
||||
'<span draggable class=name>' +
|
||||
'<a href="/fs/no-js/etc/X11/applnk" ' +
|
||||
'<a href="/fs/etc/X11/applnk" ' +
|
||||
'title="applnk" draggable=true>applnk</a>' +
|
||||
'</span>' +
|
||||
'<span draggable class=size><dir></span>' +
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
'<li draggable class>' +
|
||||
'<span draggable class="mini-icon text-file"></span>' +
|
||||
'<span draggable class=name>' +
|
||||
'<a href="/fs/no-js/etc/X11/prefdm" ' +
|
||||
'<a href="/fs/etc/X11/prefdm" ' +
|
||||
'target="_blank" title="prefdm" draggable=true>' +
|
||||
'prefdm' +
|
||||
'</a>' +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue