Better support console debug under Opera (DragonFly).

This commit is contained in:
Joel Martin 2010-06-20 15:10:34 -05:00
parent 2a4e7d8a93
commit 3b7575b219
1 changed files with 11 additions and 3 deletions

View File

@ -13,9 +13,18 @@
// Globals defined here
var Util = {}, $;
if ((!window.console) || (! /__debug__$/i.test(document.location.href))) {
// non-debug mode, an empty function
// Debug routines
if (typeof window.console === "undefined") {
window.console = window.console || {};
}
if (/__debug__$/i.test(document.location.href)) {
if (typeof window.opera !== "undefined") {
window.console.log = window.opera.postError;
window.console.warn = window.opera.postError;
window.console.error = window.opera.postError;
}
} else {
// non-debug mode, an empty function
window.console.log = function (message) {};
window.console.warn = function (message) {};
window.console.error = function (message) {};
@ -218,4 +227,3 @@ Util.Flash = (function(){
return {version: parseInt(version[0] || 0 + '.' + version[1], 10) || 0, build: parseInt(version[2], 10) || 0};
}());