mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 08:23:52 +00:00
9cb497fc97
Bug: T240582 Change-Id: I127cd937ed2725c649dc34a8d18a29560c09fb44
23 lines
609 B
JavaScript
23 lines
609 B
JavaScript
var controller = require( 'ext.discussionTools.controller' );
|
|
|
|
/**
|
|
* @class mw.dt
|
|
* @singleton
|
|
*/
|
|
mw.dt = {};
|
|
|
|
if ( new mw.Uri().query.dtdebug ) {
|
|
mw.loader.load( 'ext.discussionTools.debug' );
|
|
} else if ( mw.config.get( 'wgIsProbablyEditable' ) ) {
|
|
mw.hook( 'wikipage.content' ).add( function ( $container ) {
|
|
$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 );
|
|
}
|
|
} );
|
|
} );
|
|
}
|