2019-10-10 20:17:24 +00:00
|
|
|
/**
|
|
|
|
* @class mw.discussionTools
|
|
|
|
* @singleton
|
|
|
|
*/
|
|
|
|
mw.dt = {
|
|
|
|
init: {},
|
|
|
|
ui: {},
|
2019-11-05 14:13:18 +00:00
|
|
|
parser: require( 'ext.discussionTools.parser' ),
|
2019-11-05 13:55:01 +00:00
|
|
|
modifier: require( 'ext.discussionTools.modifier' ),
|
|
|
|
controller: require( 'ext.discussionTools.controller' )
|
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 ) {
|
|
|
|
// Don't re-run if we already handled this element
|
|
|
|
if ( $container.closest( '.dt-init-done' ).length === 0 ) {
|
|
|
|
mw.dt.controller.init( $container.find( '#mw-content-text' ).addBack( '#mw-content-text' ) );
|
|
|
|
}
|
|
|
|
} );
|
2019-10-24 14:38:31 +00:00
|
|
|
}
|