From 4a65240fa245c6cdc158000b8e176d959122fced Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 23 Jan 2013 07:25:36 -0500 Subject: [PATCH] moved jsons to json folder --- ChangeLog | 2 ++ config.json => json/config.json | 2 +- modules.json => json/modules.json | 0 lib/client.js | 6 +++--- lib/server.js | 12 +++++++++--- lib/server/ischanged.js | 2 +- lib/server/main.js | 4 ++-- 7 files changed, 18 insertions(+), 10 deletions(-) rename config.json => json/config.json (94%) rename modules.json => json/modules.json (100%) diff --git a/ChangeLog b/ChangeLog index 0736f133..cd638b6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -99,6 +99,8 @@ clicked on menu item. * Removed getting data from Minify cache. +* Moved jsons to json folder. + 2012.12.12, Version 0.1.8 diff --git a/config.json b/json/config.json similarity index 94% rename from config.json rename to json/config.json index 2daffa62..6e9dd506 100644 --- a/config.json +++ b/json/config.json @@ -3,7 +3,7 @@ "appcache" : false, "cache" : {"allowed" : false}, "minification" : { - "js" : false, + "js" : true, "css" : true, "html" : true, "img" : true diff --git a/modules.json b/json/modules.json similarity index 100% rename from modules.json rename to json/modules.json diff --git a/lib/client.js b/lib/client.js index d856dcf8..a0c20d5d 100644 --- a/lib/client.js +++ b/lib/client.js @@ -4,7 +4,7 @@ */ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander = (function(){ -"use strict"; +'use strict'; var Config, Modules; @@ -388,7 +388,7 @@ function baseInit(pCallBack){ CloudCmd.getConfig = function(pCallBack){ Util.ifExec(Config, pCallBack, function(pCallBack){ DOM.ajax({ - url:'/config.json', + url:'/json/config.json', success: function(pConfig){ Config = pConfig; Util.exec(pCallBack, pConfig); @@ -400,7 +400,7 @@ CloudCmd.getConfig = function(pCallBack){ CloudCmd.getModules = function(pCallBack){ Util.ifExec(Modules, pCallBack, function(pCallBack){ DOM.ajax({ - url:'/modules.json', + url:'/json/modules.json', success: Util.retExec(pCallBack) }); }); diff --git a/lib/server.js b/lib/server.js index 8aaa57ee..ea9d5ee2 100644 --- a/lib/server.js +++ b/lib/server.js @@ -68,8 +68,9 @@ LIBDIR = main.LIBDIR, SRVDIR = main.SRVDIR, - /* модуль для работы с путями*/ + /* модуль для работы с путями*/ Path = main.path, + crypto = main.crypto, Fs = main.fs, /* модуль для работы с файловой системой*/ Querystring = main.querystring, @@ -391,9 +392,14 @@ * меняем название html-файла и * загружаем сжатый html-файл в дальнейшем */ + + var lMinFileName = CloudServer.Minify.MinFolder + + crypto.createHash('sha1') + .update(main.DIR + 'html/index.html') + .digest('hex') + '.html'; + CloudServer.INDEX = (CloudServer.Minify._allowed.html ? - CloudServer.Minify.MinFolder + 'index.min.html' - : CloudServer.INDEX); + lMinFileName : CloudServer.INDEX); /* * сохраним указатель на response diff --git a/lib/server/ischanged.js b/lib/server/ischanged.js index 8fb17504..883c54b9 100644 --- a/lib/server/ischanged.js +++ b/lib/server/ischanged.js @@ -71,7 +71,7 @@ }); } - isFileChanged(DIR + 'favicon.ico', true, function(pData){ + isFileChanged(DIR + 'manifest.yml', true, function(pData){ console.log(pData) }); })(); \ No newline at end of file diff --git a/lib/server/main.js b/lib/server/main.js index 381b9aaa..2418c2a8 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -1,5 +1,5 @@ (function(){ - "strict mode"; + 'strict mode'; /* Global var accessible from any loaded module */ global.cloudcmd = {}; @@ -68,7 +68,7 @@ exports.zlib = zlib = mrequire('zlib'), /* Main Information */ - exports.config = rootrequire('config'); + exports.config = rootrequire('json/config'); exports.mainpackage = rootrequire('package');