From b46db441a3e2cccbf90072102bafe19bed6c72fe Mon Sep 17 00:00:00 2001 From: Fomafix Date: Sun, 17 Feb 2019 19:07:12 +0100 Subject: [PATCH] SpecialWatchlist: Conditionally hide the namespace checkboxes This changes hides the namespace checkboxes like on SpecialRecentchanges. Load the module 'mediawiki.special.recentchanges' which shows/hides the checkboxes on change of the namespace selector. Set the initial state of the visibility of the checkboxes already in the HTML to prevent a flash of the checkboxes while loading. Bug: T38317 Change-Id: I7ceb55088165c3c9bb17f6cfd4bfc6e800da9cc7 --- includes/specials/SpecialWatchlist.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 7772ef73f4..3b595e48dc 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -63,6 +63,7 @@ class SpecialWatchlist extends ChangesListSpecialPage { $this->addHelpLink( 'Help:Watching pages' ); $output->addModuleStyles( [ 'mediawiki.special' ] ); $output->addModules( [ + 'mediawiki.special.recentchanges', 'mediawiki.special.watchlist', ] ); @@ -655,14 +656,15 @@ class SpecialWatchlist extends ChangesListSpecialPage { 'class' => 'namespaceselector', ] ) . "\n"; - $namespaceForm .= '' . Xml::checkLabel( + $hidden = $opts['namespace'] === '' ? ' mw-input-hidden' : ''; + $namespaceForm .= '' . Xml::checkLabel( $this->msg( 'invert' )->text(), 'invert', 'nsinvert', $opts['invert'], [ 'title' => $this->msg( 'tooltip-invert' )->text() ] ) . "\n"; - $namespaceForm .= '' . Xml::checkLabel( + $namespaceForm .= '' . Xml::checkLabel( $this->msg( 'namespace_association' )->text(), 'associated', 'nsassociated', -- 2.20.1