From 6edaf3f30ace3ca3e093e53cf50068a6afbab18b Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 16 Mar 2014 18:12:21 -0300 Subject: [PATCH] browser global variable workaround --- wise-editor/src/main/webapp/js/editor.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/wise-editor/src/main/webapp/js/editor.js b/wise-editor/src/main/webapp/js/editor.js index 1ae589cb..1019adb3 100644 --- a/wise-editor/src/main/webapp/js/editor.js +++ b/wise-editor/src/main/webapp/js/editor.js @@ -18,6 +18,27 @@ var designer = null; + +/* +* Disclaimer: this global variable is a temporary workaround to Mootools' Browser class +* We need to avoid browser detection and replace it with feature detection, +* jquery recommends: http://www.modernizr.com/ +*/ + +Browser = { + firefox: window.globalStorage, + ie: document.all && !window.opera, + ie6: !window.XMLHttpRequest, + ie7: document.all && window.XMLHttpRequest && !XDomainRequest && !window.opera, + ie8: document.documentMode==8, + opera: Boolean(window.opera), + chrome: Boolean(window.chrome), + safari: window.getComputedStyle && !window.globalStorage && !window.opera, + Platform: { + mac: navigator.platform.indexOf('Mac') != -1 + } +}; + function buildDesigner(options) { var container = $("#"+options.container);