Commit graph

114 commits

Author SHA1 Message Date
Ed Sanders fccb247285 EditCheck: Only pause if check is not rejected
The pause is to show the user the result of their
action (sepcifically it was designed for AddReferenceEditCheck
to let them see the reference in the page).

If they reject, there is no need to pause. This applies
to mulit-check too where it would cause a pause before moving on
to the next check.

Change-Id: I57f881b37051cc2e5ea6bda23fea66a2de2b342d
2024-12-12 12:57:47 +00:00
Ed Sanders 81197ac662 Improve timing of sidebar opening and scrolling selection into view
* Don't try to draw the selections/highlights while the sidebar
  is opening.
* Only make the scroll call once (after the sidebar is open) to
  keep the animation smooth.

Change-Id: I1c1d23b0dad07aa44a2bd10ebb32149e796d6738
2024-12-12 12:39:03 +00:00
David Lynch 37627ad9ae EditCheck: move checks to a sidebar
Bug: T341308
Bug: T379443
Change-Id: I66147d95fc23d0f72960ff93a76b3e5ba65ce44e
2024-12-11 20:20:00 +00:00
Translation updater bot 237f9afcbc
Localisation updates from https://translatewiki.net.
Change-Id: Ie36fe3eeaab86b28d5b422e61af6ad1393f806e2
2024-12-11 08:26:04 +01:00
Ed Sanders e62327efe0 EditCheck: Replace highlights/selection with fragments
'selection' is only used by AddReferenceEditCheck but this can
be done in the act method.

Provide a method for getting highlight selections from
these 'affected fragments' that can be overridden.

Change-Id: Ida661682efd8ae99d945f0e310ea3ce12efc8770
2024-12-05 12:24:36 +00:00
jenkins-bot c8f295d33b Merge "Edit check: add helper to BaseEditCheck to find added nodes" 2024-11-26 16:25:38 +00:00
jenkins-bot 69d71626a8 Merge "Edit check: move some methods into BaseEditCheck" 2024-11-26 16:25:37 +00:00
Translation updater bot 0aaa6599dc
Localisation updates from https://translatewiki.net.
Change-Id: I332097e6937e4768f316a509d396d168b5ad7652
2024-11-26 08:17:28 +01:00
David Lynch 34030accdb Edit check: add helper to BaseEditCheck to find added nodes
Change-Id: Ia6e2d97b57c002f9cea2167c64f960f1422dabfe
2024-11-25 10:50:41 -06:00
David Lynch 2c73af983e Edit check: move some methods into BaseEditCheck
This is mostly cleanup from 4cd67004d removing Diff, which was the
original caller of the moved functions.

Change-Id: I015cb310527d9e7593e4ba6ac15ac204435d9ab4
2024-11-25 10:50:41 -06:00
jenkins-bot 3ffa2ac018 Merge "Edit check: move config defaults to the client-side" 2024-11-22 17:43:54 +00:00
David Lynch d806186810 Edit check: move config defaults to the client-side
This lets us encapsulate everything about a check in its JS definition,
which makes it much simpler for other extensions or gadgets to create
checks.

Change-Id: Ica23fc26a576d55addb001e4baf78b3702927208
2024-11-22 10:57:45 -06:00
Translation updater bot a226525fd7
Localisation updates from https://translatewiki.net.
Change-Id: I1d8ca1c49d1343184de0bfda68dbb8819ca6a954
2024-11-22 08:43:06 +01:00
David Lynch afb55049a3 Editcheck: fix typo in ConvertReferenceEditCheck
Follow-up to 4cd67004de

Change-Id: Ie95f36344c3627bcf0ab2a8fc2abcaf1745ab3a8
2024-11-21 11:33:23 -06:00
jenkins-bot c6303220e1 Merge "EditCheck: Add more method documentation" 2024-11-19 18:07:43 +00:00
Ed Sanders 43b49080c9 EditCheck: Add more method documentation
Change-Id: Ia250a0c09d700b0f8e78bf2ea9c17e35b8c40d6d
2024-11-19 13:56:18 +00:00
jenkins-bot 41daeb6b11 Merge "Revert "editcheck: Remove try/catch around transaction squashing"" 2024-11-19 11:54:07 +00:00
DLynch 733d0a835e Revert "editcheck: Remove try/catch around transaction squashing"
This reverts commit cf8a08f76c.

Reason for revert: these errors are still happening

