mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-27 17:10:19 +00:00
It should be possible to persist Vector font size for registered users
Bug: T346987 Change-Id: I01e0fac5ba781480ee32a8b32f6ef7fafb8d1ca5
This commit is contained in:
parent
fbc456b666
commit
d35db97615
|
@ -253,12 +253,12 @@ final class Constants {
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const CONFIG_KEY_FONT_SIZE = 'VectorCustomFontSize';
|
||||
public const PREF_KEY_FONT_SIZE = 'vector-font-size';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const FEATURE_FONT_SIZE = 'CustomFontSizeClientpref';
|
||||
public const FEATURE_FONT_SIZE = 'CustomFontSize';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
|
|
|
@ -145,6 +145,10 @@ class FeatureManager {
|
|||
$suffixEnabled = 'clientpref-1';
|
||||
$suffixDisabled = 'clientpref-0';
|
||||
break;
|
||||
case 'custom-font-size':
|
||||
$suffixEnabled = 'clientpref-enabled';
|
||||
$suffixDisabled = 'clientpref-disabled';
|
||||
break;
|
||||
default:
|
||||
// FIXME: Eventually this should not be necessary.
|
||||
$suffixEnabled = 'enabled';
|
||||
|
|
|
@ -619,6 +619,9 @@ class Hooks implements
|
|||
*/
|
||||
public function onGetPreferences( $user, &$prefs ): void {
|
||||
$vectorPrefs = [
|
||||
Constants::PREF_KEY_FONT_SIZE => [
|
||||
'type' => 'api'
|
||||
],
|
||||
Constants::PREF_KEY_PAGE_TOOLS_PINNED => [
|
||||
'type' => 'api'
|
||||
],
|
||||
|
|
|
@ -280,12 +280,12 @@ return [
|
|||
// Feature: T343928: Feature Font Size.
|
||||
// ================================
|
||||
$featureManager->registerRequirement(
|
||||
new OverridableConfigRequirement(
|
||||
$services->getMainConfig(),
|
||||
new UserPreferenceRequirement(
|
||||
$context->getUser(),
|
||||
$context->getRequest(),
|
||||
Constants::CONFIG_KEY_FONT_SIZE,
|
||||
Constants::REQUIREMENT_FONT_SIZE
|
||||
$services->getUserOptionsLookup(),
|
||||
Constants::PREF_KEY_FONT_SIZE,
|
||||
Constants::REQUIREMENT_FONT_SIZE,
|
||||
$context->getTitle()
|
||||
)
|
||||
);
|
||||
|
||||
|
|
10
skin.json
10
skin.json
|
@ -168,7 +168,8 @@
|
|||
"vector-limited-width": 1,
|
||||
"vector-page-tools-pinned": 1,
|
||||
"vector-main-menu-pinned": 1,
|
||||
"vector-toc-pinned": 1
|
||||
"vector-toc-pinned": 1,
|
||||
"vector-font-size": 0
|
||||
},
|
||||
"HookHandlers": {
|
||||
"VectorCentralAuthHooks": {
|
||||
|
@ -639,13 +640,6 @@
|
|||
"logged_out": false
|
||||
},
|
||||
"description": "@var boolean Temporary feature flag that enables the zebra design for the Vector skin."
|
||||
},
|
||||
"VectorCustomFontSize": {
|
||||
"value": {
|
||||
"logged_in": false,
|
||||
"logged_out": false
|
||||
},
|
||||
"description": "@var boolean feature flag that enables customizing the Vector font-size."
|
||||
}
|
||||
},
|
||||
"ServiceWiringFiles": [
|
||||
|
|
Loading…
Reference in a new issue