Commit graph

14343 commits

Author SHA1 Message Date
Ed Sanders 2b4dab6703 build: Update stylelint-config-wikimedia
Change-Id: I4e56a07c0cd478fb2ea1908c79f584ea3e4d788e
2023-08-21 16:06:40 +01:00
jenkins-bot 9e42850609 Merge "Remove extra margins from visual diff in Minerva" 2023-08-16 16:22:27 +00:00
jenkins-bot 79d0fcb585 Merge "Add a Process to the save workflow" 2023-08-16 15:32:54 +00:00
jenkins-bot fc7fd630d6 Merge "Edit check: Reduce scope of try block" 2023-08-16 15:32:52 +00:00
jenkins-bot a28977ee71 Merge "Edit check: Guard against completeHistory being empty" 2023-08-16 15:30:02 +00:00
David Lynch 228596cba0 Add a Process to the save workflow
A new hook `ve.preSaveProcess` is triggered to give other code the
chance to add steps to the process. The save dialog won't show until
the process completes. A step can be failed to return to normal
editing.

Change-Id: Id0740ff58ba9d9519c81174100ef1b8f8740870b
2023-08-16 15:59:04 +01:00
Ed Sanders 4c69113ed8 Edit check: Reduce scope of try block
Change-Id: Ife185999d3a0e084720a7aac4d360d65db08a131
2023-08-16 15:58:27 +01:00
Ed Sanders 3d92231cd1 Edit check: Guard against completeHistory being empty
When the document store has no entries (e.g. an empty page)
we don't initialise completeHistory with a retain transaction.

Bug: T333710
Change-Id: I5cc4ab3ea5f63a7eab804831df62d5c7ce2447e9
2023-08-16 15:57:54 +01:00
jenkins-bot 9070d1e98b Merge "Catch errors in addPlugin callbacks so VE load isn't broken" 2023-08-16 14:29:12 +00:00
David Lynch 745d13ae4b Catch errors in addPlugin callbacks so VE load isn't broken
Change-Id: I8a1eb058f10e356b3af5588862633b78f0b0ff92
2023-08-15 13:49:16 -05:00
Ed Sanders 241d3da05d Remove extra margins from visual diff in Minerva
Bug: T344181
Change-Id: I5a2a9413ee5125ca7dc416ce3e8b75060dc96b83
2023-08-14 19:13:50 +01:00
Bartosz Dziewoński 870841b407 ArticleTarget: Remove misleading error message on 'badtoken' errors
This method was only called, and the message was only shown, when
retrying after the first 'badtoken' error and refreshing the token
fails again.

If this happens, it usually indicates some terrible problem with
the wiki, and it is not something that can be fixed by logging in
again (or anything else the user can do).

Let the default API error message appear ("Invalid CSRF token.").
While not very helpful to the user, it should be more helpful to
the site administrator trying to unbreak their wiki.

Remove the "visualeditor-savedialog-identify-trylogin" message.
Keep "visualeditor-savedialog-error-badtoken", which is re-used
in another error message. I'll fix that separately.

Change-Id: Ib680218bce5ae38aa52d7d941218a6410ab7e09e
2023-08-14 19:58:26 +02:00
Bartosz Dziewoński 4bb8d8f8ea ArticleTarget: Remove unused retrying support
This has not been used for many, many years, since we started using
mw.Api#postWithToken, which automatically retries on 'badtoken' errors.
Most of our code for it was removed (e.g. save() is never called
with three parameters), but some comments and parameters remained.

Change-Id: Ibca2a222f808e6e2796ed6a61e9587a646afcf31
2023-08-14 19:58:26 +02:00
Bartosz Dziewoński 46f661ac66 ArticleTarget: Remove duplicate error codes when logging
Occasionally we end up logging error codes like
"abusefilter-disallowed,abusefilter-disallowed,abusefilter-warning"
when someone hits a bunch of different filtes.

