Commit graph

14651 commits

Author SHA1 Message Date
jenkins-bot 0c582e359e Merge "Upstream CSS hacks from skins" 2024-11-27 16:20:08 +00:00
Jon Harald Søby f539f436dc Fix styling for #catlinks:hover in Visual Editor
Use the same color (transparent blue) as `.mw-references > li:hover`
from `ve.ce.MWReferencesListNode.less`.

Bug: T370609
Change-Id: I8d8339b4c75aa5bc51c61df870fd1684dea2b183
2024-11-27 15:39:23 +01:00
Ed Sanders 4332698408 Upstream CSS hacks from skins
Change-Id: Ic2aca1e005c5d5f89a97372de40bd8aa6f4b2aa0
2024-11-25 14:02:55 +00:00
Ed Sanders 3e28af7602 ArticleTargetSaver: Use mw.deflateAsync
mw.deflate is deprecated. mw.deflateAsync is faster in supported browsers.

Change-Id: Ia16e5823365b55b741f3184572b7bdeb5bbb1bd6
Depends-On: I722ebb03c0db7c7b3ee16cc8881e41909142cee9
2024-11-21 13:23:31 +00:00
jenkins-bot c6f6967e45 Merge "MobileArticleTarget: Make close/publish buttons fixed width" 2024-11-18 11:45:48 +00:00
Bartosz Dziewoński 02654c0086 Fix forwarding promise rejection arguments
Follow-up to arrow functions refactoring
(4db99d7a27).

Change-Id: I6ea41256d9a91552736742100630aab333375125
2024-11-14 21:38:23 +00:00
Ed Sanders e434ad65ec MobileArticleTarget: Make close/publish buttons fixed width
This aligns them with the mobile wikitext editor. At mobile
widths the difference is negligible. On tablets this distinguishes
"navigation" buttons from the surface toolbar buttons.

Bug: T344370
Change-Id: I342e3bb579afb9f26e2af743e28eedb32efa3d46
2024-11-12 23:01:05 +00:00
jenkins-bot 98d112aec0 Merge "Diff extension body contents" 2024-11-10 14:01:07 +00:00
Ed Sanders b8f032d266 Handle view tab clicks even on edit pages
This allows the proper "discard changes" dialog to show.
A few more steps of the teardown now happen in the client,
but eventually in DesktopArticleTarget#teardown we check
again if we weren't on a view page and redirect (as this
is what we do after save).

Bug: T379367
Change-Id: I995649f37e5d841b6c1784a74f3bd353adfbe69f
2024-11-08 14:05:09 +00:00
Ed Sanders 176e9c3297 CollabTarget: Use generateUniqueId
Change-Id: I69faf3b2efe70d1d880585dd41f227d2d0562594
2024-11-05 15:44:39 +00:00
jenkins-bot b7c2b41754 Merge "Remove side padding from toolbar dialogs in Vector 2022" 2024-10-30 22:42:44 +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
Ed Sanders b82cd1c975 Remove side padding from toolbar dialogs in Vector 2022
Change-Id: Idcd4491c814154a2d0474eca0e076e12295b7681
2024-10-30 17:29:13 +00:00
Ed Sanders 7ac339ce29 Diff extension body contents
Bug: T359469
Change-Id: Iad2cddcd7c86f8f4c5a9c575e871392f1942aff4
2024-10-30 14:31:06 +00:00
jenkins-bot 80eff2ac37 Merge "MWGalleryDialog: Highlight item at closest index when removing an image" 2024-10-29 14:50:15 +00:00
jenkins-bot 407bb951b8 Merge "MWGalleryItemWidget: Remove unnecessary event argument" 2024-10-29 14:50:13 +00:00
jenkins-bot 9425db2172 Merge "Update VE core submodule to master (bae9101b7)" 2024-10-29 14:17:54 +00:00
Ed Sanders 4bc814f1a0 Update VE core submodule to master (bae9101b7)
New changes:
7906a6b9e build: Updating npm dependencies
92e6a5338 TextStyleAnnotation: Don't register abstract base class
456ca9b2e Localisation updates from https://translatewiki.net.
a68ba80d2 Get all annotations by ranges
dc49d9592 Demos: Default to WMUI theme
222ac7d23 Add unit tests for ve.dm.BranchNode#getAnnotationRanges
ba73b9e91 Return annotation ranges in lexicographic order
6e40aa524 Localisation updates from https://translatewiki.net.
1a4640a4a ve.ce.Surface: Remove unused $deactivatedSelection and $findResults
9455e0f0a ve.ce.Surface: Replace text/xcustom clipboard storage with a custom key
ddd14aa9b [BREAKING CHANGE] Move paste handling code to ve.ce.ClipboardHandler
19f0e500b CollabProcessDialog: Replace mw.user.getName with platform method
ecd607353 Implement pasteSourceDetectors
bae9101b7 Localisation updates from https://translatewiki.net.

