author | Giulio Cesare Solaroli <giulio.cesare@solaroli.it> | 2012-03-17 21:18:52 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@solaroli.it> | 2012-03-17 21:18:52 (UTC) |
commit | 288b8df03a499a2e68ebaad48e687d1eac9df0ff (patch) (unidiff) | |
tree | 1fcaefffee8366b548465a05a6c4cba0c31e131d /frontend/gamma/js/MochiKit/LoggingPane.js | |
parent | 6f7ead0446aae6dd9f40b183e402b059a33d0517 (diff) | |
parent | 25029b943781850c76fbf43827af0204f35a98bf (diff) | |
download | clipperz-288b8df03a499a2e68ebaad48e687d1eac9df0ff.zip clipperz-288b8df03a499a2e68ebaad48e687d1eac9df0ff.tar.gz clipperz-288b8df03a499a2e68ebaad48e687d1eac9df0ff.tar.bz2 |
Merge pull request #34 from gcsolaroli/master
Fixed some resources
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 | |||
@@ -3,33 +3,36 @@ | |||
3 | MochiKit.LoggingPane 1.5 | 3 | MochiKit.LoggingPane 1.5 |
4 | 4 | ||
5 | See <http://mochikit.com/> for documentation, downloads, license, etc. | 5 | See <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 | ||
11 | MochiKit.Base._module('LoggingPane', '1.5', ['Base', 'Logging']); | 11 | MochiKit.Base.module(MochiKit, 'LoggingPane', '1.5', ['Base', 'Logging']); |
12 | 12 | ||
13 | /** @id MochiKit.LoggingPane.createLoggingPane */ | 13 | /** @id MochiKit.LoggingPane.createLoggingPane */ |
14 | MochiKit.LoggingPane.createLoggingPane = function (inline/* = false */) { | 14 | MochiKit.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 | */ | ||
28 | MochiKit.LoggingPane.LoggingPane = function (inline/* = false */, logger/* = MochiKit.Logging.logger */) { | 31 | MochiKit.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) { |