Bug: T333710
Bug: T380234
Change-Id: I4b4a061757316bf720fecc7cfd971737b68d122f
2024-11-19 02:03:17 +00:00
Ed Sanders ee79edb58b Move edit checks to /editchecks folder
Change-Id: I27eee69c4086d44fd7d60bacde9a76c170af63fe
2024-11-14 16:44:59 +00:00
David Lynch 239aa714fa Edit check: fix an error when drawing selections
Follow-up to 793a1364aa

Change-Id: Ieb4f30ba2fe37fdca8cad559d3e4211c83642a5c
2024-11-10 23:19:13 -06:00
Ed Sanders 793a1364aa Allow multiple highlight fragments to be passed to an edit check
Change-Id: Ie9d7010a1a0ee6a5c570d4fd6988fc876afdb9e2
2024-11-05 11:41:50 +00:00
Translation updater bot 40ec9aa520
Localisation updates from https://translatewiki.net.
Change-Id: I186490be48fa70d1d1573b610cb3d2e18efed1c5
2024-11-01 08:36:58 +01:00
Ed Sanders f3930e7e12 EditCheck: Use getLinearFragment shortcut
Change-Id: I53859c24567e01e24ff46a88799ee0edadbd8e1b
2024-10-30 20:28:14 +00:00
Ed Sanders d06e9dbc31 Update VE core submodule to master (0e82a6db8)
New changes:
db0f21d03 ve.ce.Surface: Check dataTransfer.files is non-empty
e1cd78933 [BREAKING CHANGE] Move selection handling code to SelectionManager
b4b63a463 Move drag/drop handling code to DragDropHandler
540272769 Use the onPaste handler for dropped content
d3f9d8485 ClipboardHandler tests: Run tests in series
1232c0420 Tests: Introduce ve.dm.example.annotateText to simplify runs of annotated text
69d7ca482 Apply an annotation to imported (pasted/dropped) text
0e82a6db8 ve.ce.ClipboardHandler: Fix async test running

Added files:
- src/ce/annotations/ve.ce.ImportedDataAnnotation.js
- src/ce/ve.ce.DragDropHandler.js
- src/ce/ve.ce.SelectionManager.js
- src/dm/annotations/ve.dm.ImportedDataAnnotation.js
- tests/ce/ve.ce.DragDropHandler.test.js

Local changes:
- Implement new selection manager architecture

Added files:
- src/ce/annotations/ve.ce.ImportedDataAnnotation.js
- src/ce/ve.ce.DragDropHandler.js
- src/ce/ve.ce.SelectionManager.js
- src/dm/annotations/ve.dm.ImportedDataAnnotation.js
- tests/ce/ve.ce.DragDropHandler.test.js

Bug: T371996
Bug: T377427
Bug: T78696
Change-Id: If8d38246badf919c32915beda7c9a14f16e62a8a
2024-10-30 17:52:56 +00:00
Umherirrender 0463bec879 Use namespaced classes
Changes to the use statements done automatically via script

Change-Id: Ic6450685433e240a4e93ce2beec381da16587b15
2024-10-20 14:01:32 +02:00
jenkins-bot 3ffa8f92df Merge "editcheck: Remove try/catch around transaction squashing" 2024-10-18 18:11:07 +00:00
jenkins-bot c2379d7d9c Merge "editcheck: Remove mw.editcheck.Diff" 2024-10-18 18:01:11 +00:00
jenkins-bot b82b2948fe Merge "editcheck: Rename shouldApplyToSection to isRangeInValidSection" 2024-10-18 18:01:09 +00:00
jenkins-bot b92ce78406 Merge "editcheck: Move adjustForPunctuation to AddReferenceEditCheck" 2024-10-18 18:00:27 +00:00
jenkins-bot 9cc33b619f Merge "editcheck: Document some methods and improve some APIs" 2024-10-18 17:58:10 +00:00
Translation updater bot e637f262d4
Localisation updates from https://translatewiki.net.
Change-Id: I1359c287e5aa35d8421fa11d0c5a66cca923453c
2024-10-18 09:25:50 +02:00
Ed Sanders cf8a08f76c editcheck: Remove try/catch around transaction squashing
According to T333710 we haven't seen an error in the last year.

Change-Id: I7ee3447674cdda8a4350b6cf10d5d907c2162e2e
2024-10-17 17:10:02 +01:00
Ed Sanders 4cd67004de editcheck: Remove mw.editcheck.Diff
This object just contained a pointer to the surface and dm,
and had one utility method.

Move the method to mw.editcheck, and pass around a surface model
or document model to other methods as appropriate.

