Total Complexity | 5 |
Complexity/F | 0 |
Lines of Code | 31 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | interface Console { |
||
2 | olog: { |
||
3 | (...data: any[]): void; |
||
4 | (message?: any, ...optionalParams: any[]): void; |
||
5 | }; |
||
6 | } |
||
7 | declare var console_callback: any; |
||
8 | |||
9 | if (typeof module == "undefined" && typeof jQuery != "undefined") { |
||
10 | if (typeof console != "undefined") |
||
11 | if (typeof console.log != "undefined") { |
||
12 | console.olog = console.log; |
||
13 | } else { |
||
14 | console.olog = function () {}; |
||
15 | } |
||
16 | |||
17 | console.log = function (message: string) { |
||
18 | console.olog(message); |
||
19 | if (!$("#debugConsole").length) { |
||
20 | $("body").append('<div id="debugConsole" style="display:none"></div>'); |
||
21 | } |
||
22 | if (typeof console_callback == "function") { |
||
23 | console_callback(message); |
||
24 | } else { |
||
25 | $("#debugConsole").append( |
||
26 | "<p> <kbd>" + typeof message + "</kbd> " + message + "</p>" |
||
27 | ); |
||
28 | } |
||
29 | }; |
||
30 | } |
||
31 |