27 protected static $knownScriptsModules = [
'core' ];
30 'indicators',
'textures',
32 'icons-accessibility',
35 'icons-editing-advanced',
36 'icons-editing-citation',
39 'icons-editing-styling',
52 'default' =>
'WikimediaUI',
58 'scripts' =>
'resources/lib/ooui/oojs-ui-wikimediaui.js',
59 'styles' =>
'resources/lib/ooui/oojs-ui-{module}-wikimediaui.css',
60 'images' =>
'resources/lib/ooui/themes/wikimediaui/{module}.json',
63 'scripts' =>
'resources/lib/ooui/oojs-ui-apex.js',
64 'styles' =>
'resources/lib/ooui/oojs-ui-{module}-apex.css',
65 'images' =>
'resources/lib/ooui/themes/apex/{module}.json',
107 $path = $paths[ $theme ][ $kind ];
108 $path = str_replace(
'{module}', $module, $path );
118 if ( !in_array( $module, self::$knownScriptsModules ) ) {
119 throw new InvalidArgumentException(
"Invalid OOUI scripts module '$module'" );
121 return $this->
getThemePath( $theme,
'scripts', $module );
130 if ( !in_array( $module, self::$knownStylesModules ) ) {
131 throw new InvalidArgumentException(
"Invalid OOUI styles module '$module'" );
133 return $this->
getThemePath( $theme,
'styles', $module );
142 if ( !in_array( $module, self::$knownImagesModules ) ) {
143 throw new InvalidArgumentException(
"Invalid OOUI images module '$module'" );
145 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)