Change-Id: Ie81d76dea2823b633328f982ee20027808bfc8e3
2024-10-17 17:10:02 +01:00
Ed Sanders f91c62c0eb editcheck: Rename shouldApplyToSection to isRangeInValidSection
Also refactor the loop at the end, and reorder arguments.

Change-Id: I378e5103889dd57b29948c932389e3dfa071255f
2024-10-17 17:10:02 +01:00
Ed Sanders 0cfeb76abc editcheck: Move adjustForPunctuation to AddReferenceEditCheck
This method is highly specific to reference insertion. If we ever need
it for another check it can be moved back with a more specific name.

Change-Id: Ia629c8672281f33d45ea1fff6630af9bd331d80e
2024-10-17 17:10:02 +01:00
Ed Sanders de70933dca editcheck: Document some methods and improve some APIs
* Pass just the ve.dm.Document to shouldApplyToSection, instead
  of the whole diff.
* Do the quicker range check first in getModifiedRangesFromDiff

Change-Id: I1bda3a77c1c51f50fd7baadaa3619cf6719a073a
2024-10-17 17:10:02 +01:00
Translation updater bot 11c2aafdd2
Localisation updates from https://translatewiki.net.
Change-Id: I18aa40260f8c532f3ca1e61ce1cdb7ab1a16daec
2024-10-14 09:30:37 +02:00
David Lynch 3b324983c0 Fix a reference to AbuseFilter that should be Abuse Filter
This stopped link reliability from being checked on wikis that only had
Abuse Filter enabled.

Follow-up to e6e104dda5

Change-Id: Ie0045e75633713ad9d529bec647471b2ca0137d3
2024-09-19 09:25:43 -05:00
Translation updater bot 907c7cb941
Localisation updates from https://translatewiki.net.
Change-Id: I89ee792cd8e4b2d029d7f52641c12212ac109aa3
2024-09-19 09:18:50 +02:00
David Lynch 0c91e1795c Edit check: only count ChecksAvailable after the check for source-mode
Change-Id: I96091963af56a40d94445d7b65eb5c35326d0403
2024-09-18 10:26:50 -05:00
Translation updater bot c6a52ab2a4
Localisation updates from https://translatewiki.net.
Change-Id: I8f2a57fdc2136b42c5cce7ec87ce0705a04a72a6
2024-09-10 09:30:56 +02:00
David Lynch 709e791acd Edit check: let ecenable bypass the account age requirement
Clean up accountShouldSeeEditCheck since nothing is calling it but the
new method inside BaseEditCheck

Follow-up to e947e53f98

Change-Id: Ic55187bb77f5ef003369313b76a65897fb3be392
2024-09-09 10:52:50 -05:00
jenkins-bot b19679e381 Merge "Edit check: stop from appearing outside the main namespace" 2024-09-09 13:29:48 +00:00
David Lynch e947e53f98 Edit check: stop from appearing outside the main namespace
This was accidentally removed in d69d366469 during its refactor.

Because of the change to how checks are decided to be shown, I've made
AddReferenceEditCheck always be required -- later code in
hasAddedContentNeedingReference assumes that it's loaded anyway, so a
wiki deciding to configure it to not load at all for some account types
would have broken saving.

Bug: T373692
Change-Id: I007cd705451581ebacfa12e8ac5502bd1bc56a38
2024-09-04 10:33:22 -05:00
Translation updater bot d29293e043
Localisation updates from https://translatewiki.net.
Change-Id: I2417fa6f554a48aeadc0164ea856a15257d1c8e6
2024-09-02 09:21:51 +02:00
Translation updater bot dedd30bfef
Localisation updates from https://translatewiki.net.
Change-Id: I103ce5ad2adc11b48a2d7ed8ea72e4e892dc6b9f
2024-08-30 09:20:39 +02:00
Translation updater bot 471e84a0d9
Localisation updates from https://translatewiki.net.
Change-Id: Ic7ad4140ac4eeded1de5331ad1d57f17b2cd11ca
2024-08-28 09:41:04 +02:00
Translation updater bot d9c7c05e32
Localisation updates from https://translatewiki.net.
Change-Id: I5eeb703911cd5914a71d9241be0eb97ebbd4df5c
2024-08-26 09:23:43 +02:00
David Lynch 16c2dd919b Edit check: center the text in the proofreading toolbar
Bug: T341308
Change-Id: I5e12cefe690c2b9fba7cd7998a11723931575465
2024-08-22 01:23:27 -05:00
Translation updater bot 762a5c0ff9
Localisation updates from https://translatewiki.net.
Change-Id: I71885816cfe342b8cba5b6e5d443dbee1f12a859
2024-08-19 09:25:55 +02:00