2020-02-25 02:10:27 +00:00
|
|
|
var controller = require( './controller.js' );
|
2019-12-10 21:46:22 +00:00
|
|
|
|
2019-10-10 20:17:24 +00:00
|
|
|
/**
|
2019-12-10 21:46:22 +00:00
|
|
|
* @class mw.dt
|
2019-10-10 20:17:24 +00:00
|
|
|
* @singleton
|
|
|
|
*/
|
2019-12-10 21:46:22 +00:00
|
|
|
mw.dt = {};
|
2019-10-10 20:17:24 +00:00
|
|
|
|
2020-06-24 20:27:53 +00:00
|
|
|
mw.dt.initState = {};
|
|
|
|
mw.dt.init = function ( $container ) {
|
|
|
|
if ( $container.is( '#mw-content-text' ) || $container.find( '#mw-content-text' ).length ) {
|
|
|
|
// eslint-disable-next-line no-jquery/no-global-selector
|
|
|
|
controller.init( $( '#mw-content-text' ), mw.dt.initState );
|
|
|
|
// Reset for next init
|
|
|
|
mw.dt.initState = {};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-10-24 14:38:31 +00:00
|
|
|
if ( new mw.Uri().query.dtdebug ) {
|
|
|
|
mw.loader.load( 'ext.discussionTools.debug' );
|
2020-03-10 20:19:19 +00:00
|
|
|
} else if ( mw.config.get( 'wgIsProbablyEditable' ) ) {
|
2020-06-24 20:27:53 +00:00
|
|
|
// Don't use an anonymous function, because ReplyWidget needs to be able to remove this handler
|
|
|
|
mw.hook( 'wikipage.content' ).add( mw.dt.init );
|
2019-10-24 14:38:31 +00:00
|
|
|
}
|
2020-02-25 02:10:27 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
controller: require( './controller.js' ),
|
2020-07-20 21:15:03 +00:00
|
|
|
Parser: require( './Parser.js' ),
|
2020-02-25 02:10:27 +00:00
|
|
|
modifier: require( './modifier.js' ),
|
2020-07-20 14:13:59 +00:00
|
|
|
ThreadItem: require( './ThreadItem.js' ),
|
|
|
|
HeadingItem: require( './HeadingItem.js' ),
|
|
|
|
CommentItem: require( './CommentItem.js' ),
|
2020-03-08 14:32:38 +00:00
|
|
|
utils: require( './utils.js' ),
|
2020-04-29 18:45:20 +00:00
|
|
|
logger: require( './logger.js' ),
|
|
|
|
config: require( './config.json' )
|
2020-02-25 02:10:27 +00:00
|
|
|
};
|