diff --git a/cloudcmd.js b/cloudcmd.js index 69754a0d..75353439 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -25,19 +25,20 @@ function indexProcessing(pIndex, pList){ + var lReplace_s; /* если выбрана опция минифизировать скрпиты * меняем в index.html обычные css на * минифицированый */ if(srv.Minify._allowed.css){ - var lReplace_s = ''; + lReplace_s = ''; pIndex = Util.removeStr(pIndex, lReplace_s); pIndex = pIndex.replace('/css/style.css', srv.Minify.MinFolder + 'all.min.css'); } - pIndex = pIndex.replace('
', - '
'+ pList); + lReplace_s = '
'; + pIndex = pIndex.replace(lReplace_s, lReplace_s + pList); /* меняем title */ pIndex = pIndex.replace('Cloud Commander', @@ -71,7 +72,7 @@ * (usually /) to it. * argv[1] - is always script name */ - var lServerDir = path.dirname(process.argv[1]); + var lServerDir = path.dirname(process.argv[1]) + '/'; if( DIR !== lServerDir ){ console.log('current dir: ' + DIR); diff --git a/server.js b/server.js index 8fec6a0c..610ca451 100644 --- a/server.js +++ b/server.js @@ -116,27 +116,29 @@ CloudServer.Minify = main.minify, CloudServer.AppCache = main.appcache, -CloudServer.Socket = main.socket; +CloudServer.Socket = main.socket; /* базовая инициализация */ CloudServer.init = (function(pAppCachProcessing){ + var lConfig = this.Config, + lMinify = this.Minify, + lCache = this.Cache, + lAppCache = this.AppCache; + /* Переменная в которой храниться кэш*/ - this.Cache.setAllowed(this.Config.cache.allowed); + lCache.setAllowed(lConfig.cache.allowed); + /* Change default parameters of * js/css/html minification */ - this.Minify.setAllowed(this.Config.minification); + lMinify.setAllowed(lConfig.minification); + /* Если нужно минимизируем скрипты */ - this.Minify._allowed = this.Minify.doit(); - - - var lAppCache = this.AppCache; + lMinify._allowed = lMinify.doit(); /* создаём файл app cache */ - if( this.Config.appcache && - lAppCache && - this.Config.server ) - Util.exec( pAppCachProcessing ); + if( lConfig.appcache && lAppCache && lConfig.server ) + Util.exec( pAppCachProcessing ); });