Define unsupported skins

Previously UniversalLanguageSelector relied on the targets system
meaning the modules ext.uls.interface,
ext.uls.interlanguage and ext.uls.pt were
loaded on Minerva desktop skin unnecessarily and silently removed
on MobileFrontend which throws a warning.

Instead of doing this, check the skin

Bug: T237036
Bug: T235712
Change-Id: Ib38b041533cf959c3c4c30decc65869995c254fa
This commit is contained in:
jdlrobson authored and jenkins-bot committed 2020-07-28 14:55:40 +00:00
1 parent dc4937eb1f
commit b5aff8a06b
2 files changed
+13 -1

No files matched your search

+8
View File
@@ -242,6 +242,7 @@
"remoteExtPath": "UniversalLanguageSelector/resources" "remoteExtPath": "UniversalLanguageSelector/resources"
}, },
"ext.uls.interface": { "ext.uls.interface": {
"targets": [ "desktop", "mobile" ],
"scripts": "js/ext.uls.interface.js", "scripts": "js/ext.uls.interface.js",
"styles": "css/ext.uls.interface.less", "styles": "css/ext.uls.interface.less",
"dependencies": [ "dependencies": [
@@ -261,6 +262,7 @@
"remoteExtPath": "UniversalLanguageSelector/resources" "remoteExtPath": "UniversalLanguageSelector/resources"
}, },
"ext.uls.interlanguage": { "ext.uls.interlanguage": {
"targets": [ "desktop", "mobile" ],
"styles": "css/ext.uls.interlanguage.less", "styles": "css/ext.uls.interlanguage.less",
"localBasePath": "resources", "localBasePath": "resources",
"remoteExtPath": "UniversalLanguageSelector/resources" "remoteExtPath": "UniversalLanguageSelector/resources"
@@ -304,6 +306,10 @@
"remoteExtPath": "UniversalLanguageSelector/resources" "remoteExtPath": "UniversalLanguageSelector/resources"
}, },
"ext.uls.preferences": { "ext.uls.preferences": {
"targets": [
"desktop",
"mobile"
],
"scripts": "js/ext.uls.preferences.js", "scripts": "js/ext.uls.preferences.js",
"dependencies": [ "dependencies": [
"mediawiki.user", "mediawiki.user",
@@ -318,6 +324,7 @@
"remoteExtPath": "UniversalLanguageSelector/resources" "remoteExtPath": "UniversalLanguageSelector/resources"
}, },
"ext.uls.pt": { "ext.uls.pt": {
"targets": [ "desktop", "mobile" ],
"styles": "css/ext.uls.pt.less", "styles": "css/ext.uls.pt.less",
"localBasePath": "resources", "localBasePath": "resources",
"skinStyles": { "skinStyles": {
@@ -326,6 +333,7 @@
"remoteExtPath": "UniversalLanguageSelector/resources" "remoteExtPath": "UniversalLanguageSelector/resources"
}, },
"ext.uls.webfonts": { "ext.uls.webfonts": {
"targets": [ "desktop", "mobile" ],
"scripts": "js/ext.uls.webfonts.js", "scripts": "js/ext.uls.webfonts.js",
"dependencies": [ "dependencies": [
"ext.uls.common", "ext.uls.common",
+5 -1
View File
@@ -116,8 +116,12 @@ class UniversalLanguageSelectorHooks {
* @param Skin $skin * @param Skin $skin
* Hook: BeforePageDisplay * Hook: BeforePageDisplay
*/ */
public static function addModules( OutputPage $out, $skin ) { public static function addModules( OutputPage $out, Skin $skin ) {
global $wgULSPosition, $wgULSGeoService; global $wgULSPosition, $wgULSGeoService;
$unsupportedSkins = [ 'minerva' ];
if ( in_array( $skin->getSkinName(), $unsupportedSkins ) ) {
return;
}
// Soft dependency to Wikibase client. Don't enable CLL if links are managed manually. // Soft dependency to Wikibase client. Don't enable CLL if links are managed manually.
$excludedLinks = $out->getProperty( 'noexternallanglinks' ); $excludedLinks = $out->getProperty( 'noexternallanglinks' );