dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Fix IGNORE option for sqlite update"
[lhc/web/wiklou.git]
/
resources
/
mediawiki
/
mediawiki.log.js
diff --git
a/resources/mediawiki/mediawiki.log.js
b/resources/mediawiki/mediawiki.log.js
index
ee08b12
..
dd22e35
100644
(file)
--- a/
resources/mediawiki/mediawiki.log.js
+++ b/
resources/mediawiki/mediawiki.log.js
@@
-1,4
+1,4
@@
-/*
*
+/*
!
* Logger for MediaWiki javascript.
* Implements the stub left by the main 'mediawiki' module.
*
* Logger for MediaWiki javascript.
* Implements the stub left by the main 'mediawiki' module.
*
@@
-8,23
+8,32
@@
( function ( mw, $ ) {
( function ( mw, $ ) {
+ // Reference to dummy
+ // We don't need the dummy, but it has other methods on it
+ // that we need to restore afterwards.
+ var original = mw.log,
+ slice = Array.prototype.slice;
+
/**
/**
- * Logs a message to the console.
+ * Logs a message to the console
in debug mode
.
*
* In the case the browser does not have a console API, a console is created on-the-fly by appending
*
* In the case the browser does not have a console API, a console is created on-the-fly by appending
- * a
<div id="mw-log-console">
element to the bottom of the body and then appending this and future
+ * a
`<div id="mw-log-console">`
element to the bottom of the body and then appending this and future
* messages to that, instead of the console.
*
* messages to that, instead of the console.
*
- * @param {String} First in list of variadic messages to output to console.
+ * @member mw.log
+ * @param {string...} msg Messages to output to console.
*/
*/
- mw.log = function (
/* logmsg, logmsg, */
) {
+ mw.log = function () {
// Turn arguments into an array
// Turn arguments into an array
- var
args = Array.prototype.
slice.call( arguments ),
+ var
args =
slice.call( arguments ),
// Allow log messages to use a configured prefix to identify the source window (ie. frame)
prefix = mw.config.exists( 'mw.log.prefix' ) ? mw.config.get( 'mw.log.prefix' ) + '> ' : '';
// Try to use an existing console
// Allow log messages to use a configured prefix to identify the source window (ie. frame)
prefix = mw.config.exists( 'mw.log.prefix' ) ? mw.config.get( 'mw.log.prefix' ) + '> ' : '';
// Try to use an existing console
- if ( window.console !== undefined && $.isFunction( window.console.log ) ) {
+ // Generally we can cache this, but in this case we want to re-evaluate this as a
+ // global property live so that things like Firebug Lite can take precedence.
+ if ( window.console && window.console.log ) {
args.unshift( prefix );
window.console.log.apply( window.console, args );
return;
args.unshift( prefix );
window.console.log.apply( window.console, args );
return;
@@
-54,7
+63,7
@@
hovzer.update();
}
$log.append(
hovzer.update();
}
$log.append(
- $( '<div>
</div>
' )
+ $( '<div>' )
.css( {
borderBottom: 'solid 1px #DDDDDD',
fontSize: 'small',
.css( {
borderBottom: 'solid 1px #DDDDDD',
fontSize: 'small',
@@
-68,4
+77,8
@@
} );
};
} );
};
+ // Restore original methods
+ mw.log.warn = original.warn;
+ mw.log.deprecate = original.deprecate;
+
}( mediaWiki, jQuery ) );
}( mediaWiki, jQuery ) );