mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 06:13:54 +00:00
Use standard getJsConfigVars method
Depends-On: I1e2927a5ced077c8764ff7872ca033f487ae7cc7 Change-Id: Ia5aae659d9882bef7a273c709789437719303a35
This commit is contained in:
parent
8cb8a3cd3a
commit
fa6255dfd0
|
@ -314,7 +314,7 @@ class MinervaHooks {
|
|||
* ResourceLoaderGetConfigVars hook handler.
|
||||
* Used for setting JS variables which are pulled in dynamically with RL
|
||||
* instead of embedded directly on the page with a script tag.
|
||||
* These vars have a shorter cache-life than those in `getSkinConfigVariables`.
|
||||
* These vars have a shorter cache-life than those in `getJsConfigVars`.
|
||||
*
|
||||
* @param array &$vars Array of variables to be added into the output of the RL startup module.
|
||||
* @param string $skin
|
||||
|
|
|
@ -294,15 +294,6 @@ class SkinMinerva extends SkinTemplate {
|
|||
return MediaWikiServices::getInstance()->getService( 'Minerva.SkinUserPageHelper' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes output page and sets up skin-specific parameters
|
||||
* @param OutputPage $out object to initialize
|
||||
*/
|
||||
public function initPage( OutputPage $out ) {
|
||||
parent::initPage( $out );
|
||||
$out->addJsConfigVars( $this->getSkinConfigVariables() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the user button.
|
||||
* @param QuickTemplate $tpl
|
||||
|
@ -723,14 +714,13 @@ class SkinMinerva extends SkinTemplate {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns array of config variables that should be added only to this skin
|
||||
* for use in JavaScript.
|
||||
* @inheritDoc
|
||||
* @return array
|
||||
*/
|
||||
public function getSkinConfigVariables() {
|
||||
protected function getJsConfigVars() : array {
|
||||
$title = $this->getTitle();
|
||||
|
||||
$vars = [
|
||||
return array_merge( parent::getJsConfigVars(), [
|
||||
'wgMinervaPermissions' => [
|
||||
'watch' => $this->getPermissions()->isAllowed( IMinervaPagePermissions::WATCH ),
|
||||
'talk' => $this->getUserPageHelper()->isUserPage() ||
|
||||
|
@ -739,9 +729,7 @@ class SkinMinerva extends SkinTemplate {
|
|||
],
|
||||
'wgMinervaFeatures' => $this->skinOptions->getAll(),
|
||||
'wgMinervaDownloadNamespaces' => $this->getConfig()->get( 'MinervaDownloadNamespaces' ),
|
||||
];
|
||||
|
||||
return $vars;
|
||||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue