27 protected static $knownScriptsModules = [
'core' ];
30 'indicators',
'textures',
32 'icons-accessibility',
35 'icons-editing-advanced',
38 'icons-editing-styling',
51 'default' =>
'WikimediaUI',
57 'scripts' =>
'resources/lib/oojs-ui/oojs-ui-wikimediaui.js',
58 'styles' =>
'resources/lib/oojs-ui/oojs-ui-{module}-wikimediaui.css',
59 'images' =>
'resources/lib/oojs-ui/themes/wikimediaui/{module}.json',
62 'scripts' =>
'resources/lib/oojs-ui/oojs-ui-apex.js',
63 'styles' =>
'resources/lib/oojs-ui/oojs-ui-{module}-apex.css',
64 'images' =>
'resources/lib/oojs-ui/themes/apex/{module}.json',
106 $path = $paths[ $theme ][ $kind ];
107 $path = str_replace(
'{module}', $module, $path );
117 if ( !in_array( $module, self::$knownScriptsModules ) ) {
118 throw new InvalidArgumentException(
"Invalid OOUI scripts module '$module'" );
120 return $this->
getThemePath( $theme,
'scripts', $module );
129 if ( !in_array( $module, self::$knownStylesModules ) ) {
130 throw new InvalidArgumentException(
"Invalid OOUI styles module '$module'" );
132 return $this->
getThemePath( $theme,
'styles', $module );
141 if ( !in_array( $module, self::$knownImagesModules ) ) {
142 throw new InvalidArgumentException(
"Invalid OOUI images module '$module'" );
144 return $this->
getThemePath( $theme,
'images', $module );
static $knownImagesModules
static getThemePaths()
Return a map of theme names to lists of paths from which a given theme should be loaded.
static $knownStylesModules
static $builtinSkinThemeMap
static $builtinThemePaths
getThemePath( $theme, $kind, $module)
Return a path to load given module of given theme from.
static getSkinThemeMap()
Return a map of skin names (in lowercase) to OOUI theme names, defining which theme a given skin shou...
trait ResourceLoaderOOUIModule
Convenience methods for dealing with OOUI themes and their relations to MW skins.
getThemeScriptsPath( $theme, $module)
getThemeStylesPath( $theme, $module)
getThemeImagesPath( $theme, $module)