mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-15 11:58:44 +00:00
de76ab59c1
Add a Vector-specific user preference to Special:Preferences for toggling skin version, either Legacy Vector or the latest Vector. The presentation of the new preference section and the default values for anonymous, new, and existing accounts are configurable via $wgVectorShowSkinPreferences, $wgVectorDefaultSkinVersion (to be used by the feature manager in T244481), $wgVectorDefaultSkinVersionForExistingAccounts, and $wgVectorDefaultSkinVersionForNewAccounts. These configurations default to the fullest experience so that third-party configuration is minimal. See skin.json for details. The configurations are each tested in VectorHooksTest.php. When presentation is enabled, the new preference appears as a checkbox; enabled is Legacy mode and disable is latest. There are a number of unfortunate details: - Showing and hiding a checkbox is supported by OOUI. Showing and hiding a whole section (Vector skin preferences, in this case) is not so this additional client JavaScript functionality is added in Core (see Iaf68b238a8ac7a4fb22b9ef5d6c5a3394ee2e377). - Stylization as a checkbox is wanted. However, the implied storage type for OOUI checkboxes is a boolean. This is not wanted in the event that another skin version is added (e.g., '3' or 'alpha'). As a workaround, the preference is converted from a boolean to a version string ('1' or '2') on save in Hooks::onPreferencesFormPreSave() and from a version string to a checkbox enable / disable string ('1' or '0') in onGetPreferences(). There a number of test cases to help cover these concerning details. Documentation for overriding the skin version as a URL query parameter is provided in anticipation of T244481. Bug: T242381 Bug: T245793 Depends-On: Iaf68b238a8ac7a4fb22b9ef5d6c5a3394ee2e377 Depends-On: Ifc2863fca9cd9efd11ac30c780420e8d89e8cb22 Change-Id: I177dad88fc982170641059b6a4f53fbb38eefad6
143 lines
4.8 KiB
JSON
143 lines
4.8 KiB
JSON
{
|
|
"name": "Vector",
|
|
"author": [
|
|
"Trevor Parscal",
|
|
"Roan Kattouw",
|
|
"..."
|
|
],
|
|
"url": "https://www.mediawiki.org/wiki/Skin:Vector",
|
|
"descriptionmsg": "vector-skin-desc",
|
|
"namemsg": "skinname-vector",
|
|
"license-name": "GPL-2.0-or-later",
|
|
"type": "skin",
|
|
"requires": {
|
|
"MediaWiki": ">= 1.31.0"
|
|
},
|
|
"ValidSkinNames": {
|
|
"vector": "Vector"
|
|
},
|
|
"MessagesDirs": {
|
|
"Vector": [
|
|
"i18n"
|
|
]
|
|
},
|
|
"AutoloadClasses": {
|
|
"Vector\\Constants": "includes/Constants.php",
|
|
"Vector\\Hooks": "includes/Hooks.php",
|
|
"SkinVector": "includes/SkinVector.php",
|
|
"VectorTemplate": "includes/VectorTemplate.php"
|
|
},
|
|
"AutoloadNamespaces": {
|
|
"Vector\\FeatureManagement\\": "includes/FeatureManagement/"
|
|
},
|
|
"ConfigRegistry": {
|
|
"vector": "GlobalVarConfig::newInstance"
|
|
},
|
|
"Hooks": {
|
|
"BeforePageDisplayMobile": "Vector\\Hooks::onBeforePageDisplayMobile",
|
|
"GetPreferences": "Vector\\Hooks::onGetPreferences",
|
|
"PreferencesFormPreSave": "Vector\\Hooks::onPreferencesFormPreSave",
|
|
"UserGetDefaultOptions": "Vector\\Hooks::onUserGetDefaultOptions",
|
|
"LocalUserCreated": "Vector\\Hooks::onLocalUserCreated"
|
|
},
|
|
"@note": "When modifying skins.vector.styles definition, make sure the installer still works",
|
|
"ResourceModules": {
|
|
"skins.vector.styles": {
|
|
"class": "ResourceLoaderSkinModule",
|
|
"features": [ "elements", "content", "interface", "logo" ],
|
|
"targets": [
|
|
"desktop",
|
|
"mobile"
|
|
],
|
|
"styles": {
|
|
"resources/skins.vector.styles/screen.less": {
|
|
"media": "screen"
|
|
},
|
|
"resources/skins.vector.styles/screen-hd.less": {
|
|
"media": "screen and ( min-width: 982px )"
|
|
},
|
|
"resources/skins.vector.styles/print.less": []
|
|
}
|
|
},
|
|
"skins.vector.styles.responsive": {
|
|
"targets": [
|
|
"desktop",
|
|
"mobile"
|
|
],
|
|
"styles": [
|
|
"resources/skins.vector.styles.responsive.less"
|
|
]
|
|
},
|
|
"skins.vector.js": {
|
|
"scripts": [
|
|
"resources/skins.vector.js/collapsibleTabs.js",
|
|
"resources/skins.vector.js/vector.js"
|
|
],
|
|
"dependencies": [
|
|
"mediawiki.util"
|
|
]
|
|
}
|
|
},
|
|
"ResourceFileModulePaths": {
|
|
"localBasePath": "",
|
|
"remoteSkinPath": "Vector"
|
|
},
|
|
"ResourceModuleSkinStyles": {
|
|
"vector": {
|
|
"jquery.tipsy": "skinStyles/jquery.tipsy.less",
|
|
"jquery.ui": [
|
|
"skinStyles/jquery.ui/jquery.ui.core.css",
|
|
"skinStyles/jquery.ui/jquery.ui.theme.css",
|
|
"skinStyles/jquery.ui/jquery.ui.accordion.css",
|
|
"skinStyles/jquery.ui/jquery.ui.autocomplete.css",
|
|
"skinStyles/jquery.ui/jquery.ui.button.css",
|
|
"skinStyles/jquery.ui/jquery.ui.datepicker.css",
|
|
"skinStyles/jquery.ui/jquery.ui.dialog.css",
|
|
"skinStyles/jquery.ui/jquery.ui.menu.css",
|
|
"skinStyles/jquery.ui/jquery.ui.progressbar.css",
|
|
"skinStyles/jquery.ui/jquery.ui.resizable.css",
|
|
"skinStyles/jquery.ui/jquery.ui.selectable.css",
|
|
"skinStyles/jquery.ui/jquery.ui.slider.css",
|
|
"skinStyles/jquery.ui/jquery.ui.tabs.css",
|
|
"skinStyles/jquery.ui/jquery.ui.tooltip.css"
|
|
],
|
|
"+mediawiki.action.view.redirectPage": "skinStyles/mediawiki.action.view.redirectPage.less",
|
|
"+mediawiki.notification": "skinStyles/mediawiki.notification.less",
|
|
"+oojs-ui-core.styles": "skinStyles/ooui.less",
|
|
"mediawiki.special": "skinStyles/mediawiki.special.less",
|
|
"+ext.relatedArticles.readMore": "skinStyles/ext.relatedArticles.readMore.less"
|
|
}
|
|
},
|
|
"config": {
|
|
"VectorUseSimpleSearch": {
|
|
"value": true
|
|
},
|
|
"VectorUseIconWatch": {
|
|
"value": true
|
|
},
|
|
"VectorResponsive": {
|
|
"value": false
|
|
},
|
|
"VectorShowSkinPreferences": {
|
|
"value": true,
|
|
"description": "@var boolean Show skin-specific user preferences on the Special:Preferences appearance tab when true and hide them otherwise."
|
|
},
|
|
"VectorDefaultSkinVersion": {
|
|
"value": "2",
|
|
"description": "@var string:['2'|'1'] The version ('2' for latest, '1' for legacy) of the Vector skin to use for anonymous users and as a fallback."
|
|
},
|
|
"VectorDefaultSkinVersionForExistingAccounts": {
|
|
"value": "2",
|
|
"description": "@var string:['2'|'1'] The version ('2' for latest, '1' for legacy) of the Vector skin to use when an existing user has not specified a preference. This configuration is not used for new accounts (see VectorDefaultSkinVersionForNewAccounts) and is impermanent. In the future, this field may contains versions such as \"beta\" which when specified and the BetaFeatures extension is installed, and the user is enrolled, the latest version is used otherwise legacy."
|
|
},
|
|
"VectorDefaultSkinVersionForNewAccounts": {
|
|
"value": "2",
|
|
"description": "@var string:['2'|'1'] The version ('2' for latest, '1' for legacy) of the Vector skin to **set** for newly created user accounts. This configuration is not used for preexisting accounts (see VectorDefaultSkinVersion) and only ever executed once at new account creation time."
|
|
}
|
|
},
|
|
"ServiceWiringFiles": [
|
|
"includes/ServiceWiring.php"
|
|
],
|
|
"manifest_version": 2
|
|
}
|