Index: trunk/extensions/UploadWizard/resources/mw.Log.js |
— | — | @@ -61,37 +61,39 @@ |
62 | 62 | if ( typeof window.console !== 'undefined' && typeof window.console.log === 'function' ) { |
63 | 63 | window.console.log( s ); |
64 | 64 | } else { |
65 | | - // Set timestamp |
66 | | - var d = new Date(); |
67 | | - var time = ( pad( d.getHours(), 2 ) + ':' + pad( d.getMinutes(), 2 ) + pad( d.getSeconds(), 2 ) + pad( d.getMilliseconds(), 3 ) ); |
68 | | - // Show a log box for console-less browsers |
69 | | - var $log = $( '#mw-log-console' ); |
70 | | - if ( !$log.length ) { |
71 | | - $log = $( '<div id="mw-log-console"></div>' ) |
72 | | - .css( { |
73 | | - 'position': 'fixed', |
74 | | - 'overflow': 'auto', |
75 | | - 'z-index': 500, |
76 | | - 'bottom': '0px', |
77 | | - 'left': '0px', |
78 | | - 'right': '0px', |
79 | | - 'height': '150px', |
80 | | - 'background-color': 'white', |
81 | | - 'border-top': 'solid 2px #ADADAD' |
82 | | - } ) |
83 | | - .appendTo( 'body' ); |
| 65 | + if ( typeof mw.log.makeConsole !== 'undefined' && mw.log.makeConsole ) { |
| 66 | + // Set timestamp |
| 67 | + var d = new Date(); |
| 68 | + var time = ( pad( d.getHours(), 2 ) + ':' + pad( d.getMinutes(), 2 ) + pad( d.getSeconds(), 2 ) + pad( d.getMilliseconds(), 3 ) ); |
| 69 | + // Show a log box for console-less browsers |
| 70 | + var $log = $( '#mw-log-console' ); |
| 71 | + if ( !$log.length ) { |
| 72 | + $log = $( '<div id="mw-log-console"></div>' ) |
| 73 | + .css( { |
| 74 | + 'position': 'fixed', |
| 75 | + 'overflow': 'auto', |
| 76 | + 'z-index': 500, |
| 77 | + 'bottom': '0px', |
| 78 | + 'left': '0px', |
| 79 | + 'right': '0px', |
| 80 | + 'height': '150px', |
| 81 | + 'background-color': 'white', |
| 82 | + 'border-top': 'solid 2px #ADADAD' |
| 83 | + } ) |
| 84 | + .appendTo( 'body' ); |
| 85 | + } |
| 86 | + $log.append( |
| 87 | + $( '<div></div>' ) |
| 88 | + .css( { |
| 89 | + 'border-bottom': 'solid 1px #DDDDDD', |
| 90 | + 'font-size': 'small', |
| 91 | + 'font-family': 'monospace', |
| 92 | + 'padding': '0.125em 0.25em' |
| 93 | + } ) |
| 94 | + .text( s ) |
| 95 | + .append( '<span style="float:right">[' + time + ']</span>' ) |
| 96 | + ); |
84 | 97 | } |
85 | | - $log.append( |
86 | | - $( '<div></div>' ) |
87 | | - .css( { |
88 | | - 'border-bottom': 'solid 1px #DDDDDD', |
89 | | - 'font-size': 'small', |
90 | | - 'font-family': 'monospace', |
91 | | - 'padding': '0.125em 0.25em' |
92 | | - } ) |
93 | | - .text( s ) |
94 | | - .append( '<span style="float:right">[' + time + ']</span>' ) |
95 | | - ); |
96 | 98 | } |
97 | 99 | }; |
98 | 100 | |