From 2d578956b99e3d63328c4d957b3dcfecdf7e0186 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 15 Nov 2012 06:49:53 -0500 Subject: [PATCH] refactored --- cloudcmd.js | 29 ++++++++++-------- config.json | 3 +- lib/server/main.js | 7 +++-- lib/server/rest.js | 73 +++++++++++++++++++++++++++++++++++++--------- server.js | 16 ++++++---- 5 files changed, 93 insertions(+), 35 deletions(-) diff --git a/cloudcmd.js b/cloudcmd.js index b887772f..fc1c4906 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -23,9 +23,14 @@ if(update) update.get(); - - function indexProcessing(pIndex, pList){ - var lReplace_s; + /** + * additional processing of index file + * + */ + function indexProcessing(pData){ + var lReplace_s, + lData = pData.data, + lAdditional = pData.additional; /* если выбрана опция минифизировать скрпиты * меняем в index.html обычные css на * минифицированый @@ -33,26 +38,26 @@ if(srv.Minify._allowed.css){ lReplace_s = ''; - pIndex = Util.removeStr(pIndex, lReplace_s); - pIndex = pIndex.replace('/css/style.css', srv.Minify.MinFolder + 'all.min.css'); + lData = Util.removeStr(lData, lReplace_s); + lData = lData.replace('/css/style.css', srv.Minify.MinFolder + 'all.min.css'); } lReplace_s = '
'; - pIndex = pIndex.replace(lReplace_s, lReplace_s + pList); + lData = lData.replace(lReplace_s, lReplace_s + lAdditional); /* меняем title */ - pIndex = pIndex.replace('Cloud Commander', + lData = lData.replace('Cloud Commander', '' + CloudFunc.setTitle() + ''); if(!srv.Config.appcache) - pIndex = Util.removeStr(pIndex, ' manifest=/cloudcmd.appcache'); + lData = Util.removeStr(lData, ' manifest=/cloudcmd.appcache'); if(!srv.Config.show_keys_panel){ var lKeysPanel = '