mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-13 18:37:07 +00:00
a6147ffac8
* Init on wikipage.content hook * Update page state variables after save Change-Id: I05a3c766668999f05cfe06473652429025595196
23 lines
625 B
JavaScript
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' ) );
|
|
}
|
|
} );
|
|
}
|