From 92eeb0722f3ba13d94f0d9ea4d80a3279cc6f170 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 28 Dec 2011 17:28:27 -0500 Subject: [PATCH] Get SIMPLE_OPTIMIZATIONS working --- build.py | 2 +- web_frontend/utils.js | 40 +++++++++++++++++++++------------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/build.py b/build.py index 240ae0c..ceacb9c 100755 --- a/build.py +++ b/build.py @@ -121,7 +121,7 @@ def _CompileFrontEnd(options): fe_sources = map(lambda f: '--js=' + os.path.join(FE_PATH, f), SOURCES_FE) args = [ 'java', '-jar', CLOSURE_COMPILER ] args.extend(fe_sources) - args.extend(['--js_output_file', outfile]) + args.extend(['--js_output_file', outfile, '--compilation_level', 'SIMPLE_OPTIMIZATIONS']) print ' ' + ' '.join(args) handle = subprocess.Popen(args, stdout = sys.stdout, stderr = sys.stderr) handle.wait() diff --git a/web_frontend/utils.js b/web_frontend/utils.js index aacd070..991f339 100644 --- a/web_frontend/utils.js +++ b/web_frontend/utils.js @@ -1,28 +1,30 @@ // // Armadillo File Manager // Copyright (c) 2011, Robert Sesek -// +// // This program is free software: you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation, either version 3 of the License, or any later version. // -/** - * Defines a namespace. - * @param {string} ns - */ -jQuery.namespace = function(ns) { - var parent = window; - this.each(ns.split('.'), function (i, space) { - parent[space] = parent[space] || {}; - parent = parent[space]; - }); -} +$.extend({ + /** + * Defines a namespace. + * @param {string} ns + */ + namespace: function(ns) { + var parent = window; + this.each(ns.split('.'), function (i, space) { + parent[space] = parent[space] || {}; + parent = parent[space]; + }); + }, -/** - * Shortcut for creating a DOM element. - * @param {string} elm - */ -jQuery.createDom = function(elm) { - return this(document.createElement(elm)); -} + /** + * Shortcut for creating a DOM element. + * @param {string} elm + */ + createDom: function(elm) { + return this(document.createElement(elm)); + } +}); -- 2.22.5