2019-12-10 21:46:22 +00:00
|
|
|
var controller = require( 'ext.discussionTools.controller' );
|
|
|
|
|
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' );
|
|
|
|
} else {
|
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
|
|
|
}
|