diff --git a/cloudcmd.js b/cloudcmd.js index b8d3a307..33f467f1 100644 --- a/cloudcmd.js +++ b/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){ diff --git a/css/style.css b/css/style.css index d1b7736a..c40a6dd0 100644 --- a/css/style.css +++ b/css/style.css @@ -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; diff --git a/lib/util.js b/lib/util.js index c30d07a8..7884152e 100644 --- a/lib/util.js +++ b/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; diff --git a/test/test.js b/test/test.js index 5449061a..37bd5d16 100644 --- a/test/test.js +++ b/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)">' + '' + '' + + '' + '' + - '/' + - '' + + '/' + + '' + 'etc' + '/X11/' + '' + @@ -46,10 +46,10 @@ 'owner' + 'mode' + '' + - '