Disable download button in all namespaces except main

The MinervaDownloadIcon config option is replaced with a
more specific wgMinervaDownloadNamespaces config option.
If the list is empty then the download button will not be
shown.

Since the download icon is enabled everywhere in production now
this is good as it means Minerva reflects the production value.

Bug: T181152
Change-Id: Id78c1de9e8e9013530106bc0d45d3cf0297897b5
This commit is contained in:
jdlrobson 2017-11-28 13:17:27 -08:00 committed by Jdlrobson
parent 9c987a7c72
commit eaa4dae5af
3 changed files with 6 additions and 3 deletions

View File

@ -1273,7 +1273,7 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
$out = $this->getOutput();
$vars = [
'wgMinervaDownloadIcon' => $this->getConfig()->get( 'MinervaDownloadIcon' ),
'wgMinervaDownloadNamespaces' => $this->getConfig()->get( 'MinervaDownloadNamespaces' ),
'wgMinervaMenuData' => $this->getMenuData(),
// Expose for skins.minerva.tablet.scripts
'wgMinervaTocEnabled' => $out->getProperty( 'MFTOC' ),

View File

@ -229,7 +229,10 @@
loadTabletModules();
if (
config.get( 'wgMinervaDownloadIcon' ) &&
// Download button is restricted to certain namespaces T181152.
// Defaults to 0, in case cached JS has been served.
config.get( 'wgMinervaDownloadNamespaces', [ 0 ] )
.indexOf( config.get( 'wgNamespaceNumber' ) ) > -1 &&
!page.isMainPage() &&
// The iOS print dialog does not provide pdf functionality (see T177215)
!browser.isIos() &&

View File

@ -489,7 +489,7 @@
},
"author": [],
"config": {
"MinervaDownloadIcon": false,
"MinervaDownloadNamespaces": [ 0 ],
"MinervaEnableSiteNotice": false,
"MinervaCustomLogos": [],
"MinervaApplyKnownTemplateHacks": false,