From: Fomafix Date: Sun, 17 Feb 2019 19:02:22 +0000 (+0100) Subject: SpecialContributions: Conditionally hide the namespace checkboxes X-Git-Tag: 1.34.0-rc.0~2529^2 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=89d9e98c5e53a8da0ca80163ab2e3aba6281b40f;p=lhc%2Fweb%2Fwiklou.git SpecialContributions: 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: T134556 Change-Id: I84198472307532ab89c499cb75f946aeb471405f --- diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 84121b29cd..d9e76be66f 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -45,6 +45,7 @@ class SpecialContributions extends IncludableSpecialPage { 'mediawiki.special', 'mediawiki.special.changeslist', ] ); + $out->addModules( 'mediawiki.special.recentchanges' ); $this->addHelpLink( 'Help:User contributions' ); $this->opts = []; @@ -606,6 +607,7 @@ class SpecialContributions extends IncludableSpecialPage { $labelNewbies . '
' . $labelUsername . ' ' . $input . ' ' ); + $hidden = $this->opts['namespace'] === '' ? ' mw-input-hidden' : ''; $namespaceSelection = Xml::tags( 'div', [], @@ -624,11 +626,11 @@ class SpecialContributions extends IncludableSpecialPage { ) . "\u{00A0}" . Html::rawElement( 'span', - [ 'class' => 'mw-input-with-label' ], + [ 'class' => 'mw-input-with-label' . $hidden ], Xml::checkLabel( $this->msg( 'invert' )->text(), 'nsInvert', - 'nsInvert', + 'nsinvert', $this->opts['nsInvert'], [ 'title' => $this->msg( 'tooltip-invert' )->text(), @@ -636,11 +638,11 @@ class SpecialContributions extends IncludableSpecialPage { ] ) . "\u{00A0}" ) . - Html::rawElement( 'span', [ 'class' => 'mw-input-with-label' ], + Html::rawElement( 'span', [ 'class' => 'mw-input-with-label' . $hidden ], Xml::checkLabel( $this->msg( 'namespace_association' )->text(), 'associated', - 'associated', + 'nsassociated', $this->opts['associated'], [ 'title' => $this->msg( 'tooltip-namespace_association' )->text(),