Commit 3f907639 authored by XhmikosR's avatar XhmikosR

Customizer: switch to UglifyJS2 (v2.4.13).

The uglify build is generated with `uglifyjs --self -o uglify.min.js`.
parent ee2df11e
...@@ -276,7 +276,24 @@ window.onload = function () { // wait for load in a dumb way because B-0 ...@@ -276,7 +276,24 @@ window.onload = function () { // wait for load in a dumb way because B-0
return result return result
} }
function generateJavascript(preamble) { function uglify(js) {
var ast = UglifyJS.parse(js)
ast.figure_out_scope()
var compressor = UglifyJS.Compressor()
var compressedAst = ast.transform(compressor)
compressedAst.figure_out_scope()
compressedAst.compute_char_frequency()
compressedAst.mangle_names()
var stream = UglifyJS.OutputStream()
compressedAst.print(stream)
return stream.toString()
}
function generateJS(preamble) {
var $checked = $('#plugin-section input:checked') var $checked = $('#plugin-section input:checked')
if (!$checked.length) return false if (!$checked.length) return false
...@@ -351,7 +368,7 @@ window.onload = function () { // wait for load in a dumb way because B-0 ...@@ -351,7 +368,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
' * Config saved to config.json and ' + gistUrl + '\n' + ' * Config saved to config.json and ' + gistUrl + '\n' +
' */\n' ' */\n'
generateZip(generateCSS(preamble), generateJavascript(preamble), generateFonts(), configJson, function (blob) { generateZip(generateCSS(preamble), generateJS(preamble), generateFonts(), configJson, function (blob) {
$compileBtn.removeAttr('disabled') $compileBtn.removeAttr('disabled')
saveAs(blob, 'bootstrap.zip') saveAs(blob, 'bootstrap.zip')
}) })
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment