Changed the passing MoreProcessing agrument to jsScripts function Minify module, no it passes with a file name, and js file name writing only once.

This commit is contained in:
coderaiser 2012-07-11 04:07:04 -04:00
parent cc31dc3b41
commit 5228a0c5ef
3 changed files with 28 additions and 19 deletions

View file

@ -14,4 +14,7 @@ and cloudfunc.js full sized versions.
* Changed the way Minify post-processing js-files so, from now in Minify object
post-processing functions passed like this {'client.js': function(){}}
* Added ability to read file data from Minify Cache, without writing to disk
* Added ability to read file data from Minify Cache, without writing to disk
* Changed the passing MoreProcessing agrument to jsScripts function Minify module,
no it passes with a file name, and js file name writing only once.

@ -1 +1 @@
Subproject commit 04d536b9941088ef25294a03e0ca75047dd30131
Subproject commit cc198d1df010fb6db406383293e8234c5c6a1ede

View file

@ -63,7 +63,7 @@ var CloudServer={
CSSDIR :'./css',
Port :31337, /* server port */
IP :'127.0.0.1'
IP :'127.0.0.1'
};
/*
@ -173,24 +173,31 @@ CloudServer.Minify={
*/
this.MinFolder = '/' + lMinify.MinFolder;
var lMinFolder=this.MinFolder;
/* post processing function for file
* client.js
*/
var lPostProcessing_f = function(pFinalCode){
console.log('file name of ' +
'cloudfunc.js' +
' in ' +
'client.js' +
' changed. size:',
(pFinalCode = pFinalCode
.replace('cloudfunc.js','cloudfunc.min.js')
.replace('keyBinding.js','keyBinding.min.js')
.replace('/lib/', lMinFolder)
.replace('/lib/client/', lMinFolder)).length);
return pFinalCode;
};
this.done.js=this._allowed.js?
lMinify.jsScripts(['client.js',
lMinify.jsScripts([{
'client.js': lPostProcessing_f},
'lib/cloudfunc.js',
'lib/client/keyBinding.js'],
{'client.js' : function(pFinalCode){
console.log('file name of ' +
'cloudfunc.js' +
' in ' +
'client.js' +
' changed. size:',
(pFinalCode = pFinalCode
.replace('cloudfunc.js','cloudfunc.min.js')
.replace('keyBinding.js','keyBinding.min.js')
.replace('/lib/', lMinFolder)
.replace('/lib/client/', lMinFolder)).length);
return pFinalCode;
}},true)
:false;
true)
:false;
this.done.html=this._allowed.html?
lMinify.html(CloudServer.INDEX):false;
@ -409,7 +416,6 @@ CloudServer._controller=function(pReq, pRes)
var lNoJS_s=CloudFunc.NOJS;
var lFS_s=CloudFunc.FS;
console.log(pathname);
if(pathname!=='/favicon.ico')
{
console.log("request for " + pathname + " received...");