From 3b7575b219f4cf7c4c2a5fdd59d5af735e45aa50 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sun, 20 Jun 2010 15:10:34 -0500 Subject: [PATCH] Better support console debug under Opera (DragonFly). --- include/util.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/util.js b/include/util.js index bc5049a4..e6fa816b 100644 --- a/include/util.js +++ b/include/util.js @@ -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}; }()); -