The biggest negative point (as far as I can tell) with the change mentioned in the follow-up
is, that a user needs at least 3 clicks to change an option, which before it required only
one click. This option adds a new preference for the watchlist (which can be enabled/disabled
using Special:Preferences) which, if enabled, loads a new, tiny module with a script, that
listens on all input and select fields in the header form of Special:Watchlist. Whenever one
of these elements get changed, the watchlist form will be submitted automatically.
The default for this option is false (disabled).
Follow up: I3bcd27596c21aa4
Bug: T50615
Bug: T119322
Change-Id: Icab1a5143df24a06f468165421d40db8fa57e73c
'watchlisthideown' => 0,
'watchlisthidepatrolled' => 0,
'watchlisthidecategorization' => 1,
+ 'watchlistreloadautomatically' => 0,
'watchmoves' => 0,
'watchrollback' => 0,
'wllimit' => 250,
'section' => 'watchlist/advancedwatchlist',
'label-message' => 'tog-watchlisthideliu',
);
+ $defaultPreferences['watchlistreloadautomatically'] = array(
+ 'type' => 'toggle',
+ 'section' => 'watchlist/advancedwatchlist',
+ 'label-message' => 'tog-watchlistreloadautomatically',
+ );
if ( $config->get( 'RCWatchCategoryMembership' ) ) {
$defaultPreferences['watchlisthidecategorization'] = array(
*/
public function doHeader( $opts, $numRows ) {
$user = $this->getUser();
+ $out = $this->getOutput();
- $this->getOutput()->addSubtitle(
+ // if the user wishes, that the watchlist is reloaded, whenever a filter changes,
+ // add the module for that
+ if ( $user->getBoolOption( 'watchlistreloadautomatically' ) ) {
+ $out->addModules( array( 'mediawiki.special.watchlist' ) );
+ }
+
+ $out->addSubtitle(
$this->msg( 'watchlistfor2', $user->getName() )
->rawParams( SpecialEditWatchlist::buildTools( null ) )
);
"tog-watchlisthidebots": "Hide bot edits from the watchlist",
"tog-watchlisthideminor": "Hide minor edits from the watchlist",
"tog-watchlisthideliu": "Hide edits by logged in users from the watchlist",
+ "tog-watchlistreloadautomatically": "Reload the watchlist automatically whenever a filter is changed (JavaScript required)",
"tog-watchlisthideanons": "Hide edits by anonymous users from the watchlist",
"tog-watchlisthidepatrolled": "Hide patrolled edits from the watchlist",
"tog-watchlisthidecategorization": "Hide categorization of pages",
"tog-watchlisthidebots": "[[Special:Preferences]], tab 'Watchlist'. Offers user to hide bot edits from watchlist. {{Gender}}\n\n{{Related|Preferences-watchlistrc-toggle}}",
"tog-watchlisthideminor": "[[Special:Preferences]], tab 'Watchlist'. Offers user to hide minor edits from watchlist. {{Gender}}\n\n{{Related|Preferences-watchlistrc-toggle}}",
"tog-watchlisthideliu": "Option in tab 'Watchlist' of [[Special:Preferences]]. {{Gender}}\n\n{{Related|Preferences-watchlistrc-toggle}}",
+ "tog-watchlistreloadautomatically": "[[Special:Preferences]], tab 'Watchlist'. Offers user to to automatically refresh the watchlist page, when a filter is changed.",
"tog-watchlisthideanons": "Option in tab 'Watchlist' of [[Special:Preferences]]. {{Gender}}\n\n{{Related|Preferences-watchlistrc-toggle}}",
"tog-watchlisthidepatrolled": "Option in Watchlist tab of [[Special:Preferences]]. {{Gender}}\n\n{{Related|Preferences-watchlistrc-toggle}}",
"tog-watchlisthidecategorization": "Option in Watchlist tab of [[Special:Preferences]]. Offers user to hide/show categorization of pages. Appears next to checkboxes with labels such as {{msg-mw|tog-watchlisthideminor}}.",
'mediawiki.util',
),
),
+ 'mediawiki.special.watchlist' => array(
+ 'scripts' => 'resources/src/mediawiki.special/mediawiki.special.watchlist.js',
+ ),
'mediawiki.special.javaScriptTest' => array(
'scripts' => 'resources/src/mediawiki.special/mediawiki.special.javaScriptTest.js',
'messages' => array_merge( Skin::getSkinNameMessages(), array(
--- /dev/null
+/*!
+ * 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();
+ } );
+
+} );