mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 01:17:18 +00:00
moving out doit from minify to cloudcmd
This commit is contained in:
parent
b2463867d7
commit
02f8648c19
3 changed files with 73 additions and 80 deletions
38
cloudcmd.js
38
cloudcmd.js
|
|
@ -26,6 +26,7 @@
|
|||
Server.start(Config, {
|
||||
appcache : appCacheProcessing,
|
||||
index : indexProcessing,
|
||||
minimize : minimize,
|
||||
rest : rest,
|
||||
route : route
|
||||
});
|
||||
|
|
@ -38,7 +39,7 @@
|
|||
*/
|
||||
function indexProcessing(pData){
|
||||
var lReplace_s,
|
||||
lData = pData.data,
|
||||
lData = pData.data,
|
||||
lAdditional = pData.additional;
|
||||
|
||||
/*
|
||||
|
|
@ -88,6 +89,41 @@
|
|||
lAppCache.createManifest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Функция минимизирует css/js/html
|
||||
* если установлены параметры минимизации
|
||||
*/
|
||||
function minimize(pAllowed){
|
||||
var lOptimizeParams = [],
|
||||
lStyleCSS = DIR + 'css/style.css',
|
||||
lResetCSS = DIR + 'css/reset.css',
|
||||
lIndex = DIR + 'html/index.html',
|
||||
|
||||
lMinify = Server.Minify;
|
||||
|
||||
if (pAllowed.js) {
|
||||
lOptimizeParams.push(LIBDIR + 'client.js');
|
||||
}
|
||||
|
||||
if (pAllowed.html)
|
||||
lOptimizeParams.push(lIndex);
|
||||
|
||||
if (pAllowed.css) {
|
||||
var lStyles = [];
|
||||
|
||||
lStyles[0] = {};
|
||||
lStyles[0][lStyleCSS] = pAllowed.img;
|
||||
lStyles[1] = {};
|
||||
lStyles[1][lResetCSS] = pAllowed.img;
|
||||
|
||||
lOptimizeParams.push(lStyles[0]);
|
||||
lOptimizeParams.push(lStyles[1]);
|
||||
}
|
||||
|
||||
if (lOptimizeParams.length)
|
||||
lMinify.optimize(lOptimizeParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* rest interface
|
||||
* @pConnectionData {request, responce}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue