Go to the documentation of this file.
28 protected static $knownScriptsModules = [
'core' ];
33 'icons-accessibility',
36 'icons-editing-advanced',
37 'icons-editing-citation',
40 'icons-editing-styling',
53 'default' =>
'WikimediaUI',
59 'scripts' =>
'resources/lib/ooui/oojs-ui-wikimediaui.js',
60 'styles' =>
'resources/lib/ooui/oojs-ui-{module}-wikimediaui.css',
61 'images' =>
'resources/lib/ooui/themes/wikimediaui/{module}.json',
64 'scripts' =>
'resources/lib/ooui/oojs-ui-apex.js',
65 'styles' =>
'resources/lib/ooui/oojs-ui-{module}-apex.css',
66 'images' =>
'resources/lib/ooui/themes/apex/{module}.json',
96 list( $defaultLocalBasePath, $defaultRemoteBasePath ) =
101 foreach ( $themePaths as $theme => &$paths ) {
102 list( $localBasePath, $remoteBasePath ) =
104 if ( $localBasePath !== $defaultLocalBasePath || $remoteBasePath !== $defaultRemoteBasePath ) {
105 foreach ( $paths as &
$path ) {
128 $path = $paths[$theme][$kind];
131 str_replace(
'{module}', $module,
$path->getPath() ),
132 $path->getLocalBasePath(),
133 $path->getRemoteBasePath()
136 $path = str_replace(
'{module}', $module,
$path );
147 if ( !in_array( $module, self::$knownScriptsModules ) ) {
148 throw new InvalidArgumentException(
"Invalid OOUI scripts module '$module'" );
150 return $this->
getThemePath( $theme,
'scripts', $module );
160 throw new InvalidArgumentException(
"Invalid OOUI styles module '$module'" );
162 return $this->
getThemePath( $theme,
'styles', $module );
172 throw new InvalidArgumentException(
"Invalid OOUI images module '$module'" );
174 return $this->
getThemePath( $theme,
'images', $module );
static $knownStylesModules
trait ResourceLoaderOOUIModule
Convenience methods for dealing with OOUI themes and their relations to MW skins.
static getThemePaths()
Return a map of theme names to lists of paths from which a given theme should be loaded.
getThemeScriptsPath( $theme, $module)
An object to represent a path to a JavaScript/CSS file, along with a remote and local base path,...
static $builtinSkinThemeMap
getThemePath( $theme, $kind, $module)
Return a path to load given module of given theme from.
static extractBasePaths( $options=[], $localBasePath=null, $remoteBasePath=null)
Extract a pair of local and remote base paths from module definition information.
getThemeStylesPath( $theme, $module)
static $knownImagesModules
static getSkinThemeMap()
Return a map of skin names (in lowercase) to OOUI theme names, defining which theme a given skin shou...
static $builtinThemePaths
getThemeImagesPath( $theme, $module)