From 5228a0c5ef3d23ad7a3b66a94ca7e698cfd9df56 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 11 Jul 2012 04:07:04 -0400 Subject: [PATCH] Changed the passing MoreProcessing agrument to jsScripts function Minify module, no it passes with a file name, and js file name writing only once. --- ChangeLog | 5 ++++- lib/server/minify | 2 +- server.js | 40 +++++++++++++++++++++++----------------- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7050e4eb..0f2a8f47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 \ No newline at end of file +* 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. \ No newline at end of file diff --git a/lib/server/minify b/lib/server/minify index 04d536b9..cc198d1d 160000 --- a/lib/server/minify +++ b/lib/server/minify @@ -1 +1 @@ -Subproject commit 04d536b9941088ef25294a03e0ca75047dd30131 +Subproject commit cc198d1df010fb6db406383293e8234c5c6a1ede diff --git a/server.js b/server.js index e474bde6..f3c17b50 100644 --- a/server.js +++ b/server.js @@ -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...");