summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/MochiKit/LoggingPane.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/MochiKit/LoggingPane.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/MochiKit/LoggingPane.js13
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
@@ -3,33 +3,36 @@
3MochiKit.LoggingPane 1.5 3MochiKit.LoggingPane 1.5
4 4
5See <http://mochikit.com/> for documentation, downloads, license, etc. 5See <http://mochikit.com/> for documentation, downloads, license, etc.
6 6
7(c) 2005 Bob Ippolito. All rights Reserved. 7(c) 2005 Bob Ippolito. All rights Reserved.
8 8
9***/ 9***/
10 10
11MochiKit.Base._module('LoggingPane', '1.5', ['Base', 'Logging']); 11MochiKit.Base.module(MochiKit, 'LoggingPane', '1.5', ['Base', 'Logging']);
12 12
13/** @id MochiKit.LoggingPane.createLoggingPane */ 13/** @id MochiKit.LoggingPane.createLoggingPane */
14MochiKit.LoggingPane.createLoggingPane = function (inline/* = false */) { 14MochiKit.LoggingPane.createLoggingPane = function (inline/* = false */) {
15 var m = MochiKit.LoggingPane; 15 var m = MochiKit.LoggingPane;
16 inline = !(!inline); 16 inline = !(!inline);
17 if (m._loggingPane && m._loggingPane.inline != inline) { 17 if (m._loggingPane && m._loggingPane.inline != inline) {
18 m._loggingPane.closePane(); 18 m._loggingPane.closePane();
19 m._loggingPane = null; 19 m._loggingPane = null;
20 } 20 }
21 if (!m._loggingPane || m._loggingPane.closed) { 21 if (!m._loggingPane || m._loggingPane.closed) {
22 m._loggingPane = new m.LoggingPane(inline, MochiKit.Logging.logger); 22 m._loggingPane = new m.LoggingPane(inline, MochiKit.Logging.logger);
23 } 23 }
24 return m._loggingPane; 24 return m._loggingPane;
25}; 25};
26 26
27/** @id MochiKit.LoggingPane.LoggingPane */ 27/**
28 * @id MochiKit.LoggingPane.LoggingPane
29 * @constructor
30 */
28MochiKit.LoggingPane.LoggingPane = function (inline/* = false */, logger/* = MochiKit.Logging.logger */) { 31MochiKit.LoggingPane.LoggingPane = function (inline/* = false */, logger/* = MochiKit.Logging.logger */) {
29 32
30 /* Use a div if inline, pop up a window if not */ 33 /* Use a div if inline, pop up a window if not */
31 /* Create the elements */ 34 /* Create the elements */
32 if (typeof(logger) == "undefined" || logger === null) { 35 if (typeof(logger) == "undefined" || logger === null) {
33 logger = MochiKit.Logging.logger; 36 logger = MochiKit.Logging.logger;
34 } 37 }
35 this.logger = logger; 38 this.logger = logger;
@@ -141,17 +144,17 @@ MochiKit.LoggingPane.LoggingPane = function (inline/* = false */, logger/* = Moc
141 var buildMessageFilter = function () { 144 var buildMessageFilter = function () {
142 var levelre, infore; 145 var levelre, infore;
143 try { 146 try {
144 /* Catch any exceptions that might arise due to invalid regexes */ 147 /* Catch any exceptions that might arise due to invalid regexes */
145 levelre = new RegExp(levelFilterField.value); 148 levelre = new RegExp(levelFilterField.value);
146 infore = new RegExp(infoFilterField.value); 149 infore = new RegExp(infoFilterField.value);
147 } catch(e) { 150 } catch(e) {
148 /* If there was an error with the regexes, do no filtering */ 151 /* If there was an error with the regexes, do no filtering */
149 logDebug("Error in filter regex: " + e.message); 152 MochiKit.Logging.logDebug("Error in filter regex: " + e.message);
150 return null; 153 return null;
151 } 154 }
152 155
153 return function (msg) { 156 return function (msg) {
154 return ( 157 return (
155 levelre.test(messageLevel(msg)) && 158 levelre.test(messageLevel(msg)) &&
156 infore.test(messageText(msg)) 159 infore.test(messageText(msg))
157 ); 160 );
@@ -179,17 +182,17 @@ MochiKit.LoggingPane.LoggingPane = function (inline/* = false */, logger/* = Moc
179 this.closed = true; 182 this.closed = true;
180 if (MochiKit.LoggingPane._loggingPane == this) { 183 if (MochiKit.LoggingPane._loggingPane == this) {
181 MochiKit.LoggingPane._loggingPane = null; 184 MochiKit.LoggingPane._loggingPane = null;
182 } 185 }
183 this.logger.removeListener(listenerId); 186 this.logger.removeListener(listenerId);
184 try { 187 try {
185 try { 188 try {
186 debugPane.loggingPane = null; 189 debugPane.loggingPane = null;
187 } catch(e) { logFatal("Bookmarklet was closed incorrectly."); } 190 } catch(e) { MochiKit.Logging.logFatal("Bookmarklet was closed incorrectly."); }
188 if (inline) { 191 if (inline) {
189 debugPane.parentNode.removeChild(debugPane); 192 debugPane.parentNode.removeChild(debugPane);
190 } else { 193 } else {
191 this.win.close(); 194 this.win.close();
192 } 195 }
193 } catch(e) {} 196 } catch(e) {}
194 }, this); 197 }, this);
195 198
@@ -219,17 +222,17 @@ MochiKit.LoggingPane.LoggingPane = function (inline/* = false */, logger/* = Moc
219 var loadMessages = bind(function () { 222 var loadMessages = bind(function () {
220 messages = this.logger.getMessages(); 223 messages = this.logger.getMessages();
221 filterMessages(); 224 filterMessages();
222 }, this); 225 }, this);
223 226
224 /** @id MochiKit.LoggingPane.filterOnEnter */ 227 /** @id MochiKit.LoggingPane.filterOnEnter */
225 var filterOnEnter = bind(function (event) { 228 var filterOnEnter = bind(function (event) {
226 event = event || window.event; 229 event = event || window.event;
227 key = event.which || event.keyCode; 230 var key = event.which || event.keyCode;
228 if (key == 13) { 231 if (key == 13) {
229 this.buildAndApplyFilter(); 232 this.buildAndApplyFilter();
230 } 233 }
231 }, this); 234 }, this);
232 235
233 /* Create the debug pane */ 236 /* Create the debug pane */
234 var style = "display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: " + this.logFont; 237 var style = "display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: " + this.logFont;
235 if (inline) { 238 if (inline) {