From 9c91f16c71b7f541aa2ea5d9f7e6d797464124fb Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Sat, 14 Jan 2012 21:42:47 -0800 Subject: [PATCH] Improve inlining of editor content. Instead of replacing substrings, write each included file's content into a shared dictionary for lookup later. This eliminates duplication and arguably improves readability. --- node/utils/Minify.js | 42 +++++++++++++----------------------------- static/js/ace.js | 40 ++++++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 47 deletions(-) diff --git a/node/utils/Minify.js b/node/utils/Minify.js index 330c5810a..719cdaeeb 100644 --- a/node/utils/Minify.js +++ b/node/utils/Minify.js @@ -155,52 +155,36 @@ exports.minifyJS = function(req, res, jsFilename) var type = item.match(/INCLUDE_[A-Z]+/g)[0].substr("INCLUDE_".length); - var quote = item.search("_Q") != -1; - //read the included file fs.readFile(filename, "utf-8", function(err, data) { if(ERR(err, callback)) return; - - //compress the file + if(type == "JS") { - embeds[item] = "