diff options
author | Bartosz Dziewoński <matma.rex@gmail.com> | 2017-03-17 03:14:05 +0100 |
---|---|---|
committer | Bartosz Dziewoński <matma.rex@gmail.com> | 2019-07-10 22:08:14 +0200 |
commit | 77f4bab8b749ed43438cc77dd6b2330ef0f99b8a (patch) | |
tree | 465ede91496e1933c04e69a7291d8e4d01752321 /docs/extension.schema.v2.json | |
parent | d72f24589b3eece35b334d080e6e609b048fc22f (diff) | |
download | mediawikicore-77f4bab8b749ed43438cc77dd6b2330ef0f99b8a.tar.gz mediawikicore-77f4bab8b749ed43438cc77dd6b2330ef0f99b8a.zip |
Allow skins/extensions to define custom OOUI themes
This change follows I39cc2a735d9625c87bf4ede6f5fb0ec441d47dcc.
docs/extension.schema.v1.json
docs/extension.schema.v2.json
includes/registration/ExtensionProcessor.php
* The new extension attribute 'OOUIThemePaths' can be used to define
custom OOUI themes. See I9187a63e509b601b8558ea82850fa828e5c8cc0a
for an example usage.
includes/resourceloader/ResourceLoaderOOUIModule.php
* Add support for 'OOUIThemePaths'.
* Defining 'images' is now optional. I figure custom themes are
unlikely to have or need them.
* Use ResourceLoaderFilePath objects to allow skin-/extension-defined
OOUI module files to use skin/extension's base paths.
This was previously used to support $wgResourceModuleSkinStyles,
but only for 'skinStyles' - now ResourceLoaderFileModule needs
to also handle it for 'skinScripts', and ResourceLoaderImageModule
for 'images').
includes/resourceloader/ResourceLoaderFilePath.php
* Add getters for local/remote base paths, for when we need to
construct a new ResourceLoaderFilePath based on existing one.
includes/resourceloader/ResourceLoaderFileModule.php
includes/resourceloader/ResourceLoaderImageModule.php
includes/resourceloader/ResourceLoaderOOUIImageModule.php
* Add or improve handling of ResourceLoaderFilePaths:
* Replace `(array)` casts with explicit array wrapping, to avoid
casting objects into associative arrays.
* Use getLocalPath() instead of string concatenation.
tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php
* Some basic checks for the above.
Bug: T100896
Change-Id: I74362f0fc215b26f1f104ce7bdbbac1e106736ad
Diffstat (limited to 'docs/extension.schema.v2.json')
-rw-r--r-- | docs/extension.schema.v2.json | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/extension.schema.v2.json b/docs/extension.schema.v2.json index c1db2b6e4a76..9d874f47f487 100644 --- a/docs/extension.schema.v2.json +++ b/docs/extension.schema.v2.json @@ -801,6 +801,30 @@ "type": "object", "description": "Map of skin names to OOUI themes to use. Same format as ResourceLoaderOOUIModule::$builtinSkinThemeMap." }, + "OOUIThemePaths": { + "type": "object", + "description": "Map of custom OOUI theme names to paths to load them from. Same format as ResourceLoaderOOUIModule::$builtinThemePaths.", + "patternProperties": { + "^[A-Za-z]+$": { + "type": "object", + "additionalProperties": false, + "properties": { + "scripts": { + "type": "string", + "description": "Path to script file." + }, + "styles": { + "type": "string", + "description": "Path to style files. '{module}' will be replaced with the module's name." + }, + "images": { + "type": [ "string", "null" ], + "description": "Path to images (optional). '{module}' will be replaced with the module's name." + } + } + } + } + }, "PasswordPolicy": { "type": "object", "description": "Password policies" |