mediawiki-extensions-Discus.../modules/dt.init.js
Ed Sanders a6147ffac8 Highlight comment after saving
* Init on wikipage.content hook
* Update page state variables after save

Change-Id: I05a3c766668999f05cfe06473652429025595196
2019-12-03 16:40:35 +00:00

23 lines
625 B
JavaScript

/**
* @class mw.discussionTools
* @singleton
*/
mw.dt = {
init: {},
ui: {},
parser: require( 'ext.discussionTools.parser' ),
modifier: require( 'ext.discussionTools.modifier' ),
controller: require( 'ext.discussionTools.controller' )
};
if ( new mw.Uri().query.dtdebug ) {
mw.loader.load( 'ext.discussionTools.debug' );
} else {
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' ) );
}
} );
}