Commit Graph

112 Commits

Author SHA1 Message Date
Niklas Laxström
3367b51bbe Remove woff files
Bug: T318167
Change-Id: I54181a8ba084f0f1336dbe95389f046c9a987f2a
2024-05-04 14:56:46 +03:00
thiemowmde
7d5cb91cfe Use native str_contains/str_starts_with in a few more places
This makes the code quit a bit more readable, I believe.

Change-Id: I4aef30d5e20d095c421a13ad5104d64c71361c88
2024-04-04 08:58:37 +02:00
Umherirrender
cf3eece9e3 Drop RL targets definitions from module class
Now equal to the default in 1.40 - 01aec63c

Bug: T328497
Change-Id: Ibe7c9b81269a4d31fe26930b912d41191c1ac9ab
2024-01-24 00:16:09 +01:00
Umherirrender
b798142451 Use namespaced Html class
Bug: T355105
Change-Id: I1ce4f54bde95704d8414e26bff8bec67ba1ee5f0
2024-01-23 12:06:47 +00:00
Abijeet
ad5753ad40 Remove support for MediaWiki <= 1.39
With release of MediaWiki 1.41 we no longer need to support MW 1.39

Bug: T355105
Change-Id: I7957ca8aefee168ef11bc20905abd9944faecd73
2024-01-23 12:06:44 +00:00
NikG
5617a19b4e Clean up hacky code that avoids loading @wikimedia/codex in vector 2022
This code was introduced as a hotfix for avoiding loading @wikimedia/codex
module in vector 2022 skin, in I44835e672bce97a7d3a98d9d75c4805ee2cc448d.

Now that the issue has been properly handled after this patch
(I43551be73da2126fd84ffaa0d37faec58bc47135) has been merged,
we can remove this code.

Bug: T353850
Change-Id: I458a0a6835caedb25bfaa1c58800fb9ce849fb1b
2024-01-19 10:50:21 +00:00
NikG
0b7ae1dce6 Avoid loading ext.uls.compactlinks module for Vector 2022 skin
Bug: T353850
Change-Id: I43551be73da2126fd84ffaa0d37faec58bc47135
2024-01-16 10:43:26 +00:00
Fomafix
5142df9d42 Use namespaced ResourceLoader classes
This change requires MediaWiki >= 1.39 which is already required in
extension.json.

Change-Id: I25b820ddaab1775d021b1b708f989fb6d9fc2b27
2024-01-06 11:22:12 +00:00
Jon Robson
14e3be1cd3 Revise logic for creating compact links button on Vector 2022
The existing strpos code is not working and the code is loading on
Vector 2022, it also appears to be required on Vector 2022 as without
it the language button does not appear to work (these should be
decoupled in a later patch)

The easiest possible solution here, is to move the check to the
client side and not create the trigger button in Vector 2022. e.g. do
the equivalent check for the node existence in the client instead
of the server side.

Bug: T353850
Change-Id: I44835e672bce97a7d3a98d9d75c4805ee2cc448d
2024-01-04 04:09:32 +00:00
Jdlrobson
6f9ffac1c3 Use Codex styles for buttons in language overlay (attempt 2)
* Replace all instances of mw-ui markup with Codex markup
* Use codex-search-styles
* Where codex-search-styles is not installed (e.g. 1.39)
register an alias which points to @wikimedia/codex as that is
available.

Bug: T340255
Bug: T340257
Change-Id: I4f3ddfb68ea6c033ee7a49729187f4ddbc8abe5c
2023-12-20 18:53:41 +05:30
Aaron Schulz
31c7ca143c Add API help URL to ApiLanguageSearch
Bug: T342632
Change-Id: I04ed5c5542365063929229e91f4f7e78f078f1d9
2023-10-18 02:05:46 +00:00
Abijeet
2434939475 Save preferred language only for named users
Bug: T337780
Change-Id: I6238ad1d64b60ec0ca62e696fed04e9742877d65
2023-08-21 09:17:42 +00:00
Jon Robson
c00567ac4e Display the language button on pages without languages
This restores the language button on the user page and main page
for Vector 2022 for pages which have no languages

