2020-02-25 02:10:27 +00:00
|
|
|
var controller = require( './controller.js' );
|
2019-12-10 21:46:22 +00:00
|
|
|
|
2019-10-10 20:17:24 +00:00
|
|
|
/**
|
2019-12-10 21:46:22 +00:00
|
|
|
* @class mw.dt
|
2019-10-10 20:17:24 +00:00
|
|
|
* @singleton
|
|
|
|
*/
|
2019-12-10 21:46:22 +00:00
|
|
|
mw.dt = {};
|
2019-10-10 20:17:24 +00:00
|
|
|
|
2019-10-24 14:38:31 +00:00
|
|
|
if ( new mw.Uri().query.dtdebug ) {
|
|
|
|
mw.loader.load( 'ext.discussionTools.debug' );
|
2020-03-10 20:19:19 +00:00
|
|
|
} else if ( mw.config.get( 'wgIsProbablyEditable' ) ) {
|
2019-11-13 13:57:57 +00:00
|
|
|
mw.hook( 'wikipage.content' ).add( function ( $container ) {
|
2020-01-04 17:48:52 +00:00
|
|
|
$container.find( '.mw-parser-output' ).each( function () {
|
|
|
|
var $node = $( this );
|
|
|
|
// Don't re-run if we already handled this element
|
|
|
|
// eslint-disable-next-line no-jquery/no-class-state
|
|
|
|
if ( !$node.hasClass( 'dt-init-done' ) ) {
|
|
|
|
controller.init( $node );
|
|
|
|
}
|
|
|
|
} );
|
2019-11-13 13:57:57 +00:00
|
|
|
} );
|
2019-10-24 14:38:31 +00:00
|
|
|
}
|
2020-02-25 02:10:27 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
controller: require( './controller.js' ),
|
|
|
|
parser: require( './parser.js' ),
|
|
|
|
modifier: require( './modifier.js' ),
|
2020-03-08 14:32:38 +00:00
|
|
|
utils: require( './utils.js' ),
|
2020-02-25 02:10:27 +00:00
|
|
|
logger: require( './logger.js' )
|
|
|
|
};
|