From 51e844ec48f5ad7ffcc98addc428ab4c650dc60a Mon Sep 17 00:00:00 2001 From: jonobr1 Date: Sun, 23 Jan 2011 13:54:09 -0800 Subject: [PATCH 1/3] added log method to gui.js --- gui.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gui.js b/gui.js index b881cd3..af6c010 100644 --- a/gui.js +++ b/gui.js @@ -11,7 +11,7 @@ var GUI = new function() { var handler = addHandlers[type]; if (handler) { } else { - console.error("I don't know how to handle data type: " + type); + log("I don't know how to handle data type: " + type); } } @@ -36,4 +36,11 @@ var GUI = new function() { }; +}; + +// Now we don't need to worry about console.log +var log = function(item) { + if(window.console) + if(trim(window.console.firebug) != '') + console.info(item); }; \ No newline at end of file From 354eeb3c0b0e4f28afc7b5fee1f95eb7b836116c Mon Sep 17 00:00:00 2001 From: jonobr1 Date: Sun, 23 Jan 2011 13:59:29 -0800 Subject: [PATCH 2/3] edited log method --- gui.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gui.js b/gui.js index af6c010..a7afe77 100644 --- a/gui.js +++ b/gui.js @@ -40,7 +40,6 @@ var GUI = new function() { // Now we don't need to worry about console.log var log = function(item) { - if(window.console) - if(trim(window.console.firebug) != '') - console.info(item); + if(typeof console.log == 'function') + console.log(item); }; \ No newline at end of file From 4d5febb0e573246ab4a51085e894dd9770ca6b59 Mon Sep 17 00:00:00 2001 From: jonobr1 Date: Sun, 23 Jan 2011 14:04:08 -0800 Subject: [PATCH 3/3] handles properly --- gui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui.js b/gui.js index a7afe77..97c4488 100644 --- a/gui.js +++ b/gui.js @@ -10,6 +10,7 @@ var GUI = new function() { var type = typeof value; var handler = addHandlers[type]; if (handler) { + log(property.toString() + " is a " + type + " based GUI object"); } else { log("I don't know how to handle data type: " + type); } @@ -38,7 +39,6 @@ var GUI = new function() { }; -// Now we don't need to worry about console.log var log = function(item) { if(typeof console.log == 'function') console.log(item);