Added files:
- src/ce/ve.ce.ClipboardHandler.js
- tests/ce/ve.ce.ClipboardHandler.test.js

Local changes:
* Implement new paste handler architecture
* Use new clipboard key

Bug: T360624
Bug: T376306
Bug: T78696
Change-Id: Iea10d32b6132ae364d486cc6b96895bb937ac944
2024-10-22 15:31:24 +01:00
Ed Sanders 3dfef738e2 MWGalleryDialog: Highlight item at closest index when removing an image
Bug: T373981
Change-Id: Ib0edc97279c6ec4e0529197d9beb1d7c9c51ee28
2024-10-21 17:18:43 +00:00
Ed Sanders 332188807a MWGalleryNode: Check node still exists when updating
Bug: T377717
Change-Id: I13f9c1ced3e59d4d88aaca02b884d06cc57b11a6
2024-10-21 14:03:15 +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
jenkins-bot c2dd7617a3 Merge "ve.ce.MWPreNode: Fix primaryCommandName" 2024-10-08 16:38:41 +00:00
Ed Sanders 67b5e1c5e1 ve.ce.MWPreNode: Fix primaryCommandName
Change-Id: I20f3c946ef9a7436756dc298fa9609ffd05ce5a1
2024-10-08 15:16:02 +01:00
Bartosz Dziewoński 365cefa878 tests: Use real mw.Api in ve.ui.MWTemplateTitleInputWidget tests
Otherwise the changes to mw.widgets.TitleWidget in
Iec338e9f595b452c19ce8e74eb81339fbce11640 cause the test to fail.
To avoid making real API requests, use fake server instead.

Change-Id: I7ff705af79760e33200a2dfbfdd05138c18bb110
2024-10-07 19:24:43 +00:00
Bartosz Dziewoński e6f1698bcb Fix "target is undefined" exception when loading fails
When loading the editor fails, getTarget() should return a rejected
promise. However, the rejection handler that logs the loading error
also accidentally converted the promise to a resolved one.

The easiest way to reproduce is to enable offline mode in your
browser's developer tools, then click "Edit".

Change-Id: Icf6ea14f4d4e3afcb6608f4c0c49b76c297bf9a3
2024-10-07 19:24:43 +00:00
Ed Sanders 365950cbe6 Get attached node from document model, instead of surface
Change-Id: I37b3dfeabe7666878884d21113f928691363a39a
Depends-On: I813c341cb1a0751443880d2e05aa209d3d973a00
2024-10-01 15:01:43 +00:00
Ed Sanders cefa56ecb9 Use fixed font size for UI componenets in Vector 22
Use rem's to set the font size of the toolbar and local/global
overlays, as the font size is now variable in that skin.

Bug: T373875
Change-Id: Ib2511debd01dbc0cf03ff6d92cd9bfe71078c387
2024-09-05 11:21:08 +01:00
Ed Sanders ac652a2e36 MWGalleryItemWidget: Remove unnecessary event argument
Listeners will already know which object emitted the event.
Currently this event is used once as a aggregate event,
(as 'editItem' in the ve.ui.MWGalleryGroupWidget constructor)
in which case the emitting object is already prepended as the
first argument (as documented in OO.EmitterList.prototype.aggregate).

Change-Id: I490f368af8e9cae60eacac918bf83702999f705b
2024-09-04 10:58:06 +01:00
jenkins-bot f363c943cc Merge "Allow &veaction=editsource to load 2017WTE regardless of user prefs" 2024-08-30 06:20:42 +00:00
jenkins-bot 1b777d45e0 Merge "Fix exception editing cross-wiki redirects" 2024-08-29 22:54:21 +00:00
Mahmoud Al-Qudsi a9278f654b Fix exception editing cross-wiki redirects
As described in T326169, when editing a (manually created) cross-wiki redirect,
VisualEditor will throw a null dereference exception causing it to fail to load
in the browser (looking like it is just taking forever to load).

This patch prevents the exception from occurring by not attempting to write to
the null object.

Bug: T326169
Change-Id: I50fa803c7b4ce65dac1fe345431d8b8f9d0b3d61
2024-08-28 13:27:09 -05:00
Bartosz Dziewoński b4fc696ad5 Reattempt save as temporary user only when we were previously anon
…but not when we were previously logged-in. Temporary accounts no
longer leak IP addresses, but it's still not nice to lose attribution
of edits by logged-in users.

Follow-up to 317d6dd724.

