Make sure Vector skin preferences always follows skin
Sections can be nested. Using rendering/skin as the parent means that Vector's skin preference will always come straight after the skin preference and before Popups. A change in core is needed to update the selector for the element which shows/hides the subsection as well as provide a generic message key to replace the one inside this repository. Note: If the "Vector" specific heading is needed, we can achieve this with a little more work but that is a conversation for another time. Depends-On: Idd06bcfe7935e16732a6a95c1253dbf95c8aca2e Bug: T246162 Change-Id: I4be9764ddca186e5bfd493678afd62d446072e8f
This commit is contained in:
parent
48988c8ab0
commit
0ba99a1e97
|
@ -4,7 +4,6 @@
|
|||
},
|
||||
"skinname-vector": "Vector",
|
||||
"vector-skin-desc": "Modern version of MonoBook with fresh look and many usability improvements",
|
||||
"prefs-skin-prefs": "Vector skin preferences",
|
||||
"prefs-vector-enable-vector-1-label": "Use Legacy Vector",
|
||||
"prefs-vector-enable-vector-1-help": "Over the next few years, we will be gradually updating the Vector skin. Legacy Vector will allow you to view the old version of Vector (as of December 2019). To learn more about the updates, go to our [[mw:Reading/Web/Desktop_Improvements|project page]].",
|
||||
"vector.css": "/* All CSS here will be loaded for users of the Vector skin */",
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
},
|
||||
"skinname-vector": "{{name}}",
|
||||
"vector-skin-desc": "{{desc|what=skin|name=Vector|url=https://www.mediawiki.org/wiki/Skin:Vector}}",
|
||||
"prefs-skin-prefs": "Title for Vector-specific user preferences shown on Special:Preferences.",
|
||||
"prefs-vector-enable-vector-1-label": "Label for the checkbox to force Legacy Vector operation accessible via Special:Preferences. When this checkbox is enabled, the December 2019 of Vector is used. When this checkbox is disabled, the actively developed version of Vector is used instead.",
|
||||
"prefs-vector-enable-vector-1-help": "Detail explaining the operation of the prefs-vector-enable-vector-1-label checkbox.",
|
||||
"vector.css": "{{optional}}",
|
||||
|
|
|
@ -54,7 +54,7 @@ class Hooks {
|
|||
'help-message' => 'prefs-vector-enable-vector-1-help',
|
||||
// The tab location and title of the section to insert the checkbox. The bit after the slash
|
||||
// indicates that a prefs-skin-prefs string will be provided.
|
||||
'section' => 'rendering/skin-prefs',
|
||||
'section' => 'rendering/skin/skin-prefs',
|
||||
// Convert the preference string to a boolean presentation.
|
||||
'default' =>
|
||||
$user->getOption( Constants::PREF_KEY_SKIN_VERSION ) === Constants::SKIN_VERSION_LATEST ?
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
use Vector\Hooks;
|
||||
|
||||
const SKIN_PREFS_SECTION = 'rendering/skin/skin-prefs';
|
||||
|
||||
/**
|
||||
* Integration tests for Vector Hooks.
|
||||
*
|
||||
|
@ -53,7 +55,7 @@ class VectorHooksTest extends \MediaWikiTestCase {
|
|||
'type' => 'toggle',
|
||||
'label-message' => 'prefs-vector-enable-vector-1-label',
|
||||
'help-message' => 'prefs-vector-enable-vector-1-help',
|
||||
'section' => 'rendering/skin-prefs',
|
||||
'section' => SKIN_PREFS_SECTION,
|
||||
// '1' is enabled which means Legacy.
|
||||
'default' => '1',
|
||||
'hide-if' => [ '!==', 'wpskin', 'vector' ]
|
||||
|
@ -89,7 +91,7 @@ class VectorHooksTest extends \MediaWikiTestCase {
|
|||
'type' => 'toggle',
|
||||
'label-message' => 'prefs-vector-enable-vector-1-label',
|
||||
'help-message' => 'prefs-vector-enable-vector-1-help',
|
||||
'section' => 'rendering/skin-prefs',
|
||||
'section' => SKIN_PREFS_SECTION,
|
||||
// '1' is enabled which means Legacy.
|
||||
'default' => '1',
|
||||
'hide-if' => [ '!==', 'wpskin', 'vector' ]
|
||||
|
@ -130,7 +132,7 @@ class VectorHooksTest extends \MediaWikiTestCase {
|
|||
'type' => 'toggle',
|
||||
'label-message' => 'prefs-vector-enable-vector-1-label',
|
||||
'help-message' => 'prefs-vector-enable-vector-1-help',
|
||||
'section' => 'rendering/skin-prefs',
|
||||
'section' => SKIN_PREFS_SECTION,
|
||||
// '0' is disabled (which means latest).
|
||||
'default' => '0',
|
||||
'hide-if' => [ '!==', 'wpskin', 'vector' ]
|
||||
|
|
Loading…
Reference in New Issue