tot - Check-in [40]
Not logged in
[Browse]  [Home]  [Login]  [Reports]  [Search]  [Timeline
  [Patchset
Check-in Number: 40
Date: 2008-Aug-28 19:32:59 (local)
2008-Aug-28 17:32:59 (UTC)
User:rse
Branch:
Comment: some cleanups
Tickets:
Inspections:
Files:
jquery/jquery.debug.js      24 -> 40
Modified: jquery/jquery.debug.js
===================================================================
--- jquery/jquery.debug.js	2008-02-05 19:15:55 UTC (rev 39)
+++ jquery/jquery.debug.js	2008-08-28 17:32:59 UTC (rev 40)
@@ -23,7 +23,7 @@
         /* method for logging an object or message */
         log: function (message) {
             if ($._debug$ == true)
-                console.debug(message);
+                window.console.debug(message);
         }
     });
 
@@ -89,7 +89,7 @@
                 return text;
             };
 
-            /* create the logging <div> node */
+            /* create the custom console <div> node */
             $(document).ready(function () {
                 $("body")
                     .append('<div id="jQueryDebug"><ol></ol></div>');
@@ -106,26 +106,26 @@
                     .css("paddingRight", "20px");
             });
 
-            /* attach a function to each of the Firebug methods */
+            /* attach a logging function to each of the usual Firebug methods */
             var names = [
                 "log", "debug", "info", "warn", "error", "assert",
                 "dir", "dirxml", "group", "groupEnd", "time", "timeEnd",
                 "count", "trace", "profile", "profileEnd"
             ];
+            var logfunc = function(msg) {
+                $('#jQueryDebug')
+                    .css("display", $._debug$ == true ? "block" : "none");
+                $('#jQueryDebug ol')
+                    .append('<li>' + object2text(msg) + '</li>').css;
+                $("#jQueryDebug ol li")
+                    .css("borderBottom", "1px solid #cccccc")
+                    .css("padding", "1px 10px 1px 10px");
+            };
             window.console = {};
-            for (var i = 0; i < names.length; i++) {
-                window.console[names[i]] = function(msg) {
-                    $('#jQueryDebug')
-                        .css("display", $._debug$ == true ? "block" : "none");
-                    $('#jQueryDebug ol')
-                        .append('<li>' + object2text(msg) + '</li>').css;
-                    $("#jQueryDebug ol li")
-                        .css("borderBottom", "1px solid #cccccc")
-                        .css("padding", "1px 10px 1px 10px");
-                }
-            }
+            for (var i = 0; i < names.length; i++)
+                window.console[names[i]] = logfunc;
 
-            /* indicate that we are the one who is proving the Firebug interface */
+            /* indicate that we are the one who is providing the Firebug interface */
             window.console["jQueryDebug"] = true;
         }
     });