| 1 | <?xml version="1.0" encoding="utf-8" ?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | |
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 5 | <head> |
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 7 | <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> |
| 8 | <title>MochiKit.LoggingPane - Interactive MochiKit.Logging pane</title> |
| 9 | |
| 10 | <link rel="stylesheet" href="../../../include/css/documentation.css" type="text/css" /> |
| 11 | <script type="text/javascript" src="../../../packed/MochiKit/MochiKit.js"></script> |
| 12 | <script type="text/javascript" src="../../js/toc.js"></script> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div class="document"> |
| 16 | <div class="section"> |
| 17 | <h1><a id="name" name="name">Name</a></h1> |
| 18 | <p>MochiKit.LoggingPane - Interactive MochiKit.Logging pane</p> |
| 19 | </div> |
| 20 | <div class="section"> |
| 21 | <h1><a id="synopsis" name="synopsis">Synopsis</a></h1> |
| 22 | <pre class="literal-block"> |
| 23 | // open a pop-up window |
| 24 | createLoggingPane() |
| 25 | // use a div at the bottom of the document |
| 26 | createLoggingPane(true); |
| 27 | </pre> |
| 28 | </div> |
| 29 | <div class="section"> |
| 30 | <h1><a id="description" name="description">Description</a></h1> |
| 31 | <p>MochiKit.Logging does not have any browser dependencies and is |
| 32 | completely unobtrusive. MochiKit.LoggingPane is a browser-based |
| 33 | colored viewing pane for your <a class="mochiref reference" href="Logging.html">MochiKit.Logging</a> output that |
| 34 | can be used as a pop-up or inline.</p> |
| 35 | <p>It also allows for regex and level filtering! MochiKit.LoggingPane is |
| 36 | used as the default |
| 37 | <a class="mochiref reference" href="Logging.html#fn-debuggingbookmarklet">MochiKit.Logging.debuggingBookmarklet()</a> if it is loaded.</p> |
| 38 | </div> |
| 39 | <div class="section"> |
| 40 | <h1><a id="dependencies" name="dependencies">Dependencies</a></h1> |
| 41 | <ul class="simple"> |
| 42 | <li><a class="mochiref reference" href="Base.html">MochiKit.Base</a></li> |
| 43 | <li><a class="mochiref reference" href="Logging.html">MochiKit.Logging</a></li> |
| 44 | </ul> |
| 45 | </div> |
| 46 | <div class="section"> |
| 47 | <h1><a id="api-reference" name="api-reference">API Reference</a></h1> |
| 48 | <div class="section"> |
| 49 | <h2><a id="constructors" name="constructors">Constructors</a></h2> |
| 50 | <p> |
| 51 | <a name="fn-loggingpane"></a> |
| 52 | <a class="mochidef reference" href="#fn-loggingpane">LoggingPane(inline=false, logger=MochiKit.Logging.logger)</a>:</p> |
| 53 | <blockquote> |
| 54 | <p>A listener for a <a class="mochiref reference" href="Logging.html">MochiKit.Logging</a> logger with an |
| 55 | interactive DOM representation.</p> |
| 56 | <p>If <tt class="docutils literal"><span class="pre">inline</span></tt> is <tt class="docutils literal"><span class="pre">true</span></tt>, then the <tt class="docutils literal"><span class="pre">LoggingPane</span></tt> will be a |
| 57 | <tt class="docutils literal"><span class="pre">DIV</span></tt> at the bottom of the document. Otherwise, it will be in a |
| 58 | pop-up window with a name based on the calling page's URL. If |
| 59 | there is an element in the document with an id of |
| 60 | <tt class="docutils literal"><span class="pre">_MochiKit_LoggingPane</span></tt>, it will be used instead of appending a |
| 61 | new <tt class="docutils literal"><span class="pre">DIV</span></tt> to the body.</p> |
| 62 | <p><tt class="docutils literal"><span class="pre">logger</span></tt> is the reference to the |
| 63 | <a class="mochiref reference" href="Logging.html#fn-logger">MochiKit.Logging.Logger</a> to listen to. If not |
| 64 | specified, the global default logger is used.</p> |
| 65 | <p>Properties:</p> |
| 66 | <blockquote> |
| 67 | <dl class="docutils"> |
| 68 | <dt><tt class="docutils literal"><span class="pre">win</span></tt>:</dt> |
| 69 | <dd>Reference to the pop-up window (<tt class="docutils literal"><span class="pre">undefined</span></tt> if |
| 70 | <tt class="docutils literal"><span class="pre">inline</span></tt>)</dd> |
| 71 | <dt><tt class="docutils literal"><span class="pre">inline</span></tt>:</dt> |
| 72 | <dd><tt class="docutils literal"><span class="pre">true</span></tt> if the <tt class="docutils literal"><span class="pre">LoggingPane</span></tt> is inline</dd> |
| 73 | <dt><tt class="docutils literal"><span class="pre">colorTable</span></tt>:</dt> |
| 74 | <dd><p class="first">An object with property->value mappings for each log level |
| 75 | and its color. May also be mutated on |
| 76 | <tt class="docutils literal"><span class="pre">LoggingPane.prototype</span></tt> to affect all instances. For |
| 77 | example:</p> |
| 78 | <pre class="last literal-block"> |
| 79 | MochiKit.LoggingPane.LoggingPane.prototype.colorTable = { |
| 80 | DEBUG: "green", |
| 81 | INFO: "black", |
| 82 | WARNING: "blue", |
| 83 | ERROR: "red", |
| 84 | FATAL: "darkred" |
| 85 | }; |
| 86 | </pre> |
| 87 | </dd> |
| 88 | </dl> |
| 89 | </blockquote> |
| 90 | <dl class="docutils"> |
| 91 | <dt><em>Availability</em>:</dt> |
| 92 | <dd>Available in MochiKit 1.3.1+</dd> |
| 93 | </dl> |
| 94 | </blockquote> |
| 95 | <p> |
| 96 | <a name="fn-loggingpane.prototype.closepane"></a> |
| 97 | <a class="mochidef reference" href="#fn-loggingpane.prototype.closepane">LoggingPane.prototype.closePane()</a>:</p> |
| 98 | <blockquote> |
| 99 | <p>Close the <a class="mochiref reference" href="#fn-loggingpane">LoggingPane</a> (close the child window, or |
| 100 | remove the <tt class="docutils literal"><span class="pre">_MochiKit_LoggingPane</span></tt> <tt class="docutils literal"><span class="pre">DIV</span></tt> from the document).</p> |
| 101 | <dl class="docutils"> |
| 102 | <dt><em>Availability</em>:</dt> |
| 103 | <dd>Available in MochiKit 1.3.1+</dd> |
| 104 | </dl> |
| 105 | </blockquote> |
| 106 | </div> |
| 107 | <div class="section"> |
| 108 | <h2><a id="functions" name="functions">Functions</a></h2> |
| 109 | <p> |
| 110 | <a name="fn-createloggingpane"></a> |
| 111 | <a class="mochidef reference" href="#fn-createloggingpane">createLoggingPane(inline=false)</a>:</p> |
| 112 | <blockquote> |
| 113 | <p>Create or return an existing <a class="mochiref reference" href="#fn-loggingpane">LoggingPane</a> for this |
| 114 | document with the given inline setting. This is preferred over |
| 115 | using <a class="mochiref reference" href="#fn-loggingpane">LoggingPane</a> directly, as only one |
| 116 | <a class="mochiref reference" href="#fn-loggingpane">LoggingPane</a> should be present in a given document.</p> |
| 117 | <dl class="docutils"> |
| 118 | <dt><em>Availability</em>:</dt> |
| 119 | <dd>Available in MochiKit 1.3.1+</dd> |
| 120 | </dl> |
| 121 | </blockquote> |
| 122 | </div> |
| 123 | </div> |
| 124 | <div class="section"> |
| 125 | <h1><a id="authors" name="authors">Authors</a></h1> |
| 126 | <ul class="simple"> |
| 127 | <li>Bob Ippolito <<a class="reference" href="mailto:bob@redivi.com">bob@redivi.com</a>></li> |
| 128 | </ul> |
| 129 | </div> |
| 130 | <div class="section"> |
| 131 | <h1><a id="copyright" name="copyright">Copyright</a></h1> |
| 132 | <p>Copyright 2005 Bob Ippolito <<a class="reference" href="mailto:bob@redivi.com">bob@redivi.com</a>>. This program is |
| 133 | dual-licensed free software; you can redistribute it and/or modify it |
| 134 | under the terms of the <a class="reference" href="http://www.opensource.org/licenses/mit-license.php">MIT License</a> or the <a class="reference" href="http://www.opensource.org/licenses/afl-2.1.php">Academic Free License |
| 135 | v2.1</a>.</p> |
| 136 | </div> |
| 137 | </div> |
| 138 | |
| 139 | </body> |
| 140 | </html> |