diff --git a/Makefile b/Makefile index d3b04cb0..dd351c79 100644 --- a/Makefile +++ b/Makefile @@ -43,10 +43,11 @@ build/$(PACKAGE): $(COMPILED_JS) # Create the release version of the main HTML file. build/tools/ship.py --i=editor/svg-editor.html --on=svg_edit_release > build/$(PACKAGE)/svg-editor.html -# codedread: NOTE: Some files are not ready for the Closure compiler: (jquery) +# NOTE: Some files are not ready for the Closure compiler: (jquery) +# NOTE: Our code is *not* ready for ADVANCED_OPTIMIZATIONS $(COMPILED_JS): java -jar $(CLOSURE) \ - --compilation_level WHITESPACE_ONLY \ + --compilation_level SIMPLE_OPTIMIZATIONS \ $(CLOSURE_JS_ARGS) \ --js_output_file $(COMPILED_JS) diff --git a/editor/browser.js b/editor/browser.js index cda1a3a7..48809fe7 100644 --- a/editor/browser.js +++ b/editor/browser.js @@ -10,11 +10,9 @@ // Dependencies: // 1) jQuery (for $.alert()) -(function() { +var svgedit = svgedit || {}; -if (!window.svgedit) { - window.svgedit = {}; -} +(function() { if (!svgedit.browser) { svgedit.browser = {}; @@ -25,7 +23,7 @@ var supportsSvg_ = (function() { })(); svgedit.browser.supportsSvg = function() { return supportsSvg_; } if(!svgedit.browser.supportsSvg()) { - window.location = "browser-not-supported.html"; + window.location = "browser-not-supported.html"; } else{ diff --git a/editor/draw.js b/editor/draw.js index ccfd349c..0fcd5d97 100644 --- a/editor/draw.js +++ b/editor/draw.js @@ -11,10 +11,9 @@ // 2) browser.js // 3) svgutils.js +var svgedit = svgedit || {}; + (function() { -if (!window.svgedit) { - window.svgedit = {}; -} if (!svgedit.draw) { svgedit.draw = {}; diff --git a/editor/history.js b/editor/history.js index c0e9d88e..98eb5a36 100644 --- a/editor/history.js +++ b/editor/history.js @@ -11,11 +11,9 @@ // 2) svgtransformlist.js // 3) svgutils.js -(function() { +var svgedit = svgedit || {}; -if (!window.svgedit) { - window.svgedit = {}; -} +(function() { if (!svgedit.history) { svgedit.history = {}; diff --git a/editor/math.js b/editor/math.js index 5ae1e949..d69bc3f1 100644 --- a/editor/math.js +++ b/editor/math.js @@ -10,11 +10,9 @@ // Dependencies: // None. -(function() { +var svgedit = svgedit || {}; -if (!window.svgedit) { - window.svgedit = {}; -} +(function() { if (!svgedit.math) { svgedit.math = {}; diff --git a/editor/sanitize.js b/editor/sanitize.js index 1cbf6016..6442332c 100644 --- a/editor/sanitize.js +++ b/editor/sanitize.js @@ -11,11 +11,9 @@ // 1) browser.js // 2) svgutils.js -(function() { +var svgedit = svgedit || {}; -if (!window.svgedit) { - window.svgedit = {}; -} +(function() { if (!svgedit.sanitize) { svgedit.sanitize = {}; diff --git a/editor/select.js b/editor/select.js index 917685b5..c13f2918 100644 --- a/editor/select.js +++ b/editor/select.js @@ -13,11 +13,9 @@ // 3) math.js // 4) svgutils.js -(function() { +var svgedit = svgedit || {}; -if (!window.svgedit) { - window.svgedit = {}; -} +(function() { if (!svgedit.select) { svgedit.select = {}; diff --git a/editor/svgtransformlist.js b/editor/svgtransformlist.js index fe4539f3..5c291ca7 100644 --- a/editor/svgtransformlist.js +++ b/editor/svgtransformlist.js @@ -10,11 +10,10 @@ // Dependencies: // 1) browser.js +var svgedit = svgedit || {}; + (function() { -if (!window.svgedit) { - window.svgedit = {}; -} if (!svgedit.transformlist) { svgedit.transformlist = {}; } diff --git a/editor/svgutils.js b/editor/svgutils.js index 434fc422..b56119b8 100644 --- a/editor/svgutils.js +++ b/editor/svgutils.js @@ -12,11 +12,9 @@ // 2) browser.js: only for getBBox() // 3) svgtransformlist.js: only for getRotationAngle() -(function() { +var svgedit = svgedit || {}; -if (!window.svgedit) { - window.svgedit = {}; -} +(function() { if (!svgedit.utilities) { svgedit.utilities = {}; diff --git a/editor/units.js b/editor/units.js index 903de164..237489ae 100644 --- a/editor/units.js +++ b/editor/units.js @@ -10,11 +10,9 @@ // Dependencies: // 1) jQuery -(function() { +var svgedit = svgedit || {}; -if (!window.svgedit) { - window.svgedit = {}; -} +(function() { if (!svgedit.units) { svgedit.units = {};