mediawiki-extensions-Discus.../modules/dt.init.js
Ed Sanders 9fab4add17 Config: Separate useVisualEditor into enableVisual and use2017Wikitext
Currently use2017Wikitext is missing some implementations.

Change-Id: Ib5f9bcc588561a80ca11de85518e6fae64e5b104
2020-05-06 18:03:36 +01:00

32 lines
838 B
JavaScript

var controller = require( './controller.js' );
/**
* @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 );
}
} );
} );
}
module.exports = {
controller: require( './controller.js' ),
parser: require( './parser.js' ),
modifier: require( './modifier.js' ),
utils: require( './utils.js' ),
logger: require( './logger.js' ),
config: require( './config.json' )
};