Commit 11bb7a4a authored by Joel Martin's avatar Joel Martin

Fix browser detection code in IE.

parent 3915e536
...@@ -15,7 +15,10 @@ var Util = {}, $; ...@@ -15,7 +15,10 @@ var Util = {}, $;
// Debug routines // Debug routines
if (typeof window.console === "undefined") { if (typeof window.console === "undefined") {
window.console = window.console || {}; window.console = {
'log': function(m) {},
'warn': function(m) {},
'error': function(m) {}};
} }
if (/__debug__$/i.test(document.location.href)) { if (/__debug__$/i.test(document.location.href)) {
if (typeof window.opera !== "undefined") { if (typeof window.opera !== "undefined") {
...@@ -24,10 +27,12 @@ if (/__debug__$/i.test(document.location.href)) { ...@@ -24,10 +27,12 @@ if (/__debug__$/i.test(document.location.href)) {
window.console.error = window.opera.postError; window.console.error = window.opera.postError;
} }
} else { } else {
/*
// non-debug mode, an empty function // non-debug mode, an empty function
window.console.log = function (message) {}; window.console.log = function (message) {};
window.console.warn = function (message) {}; window.console.warn = function (message) {};
window.console.error = function (message) {}; window.console.error = function (message) {};
*/
} }
// Simple DOM selector by ID // Simple DOM selector by ID
...@@ -207,7 +212,9 @@ Util.Engine = { ...@@ -207,7 +212,9 @@ Util.Engine = {
'trident': (function() { 'trident': (function() {
return (!window.ActiveXObject) ? false : ((window.XMLHttpRequest) ? ((document.querySelectorAll) ? 6 : 5) : 4); }()), return (!window.ActiveXObject) ? false : ((window.XMLHttpRequest) ? ((document.querySelectorAll) ? 6 : 5) : 4); }()),
'webkit': (function() { 'webkit': (function() {
return (navigator.taintEnabled) ? false : ((Util.Features.xpath) ? ((Util.Features.query) ? 525 : 420) : 419); }()), try { return (navigator.taintEnabled) ? false : ((Util.Features.xpath) ? ((Util.Features.query) ? 525 : 420) : 419); } catch (e) { return false; } }()),
//'webkit': (function() {
// return ((typeof navigator.taintEnabled !== "unknown") && navigator.taintEnabled) ? false : ((Util.Features.xpath) ? ((Util.Features.query) ? 525 : 420) : 419); }()),
'gecko': (function() { 'gecko': (function() {
return (!document.getBoxObjectFor && !window.mozInnerScreenX) ? false : ((document.getElementsByClassName) ? 19 : 18); }()) return (!document.getBoxObjectFor && !window.mozInnerScreenX) ? false : ((document.getElementsByClassName) ? 19 : 18); }())
}; };
......
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