Bug: T345975
Change-Id: I24c786c0f060921f773e1d6d1c7463f1cc79aab2
2024-08-27 23:23:11 +02:00
jenkins-bot 24c53a321e Merge "Reattempt save when refreshing temporary user if session expired" 2024-08-27 13:49:58 +00:00
Bartosz Dziewoński c93d4a9695 Allow &veaction=editsource to load 2017WTE regardless of user prefs
Bug: T239796
Change-Id: I0391d44d15763980cfb48b2945bac35e5b08e930
2024-08-26 20:13:36 +02:00
Timo Tijhof 07a132d310 tests: Force templateDataInstalled condition for MWTemplateTitleInputWidget
Change-Id: I730a0e53547d4e7510fcec09905ea98030490c0d
2024-08-22 00:29:16 +01:00
jenkins-bot fcce9b0b89 Merge "Move edit section colorings to core" 2024-08-17 14:19:55 +00:00
jenkins-bot b54f4ebb28 Merge "Fix getTemplateDataQueryTitle() when the title ends with a newline" 2024-08-16 15:30:57 +00:00
Ebrahim Byagowi 84557b6d13 Move edit section colorings to core
Bug: T372436
Depends-On: I691dbef2313e006de4b7d096232c531d81bdd380
Change-Id: If6c606cd6d3816b9286aee0ffd4d96be704521d4
2024-08-14 22:24:00 +03:30
Jamie Kuppens 317d6dd724 Reattempt save when refreshing temporary user if session expired
A notice already appears and informs the user of the visual editor that
they're not logged in if their session has ended. Showing an additional
error dialog informing the editor of this when saving changes is not
needed.

Bug: T345975
Change-Id: I20a904dbc6d3c2f0d08e4ceea27e35ee1b65bb71
2024-08-13 16:33:55 -07:00
jenkins-bot c3e7d584e5 Merge "Reenable Cite-related test" 2024-08-05 08:10:00 +00:00
Ebrahim Byagowi 5c798b0eea Move editsection bidi isolate to MediaWiki
MediaWiki needs this even without VisualEditor so let's move it there.

Bug: T371702
Depends-On: I4dcfa3916a07e92565b5667adb2ead0115fdb438
Change-Id: I0562ea1e5bd28eabd3ef0bcd8372155da67bcd0c
2024-08-02 18:52:54 +03:30
Ebrahim Byagowi 0f85b14328 Define brackets spacing in a direction aware way
This also resolves the bug but it hides the underlying issue on it
that's why I like to have this but after having
Ia7dd8076c8789ed04d3fb52a078c70561ee5c6f8

Bug: T371665
Change-Id: I7340829acbd2bf3fcccfb631848964e5338470b0
2024-08-02 11:30:27 +03:30
Ebrahim Byagowi 6965da7012 Don't set direction for editsections
This causes editsection to jump

Bug: T371665
Change-Id: Ia7dd8076c8789ed04d3fb52a078c70561ee5c6f8
2024-08-02 11:09:45 +03:30
Sébastien Beyou 6ea7ab19fd Fix getTemplateDataQueryTitle() when the title ends with a newline
According to ECMAScript, .trim() and RegExp’s "\s" capture the same
characters, so I replace the initial "\s*" by .trim() to remove
whitespaces and line terminators at the beginning and at the end.

Bug: T371000
Change-Id: Id9188f97a3136b986b052b71cd4079c1109ea8ff
2024-07-26 16:18:29 +02:00
James D. Forrester 8c9605921c DesktopArticleTarget: Set wgCurRevisionId and wgRevisionId once publish goes through
Bug: T370771
Change-Id: I0100c155352ec55275f40616f87e69af52d6e97b
2024-07-25 12:28:15 -04:00
Ed Sanders b302e0288b Disable edit mode switch in multi-user environment
Bug: T370819
Change-Id: I8244aaa0783e35ca70385045a8165e0bcb9a91dc
2024-07-24 13:37:18 +01:00
Adam Wight 67417c28b8 Reenable Cite-related test
Bug: T370512
Depends-On: Id8684ccee2e6725af2c861da20fc31af1067e614
Change-Id: I8453ce99daae2dbec58088186961a30ae9d1c3e7
2024-07-24 11:44:35 +02:00
Adam Wight b4da46585c Temporarily disable Cite-related test
This can be reenabled once Cite changes are merged.

The disabled test is also updated in this patch so that it will pass
with the new Cite code.

Bug: T370512
Change-Id: I56b52c399d2c76689fdcb0bc7fd50a8c0ced28fd
2024-07-24 11:43:33 +02:00
Timo Tijhof ba6f60032b tests: Fix DesktopArticleTarget dirtying location.href
Without this, wheneve VE is installed, test execution ends with the
address bar rewritten to Special:Badtitle, which affects reloads etc
and makes debugging anything else harder.

Bug: T250045
Change-Id: Ic453ae388c842369ff1cb1e84dcad4a8bbc7d54f
2024-07-20 04:05:42 +00:00
jenkins-bot c322fe0459 Merge "Rewrite a conditional to make the logic a little clearer." 2024-07-17 10:22:07 +00:00