Permalink
Browse files

Added missing passthrough methods: exception, groupCollapsed, table (…

…patch from rdeago)
  • Loading branch information...
1 parent 597d658 commit c6bddf5d426e1cbf9ca9f88f7c120637bd50b480 @cowboy cowboy committed Jun 22, 2010
View
@@ -1,8 +1,8 @@
/*!
- * JavaScript Debug - v0.3 - 6/8/2009
+ * JavaScript Debug - v0.4 - 6/22/2010
* http://benalman.com/projects/javascript-debug-console-log/
*
- * Copyright (c) 2009 "Cowboy" Ben Alman
+ * Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*
@@ -12,9 +12,9 @@
// Script: JavaScript Debug: A simple wrapper for console.log
//
-// *Version: 0.3, Last Updated: 6/8/2009*
+// *Version: 0.4, Last Updated: 6/22/2010*
//
-// Tested with Internet Explorer 6-8, Firefox 3, Safari 3-4, Chrome, Opera 9.
+// Tested with Internet Explorer 6-8, Firefox 3-3.6, Safari 3-4, Chrome 3-5, Opera 9.6-10.5
//
// Home - http://benalman.com/projects/javascript-debug-console-log/
// GitHub - http://github.com/cowboy/javascript-debug/
@@ -23,15 +23,16 @@
//
// About: License
//
-// Copyright (c) 2009 "Cowboy" Ben Alman,
+// Copyright (c) 2010 "Cowboy" Ben Alman,
// Dual licensed under the MIT and GPL licenses.
// http://benalman.com/about/license/
//
// About: Support and Testing
//
// Information about what browsers this code has been tested in.
//
-// Browsers Tested - Internet Explorer 6-8, Firefox 3-3.5, Safari 3-4, Chrome, Opera 9.
+// Browsers Tested - Internet Explorer 6-8, Firefox 3-3.6, Safari 3-4, Chrome
+// 3-5, Opera 9.6-10.5
//
// About: Examples
//
@@ -42,12 +43,14 @@
//
// About: Revision History
//
+// 0.4 - (6/22/2010) Added missing passthrough methods: exception,
+// groupCollapsed, table
// 0.3 - (6/8/2009) Initial release
//
// Topic: Pass-through console methods
//
-// assert, clear, count, dir, dirxml, group, groupEnd, profile, profileEnd,
-// time, timeEnd, trace
+// assert, clear, count, dir, dirxml, exception, group, groupCollapsed,
+// groupEnd, profile, profileEnd, table, time, timeEnd, trace
//
// These console methods are passed through (but only if both the console and
// the method exists), so use them without fear of reprisal. Note that these
@@ -77,7 +80,7 @@ window.debug = (function(){
// Pass these methods through to the console if they exist, otherwise just
// fail gracefully. These methods are provided for convenience.
- pass_methods = 'assert clear count dir dirxml group groupEnd profile profileEnd time timeEnd trace'.split(' '),
+ pass_methods = 'assert clear count dir dirxml exception group groupCollapsed groupEnd profile profileEnd table time timeEnd trace'.split(' '),
idx = pass_methods.length,
// Logs are stored here so that they can be recalled as necessary.
View
@@ -1,12 +1,12 @@
/*
- * JavaScript Debug - v0.3 - 6/8/2009
+ * JavaScript Debug - v0.4 - 6/22/2010
* http://benalman.com/projects/javascript-debug-console-log/
*
- * Copyright (c) 2009 "Cowboy" Ben Alman
+ * Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*
* With lots of help from Paul Irish!
* http://paulirish.com/
*/
-window.debug=(function(){var c=this,e=Array.prototype.slice,b=c.console,i={},f,g,j=9,d=["error","warn","info","debug","log"],m="assert clear count dir dirxml group groupEnd profile profileEnd time timeEnd trace".split(" "),k=m.length,a=[];while(--k>=0){(function(n){i[n]=function(){j!==0&&b&&b[n]&&b[n].apply(b,arguments)}})(m[k])}k=d.length;while(--k>=0){(function(n,o){i[o]=function(){var q=e.call(arguments),p=[o].concat(q);a.push(p);h(p);if(!b||!l(n)){return}b.firebug?b[o].apply(c,q):b[o]?b[o](q):b.log(q)}})(k,d[k])}function h(n){if(f&&(g||!b||!b.log)){f.apply(c,n)}}i.setLevel=function(n){j=typeof n==="number"?n:9};function l(n){return j>0?j>n:d.length+j<=n}i.setCallback=function(){var o=e.call(arguments),n=a.length,p=n;f=o.shift()||null;g=typeof o[0]==="boolean"?o.shift():false;p-=typeof o[0]==="number"?o.shift():n;while(p<n){h(a[p++])}};return i})();
+window.debug=(function(){var i=this,b=Array.prototype.slice,d=i.console,h={},f,g,m=9,c=["error","warn","info","debug","log"],l="assert clear count dir dirxml exception group groupCollapsed groupEnd profile profileEnd table time timeEnd trace".split(" "),j=l.length,a=[];while(--j>=0){(function(n){h[n]=function(){m!==0&&d&&d[n]&&d[n].apply(d,arguments)}})(l[j])}j=c.length;while(--j>=0){(function(n,o){h[o]=function(){var q=b.call(arguments),p=[o].concat(q);a.push(p);e(p);if(!d||!k(n)){return}d.firebug?d[o].apply(i,q):d[o]?d[o](q):d.log(q)}})(j,c[j])}function e(n){if(f&&(g||!d||!d.log)){f.apply(i,n)}}h.setLevel=function(n){m=typeof n==="number"?n:9};function k(n){return m>0?m>n:c.length+m<=n}h.setCallback=function(){var o=b.call(arguments),n=a.length,p=n;f=o.shift()||null;g=typeof o[0]==="boolean"?o.shift():false;p-=typeof o[0]==="number"?o.shift():n;while(p<n){e(a[p++])}};return h})();
@@ -11,17 +11,17 @@
-<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="JavaScript_Debug:A_simple_wrapper_for_console.log"></a>JavaScript Debug: A simple wrapper for console.log</h1><div class=CBody><p><b>Version: 0.3, Last Updated: 6/8/2009</b></p><p>Tested with Internet Explorer 6-8, Firefox 3, Safari 3-4, Chrome, Opera 9.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Home</td><td class=CDLDescription><a href="http://benalman.com/projects/javascript-debug-console-log/" class=LURL target=_top>http://benalman.com<wbr>/projects<wbr>/javascript-debug-console-log<wbr>/</a></td></tr><tr><td class=CDLEntry>GitHub</td><td class=CDLDescription><a href="http://github.com/cowboy/javascript-debug/" class=LURL target=_top>http://github.com/cowboy/javascript-debug/</a></td></tr><tr><td class=CDLEntry>Source</td><td class=CDLDescription><a href="http://github.com/cowboy/javascript-debug/raw/master/ba-debug.js" class=LURL target=_top>http://github.com<wbr>/cowboy<wbr>/javascript-debug<wbr>/raw<wbr>/master<wbr>/ba-debug.js</a></td></tr><tr><td class=CDLEntry>(Minified)</td><td class=CDLDescription><a href="http://github.com/cowboy/javascript-debug/raw/master/ba-debug.min.js" class=LURL target=_top>http://github.com<wbr>/cowboy<wbr>/javascript-debug<wbr>/raw<wbr>/master<wbr>/ba-debug.min.js</a> (1.1kb)</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#JavaScript_Debug:A_simple_wrapper_for_console.log" >JavaScript Debug: A simple wrapper for console.log</a></td><td class=SDescription><b>Version: 0.3, Last Updated: 6/8/2009</b></td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#License" >License</a></td><td class=SDescription>Copyright &copy; 2009 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses. </td></tr><tr class="SGeneric"><td class=SEntry><a href="#Support_and_Testing" >Support and Testing</a></td><td class=SDescription>Information about what browsers this code has been tested in.</td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#Examples" >Examples</a></td><td class=SDescription>These working examples, complete with fully commented code, illustrate a few ways in which this plugin can be used.</td></tr><tr class="SGeneric"><td class=SEntry><a href="#Revision_History" >Revision History</a></td><td class=SDescription></td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#Pass-through_console_methods" >Pass-through console methods</a></td><td class=SDescription>assert, clear, count, dir, dirxml, group, groupEnd, profile, profileEnd, time, timeEnd, trace</td></tr><tr class="SGroup"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#debug.log" >debug.log</a></td><td class=SDescription>Call the console.log method if available. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#debug.debug" >debug.<wbr>debug</a></td><td class=SDescription>Call the console.debug method if available, otherwise call console.log. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#debug.info" >debug.info</a></td><td class=SDescription>Call the console.info method if available, otherwise call console.log. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#debug.warn" >debug.warn</a></td><td class=SDescription>Call the console.warn method if available, otherwise call console.log. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#debug.error" >debug.<wbr>error</a></td><td class=SDescription>Call the console.error method if available, otherwise call console.log. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#debug.setLevel" >debug.<wbr>setLevel</a></td><td class=SDescription>Set a minimum or maximum logging level for the console. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#debug.setCallback" >debug.<wbr>setCallback</a></td><td class=SDescription>Set a callback to be used if logging isn&rsquo;t possible due to console.log not existing. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
+<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="JavaScript_Debug:A_simple_wrapper_for_console.log"></a>JavaScript Debug: A simple wrapper for console.log</h1><div class=CBody><p><b>Version: 0.4, Last Updated: 6/22/2010</b></p><p>Tested with Internet Explorer 6-8, Firefox 3-3.6, Safari 3-4, Chrome 3-5, Opera 9.6-10.5</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Home</td><td class=CDLDescription><a href="http://benalman.com/projects/javascript-debug-console-log/" class=LURL target=_top>http://benalman.com<wbr>/projects<wbr>/javascript-debug-console-log<wbr>/</a></td></tr><tr><td class=CDLEntry>GitHub</td><td class=CDLDescription><a href="http://github.com/cowboy/javascript-debug/" class=LURL target=_top>http://github.com/cowboy/javascript-debug/</a></td></tr><tr><td class=CDLEntry>Source</td><td class=CDLDescription><a href="http://github.com/cowboy/javascript-debug/raw/master/ba-debug.js" class=LURL target=_top>http://github.com<wbr>/cowboy<wbr>/javascript-debug<wbr>/raw<wbr>/master<wbr>/ba-debug.js</a></td></tr><tr><td class=CDLEntry>(Minified)</td><td class=CDLDescription><a href="http://github.com/cowboy/javascript-debug/raw/master/ba-debug.min.js" class=LURL target=_top>http://github.com<wbr>/cowboy<wbr>/javascript-debug<wbr>/raw<wbr>/master<wbr>/ba-debug.min.js</a> (1.1kb)</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#JavaScript_Debug:A_simple_wrapper_for_console.log" >JavaScript Debug: A simple wrapper for console.log</a></td><td class=SDescription><b>Version: 0.4, Last Updated: 6/22/2010</b></td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#License" >License</a></td><td class=SDescription>Copyright &copy; 2010 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses. </td></tr><tr class="SGeneric"><td class=SEntry><a href="#Support_and_Testing" >Support and Testing</a></td><td class=SDescription>Information about what browsers this code has been tested in.</td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#Examples" >Examples</a></td><td class=SDescription>These working examples, complete with fully commented code, illustrate a few ways in which this plugin can be used.</td></tr><tr class="SGeneric"><td class=SEntry><a href="#Revision_History" >Revision History</a></td><td class=SDescription></td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#Pass-through_console_methods" >Pass-through console methods</a></td><td class=SDescription>assert, clear, count, dir, dirxml, exception, group, groupCollapsed, groupEnd, profile, profileEnd, table, time, timeEnd, trace</td></tr><tr class="SGroup"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#debug.log" >debug.log</a></td><td class=SDescription>Call the console.log method if available. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#debug.debug" >debug.<wbr>debug</a></td><td class=SDescription>Call the console.debug method if available, otherwise call console.log. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#debug.info" >debug.info</a></td><td class=SDescription>Call the console.info method if available, otherwise call console.log. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#debug.warn" >debug.warn</a></td><td class=SDescription>Call the console.warn method if available, otherwise call console.log. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#debug.error" >debug.<wbr>error</a></td><td class=SDescription>Call the console.error method if available, otherwise call console.log. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#debug.setLevel" >debug.<wbr>setLevel</a></td><td class=SDescription>Set a minimum or maximum logging level for the console. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#debug.setCallback" >debug.<wbr>setCallback</a></td><td class=SDescription>Set a callback to be used if logging isn&rsquo;t possible due to console.log not existing. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
-<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="License"></a>License</h3><div class=CBody><p>Copyright &copy; 2009 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses.&nbsp; <a href="http://benalman.com/about/license/" class=LURL target=_top>http://benalman.com/about/license/</a></p></div></div></div>
+<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="License"></a>License</h3><div class=CBody><p>Copyright &copy; 2010 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses.&nbsp; <a href="http://benalman.com/about/license/" class=LURL target=_top>http://benalman.com/about/license/</a></p></div></div></div>
-<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Support_and_Testing"></a>Support and Testing</h3><div class=CBody><p>Information about what browsers this code has been tested in.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Browsers Tested</td><td class=CDLDescription>Internet Explorer 6-8, Firefox 3-3.5, Safari 3-4, Chrome, Opera 9.</td></tr></table></div></div></div>
+<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Support_and_Testing"></a>Support and Testing</h3><div class=CBody><p>Information about what browsers this code has been tested in.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Browsers Tested</td><td class=CDLDescription>Internet Explorer 6-8, Firefox 3-3.6, Safari 3-4, Chrome 3-5, Opera 9.6-10.5</td></tr></table></div></div></div>
<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Examples"></a>Examples</h3><div class=CBody><p>These working examples, complete with fully commented code, illustrate a few ways in which this plugin can be used.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Examples</td><td class=CDLDescription><a href="http://benalman.com/code/projects/javascript-debug/examples/debug/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/javascript-debug<wbr>/examples<wbr>/debug<wbr>/</a></td></tr></table></div></div></div>
-<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Revision_History"></a>Revision History</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>0.3</td><td class=CDLDescription>(6/8/2009) Initial release</td></tr></table></div></div></div>
+<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Revision_History"></a>Revision History</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>0.4</td><td class=CDLDescription>(6/22/2010) Added missing passthrough methods: exception, groupCollapsed, table</td></tr><tr><td class=CDLEntry>0.3</td><td class=CDLDescription>(6/8/2009) Initial release</td></tr></table></div></div></div>
-<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Pass-through_console_methods"></a>Pass-through console methods</h3><div class=CBody><p>assert, clear, count, dir, dirxml, group, groupEnd, profile, profileEnd, time, timeEnd, trace</p><p>These console methods are passed through (but only if both the console and the method exists), so use them without fear of reprisal.&nbsp; Note that these methods will not be passed through if the logging level is set to 0 via <a href="#debug.setLevel" class=LFunction id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">debug.setLevel</a>.</p></div></div></div>
+<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Pass-through_console_methods"></a>Pass-through console methods</h3><div class=CBody><p>assert, clear, count, dir, dirxml, exception, group, groupCollapsed, groupEnd, profile, profileEnd, table, time, timeEnd, trace</p><p>These console methods are passed through (but only if both the console and the method exists), so use them without fear of reprisal.&nbsp; Note that these methods will not be passed through if the logging level is set to 0 via <a href="#debug.setLevel" class=LFunction id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">debug.setLevel</a>.</p></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Functions"></a>Functions</h3></div></div>
@@ -52,7 +52,7 @@
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt1"><div class=CFunction>Set a minimum or maximum logging level for the console. </div></div><div class=CToolTip id="tt2"><div class=CFunction>Set a callback to be used if logging isn&rsquo;t possible due to console.log not existing. </div></div><div class=CToolTip id="tt3"><div class=CGeneric>assert, clear, count, dir, dirxml, group, groupEnd, profile, profileEnd, time, timeEnd, trace</div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt1"><div class=CFunction>Set a minimum or maximum logging level for the console. </div></div><div class=CToolTip id="tt2"><div class=CFunction>Set a callback to be used if logging isn&rsquo;t possible due to console.log not existing. </div></div><div class=CToolTip id="tt3"><div class=CGeneric>assert, clear, count, dir, dirxml, exception, group, groupCollapsed, groupEnd, profile, profileEnd, table, time, timeEnd, trace</div></div><!--END_ND_TOOLTIPS-->
View
@@ -13,7 +13,7 @@
<div id=Index><div class=IPageTitle>File Index</div><div class=INavigationBar>$#! &middot; 0-9 &middot; A &middot; B &middot; C &middot; D &middot; E &middot; F &middot; G &middot; H &middot; I &middot; <a href="#J">J</a> &middot; K &middot; L &middot; M &middot; N &middot; O &middot; P &middot; Q &middot; R &middot; S &middot; T &middot; U &middot; V &middot; W &middot; X &middot; Y &middot; Z</div><table border=0 cellspacing=0 cellpadding=0><tr><td class=IHeading id=IFirstHeading><a name="J"></a>J</td><td></td></tr><tr><td class=ISymbolPrefix id=IOnlySymbolPrefix>&nbsp;</td><td class=IEntry><a href="../files/ba-debug-js.html#JavaScript_Debug:A_simple_wrapper_for_console.log" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')" class=ISymbol>JavaScript Debug:<wbr>A simple wrapper for console.log</a></td></tr></table>
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt1"><div class=CFile><b>Version: 0.3, Last Updated: 6/8/2009</b></div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt1"><div class=CFile><b>Version: 0.4, Last Updated: 6/22/2010</b></div></div><!--END_ND_TOOLTIPS-->
</div><!--Index-->
Oops, something went wrong.

0 comments on commit c6bddf5

Please sign in to comment.