Change-Id: I967d374d13473ca684412b380d732653a3ceaff3
2023-08-14 19:58:26 +02:00
jenkins-bot 4b1503e3cd Merge "Convert WikitextPasteContextItem to PersistentContextItem" 2023-08-14 05:08:05 +00:00
jenkins-bot 704e7ab295 Merge "Port Parsoid's WTUtils::textContentFromCaption" 2023-08-11 22:02:10 +00:00
jenkins-bot 023fe1af0a Merge "Use passive event listeners for window scroll events" 2023-08-11 21:30:14 +00:00
Ed Sanders 916b7beb22 Convert WikitextPasteContextItem to PersistentContextItem
Depends-On: Id2900c2d2c692b611e611b7eee6cacb74a737a8c
Change-Id: Ic539a41e8623c4ed12e4fa0e24db826ca967ee5a
2023-08-11 12:54:38 +01:00
Arlo Breault 674095bbaf Port Parsoid's WTUtils::textContentFromCaption
Matches the changes in Ice62d61d1a4f661770869b43d54eb8fc20824b71

Bug: T339237
Change-Id: I16301750ae8693e850aa3ce83bbb477f820d5cae
2023-08-10 18:06:27 -04:00
Ed Sanders a54f36c886 Use passive event listeners for window scroll events
TODO comments suggested using the VE helper util, but
that is no longer necessary since all our browsers
support passive events.

Change-Id: Idb7e702d58931208d555a3f994cd0b73abec2e20
2023-08-09 16:42:23 +01:00
jenkins-bot 8be133fe66 Merge "Reduce code duplication in ve.ui.MWGalleryDialog" 2023-08-08 18:55:30 +00:00
jenkins-bot e2efe5079a Merge "Use different tooltips for ca-edit and ca-ve-edit links" 2023-08-03 15:53:21 +00:00
Dringsim cce52fae65 Use different tooltips for ca-edit and ca-ve-edit links
Bug: T337653
Bug: T341424
Change-Id: I3aa79fec71ca2c40a0ece3ca73dd934cf6c9d5a8
2023-08-02 16:36:54 +00:00
Ed Sanders 85d584930f Simplify definition of textStyle group in toolbar
This makes it easier for 3rd parties to insert extra tools
in sensible places.

Change-Id: I6c8d0c96f53655d8f9ae9f01e5d0e1a1678d29a1
Depends-On: Ib8882fa6319915d291b345a69ab95f362739ad7b
2023-07-31 11:06:18 +00:00
jenkins-bot 16623ac116 Merge "Simplify code for showing "Loading" message in template context" 2023-07-31 10:16:40 +00:00
jenkins-bot 7970346855 Merge "build: Upgrade stylelint-config-wikimedia from 0.15.0 to 0.16.0" 2023-07-26 12:54:43 +00:00
jenkins-bot b9f0764711 Merge "Prevent JS code from changing 'skin-view-edit-local' message to 'skin-view-edit'" 2023-07-17 23:54:53 +00:00
jenkins-bot 4231c7a328 Merge "Use different titles for "Edit" and "Edit source" links (section headings)" 2023-07-17 23:07:44 +00:00
James D. Forrester 325ca8a40a build: Upgrade stylelint-config-wikimedia from 0.15.0 to 0.16.0
Change-Id: I993074948832a50997255bd413192c8fdeaf9edb
2023-07-14 13:02:49 -04:00
David Lynch 7d1e9f3eaf When switching from WikiEditor activate VE *after* notifying WikiEditor
This affects logging behavior -- notifying WikiEditor lets its logging
clean up after itself before the init event for VE fires. This was only
an issue when switching *with* changes, because that path resulted in
the timings being cleared, making future events whose timing depended
on the init event have NaN timings.

(This wasn't an issue before we centralized the logging code into
WikimediaEvents, as before that WikiEditor and VE were maintaining
separate timing registries.)