Bug: T315036
Change-Id: I65e638f05bf1fd6451fa33bd9d8fc660ee45b87e
2023-06-27 06:16:28 +00:00
Jon Robson
bcbe6fc705 Correct the logic for the ULS settings cog for Vector 2022
Bug: T315036
Change-Id: I9fe711cee57ee07dabba5c04f3c7faa5eb82a2c4
2023-06-22 08:44:18 +00:00
Ed Sanders
81cfb348cb Always use the strict equality flag when using in_array
Change-Id: I8ce7209c03bb054b2a9ad96c7d5897d081b4e27e
2023-06-06 13:36:56 +01:00
Winston Sung
a24e94265e UniversalLanguageSelector: Fix BCP 47 language code detection
Some browsers use formats like "zh-Hant-TW", the current detection
 cannot handle them correctly.

Bug: T337665
Change-Id: I0db11a20e219d4cf66832aeee67d59bf3ec41a62
2023-05-31 09:49:46 +00:00
Niklas Laxström
7d20f15b17 Remove ULSMobileWebfontsEnabled
To my knowledge never used since it was added in in 2013 with
commit fd885d9881.

Bug: T332837
Change-Id: Ia9ecb3e4dd47b8ce4dfaaa489a1ec5a71c378492
2023-04-05 06:21:40 +00:00
NikG
613276ca89 ULS: Display "Page contents not supported" body in missing and talk pages
Instead of displaying the empty state for all non-content pages, we
should check whether the page is missing or if it's a talk page instead.

Also use the term "subject page" to align with existing functions
of Title and NamespaceInfo.

Bug: T316559
Bug: T326788
Change-Id: I0f50898b6e9817aee2bcfba38e69c67ae041a14b
2023-01-16 12:29:18 +02:00
NikG
965ffc3b1a Add language settings button inside dropdown for non-content pages
NOTE: This patch is identical to patch with change-id:
Ifdf2a529b30e5a2df8867b606a525c9f7b3bdb6c

The above patch has been merged but reverted because of the usage
of '$skin->getTemplateDate()' method, which should be avoided. The
current patch replaces the usage of this method, with the usage of
the output page title ($out->getTitle()). All the rest of the code
has been kept the same.

Bug: T316559
Change-Id: Ibef9f6fd46d9055c3e0865905fb8aa8d031c1940
2023-01-11 18:05:29 +02:00
Jdlrobson
570a7d3b4e Revert "Add language settings button inside dropdown for non-content pages"
This reverts commit 5d576d05b4.

Reason for revert: Using Skin::getTemplateData method outside the
skin rendering layer is dangerous and likely a performance issue as
it means generating the rendering data twice and makes various hooks
execute multiple times.
It has caused T326538 and may be causing other issues.

Bug: T326538
Change-Id: Ie5d079deae414eb199d2a40b98d04b57439eaac4
2023-01-09 20:25:46 +00:00
NikG
5d576d05b4 Add language settings button inside dropdown for non-content pages
Bug: T316559
Change-Id: Ifdf2a529b30e5a2df8867b606a525c9f7b3bdb6c
2023-01-09 05:02:57 +00:00
Umherirrender
9cdbe0ff44 Replace deprecated Language::getFallbacksFor
Bug: T325979
Change-Id: Iccc02c9646f9ba119bdfa0eb71c348b2346dda11
2022-12-29 17:56:50 +00:00
Umherirrender
61256e25b7 Use LanguageNameUtils::AUTONYMS/SUPPORTED instead of hard coded value
Easier to spot the documentation what happen with this option

Change-Id: I977485c2cba0063b5bdee3724d9262b75341faec
2022-12-29 13:41:24 +01:00
Umherirrender
7ea30c85bf Replace deprecated Language::fetchLanguageNames
Bug: T325962
Change-Id: I8d5724cd9b79639a0b2001759a70b8d8106c74ee
2022-12-27 17:22:26 +01:00
Fomafix
e44e4c4c0c Remove phpcs exclude rules and update PHP code
Change-Id: Ie37deda368a4d163cf324988721033829ae8af77
2022-11-13 18:33:34 +00:00
NikG
8a55528772 Compact language list preference should be ignored for Vector 2022 skin
The Compact language list preference was intended to control whether to
show all languages directly or show just a few of them (with option to
search for the rest) instead. However, with the new Vector 2022 skin,
there is only a button to access language selection and thus, this
setting should be ignored for this skin.

This patch modifies the "isCompactLinksEnabled" method inside Hooks
to always return true when the skin is set to Vector 2022 (when ULS
features are enabled).

Bug: T319690
Change-Id: Ic8a537d31ee4dad02932a04017f19537140e0c1c
2022-11-02 14:38:55 +00:00
Fomafix
35852fee74 Use WebRequest::getRawVal instead of WebRequest::getText
The UTF-8 normalization for the URL attributes `languagecode`, `uselang`
and `setlang` are not needed.

Change-Id: Ib204629fb15e2578bba09be4c40d0210eb81dd77
2022-08-24 06:19:52 +00:00
Jon Robson
06091efcd0 Limit ULSPosition check to non-Vector 2022 skins
I'm not sure what this is for, but it's definitely not needed
in Vector 2022 skin. It also prevents the uls-after-portlet-link
element from appearing inside the language button when ULS is disabled.

Bug: T275147
Change-Id: I8f6c1361040b72107f2d45bfc18e22d6b8f2021c
2022-07-28 04:32:43 +00:00
Abijeet
4632f33e6a Drop support for MediaWiki 1.36
Bug: T311510
Change-Id: I9bc2f91f274df1d37ebad639b42ee4b542274db9
2022-07-26 11:04:40 +00:00
Tim Starling
3524e733b9 Suppress PhanParamSignatureRealMismatchParamType on classes affected by new RL namespace
There is an alias, so there shouldn't be a problem in production. Phan
raises a spurious warning when the target version is PHP 7.2.

Bug: T308443
Change-Id: I75f1a1bd113a18c40236bd622b0eb76743432ceb
2022-05-25 02:47:45 +00:00
Thiemo Kreuz
78c25ebcf7 Fix-ups to comments and User interface usages
* Use isRegistered() from the more narrow UserIdentity interface.
* More specific type hints.
* Remove comments that literally repeat the code.

Change-Id: Icd0eaf8236be41b258efcf81d581540d2448e9e3
2022-04-20 09:54:25 +02:00
Reedy
f8eda0ca0c Use namespaced Babel class
Depends-On: I16411d99d97762606ed43e5a0093ff7ed1cfa0b8
Change-Id: I15ae2cd07b88991ed6f150e12af30bee9499dbdc
2022-03-06 14:41:56 +00:00
Reedy
430afafeb7 Use ExtensionRegistry to see if Babel is loaded
Change-Id: Iabc24b4580bab39a6d232d61e9c52a641cce41a3
2022-03-06 14:41:10 +00:00
Abijeet
6e6635bdbb Move version check inside PersonalUrls hook
Stop additional conditional hook if MW < 1.37, and move the check
to inside the hook itself

Bug: T299305
Change-Id: Ied1c5c0beee015d7b0a8d6bd750346f4a8a5aaa1
2022-01-24 09:24:43 +00:00
Abijeet
30986e6d9e Remove backward compatibility for MW <= 1.35
Bug: T298856
Change-Id: I1e635785d0a29d87f510e729b11fce9a2eb68e11
2022-01-18 12:51:07 +00:00
Reedy
f9532855ad Namespace extension
Change-Id: I79aa319f177589d85446888289568748cd63d1c5
2022-01-05 10:47:22 +00:00
Umherirrender
72c8cdb40b Use User object in UserGetLanguageObject hook only when safe to load
In case of error formatting the context language may set up before the
Setup.php is ended.

