browser global variable workaround

This commit is contained in:
Ezequiel Bergamaschi 2014-03-16 18:12:21 -03:00
parent 51d4510241
commit 43898f6878

View File

@ -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);