From: Fomafix Date: Sun, 17 Feb 2019 18:07:12 +0000 (+0100) Subject: SpecialWatchlist: Conditionally hide the namespace checkboxes X-Git-Tag: 1.34.0-rc.0~2530^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=b46db441a3e2cccbf90072102bafe19bed6c72fe;p=lhc%2Fweb%2Fwiklou.git 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 --- 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',