mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-12 09:21:11 +00:00
457dcfc472
- Pull IntersectionObserver into new file to share observer with different callbacks: - Wrap show/hide functionality of sticky header in conditionals based on user test group or by default. - Fire hooks for scroll event tracking in WME. - Add new js for A/B test functions and variables: - Fire hook to send data for A/B test initialization. - Update main js to include scrollObserver, A/B test init functionality. - Add A/B test config. - Update ResourceLoader package dependencies for sticky header. - Though not a strict dependency, see I42e3e7c2084c1e88363d5d1662630ed23a28c4d2 in WME repo which uses these hooks to log scroll events. - This patch includes changes from I56f40e706f8706fde1c0891a0561dd32c5e02bfc which were consolidated here for simplicity and ease of review - related to T292587 which calls for logging an init event for bucketing of users during A/B testing. Bug: T292586 Change-Id: If6446e1e84cea3649905808c4f0e9f6862255fa3
410 lines
12 KiB
JSON
410 lines
12 KiB
JSON
{
|
|
"name": "Vector",
|
|
"version": "1.0.0",
|
|
"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.38.0"
|
|
},
|
|
"ValidSkinNames": {
|
|
"vector": {
|
|
"class": "SkinVector",
|
|
"@args": "See SkinVector::__construct for more detail.",
|
|
"args": [
|
|
{
|
|
"name": "vector",
|
|
"scripts": [
|
|
"skins.vector.es6",
|
|
"skins.vector.js"
|
|
],
|
|
"templateDirectory": "includes/templates",
|
|
"responsive": true,
|
|
"styles": [
|
|
"mediawiki.ui.button",
|
|
"skins.vector.styles",
|
|
"skins.vector.icons",
|
|
"mediawiki.ui.icon"
|
|
],
|
|
"messages": [
|
|
"tooltip-p-logo",
|
|
"vector-opt-out-tooltip",
|
|
"vector-opt-out",
|
|
"navigation-heading",
|
|
"vector-action-toggle-sidebar",
|
|
"vector-main-menu-tooltip",
|
|
"vector-menu-checkbox-expanded",
|
|
"vector-menu-checkbox-collapsed",
|
|
"vector-jumptonavigation",
|
|
"vector-jumptosearch",
|
|
"vector-jumptocontent",
|
|
"search",
|
|
"searchbutton",
|
|
"searcharticle",
|
|
"searchsuggest-search",
|
|
"sitesubtitle",
|
|
"sitetitle",
|
|
"tagline"
|
|
],
|
|
"link": {
|
|
"text-wrapper": {
|
|
"tag": "span"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"SkinLessImportPaths": {
|
|
"vector": "resources/mediawiki.less"
|
|
},
|
|
"MessagesDirs": {
|
|
"Vector": [
|
|
"i18n"
|
|
]
|
|
},
|
|
"AutoloadClasses": {
|
|
"SkinVector": "includes/SkinVector.php"
|
|
},
|
|
"AutoloadNamespaces": {
|
|
"Vector\\": "includes/"
|
|
},
|
|
"ConfigRegistry": {
|
|
"vector": "GlobalVarConfig::newInstance"
|
|
},
|
|
"Hooks": {
|
|
"SkinPageReadyConfig": "Vector\\Hooks::onSkinPageReadyConfig",
|
|
"GetPreferences": "Vector\\Hooks::onGetPreferences",
|
|
"PreferencesFormPreSave": "Vector\\Hooks::onPreferencesFormPreSave",
|
|
"LocalUserCreated": "Vector\\Hooks::onLocalUserCreated",
|
|
"OutputPageBodyAttributes": "Vector\\Hooks::onOutputPageBodyAttributes",
|
|
"MakeGlobalVariablesScript": "Vector\\Hooks::onMakeGlobalVariablesScript"
|
|
},
|
|
"@note": "When modifying skins.vector.styles definition, make sure the installer still works",
|
|
"ResourceModules": {
|
|
"skins.vector.search": {
|
|
"dependencies": [
|
|
"mediawiki.Uri",
|
|
"wvui-search"
|
|
],
|
|
"packageFiles": [
|
|
"resources/skins.vector.search/skins.vector.search.js",
|
|
"resources/skins.vector.search/instrumentation.js",
|
|
"resources/skins.vector.search/App.vue",
|
|
{
|
|
"name": "resources/skins.vector.search/config.json",
|
|
"callback": "Vector\\Hooks::getVectorWvuiSearchResourceLoaderConfig"
|
|
}
|
|
],
|
|
"messages": [
|
|
"searchbutton",
|
|
"searchresults",
|
|
"searchsuggest-containing"
|
|
]
|
|
},
|
|
"skins.vector.styles.legacy": {
|
|
"class": "ResourceLoaderSkinModule",
|
|
"features": {
|
|
"normalize": true,
|
|
"elements": true,
|
|
"logo": true,
|
|
"content-media": true,
|
|
"content-links": true,
|
|
"interface": true,
|
|
"interface-message-box": true,
|
|
"interface-category": true,
|
|
"content-tables": true,
|
|
"i18n-ordered-lists": true,
|
|
"i18n-all-lists-margins": true,
|
|
"i18n-headings": true
|
|
},
|
|
"targets": [
|
|
"desktop",
|
|
"mobile"
|
|
],
|
|
"styles": [
|
|
"resources/common/common.less",
|
|
"resources/skins.vector.styles.legacy/skin-legacy.less"
|
|
]
|
|
},
|
|
"skins.vector.styles": {
|
|
"class": "ResourceLoaderSkinModule",
|
|
"features": {
|
|
"normalize": true,
|
|
"elements": true,
|
|
"content-links": true,
|
|
"content-media": true,
|
|
"content-tables": true,
|
|
"interface": true,
|
|
"interface-message-box": true,
|
|
"interface-category": true,
|
|
"i18n-ordered-lists": true,
|
|
"i18n-all-lists-margins": true,
|
|
"i18n-headings": true
|
|
},
|
|
"targets": [
|
|
"desktop",
|
|
"mobile"
|
|
],
|
|
"styles": [
|
|
"resources/common/common.less",
|
|
"resources/skins.vector.styles/skin.less"
|
|
],
|
|
"lessMessages": [
|
|
"parentheses-start",
|
|
"parentheses-end"
|
|
]
|
|
},
|
|
"skins.vector.icons.js": {
|
|
"selectorWithVariant": ".mw-ui-icon-wikimedia-{name}-{variant}:before",
|
|
"selectorWithoutVariant": ".mw-ui-icon-wikimedia-{name}:before",
|
|
"useDataURI": false,
|
|
"defaultColor": "#000",
|
|
"class": "ResourceLoaderOOUIIconPackModule",
|
|
"variants": [],
|
|
"icons": [
|
|
"history",
|
|
"speechBubbles",
|
|
"edit",
|
|
"editLock",
|
|
"wikiText"
|
|
]
|
|
},
|
|
"skins.vector.icons": {
|
|
"selectorWithVariant": ".mw-ui-icon-wikimedia-{name}-{variant}:before",
|
|
"selectorWithoutVariant": ".mw-ui-icon-wikimedia-{name}:before",
|
|
"useDataURI": false,
|
|
"defaultColor": "#000",
|
|
"class": "ResourceLoaderOOUIIconPackModule",
|
|
"variants": [],
|
|
"icons": [
|
|
"language",
|
|
"ellipsis",
|
|
"userAvatar",
|
|
"userTalk",
|
|
"markup",
|
|
"search",
|
|
"settings",
|
|
"labFlask",
|
|
"unStar",
|
|
"userContributions",
|
|
"logIn",
|
|
"logOut",
|
|
"imageGallery",
|
|
"userGroup"
|
|
]
|
|
},
|
|
"skins.vector.es6": {
|
|
"es6": true,
|
|
"packageFiles": [
|
|
"resources/skins.vector.es6/main.js",
|
|
"resources/skins.vector.es6/searchToggle.js",
|
|
"resources/skins.vector.es6/stickyHeader.js",
|
|
"resources/skins.vector.es6/scrollObserver.js",
|
|
"resources/skins.vector.es6/AB.js",
|
|
{
|
|
"name": "resources/skins.vector.es6/config.json",
|
|
"callback": "Vector\\Hooks::getVectorResourceLoaderConfig"
|
|
}
|
|
],
|
|
"dependencies": [
|
|
"skins.vector.icons.js",
|
|
"mediawiki.page.ready",
|
|
"mediawiki.util",
|
|
"mediawiki.experiments"
|
|
]
|
|
},
|
|
"skins.vector.js": {
|
|
"packageFiles": [
|
|
"resources/skins.vector.js/skin.js",
|
|
{
|
|
"name": "resources/skins.vector.js/config.json",
|
|
"callback": "Vector\\Hooks::getVectorResourceLoaderConfig"
|
|
},
|
|
"resources/skins.vector.js/dropdownMenus.js",
|
|
"resources/skins.vector.js/sidebar.js",
|
|
"resources/skins.vector.legacy.js/collapsibleTabs.js",
|
|
"resources/skins.vector.legacy.js/vector.js",
|
|
"resources/skins.vector.js/languageButton.js",
|
|
"resources/skins.vector.js/searchLoader.js"
|
|
],
|
|
"dependencies": [
|
|
"skins.vector.icons.js",
|
|
"mediawiki.page.ready",
|
|
"mediawiki.util"
|
|
],
|
|
"messages": [ "vector-search-loader" ]
|
|
},
|
|
"skins.vector.legacy.js": {
|
|
"packageFiles": [
|
|
"resources/skins.vector.legacy.js/skin-legacy.js",
|
|
"resources/skins.vector.legacy.js/collapsibleTabs.js",
|
|
"resources/skins.vector.legacy.js/vector.js"
|
|
],
|
|
"dependencies": [
|
|
"mediawiki.page.ready",
|
|
"mediawiki.util"
|
|
]
|
|
}
|
|
},
|
|
"ResourceFileModulePaths": {
|
|
"localBasePath": "",
|
|
"remoteSkinPath": "Vector"
|
|
},
|
|
"ResourceModuleSkinStyles": {
|
|
"vector": {
|
|
"+ext.echo.styles.alert": "skinStyles/ext.echo.styles.alert.less",
|
|
"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": {
|
|
"VectorSearchHost": {
|
|
"value": "",
|
|
"description": "Override default search API. Can be used with $wgDisableTextSearch and $wgSearchForwardUrl to mimic user experience on production."
|
|
},
|
|
"VectorUseIconWatch": {
|
|
"value": true
|
|
},
|
|
"VectorMaxWidthOptions": {
|
|
"value": {
|
|
"exclude": {
|
|
"mainpage": false,
|
|
"querystring": {
|
|
"action": "history",
|
|
"diff": "*"
|
|
},
|
|
"namespaces": [
|
|
-1,
|
|
14
|
|
]
|
|
},
|
|
"include": [
|
|
"Special:Preferences"
|
|
]
|
|
},
|
|
"description": "options for configuring where where max-width should and should not apply. More details can be found in Hooks::shouldDisableMaxWidth PHP documentation."
|
|
},
|
|
"VectorResponsive": {
|
|
"value": false,
|
|
"description": "@var boolean When wgVectorDefaultSkinVersion is set to 2, turn Vector into a responsive skin by applying a view port and disabling the min-width"
|
|
},
|
|
"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": "1",
|
|
"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. The value is _not_ persisted."
|
|
},
|
|
"VectorDefaultSkinVersionForExistingAccounts": {
|
|
"value": "1",
|
|
"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. The value is _not_ persisted."
|
|
},
|
|
"VectorDefaultSkinVersionForNewAccounts": {
|
|
"value": "1",
|
|
"description": "@var string:['2'|'1'] The version ('2' for latest, '1' for legacy) of the Vector skin to **set** for newly created user accounts. **The value is persisted as a user preference.** This configuration is not used for preexisting accounts (see VectorDefaultSkinVersionForExistingAccounts) and only ever executed once at new account creation time."
|
|
},
|
|
"VectorUseWvuiSearch": {
|
|
"value": true
|
|
},
|
|
"VectorSearchTreatmentABTest": {
|
|
"value": false,
|
|
"description": "@var boolean Enables or disables the search treatment A/B test. See https://phabricator.wikimedia.org/T261647 and associated tasks for additional detail."
|
|
},
|
|
"VectorWvuiSearchOptions": {
|
|
"value": {
|
|
"showThumbnail": true,
|
|
"showDescription": true
|
|
}
|
|
},
|
|
"VectorDefaultSidebarVisibleForAuthorisedUser": {
|
|
"value": true
|
|
},
|
|
"VectorDefaultSidebarVisibleForAnonymousUser": {
|
|
"value": false
|
|
},
|
|
"VectorLanguageInHeader": {
|
|
"value": {
|
|
"logged_in": false,
|
|
"logged_out": false
|
|
},
|
|
"description": "@var array Moves the language links from the sidebar into a menu beside the page title. Also moves the indicators to the line below, next to the tagline (siteSub)."
|
|
},
|
|
"VectorLanguageInHeaderTreatmentABTest": {
|
|
"value": false,
|
|
"description": "@var boolean Enables or disables the language in header treatment A/B test. See https://phabricator.wikimedia.org/T280825 and associated tasks for additional detail."
|
|
},
|
|
"VectorStickyHeader": {
|
|
"value": {
|
|
"logged_in": false,
|
|
"logged_out": false
|
|
},
|
|
"description": "@var array Enables a persistent header that allows quick access to user links, editing tools, search and other links while scrolling down a page"
|
|
},
|
|
"VectorStickyHeaderEdit": {
|
|
"value": {
|
|
"logged_in": true,
|
|
"logged_out": false
|
|
},
|
|
"description": "@var array Enables the edit icons if $wgVectorStickyHeader is true."
|
|
},
|
|
"VectorWebABTestEnrollment": {
|
|
"value": {
|
|
"name": "vector.sticky_header_2021_11",
|
|
"enabled": false,
|
|
"buckets": {
|
|
"unsampled": {
|
|
"samplingRate": "0.1"
|
|
},
|
|
"control": {
|
|
"samplingRate": "0.3"
|
|
},
|
|
"stickyHeaderDisabled": {
|
|
"samplingRate": "0.3"
|
|
},
|
|
"stickyHeaderEnabled": {
|
|
"samplingRate": "0.3"
|
|
}
|
|
}
|
|
},
|
|
"description": "An associative array of A/B test configs keyed by parameters noted in mediawiki.experiments.js."
|
|
},
|
|
"VectorDisableSidebarPersistence": {
|
|
"value": false,
|
|
"description": "@var boolean Temporary feature flag that disables saving the sidebar expanded/collapsed state as a user-preference (triggered via clicking the main menu icon). This is intended as a temporary kill-switch in the event that the DB is overloaded with writes to the user_options table."
|
|
}
|
|
},
|
|
"ServiceWiringFiles": [
|
|
"includes/ServiceWiring.php"
|
|
],
|
|
"manifest_version": 2
|
|
}
|