$this->addHelpLink( 'Help:Watching pages' );
$output->addModules( [
'mediawiki.special.changeslist.visitedstatus',
+ 'mediawiki.special.watchlist',
] );
$mode = SpecialEditWatchlist::getMode( $request, $subpage );
$user = $this->getUser();
$out = $this->getOutput();
- // if the user wishes, that the watchlist is reloaded, whenever a filter changes,
- // add the module for that
- if ( $user->getBoolOption( 'watchlistreloadautomatically' ) ) {
- $out->addModules( [ 'mediawiki.special.watchlist' ] );
- }
-
$out->addSubtitle(
$this->msg( 'watchlistfor2', $user->getName() )
->rawParams( SpecialEditWatchlist::buildTools(
],
'mediawiki.special.watchlist' => [
'scripts' => 'resources/src/mediawiki.special/mediawiki.special.watchlist.js',
+ 'dependencies' => [
+ 'user.options',
+ ]
],
'mediawiki.special.version' => [
'styles' => 'resources/src/mediawiki.special/mediawiki.special.version.css',
/*!
* JavaScript for Special:Watchlist
- *
- * This script is only loaded, if the user opt-in a setting in Special:Preferences,
- * that the watchlist should be automatically reloaded, when a filter option is
- * changed in the header form.
*/
-jQuery( function ( $ ) {
- // add a listener on all form elements in the header form
- $( '#mw-watchlist-form input, #mw-watchlist-form select' ).on( 'change', function () {
- // submit the form, when one of the input fields was changed
- $( '#mw-watchlist-form' ).submit();
+( function ( mw, $ ) {
+ $( function () {
+ // if the user wishes to reload the watchlist whenever a filter changes
+ if ( mw.user.options.get( 'watchlistreloadautomatically' ) ) {
+ // add a listener on all form elements in the header form
+ $( '#mw-watchlist-form input, #mw-watchlist-form select' ).on( 'change', function () {
+ // submit the form when one of the input fields is modified
+ $( '#mw-watchlist-form' ).submit();
+ } );
+ }
} );
-} );
+}( mediaWiki, jQuery ) );