Diffstat (limited to 'frontend/gamma/js/MochiKit/LoggingPane.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/MochiKit/LoggingPane.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/frontend/gamma/js/MochiKit/LoggingPane.js b/frontend/gamma/js/MochiKit/LoggingPane.js index c960c21..b7ea120 100644 --- a/frontend/gamma/js/MochiKit/LoggingPane.js +++ b/frontend/gamma/js/MochiKit/LoggingPane.js @@ -1,39 +1,42 @@ /*** MochiKit.LoggingPane 1.5 See <http://mochikit.com/> for documentation, downloads, license, etc. (c) 2005 Bob Ippolito. All rights Reserved. ***/ -MochiKit.Base._module('LoggingPane', '1.5', ['Base', 'Logging']); +MochiKit.Base.module(MochiKit, 'LoggingPane', '1.5', ['Base', 'Logging']); /** @id MochiKit.LoggingPane.createLoggingPane */ MochiKit.LoggingPane.createLoggingPane = function (inline/* = false */) { var m = MochiKit.LoggingPane; inline = !(!inline); if (m._loggingPane && m._loggingPane.inline != inline) { m._loggingPane.closePane(); m._loggingPane = null; } if (!m._loggingPane || m._loggingPane.closed) { m._loggingPane = new m.LoggingPane(inline, MochiKit.Logging.logger); } return m._loggingPane; }; -/** @id MochiKit.LoggingPane.LoggingPane */ +/** + * @id MochiKit.LoggingPane.LoggingPane + * @constructor + */ MochiKit.LoggingPane.LoggingPane = function (inline/* = false */, logger/* = MochiKit.Logging.logger */) { /* Use a div if inline, pop up a window if not */ /* Create the elements */ if (typeof(logger) == "undefined" || logger === null) { logger = MochiKit.Logging.logger; } this.logger = logger; var update = MochiKit.Base.update; var updatetree = MochiKit.Base.updatetree; var bind = MochiKit.Base.bind; var clone = MochiKit.Base.clone; @@ -137,25 +140,25 @@ MochiKit.LoggingPane.LoggingPane = function (inline/* = false */, logger/* = Moc addMessageText(msg); }; /** @id MochiKit.LoggingPane.buildMessageFilter */ var buildMessageFilter = function () { var levelre, infore; try { /* Catch any exceptions that might arise due to invalid regexes */ levelre = new RegExp(levelFilterField.value); infore = new RegExp(infoFilterField.value); } catch(e) { /* If there was an error with the regexes, do no filtering */ - logDebug("Error in filter regex: " + e.message); + MochiKit.Logging.logDebug("Error in filter regex: " + e.message); return null; } return function (msg) { return ( levelre.test(messageLevel(msg)) && infore.test(messageText(msg)) ); }; }; /** @id MochiKit.LoggingPane.clearMessagePane */ @@ -175,25 +178,25 @@ MochiKit.LoggingPane.LoggingPane = function (inline/* = false */, logger/* = Moc var closePane = bind(function () { if (this.closed) { return; } this.closed = true; if (MochiKit.LoggingPane._loggingPane == this) { MochiKit.LoggingPane._loggingPane = null; } this.logger.removeListener(listenerId); try { try { debugPane.loggingPane = null; - } catch(e) { logFatal("Bookmarklet was closed incorrectly."); } + } catch(e) { MochiKit.Logging.logFatal("Bookmarklet was closed incorrectly."); } if (inline) { debugPane.parentNode.removeChild(debugPane); } else { this.win.close(); } } catch(e) {} }, this); /** @id MochiKit.LoggingPane.filterMessages */ var filterMessages = function () { clearMessagePane(); @@ -215,25 +218,25 @@ MochiKit.LoggingPane.LoggingPane = function (inline/* = false */, logger/* = Moc }; /** @id MochiKit.LoggingPane.loadMessages */ var loadMessages = bind(function () { messages = this.logger.getMessages(); filterMessages(); }, this); /** @id MochiKit.LoggingPane.filterOnEnter */ var filterOnEnter = bind(function (event) { event = event || window.event; - key = event.which || event.keyCode; + var key = event.which || event.keyCode; if (key == 13) { this.buildAndApplyFilter(); } }, this); /* Create the debug pane */ var style = "display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: " + this.logFont; if (inline) { style += "; height: 10em; border-top: 2px solid black"; } else { style += "; height: 100%;"; } |