No longer needed per doing Ic137cb494ba23 in a different way.
This may be useful to revisit, but for now preferring to keep
simplicity and removing this unused option.
This reverts commit
9e217bf42d73ef2dfcdecfe3a753cf8d702a18fd.
Change-Id: I9c0c316a3b58a3d0a3d3282dd74c7fa4eef8e378
// Group of module
protected $group;
- // Whether to enable variable expansion (e.g. "{skin}")
- protected $allowVariables = false;
-
/**
* @param array $options For back-compat, this can be omitted in favour of overwriting getPages.
*/
case 'scripts':
case 'group':
case 'targets':
- case 'allowVariables':
$this->{$member} = $option;
break;
}
// Filter out pages from origins not allowed by the current wiki configuration.
if ( $config->get( 'UseSiteJs' ) ) {
foreach ( $this->scripts as $script ) {
- $page = $this->expandVariables( $context, $script );
- $pages[$page] = [ 'type' => 'script' ];
+ $pages[$script] = [ 'type' => 'script' ];
}
}
if ( $config->get( 'UseSiteCss' ) ) {
foreach ( $this->styles as $style ) {
- $page = $this->expandVariables( $context, $style );
- $pages[$page] = [ 'type' => 'style' ];
+ $pages[$style] = [ 'type' => 'style' ];
}
}
return $pages;
}
- private function expandVariables( ResourceLoaderContext $context, $pageName ) {
- if ( !$this->allowVariables ) {
- return $pageName;
- }
- return strtr( $pageName, [
- '{skin}' => $context->getSkin()
- ] );
- }
-
/**
* Get group name
*
// For ResourceLoader::inDebugMode since it doesn't have context
'ResourceLoaderDebug' => true,
- // For ResourceLoaderContext::newDummyContext()
- 'DefaultSkin' => 'vector',
-
// Avoid influence from wgInvalidateCacheOnLocalSettingsChange
'CacheEpoch' => '20140101000000',
'scripts' => [ 'MediaWiki:Common.js' ],
];
- $variableParams = [
- 'allowVariables' => true,
- 'styles' => [ 'MediaWiki:Common.css', 'MediaWiki:{skin}.css' ],
- 'scripts' => [ 'MediaWiki:Common.js', 'MediaWiki:{skin}.js' ],
- ];
-
return [
[ [], new HashConfig( $settings ), [] ],
[ $params, new HashConfig( $settings ), [
),
[]
],
- [ $variableParams, new HashConfig( $settings ), [
- 'MediaWiki:Common.js' => [ 'type' => 'script' ],
- 'MediaWiki:vector.js' => [ 'type' => 'script' ],
- 'MediaWiki:Common.css' => [ 'type' => 'style' ],
- 'MediaWiki:vector.css' => [ 'type' => 'style' ]
- ] ],
];
}