Bug: T237063
Change-Id: Icdb307fa0ce0d1dac3744e4bab41b3588f14777f
2023-07-13 09:32:55 -05:00
沈澄心 70cb30c2a8 Prevent JS code from changing 'skin-view-edit-local' message to 'skin-view-edit'
Change-Id: I33ab649959226a848e1c57fc7c2b7e95a014e4bd
2023-07-13 02:51:12 +00:00
沈澄心 8523b5a876 Use different titles for "Edit" and "Edit source" links (section headings)
Bug: T337653
Change-Id: I6793d458b7a1573de6752177cab5a9bfae9ffca0
2023-07-13 02:47:50 +00:00
Ed Sanders 3d8315f4c3 Simplify code for showing "Loading" message in template context
Instead of passing a "teardown callback" to a specific dialog,
run the command as usual and clear the loading message once
the dialog has successfully opened.

Change-Id: Icacabb298f1a0d7a587ab8b992759b04ff59c5c3
2023-07-12 11:04:59 +01:00
jenkins-bot 82f72cfeda Merge "Merge mobile and desktop save buttons" 2023-07-11 21:34:17 +00:00
jenkins-bot 067cbd3438 Merge "Fix ContextItem documentation" 2023-07-11 21:32:59 +00:00
jenkins-bot 7ae61934a3 Merge "Remove remains of lossy-switching and discard-switching" 2023-07-11 15:34:52 +00:00
jenkins-bot 5574237f47 Merge "Support '&editintro=…' etc. on subsequent loads via page tabs" 2023-07-11 15:33:30 +00:00
jenkins-bot c4fb50b59f Merge "Support '&editintro=…' etc. on back/forward and VE/NWE switch" 2023-07-11 15:33:26 +00:00
jenkins-bot 93427a6708 Merge "Reload page or redirect when saving an edit creates a temp account" 2023-07-11 15:16:56 +00:00
Bartosz Dziewoński 0dddd98b5f Reload page or redirect when saving an edit creates a temp account
Depends-On: I6cdc014fb39d35ce1f091b53dc3a9c4a3c95f9e9
Bug: T338002
Change-Id: I01e13ce1ebab462eeb0ba3847d4205a88965a127
2023-07-10 19:33:16 +02:00
Ed Sanders 4f90ce2594 Merge mobile and desktop save buttons
Use toolbar groups where appropriate.

Change-Id: If4e0d157f04ba741ed4cf891e4183fe351d537b8
2023-07-10 17:06:58 +01:00
Ed Sanders 2a1076e295 Fix ContextItem documentation
* Be more specific about the type of context which a
  context item belongs to.
* Make grammar clearer.

Change-Id: Ic480411cead80a1651c61ce9841dfbdc24a7b915
2023-07-10 14:32:12 +01:00
jenkins-bot 6a2b36bc16 Merge "Drop visualeditor-beta-warning from help menu" 2023-07-08 00:43:18 +00:00
jenkins-bot 76ed447217 Merge "Convert MWPopupTool into MWHelpListToolGroup" 2023-07-08 00:19:14 +00:00
jenkins-bot 329faab1e9 Merge "MobileArticleTarget teardown behavior is upstreamed to MobileFrontend" 2023-07-07 23:49:57 +00:00
jenkins-bot 0f5eedc26f Merge "Only trigger editcheck on pure insertion (remove.length === 0)" 2023-07-07 15:00:34 +00:00
Ed Sanders 0f33f7193f Drop visualeditor-beta-warning from help menu
Bug: T341350
Change-Id: I69b886e7681281057c92ddb4175de2998512f0ed
2023-07-07 15:54:15 +01:00
thiemowmde 60409599f5 Reduce code duplication in ve.ui.MWGalleryDialog
Change-Id: I7e3f831b9abd8834cc55460e579261cbf9d5fcff
2023-07-07 10:25:55 +02:00
Esanders b33bb734af Revert "Revert "Add tag when reference added to the page""
This reverts commit 235e5aca00.

Reason for revert: Re-applying with fixes

Change-Id: I9dc5a77045ea5f15c90cf84a15815e13dffd5739
2023-07-06 17:50:08 +01:00
Bartosz Dziewoński 235e5aca00 Revert "Add tag when reference added to the page"
This reverts commit d4460219bd.

Bug: T341202
Change-Id: I8e608a5a34a3bb18d1994d5c182c3918e6d6f89d
2023-07-06 11:35:50 +00:00