diff --git a/cloudcmd.js b/cloudcmd.js
index 85815a22..07df2a36 100644
--- a/cloudcmd.js
+++ b/cloudcmd.js
@@ -11,7 +11,8 @@ var DIR = process.cwd() + '/',
CloudFunc = srvfunc.require(LIBDIR +'cloudfunc'),
update = srvfunc.require(SRVDIR + 'update'),
- Config = readConfig();
+ srv = Server.CloudServer,
+ Config = readConfig();
Server.start(Config, indexProcessing);
@@ -25,7 +26,7 @@ function indexProcessing(pIndex, pList){
* меняем в index.html обычные css на
* минифицированый
*/
- if(Server.CloudServer.Minify._allowed.css){
+ if(srv.Minify._allowed.css){
var lReplace_s = '';
@@ -33,7 +34,7 @@ function indexProcessing(pIndex, pList){
lReplace_s = lReplace_s + '"/css/reset.css">';
pIndex = pIndex.replace(lReplace_s, '');
- pIndex = pIndex.replace('/css/style.css', Server.CloudServer.Minify.MinFolder + 'all.min.css');
+ pIndex = pIndex.replace('/css/style.css', srv.Minify.MinFolder + 'all.min.css');
}
pIndex = pIndex.replace('
',
@@ -43,7 +44,7 @@ function indexProcessing(pIndex, pList){
pIndex = pIndex.replace('
Cloud Commander',
'' + CloudFunc.setTitle() + '');
- if(!Server.CloudServer.Config.appcache){
+ if(!srv.Config.appcache){
if(lWin32)
pIndex = pIndex.replace(' manifest=/cloudcmd.appcache', '');
else
@@ -54,6 +55,20 @@ function indexProcessing(pIndex, pList){
}
+function appCacheProcessing(){
+ var lAppCache = srv.AppCache;
+ /* создаём файл app cache */
+ if(srv.Config.appcache && lAppCache && srv.Config.server){
+ var lFiles = [{'//themes.googleusercontent.com/static/fonts/droidsansmono/v4/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff' : './font/DroidSansMono.woff'},
+ {'//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js' : './lib/client/jquery.js'}];
+
+ if(srv.Minify._allowed.css)
+ lFiles.push('./min/all.min.css');
+
+ lAppCache.addFiles(lFiles);
+ lAppCache.createManifest();
+ }
+}
function readConfig(){
diff --git a/server.js b/server.js
index a98e531f..a956234c 100644
--- a/server.js
+++ b/server.js
@@ -127,7 +127,7 @@ else
console.log('could not found one of Cloud Commander SS files');
/* базовая инициализация */
-CloudServer.init = (function(){
+CloudServer.init = (function(pAppCachProcessing){
/* Переменная в которой храниться кэш*/
this.Cache.setAllowed(CloudServer.Config.cache.allowed);
/* Change default parameters of
@@ -138,18 +138,7 @@ CloudServer.init = (function(){
this.Minify._allowed = this.Minify.doit();
- var lAppCache = CloudServer.AppCache;
- /* создаём файл app cache */
- if(this.Config.appcache && lAppCache && this.Config.server){
- var lFiles = [{'//themes.googleusercontent.com/static/fonts/droidsansmono/v4/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff' : './font/DroidSansMono.woff'},
- {'//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js' : './lib/client/jquery.js'}];
-
- if(this.Minify._allowed.css)
- lFiles.push('./min/all.min.css');
-
- lAppCache.addFiles(lFiles);
- lAppCache.createManifest();
- }
+ Util.exec( pAppCachProcessing );
});
@@ -157,7 +146,7 @@ CloudServer.init = (function(){
* Функция создаёт сервер
* @param pConfig
*/
-CloudServer.start = function (pConfig, pIndexProcessing) {
+CloudServer.start = function (pConfig, pIndexProcessing, pAppCachProcessing) {
if(pConfig)
this.Config = pConfig;
else
@@ -167,7 +156,7 @@ CloudServer.start = function (pConfig, pIndexProcessing) {
CloudServer.indexProcessing = pIndexProcessing;
- this.init();
+ this.init(pAppCachProcessing);
this.Port = process.env.PORT || /* c9 */
process.env.app_port || /* nodester */
@@ -814,7 +803,7 @@ CloudServer.sendResponse = function(pHead, pData, pName){
}
};
-exports.start = function(pConfig, pIndexProcessing){
- CloudServer.start(pConfig, pIndexProcessing);
+exports.start = function(pConfig, pIndexProcessing, pAppCachProcessing){
+ CloudServer.start(pConfig, pIndexProcessing, pAppCachProcessing);
};
exports.CloudServer = CloudServer;
\ No newline at end of file