Commit graph

106565 commits

Author SHA1 Message Date
Nicholas Ray
45c003e1ce Change checkboxHack bindToggleOnSpaceEnter function
This refactors the bindToggleOnSpaceEnter function to use keydown and
keyup listeners to provide the space/enter key functionality. This
provides the following benefits:

* A click event is triggered when pressing the space or enter key on the
passed in "button" element. This simulates native button behavior which
triggers a click event when these keys are pressed.

* Checkboxhack menus will no longer toggle rapidly when holding down the
space/enter keys.

Bug: T291096
Change-Id: I1ea65112fa6b527f1bd9118212838298399996aa
2021-10-27 17:06:17 -06:00
jenkins-bot
7766b0206e Merge "Give skins more flexibility over table of contents render" 2021-10-27 23:02:57 +00:00
Nicholas Ray
d99dd4040e [BREAKING] Change cleanup API of checkboxHack
Before this commit, each bind function would return an object containing
a reference to the function used in the event listener creation with the
intention that this could later be used to cleanup the event listeners.
This is problematic for the following reasons:

* In order to cleanup the event listener, it forces the client to know
which element the event listener was added to (button, checkbox,
document, window, etc.),. the event type that was used ('click',
'focusin', etc), and whether or not the "useCapture" param was also
used. The `removeEventListener` API won't remove the correct event
listener unless these three pieces of info are known by the client [1].

* Because the above point is tricky to get right, numerous potential
memory leaks were possible with the `unbind` function as the
`useCapture` param wasn't being passed in some cases.

This commit aims to simplify the cleanup API by returning an anonymous
function in each bind function that the client can call to cleanup the
relevant event listeners without knowing any of the implementation
details. This also makes the `unbind` function unnecessary.

** This is a breaking change to the checkboxHack API ** but because
there aren't any known clients of the return values [2], a formal
deprecation process was assumed to be unnecessary. Note gadgets should
not be using the internal function mw.loader.require so these were
not considered.

[1] https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener#matching_event_listeners_for_removal
[2] https://codesearch.wmcloud.org/search/?q=checkboxHack&i=nope&files=&excludeFiles=&repos=

Bug: T291096
Change-Id: Ia2d79f27dd81fdc74a44829da3ca472f4c01d4b5
2021-10-27 18:25:49 +00:00
jenkins-bot
b2d441658f Merge "Upgrade RemexHtml to 3.0.0" 2021-10-27 17:27:46 +00:00
jenkins-bot
94ff9fc6cd Merge "Selected links should not be red." 2021-10-27 16:42:17 +00:00
Tim Starling
6273b5f932 Upgrade RemexHtml to 3.0.0
This is required by Parsoid 0.15.0-a6.

I don't need to increment the Parsoid version here since it is
not using semantic versioning. The caret will allow upgrades until the
Glorious Future of 1.0.0.

Depends-On: I72346a431f556555410f6af64bdb10140ea9bd8a
Change-Id: Idefebb725444d244252623533b8469214324f931
2021-10-27 16:29:18 +00:00
Translation updater bot
d27bf77b4d Localisation updates from https://translatewiki.net.
Change-Id: I632bb2ded31697298118a1ce38efd86333374810
2021-10-27 08:07:55 +02:00
jenkins-bot
fdaf95c524 Merge "ApiQueryImageInfo: don't show empty comments as deleted" 2021-10-26 19:59:25 +00:00
Petr Pchelko
392d2af20c ApiQueryImageInfo: don't show empty comments as deleted
Bug: T293783
Change-Id: Icddd06c7171bc1d1dba14ec7d6703e082b87836a
2021-10-26 11:36:09 -07:00
jdlrobson
8e16fa453e Selected links should not be red.
Bug: T236608
Change-Id: I949b51c0efcb883ce0d9dac4fbae956fdc467be9
2021-10-26 16:13:06 +00:00
jenkins-bot
e0f7759256 Merge "Hard deprecate LinkCache::addGoodLinkObj" 2021-10-26 15:51:05 +00:00
vladshapik
1ae8e89eb5 Hard deprecate LinkCache::addGoodLinkObj
LinkCache::addGoodLinkObj was hard deprecated.
Use addGoodLinkObjFromRow() instead. PHPUnit tests
must use LinkCacheTestTrait::addGoodLinkObject().

Bug: T284955
Change-Id: I0c22be2f00e6d6d4ba6dd1511c5385cad55e8ff7
2021-10-26 18:21:32 +03:00
jenkins-bot
3327b4a1a1 Merge "Cleanup hard-deprecated code in blocks." 2021-10-26 14:41:09 +00:00
jenkins-bot
b98d8b6060 Merge "Make SlotRecordTest a unit test" 2021-10-26 14:17:50 +00:00
Petr Pchelko
25bb5b296a Cleanup hard-deprecated code in blocks.
Change-Id: I1b3f4a0f072197c6b3dc6c9a80fcb2946aeb6360
2021-10-26 06:44:05 -07:00
Petr Pchelko
164ec5cb29 UserOptions: remove deprecated hooks.
After the hooks were removed we are finally ready to stop
reading user options from primary before writing them on save.
The new save hooks only work on modified options, so options
saving code can be significantly simplified.

Change-Id: I48df616c9f35d9a0b2801ada1b7dbef0bd4ad058
2021-10-26 12:55:01 +00:00
jenkins-bot
cf81b18f25 Merge "Add namespace translations for [ami] Amis and [pwn] Paiwan" 2021-10-26 12:14:52 +00:00
Winston Sung
6eda8891a0 Update 台灣 to 臺灣 according to Wikipedia-zh village pump discussions
https://zh.wikipedia.org/wiki/Wikipedia:互助客栈/其他/存档/2019年2月?oldid=61018059#「台灣」「正體」?

Follow-up of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/700626

Change-Id: I6d2a128f682e71312400b97333ffbfffe9968ee7
2021-10-26 11:02:07 +00:00
jenkins-bot
9b05a56a5d Merge "resourceloader: Change User::isAnon to !User::isRegistered" 2021-10-26 09:45:37 +00:00
Amir E. Aharoni
6167f3df7d Hyphenate "case-sensisitive", as in the main en.json
Change-Id: I0e4b7f5d64926b265b10e80337d56986e2196fca
2021-10-26 11:39:29 +03:00
Translation updater bot
46e3a4e4b1 Localisation updates from https://translatewiki.net.
Change-Id: Iece5c7db9af2969ed364cc36c3a0f0313a15ec6f
2021-10-26 07:59:41 +02:00
Paladox
bc931b1253 JobQueueRedis: Replace deprecated zSize with zCard
https://github.com/phpredis/phpredis/issues/1669

Change-Id: I15f1e398d45d699c3e683164e42ea6c0dc974d96
2021-10-26 01:28:27 +00:00
jenkins-bot
d419c67579 Merge "RELEASE-NOTES-1.37: Note that we require PHP 7.4.2+ and not PHP 8.0" 2021-10-26 00:02:14 +00:00
jdlrobson
24949480eb Give skins more flexibility over table of contents render
* Do not store table of contents in parser output
* Instead inject table of contents via strpos where needed
  inside Article based on Skin "toc" option
* Use <mw:tocplace> as a TOC placeholder; for Parsoid compatibility
  this will be replaced with a <meta> tag in a followup patch.

Bug: T287767
Change-Id: I44045b3b9e78e7ab793da3f37e3c0dbc91cd7d39
2021-10-25 22:26:41 +00:00
Jon Harald Søby
8210560bb4 Add namespace translations for [ami] Amis and [pwn] Paiwan
Add namespace translations for these two languages.
Also add namespace aliases for straight apostrophe (') to
typographical apostrophe (’), so that links will still work
if someone uses the wrong one by mistake. This is also done
for [tay] Atayal language.

Also harmonizing fallback languages to be the same as for
other Taiwanese aboriginal languages (i.e. 'zh-tw, zh-hant,
zh-hans').

Bug: T292414
Bug: T292415
Change-Id: I755a0672ad05588d3e4352ea74d8c4854d9571a4
2021-10-25 22:19:52 +00:00
jenkins-bot
4cd4eec36f Merge "Reapply "Update user_touched after saving user options."" 2021-10-25 21:10:43 +00:00
Ppchelko
8ff180948c Reapply "Update user_touched after saving user options."
This reverts commit 4d19d06455.

Reason for revert: CenralAuth tests fixed

Bug: T284354
Depends-On: I9d681baeca0df4808335e7bececfd114cdad2f0e
Change-Id: I483b8f61dcfae70c5a50399391b361cf5310ae24
2021-10-25 20:28:07 +00:00
jenkins-bot
226dbef3f6 Merge "user: Add default value for all "variant" user option keys" 2021-10-25 20:07:36 +00:00
jenkins-bot
c0ba482b44 Merge "Make TitleValue fields private" 2021-10-25 20:04:58 +00:00
Umherirrender
1b334a48e9 user: Add default value for all "variant" user option keys
Without a default the preference is treat as unknown and possible values
identical to the default are not excluded from javascript code or
database.

Bug: T291748
Change-Id: I37cf1cd87a5ef1fd91aba0c3cc4b0e3f9c9c08b4
2021-10-25 19:45:59 +00:00
Tks4Fish
76e3701d6a OutputPage: Remove $wgLoggedOutMaxAge experiment and related tests
Bug: T293848
Change-Id: I5e5e52fac7fe389b36715dae11cc30cdb2b9136a
2021-10-25 19:33:32 +00:00
jenkins-bot
98fbea6293 Merge "Fix PHP warning with some inputs to wfCgiToArray()" 2021-10-25 18:58:01 +00:00
jenkins-bot
f6f6c748a6 Merge "mediawiki.action.edit, mediawiki.page.watch.ajax: Move var declarations inline" 2021-10-25 17:23:58 +00:00
Alexander Vorwerk
4d19d06455 Revert: "Update user_touched after saving user options."
This reverts commit 98878c08ba.

reason for revert: had some weird and unwanted side effects

Bug: T294265
Change-Id: I53c2175498af5b37096505dae011e65cebf029aa
2021-10-25 16:33:10 +00:00
jenkins-bot
abc03533d5 Merge "Consistent hyphenation of "case-sensitive" in messages" 2021-10-25 16:19:33 +00:00
Petr Pchelko
045d04ca2b Make TitleValue fields private
Class is extended only in JsonConfig extension, but
these fields are not accessed.

The @deprecated annotation was put in there to prevent
external access, since the fields were protected we can't
use DeprecationHelper to hard deprecate. The class is
not @stable to extend, so for all intents and purposes
protected is equivalent to private.

Change-Id: I30089cf1f1361bf8f8c544316e422581ac7aea64
2021-10-25 08:17:58 -07:00
Ed Sanders
11ed9f9831 mediawiki.action.edit, mediawiki.page.watch.ajax: Move var declarations inline
Change-Id: I2b0a4ce806d0f3354c785d60d0cb596f50e93936
2021-10-25 16:05:56 +01:00
jenkins-bot
a4b5426e4c Merge "Type-hint LinkTarget" 2021-10-25 14:53:17 +00:00
jenkins-bot
2bd3e49169 Merge "Update user_touched after saving user options." 2021-10-25 14:48:26 +00:00
jenkins-bot
d08d110088 Merge "Split PageArchiveTest" 2021-10-25 12:59:10 +00:00
Amir E. Aharoni
dc85587d29 Consistent hyphenation of "case-sensitive" in messages
Change-Id: I21fc1a965fb0323cbec0900cd30cf256850b1682
2021-10-25 13:09:50 +03:00
Matěj Suchánek
b411cbfdaa Split PageArchiveTest
Create ArchivedRevisionLookupTest to test ArchivedRevisionLookup.
Expand tests a bit and add two more for ::getPreviousRevisionRecord.

Change-Id: I3e176b24a13479464b7e73d062639ecb4db86f8f
2021-10-25 10:41:33 +02:00
Translation updater bot
7bac868eb1 Localisation updates from https://translatewiki.net.
Change-Id: Idc34127b2fac69adb6db143700cb1a4b1d73ee0e
2021-10-25 08:15:00 +02:00
Universal Omega
e20793255d checkStorage: pass no parameters to WikiRevision::getContent()
This defaults to SlotRecord::MAIN, which is what it should be rather than RevisionRecord::RAW

Bug: T294043
Change-Id: Ib035fe4eea778747f47a476c8aa2cfaab44aa7d8
2021-10-24 11:47:32 +00:00
Umherirrender
7ce7e0d4aa resourceloader: Change User::isAnon to !User::isRegistered
User::isRegistered is part of the UserIdentity interface,
which makes moving from heavy User class to UserIdentity easier.

Change-Id: If44bfd398694c509272b3f89c93473b2e3c05759
2021-10-24 10:00:51 +00:00
jenkins-bot
0d675c382b Merge "rdbms: mark getServerConnection() as @internal" 2021-10-23 03:09:30 +00:00
Timo Tijhof
58fe6328cc docker: Update dev images to newer version with Composer 2.x
Ref https://gitlab.wikimedia.org/releng/dev-images/-/merge_requests/7.

Bug: T279857
Change-Id: Ie113f7a6b70edecbdabe1774f79e88ebd8f92151
2021-10-23 02:21:33 +01:00
jenkins-bot
743dc72f25 Merge "Hide deprecation on tests for ParserOutput::addWarning" 2021-10-22 21:53:17 +00:00
Alexander Vorwerk
bd13a42535 build: Update mediawiki-codesniffer from v37.0.0 to v38.0.0
Change-Id: Iff096d3789b8c261aa47fb41d6f450a3bda7ce6a
2021-10-22 22:43:16 +02:00
jenkins-bot
bcb797a5be Merge "CheckStorage: Annotate importRevision $revision parameter as being WikiRevision" 2021-10-22 18:30:11 +00:00