Move packaging info into its own file.

This commit is contained in:
Chad Weider 2012-01-14 16:12:03 -08:00
parent c45932c6b8
commit 77804673d7
2 changed files with 53 additions and 13 deletions

View File

@ -32,9 +32,8 @@ var gzip = require('gzip');
var server = require('../server'); var server = require('../server');
var os = require('os'); var os = require('os');
var padJS = ["jquery.min.js", "pad_utils.js", "plugins.js", "undo-xpopup.js", "json2.js", "pad_cookie.js", "pad_editor.js", "pad_editbar.js", "pad_docbar.js", "pad_modals.js", "ace.js", "collab_client.js", "pad_userlist.js", "pad_impexp.js", "pad_savedrevs.js", "pad_connectionstatus.js", "pad2.js", "jquery-ui.js", "chat.js", "excanvas.js", "farbtastic.js"]; var TAR_PATH = path.join(__dirname, 'tar.json');
var tar = JSON.parse(fs.readFileSync(TAR_PATH, 'utf8'));
var timesliderJS = ["jquery.min.js", "plugins.js", "undo-xpopup.js", "json2.js", "colorutils.js", "draggable.js", "pad_utils.js", "pad_cookie.js", "pad_editor.js", "pad_editbar.js", "pad_docbar.js", "pad_modals.js", "pad_impexp.js", "easysync2_client.js", "domline_client.js", "linestylefilter_client.js", "cssmanager_client.js", "broadcast.js", "broadcast_slider.js", "broadcast_revisions.js"];
/** /**
* creates the minifed javascript for the given minified name * creates the minifed javascript for the given minified name
@ -46,16 +45,10 @@ exports.minifyJS = function(req, res, jsFilename)
res.header("Content-Type","text/javascript"); res.header("Content-Type","text/javascript");
//choose the js files we need //choose the js files we need
if(jsFilename == "pad.js") var jsFiles = undefined;
{ if (Object.prototype.hasOwnProperty.call(tar, jsFilename)) {
jsFiles = padJS; jsFiles = tar[jsFilename];
} } else {
else if(jsFilename == "timeslider.js")
{
jsFiles = timesliderJS;
}
else
{
throw new Error("there is no profile for creating " + name); throw new Error("there is no profile for creating " + name);
} }

47
node/utils/tar.json Normal file
View File

@ -0,0 +1,47 @@
{
"pad.js": [
"jquery.min.js"
, "pad_utils.js"
, "plugins.js"
, "undo-xpopup.js"
, "json2.js"
, "pad_cookie.js"
, "pad_editor.js"
, "pad_editbar.js"
, "pad_docbar.js"
, "pad_modals.js"
, "ace.js"
, "collab_client.js"
, "pad_userlist.js"
, "pad_impexp.js"
, "pad_savedrevs.js"
, "pad_connectionstatus.js"
, "pad2.js"
, "jquery-ui.js"
, "chat.js"
, "excanvas.js"
, "farbtastic.js"
]
, "timeslider.js": [
"jquery.min.js"
, "plugins.js"
, "undo-xpopup.js"
, "json2.js"
, "colorutils.js"
, "draggable.js"
, "pad_utils.js"
, "pad_cookie.js"
, "pad_editor.js"
, "pad_editbar.js"
, "pad_docbar.js"
, "pad_modals.js"
, "pad_impexp.js"
, "easysync2_client.js"
, "domline_client.js"
, "linestylefilter_client.js"
, "cssmanager_client.js"
, "broadcast.js"
, "broadcast_slider.js"
, "broadcast_revisions.js"
]
}