Bug: T267445
Change-Id: I4f07b30f75922884867bd14d654effc0e26a47f4
2021-11-29 13:59:30 +00:00
Fomafix
bd4a6f20a3 Update comment from addConfig to onResourceLoaderGetConfigVars
In f0c6bec1ac the function addConfig was
renamed to onResourceLoaderGetConfigVars.

Change-Id: I1fd7242b676e90366fbe5bfb95e6e0e3497b917f
2021-11-22 05:54:42 +00:00
Fomafix
c1a36d3490 Don't call isCompactLinksEnabled() twice in the same function
Store the result in a local variable.

Change-Id: Ie45c22c3af370b0cdcbe614497691b0bd849393f
2021-11-21 19:00:08 +00:00
Niklas Laxström
9cf8ca3305 Add apioutput to unsupported skins
There is nothing ULS can do here: there is no entry point to change
language or access settings, there is nothing to type.

One exception would be loading web fonts. But I would argue that
that is a small set of users, who can use Special:ApiSandbox or
the wiki help pages.

Bug: T145186
Change-Id: I71de2a58f007ff03b01c9edc5ed6bed0e6524c4e
2021-11-17 13:14:05 +00:00
Abijeet
defc3d416d ApiULSSetLanguage: Use LanguageNameUtils
Change-Id: I00e814894db4ba84f1d08c52db2993b59fbccf55
2021-11-16 18:36:23 +00:00
Abijeet
da4d965739 Replace usage of ApiBase::PARAM_* with ParamValidator::PARAM_*
Change-Id: I4c7c16f8b3380cdaf32fbedc9d33f12b14050774
2021-11-16 13:56:49 +00:00
Fomafix
f0c6bec1ac Use HookHandlers and inject services
This change also replaces the calls of deprecated functions from class
Language and replaces the global variables by the MainConfig.

Change-Id: Ice7273481a736cb138e263a9300bfd90fdcbb401
2021-11-04 14:00:31 +00:00
Fomafix
183bb97f74 ApiULSLocalization: Inject LanguageNameUtils
Replace deprecated Language::isValidCode by
LanguageNameUtils::isValidCode.

Change-Id: I2adef21fb37e78c163674008a4f9b1e5a74aa6a1
2021-10-29 13:14:31 +00:00
Abijeet
4d8131af10 MW 1.35: Re-add class attribute for ULS
Without the class attribute, the ULS does not open on MW <= 1.35.
This was changed in Ie9e30af5468aea9803d77c9a36e480ba2b2e86a0

Bug: T294021
Change-Id: I1bcf4e442e85f8848c5e4ff5609204602265b949
2021-10-28 08:08:29 +00:00
Daimona Eaytoy
005f7199ba Suppress taint-check false positive blocking CI
Bug: T294441
Change-Id: I8e060fa8cb7d90b742673a93a52f449920e1d6e9
2021-10-27 17:45:53 +02:00
Reedy
6f8763b3b2 Remove out of date comment in UniversalLanguageSelectorHooks::setVersionConstant()
PHP entry point is gone

Change-Id: I3f2093336a78fa081b4aee862788c793f586fb63
2021-10-07 02:46:33 +00:00
Reedy
b5ec74dc14 Use namespaced BetaFeatures class
Change-Id: I155ca6aa87160be29af1ee57bdd905314410bcf8
2021-10-01 14:38:47 +01:00
jdlrobson
9f92d7e759 Register meta data to allow Vector to handle display of this menu item
- Adjusts CSS to defer button/icon rendering to skins that support button
and icons e.g. Vector

Depends-On: Ib518858e06549f252d73d57fd4768f446cc561b9
Bug: T289630
Change-Id: Ie9e30af5468aea9803d77c9a36e480ba2b2e86a0
2021-09-03 19:21:21 +00:00
Jdlrobson
4c3907e61d Revert "Language button icon/button should be consistent with other buttons"
This reverts commit 5ca2ccb58a.

Reason for revert: Per Niklas's review (T289630#7324439)
I've also seen a much better way to do this which limits the change
to modern skins so I'll post a follow up shortly.

Change-Id: I99802c60390e23eaa0de21462788da622a35a37a
2021-09-01 15:35:05 +00:00