Commit graph

526 commits

Author SHA1 Message Date
David Lynch 7fb5663188 Don't hook CustomEditor for MobileFrontend requests
Bug: T334263
Change-Id: I7ccf1ba7e8f227c236a6244bfa91a2b8a9fd5765
2023-04-10 22:17:16 +00:00
David Lynch 99336933b3 Use new showPendingTakeover OutputPage method
Depends-On: I8f25f53a05ce0437b0e9f63033cc151213c797bf
Change-Id: Ib9a09514ed3da614ff8a654ae5b84a3a5b2ce886
2023-04-06 17:20:30 -05:00
daniel 96292e770a Don't force the "view" flavor when using stashing!
Bug: T333402
Change-Id: I6fc598cb2309c442a0b5bfe665f6f96c1a6edf85
2023-04-06 12:17:11 +02:00
David Lynch f11a7b4c16 Change name of the editcheck-needreference tag to editcheck-references
Bug: T324733
Change-Id: I435100fb05cb846cb1c0e3d5d5a72a1570ada1f4
2023-03-28 10:14:51 -05:00
David Lynch 31108dda7c Add editcheck tags when VE thinks a reference is needed
Bug: T324733
Change-Id: Iddc57e07133c56000c1338e8d780fa55cc95ab89
2023-03-27 22:48:25 +00:00
Ed Sanders 6e77f963e4 Initial edit check tagging
Bug: T324730
Change-Id: I112015809e55da802e3840fdfeaf16a72e090cb3
2023-03-27 22:47:40 +00:00
C. Scott Ananian 4d8345247a DirectParsoidClient: Remove backward-compatibility workaround
Depends-On: I982e0df706a633b05dcc02b5220b737c19adc401
Change-Id: I316c4f9ddd4483eacb6c88181f0c5edd785cffe5
2023-03-14 21:38:46 +01:00
jenkins-bot 099b8f9968 Merge "Remove visualeditor-enable-experimental and ext.visualEditor.experimental" 2023-03-09 19:33:59 +00:00
C. Scott Ananian 10cb01cdd1 Update DirectParsoidClient to match BCP-47 changes in core
We're trying to avoid passing raw strings around, since they can be
ambiguous specifiers of language.  This patch makes VE compatible
with I982e0df706a633b05dcc02b5220b737c19adc401, with a backward
compatibility workaround which can be removed after
I982e0df706a633b05dcc02b5220b737c19adc401 merges.

The new code also uses slightly more methods of the Language object,
which need to be mocked in a unit test.

Change-Id: I830867d58f8962d6a57be16ce3735e8384f9ac1c
2023-03-08 21:19:21 +00:00
Ed Sanders 55ded73e9d Remove visualeditor-enable-experimental and ext.visualEditor.experimental
These haven't been used for a while, and we usually enable experimental
features via BetaFeatures these days.

Change-Id: Iec3a7da3cc962d8ac9416b508780fcdc3ca58d3e
2023-03-08 15:05:10 +00:00
Ed Sanders 143291b9d0 Doc comment: Replace nbsp with normal space
Change-Id: I5f44f2c3fc80ad6e29eaa8a5aaab2df53614e6f4
2023-01-30 11:09:37 +00:00
Derick Alangi deecb3cdcb Use helper classes from the new namespace
Helper classes have been moved to a dedicated namespace
of their own, this patch references the new namespace.

Depends-On: Ieeb7a0a706a4cb38778f312bfbfe781a1f366d14
Change-Id: I5a2792a3536f6d953905561410f0e4966254ccbe
2023-01-16 14:22:38 +01:00
daniel 3a50a092d9 Catch HttpException early
Catch HttpException from REST helpers, even when they are triggered
already during initialization. This will happen e.g. when the request is
asking for a render key for which the stashed rendering has expired.

Bug: T325310
Change-Id: I9e622b5bb253f5e40fe2b50ff08471beddac9acf
2022-12-15 18:12:37 +00:00
Bartosz Dziewoński ac946cff36 ParsoidClient: Improve return type documentation for Phan
Change-Id: I1aecdc5ab7a21e1ef43ddcec4f4dbea610822493
2022-12-15 00:00:41 +01:00
Bartosz Dziewoński b368d741a1 Don't index VE edit pages
Bug: T319124
Change-Id: Ia738698e93252f884b9045aab5840465d3f0d3d3
2022-12-01 22:26:45 +01:00
daniel f36572432b Use PageRestHelperFactory
This isolates this extension from knowledge about the constructor
signature of the helper classes. Constructore signatures are not stable
interfaces.

Needed-By: Ie430acd0753880d88370bb9f22bb40a0f9ded917
Depends-On: I10af85b2da96568cfffd03867d1cb299645fb371
Change-Id: If1914dbfbefc3501b4d4cef4beb1fae307c36455
2022-11-19 21:21:11 +00:00
jenkins-bot a584e73975 Merge "Remove usage of User::isBlockedGlobally and User::getGlobalBlock" 2022-11-16 15:22:09 +00:00
csimiyu 4bdb4917f0 Remove usage of User::isBlockedGlobally and User::getGlobalBlock
Bug: T318898
Change-Id: I727cda9008866b665395cd0e9969c920dc9c28d6
2022-11-16 17:22:17 +03:00
daniel 7da2df9724 Collect timing metrics for ParsoidClient
We want to be able to measure how backend performance changes
when we switch from RESTbase to calling Parsoid directly.
We expect to see a performance boost, in particular for
html/to/wikitext, since we avoid the network overhead.

Since we will make the switch by wiki, we need to be able to compare
the metric before vs. after for a single wiki. So, this adds the
wiki ID as a prefix to all existing metrics. Once fully rolled out,
we should get rid of the wiki prefix.

We will need to update the dashboard found at this url:
https://grafana.wikimedia.org/d/000000249/edit-stash?orgId=1

Change-Id: Iac9070b27f4b0d25b0e31c9fad38abc08c433a28
2022-11-15 01:15:28 +00:00
daniel ea62ee6b19 Always allow switching to visual when using DirectParsoidClient.
When using DirectParsoidClient, switching should be lossless.

Depends-On: I86c611fa0b717ef619e5ffe550b6c2be49a28c99
Change-Id: Ie30ccbc8c12ce48f481b9f727f28e60d21ee37b9
2022-11-07 21:25:27 +01:00
daniel bb66502100 Use setters to initialize helpers
Use setters instead of constructing fake request data.

Depends-On: I18c8bc6f5aa7c204f0faa56919bfe64026761bd4
Change-Id: I8d778c6e5d0b21f8615e3f330f63675cf51eee94
2022-11-04 13:18:56 +00:00
msantos 72b4f8cdbb Rename HTMLTransform related classes
* Rename imported classes in VE that will be renamed in core
* Re-enable tests that would fail when the core patch is merged

Depends-On: I506f3303ae8f9e4db17299211366bef1558f142c
Change-Id: I59ebeb24fa0de5f10d1501cc0830c7e4805e1003
2022-11-04 11:43:36 +00:00
jenkins-bot 4191ac2a20 Merge "Add HtmlTransformFactory as depdendency for HtmlOutputRendererHelper" 2022-11-01 19:48:39 +00:00
Arlo Breault c1afc62040 Bump requested Parsoid HTML version to 2.6.0
Change-Id: I544d31ca6ea6186a4ddaf7ef25fdea899f454c58
2022-10-20 17:01:17 -04:00
daniel adc017f73f Pick ParsoidClient implementation based on etag.
When receiving HTML from a VE session, process it with the same kind of
ParsoidClient that was originally used to generate the HTML. If we were
to use a different implementation, the ETag wouldn't match, so we would
fail to find the stashed data-parsoid map, and the edit would fail.

Bug: T320704
Change-Id: I3b73431fccacecb4ad88b82f8f5675b1042e03ce
2022-10-20 08:52:20 +00:00
jenkins-bot bf1bacfce1 Merge "Remove AutoConfig setting" 2022-10-14 15:59:07 +00:00
jenkins-bot 669cbcea37 Merge "Use RevisionLookup methods instead of ApiParsoidTrait methods" 2022-10-14 14:16:46 +00:00
Abijeet a9a4d9eab0 Add HtmlTransformFactory as depdendency for HtmlOutputRendererHelper
Bug: T317019
Depends-On: I5e11452f1c531a757e8d860f9c727b5810406bce
Change-Id: Ib4262e95cc333d008b083f74c88919441095f446
2022-10-14 15:47:31 +05:30
daniel 92e52d0bad Remove AutoConfig setting
AutoConfig was used to set VE to call internal REST API endpoints exposed by the parsoid extension.
With DirectParsoidClient available, this is no longer needed.

NOTE: this causes all wikis that do not have a RESTbase backend
configured to start using DirectParsoidClient. This is true in
particular for officewiki and labswiki.

Bug: T320704
Change-Id: Ia4c6184dd75a653c3202ea160b6605335f36f6eb
2022-10-14 10:55:53 +02:00
daniel 07afdba500 Don't try to contact RESTbase directly when in PHP direct mode.
If VE is configured to call parsoid directly in PHP, the client
should not try to fetch HTML from restbase. Doing so will
lead to inconsistencies, and may cause edits to fail.

Bug: T320704
Bug: T320703
Change-Id: I98bfdd305dcd188d91db6a8fe5885156cdeca7db
2022-10-13 11:22:52 +00:00
daniel 35cb550747 Local implementation of ParsoidClient (DirectParsoidClient)
* DirectParsoidClient makes use of parsoid directly for performing
transformations on both wikitext and/or HTML contents.

* Also, it's used to fetch HTML from parsoid's parser cache. Before,
this operation was done via RESTBase but now it's being fetched in
core's parsoid parser cache.

* This patch also enables VE clients to transform HTML to
Wikitext when switching from HTML to source mode on. It
makes use of the HtmlInputTransformHelper to perform this
transformation.

* Now, VE client can make use of core code for switching
between HTML to source mode and back without RESTBase.

Change-Id: I5c7cfcc4086d8da7905897194d8601aa07418b59
2022-10-11 18:34:06 +01:00
Bartosz Dziewoński d2e49b16f7 Use RevisionLookup methods instead of ApiParsoidTrait methods
Part of my secret plan to delete ApiParsoidTrait.

* Inject RevisionLookup into ApiVisualEditor
* Use RevisionLookup::getRevisionById instead of ApiParsoidTrait::getValidRevision
* Use RevisionLookup::getRevisionByTitle instead of ApiParsoidTrait::getLatestRevision
* Use standard MediaWiki error messages
* Delete unused ApiParsoidTrait::getValidRevision
* Delete unused ApiParsoidTrait::getLatestRevision

Depends-On: I7244ee4916fb011fad5faa1d9f837e83f6ac2dc1
Change-Id: I8089c0c516d9dba52e931a0a80740c0361216dbd
2022-10-11 14:54:40 +00:00
Daimona Eaytoy 16ae2da19a build: Update mediawiki/mediawiki-phan-config to 0.12.0
Change-Id: Ib527ec60ac7894d28e330b7080f0e3b0a2b3ddfc
2022-10-08 02:45:31 +02:00
Derick Alangi 1746b76129 ApiVisualEditor: Remove parsedoc VE paction
This VE paction was removed in I90d775dd71d5f5a61d651b63d946ab60a27e2ca3
so this code can be deleted per Bartosz, so this patch removes the code.

NOTE: A merged API test that uses this is also removed along side.

Change-Id: I4ff75df57fd58f508ef7212486e52cb11a7cfb57
2022-10-03 14:12:35 +01:00
Bartosz Dziewoński 8418686893 ApiParsoidTrait: Remove unused abstract method dieStatus
No longer needed after 1177e677e6.

Change-Id: Ie77ff40c6c98208e99efe151ec18544644a3c9b4
2022-09-28 16:00:24 +00:00
Bartosz Dziewoński 209aaf6943 ParsoidClient: Fix getPageHtml() $targetLanguage param inconsistencies
* DirectParsoidClient: Actually allow null to be provided.
  Previously we tried to call methods on it unconditionally.

* VRSParsoidClient: Require the param to be provided (even if null).
  No reason to diverge from the interface, which requires it.

Change-Id: Id9a450dc8b8eb3e82cf87718b96975e5a3c6180c
2022-09-26 22:52:31 +02:00
daniel 0d833c3de1 ParsoidClient: rename language parameter
The language parameter in the ParsoidClient is always the desired output
language.

Change-Id: I10bec964b16fb041d5acfc63f38511e545adafc4
2022-09-26 22:46:22 +02:00
daniel 4c1ec8fc40 ParsoidClient: error should be array or null
This follows up the initial fix with additional sanitation and a
regression test. See I21c7a2b2541061a858a9791a2cb12866acd38dc5.

Bug: T318083
Change-Id: I4e433e711c068336a888f4aafa243455764fd710
2022-09-20 21:05:51 +02:00
Alexander Vorwerk 87ff7a5fec Only die when error string is not empty
Bug: T318083
Change-Id: I21c7a2b2541061a858a9791a2cb12866acd38dc5
2022-09-19 13:25:37 +00:00
daniel 1177e677e6 Remove redundant ParsoidHelper class from VE
All code that used to live in ParsoidHelper has been moved to
VisualEditorParsoidClientFactory and VRSParsoidClient.
ParsoidHelper is no longer needed.

Change-Id: I21c4a8cd86f8d085e75a601ed6d2509dedd75d42
2022-09-15 19:23:05 +00:00
daniel 0cd6c90d5a Extract RESTbase client code into VRSParsoidClient.
This makes the "direct" client and the VRS based client
implement the same interface, so the caller doesn't have to know
which one it is using.

It looks like ParsoidHelper will not be needed if we use this approach.

Change-Id: Ib1c1d7355951fc0765227dd01a9edfc554fc448d
2022-09-14 18:20:36 +01:00
jenkins-bot 47cba98037 Merge "Improve some API param docs and validation" 2022-09-06 22:40:13 +00:00
Derick Alangi 8bfe88b8b1 ParsoidHelper: Make VisualEditorParsoidClientFactory required
In order to make this interface cleaner and not promote the
use of optional parameters when not needed, make the factory
required so that callers should worry about it and not overwork
the helper.

In this case, DiscussionTools extension is already using this
interface and has the factory injected appropriately.

Depends-On: If682af406c0fc7a9eca106eb3ebd95e6c14baddd
Change-Id: I836c0ad73687d8b99d1e067a5c3a3e512b4bd37a
2022-09-06 21:44:29 +01:00
Derick Alangi 8c458e78b4 ParsoidHelper: Remove unnecessary $config
Getting the correct client is now done via the VisualEditorParsoidClientFactory
so this is no longer needed. Follow-up of: I787c0afb227308aab56770d.

Depends-On: I4b9e7362a1bf1b4f224c8c652d40851a18c19824
Change-Id: I175aef2326a0d784fb8211542a3fe90cbf6c6d08
2022-09-06 12:05:39 +00:00
Derick Alangi b029fd8ede Introduce VisualEditorParsoidClientFactory
This patch introduces a factory service for creating VE Parsoid
clients.

NOTE: This patch also injects a GlobalIdGenerator to the client
 and avoids usage of deprecated UIDGenerator class.

Change-Id: I787c0afb227308aab56770d14d62e08eb0084a6c
2022-09-06 12:47:43 +01:00
Bartosz Dziewoński 0ade4be5b6 Restore the $oldid condition for funny ETag logging
Follow-up to 951348dbbf. When creating a
new page on a RESTBase wiki, ETag is actually expected, but it will be
in a different format; the code comment was wrong.

Bug: T316969
Change-Id: Ia36488616ced70b900d2e67ce8e28993cc2c7514
2022-09-03 05:06:44 +02:00
Bartosz Dziewoński 6f3de6d7f0 Improve some API param docs and validation
Change-Id: Ic1319f82e581b1a3c2108ab32449ce75aa187831
2022-09-02 04:20:41 +02:00
jenkins-bot ce37169a51 Merge "Don't send missing $wgVisualEditorTabMessages to the browser" 2022-08-26 18:57:07 +00:00
Bartosz Dziewoński 951348dbbf ParsoidHelper: Stop logging missing etags
While a missing etag on a RESTBase wiki still indicates a problem,
we worked around these problems long ago in T233320 and we don't
really care about the logs any more, and the logging is now dominated
by requests on private wikis where etags are not expected.

Bug: T316234
Change-Id: I4cc29847524863af2c5642cb60371893533a9df8
2022-08-25 21:23:35 +02:00
Bartosz Dziewoński f2df5dc7b9 Improve error messages for RESTBase errors
For error responses, the response body should be JSON containing a
'detail' key with a human-readable error message.

Remove old debug logging for T233320, it's no longer needed and it
stopped working on WMF wikis anyway (again, previously it was broken
due to T234564).

Change-Id: I64d0b934c90c7e9582e5433ae7a1b9ed2bc0c9a2
2022-08-19 21:13:35 +00:00
Timo Tijhof 3901a8a4f1 ApiVisualEditorEdit: Switch to non-global FlaggablePageView::newFromTitle
Introduced in FlaggedRevs with Idbdab9a7396 (6bfd276e64), and I've
migrated consumers away from the singleton in I192b962147 (5ee96e5ca7)
and I04fdbd497b8 (bbdfc4c024).

The one thing that remains global by default is the context, but
VE already avoids that with setContext, and (correctly) restores this
afterward since the FlaggablePageView object is re-used by title.
That's exactly as terrible as it sounds, but at least it's a bit more
visible after my refactor.

Bug: T314008
Change-Id: I0008818ec821c35c570d9db9c82f737783e6729b
2022-08-15 18:02:24 +00:00
Bartosz Dziewoński 84433157aa Migrate usage of Database::select to SelectQueryBuilder
We can simplify the code in Hooks.php to use revision.rev_actor
unconditionally, reverting 391c30da67
(the migration is done: T275246).

Bug: T312472
Change-Id: Iaab268409ec4ad0a8d3a835057321aa3c01a2cc7
2022-08-12 22:35:30 +00:00
jenkins-bot efdde38f85 Merge "Create Parsoid helper for use outside of action API" 2022-08-11 13:39:29 +00:00
Bartosz Dziewoński 8d735bbd9e Create Parsoid helper for use outside of action API
ApiParsoidTrait depends on some ApiBase methods, which is inconvenient
when one wishes to access Parsoid HTML outside of the action API. Move
the bulk of the code into a new class ParsoidHelper, which doesn't.

Replace the uses of methods:
* dieWithError: throw a different kind of exception where it makes
  sense, or change the method to return a StatusValue instead of
  throwing where it doesn't
* getPageLanguage: use Title::getPageLanguage() or pass as parameter
* getConfig: pass to constructor
* getLogger: pass to constructor
* getRequest: pass the only required part to constructor,
  leave some other API-specific code using it in ApiParsoidTrait

Bug: T314565
Change-Id: I90656cc74bb1cb1f2f3c82ad51cfb164cb8a4a4b
2022-08-10 23:20:59 +00:00
jenkins-bot 484dcffaab Merge "ApiParsoidTrait: Mark private methods and properties" 2022-08-10 17:12:03 +00:00
jenkins-bot ebef91b210 Merge "Update code for setting user preferences" 2022-08-10 16:44:42 +00:00
Bartosz Dziewoński 6980c966cd ApiParsoidTrait: Mark private methods and properties
They are not accessed outside this trait.

Change-Id: Ib238c0d5507f717ab0d4af2b6e452c255d260fd0
2022-08-09 23:42:35 +02:00
jenkins-bot dbecc84755 Merge "ApiVisualEditorEdit: Re-order FlaggedRevs logic to avoid breakage" 2022-08-08 09:17:47 +00:00
Subramanya Sastry 5319c49df0 Update call to PageConfigFactory::create to use new signature
* Followup to 43231df9

Bug: T314523
Change-Id: I9a299321344c7bbd481f96132393c45b31a93e52
2022-08-03 15:06:52 -05:00
Timo Tijhof f43dfea1b5 ApiVisualEditorEdit: Re-order FlaggedRevs logic to avoid breakage
Needed for Idbdab9a73964efa5 and I09eb8c3a38c0d4.

Bug: T314008
Change-Id: I8575bb40d0a9d24d481b6f58cd9ba500fe0f0f13
2022-08-01 16:23:10 -07:00
C. Scott Ananian d668492e58 ApiVisualEditorEdit: Transition from 'hidetoc' to 'showtoc' in API result
Bug: T314000
Depends-On: I1644a74370b42b04d0db167879f7de2207ebfcf5
Change-Id: I823f26652b9770ea577daee32bff05864a7498bb
2022-07-28 14:55:27 +00:00
Thiemo Kreuz f09f704364 Don't send missing $wgVisualEditorTabMessages to the browser
This is send as an associative array. Instead of adding elements that
are null we can just not add them.

Bug: T291729
Change-Id: I28d847941eec865cb255779534eca14ec88f588f
2022-07-27 09:13:48 +02:00
C. Scott Ananian 43231df98a VisualEditorParsoidClient: use the new PageConfigFactory::create() signature
Depends-On: I79a2773bf6d2366593b31555afd0b548b66d222a
Change-Id: I40b0c7159c493f7ff12085f9845fc5399102df2f
2022-07-26 21:21:40 +00:00
vahurzpu 766884b41d ApiVisualEditor: set title when expanding permission editnotices
Before, permission editnotices didn't have access to the page titles, so
magic words like {{PAGENAME}} would give a subpage of Special:Badtitle. This
formats the message in the appropriate context.

Bug: T313372
Change-Id: I93894a4fc129de9da4b120c084b1d343b4021cdd
2022-07-20 10:48:56 -04:00
Thiemo Kreuz 139e6547d1 Remove unused media/meta-related messages
visualeditor-dialog-media-thumbdimensions
Added in 2014 via I7b4d019, but never used, as far as I can tell.

visualeditor-dialog-media-searchselect
Unused since I65aed34 from 2015.

visualeditor-dialog-meta-settings-displaytitle-enable
The feature was removed in 2017 via I46db6b1.

This patch also marks some other messages as being used via comments.

Change-Id: Ia10b6a5c0ea83dd670e2cfdbaa768c41fc0cf392
2022-07-13 13:56:41 +02:00
jenkins-bot 93b18174c1 Merge "Avoid preloading base translation page in editor" 2022-06-26 19:17:17 +00:00
Umherirrender ab823c0115 Replace deprecated WikiPage::factory
Remove WikiFilePage instance check, isLocal exists also on WikiPage and
newFromTitle never returns null

Bug: T297688
Change-Id: I925771a84afe4402fdb0f201c0b562c7028c44b2
2022-06-24 23:06:39 +02:00
Thalia 73d163e77a Avoid preloading base translation page in editor
Bug: T309329
Depends-On: I739cee94620bc8d0689a4d3ec5898bfd75c18b8a
Change-Id: I29aa56627c74edf38573fd9aff52a015de92cc00
2022-06-22 14:59:57 +01:00
Jon Robson 3d4e0f71b1 Use SkinTemplateNavigation::Universal
Web team plans to deprecate the SkinTemplateNavigation
and  SkinTemplateNavigation::SpecialPage hook. The
Universal hook can cater for both cases.

Bug: T255319
Change-Id: Ifad4918cf5d3d6b3f4d7abeb48d27fc5a46764b3
2022-06-21 22:34:55 +00:00
Bartosz Dziewoński a2611086d0 Update code for setting user preferences
Bug: T310809
Change-Id: I0a2d58517a94f5fd52cd83cc42d440d69c2e97a7
2022-06-21 19:44:50 +02:00
jenkins-bot 5e0755d369 Merge "Force "new template dialog sidebar" feature flag to be true" 2022-06-17 07:12:27 +00:00
jenkins-bot 1119d52cd8 Merge "Fire new 'wikipage.tableOfContents' hook to update TOC after save" 2022-06-16 17:28:50 +00:00
Thiemo Kreuz cf9fea9688 Force "new template dialog sidebar" feature flag to be true
I suggest this as the first, most minimal step. This allows us to
slowly remove all the code that uses this flag without breaking
anything on wikis where the feature flag is not enabled. In other
words: this patch turns all code that expects this flag to be false
into dead code. We can then slowly remove said dead code.

Bug: T289049
Change-Id: I523978f7ca72dfc1cc7b64741e2f4f20ed3adfb7
2022-06-16 18:09:26 +02:00
Adam Wight 1b4c81c27d Remove $wgVisualEditorTransclusionDialogInlineDescriptions feature flag
The feature is always enabled now.

Bug: T307188
Change-Id: Id8b39d44901dee9118837fc4670d7faa4ef19b43
2022-06-15 12:09:47 +02:00
Adam Wight e1ea921f76 Remove $wgVisualEditorTemplateSearchImprovements feature flag
The feature is always enabled now.

Bug: T307188
Change-Id: I34a3db44355d93413f611b99cd80b876d8737413
2022-06-14 10:48:19 +02:00
jenkins-bot d7140912c7 Merge "Fix tab messages being changed wrong by JavaScript" 2022-06-13 21:15:09 +00:00
Bartosz Dziewoński dc842277c7 Fix tab messages being changed wrong by JavaScript
Following the MediaWiki changes from T301203, we should use
the messages 'skin-view-edit' and 'skin-view-create' instead
of 'edit' and 'create'.

(Also remove redundant definitions in extension.json, we load
all messages listed in 'VisualEditorTabMessages'.)

Bug: T310529
Change-Id: If055fa2a4dc009be869425e6c2262c9b62056179
2022-06-13 20:21:32 +02:00
jenkins-bot fcf849ddb0 Merge "Remove $wgVisualEditorTransclusionDialogBackButton feature flag" 2022-06-13 08:12:40 +00:00
Adam Wight 2e2e40e76e Remove $wgVisualEditorTransclusionDialogBackButton feature flag
Feature is always enabled now.

Bug: T307188
Change-Id: I70305ec3d2ed9cfb767ee9ea90e8ed6c93cfbdbb
2022-06-10 17:33:56 +02:00
Adam Wight 23f0bdf822 Remove $wgVisualEditorTransclusionDialogSuggestedValues feature flag
Feature is always enabled now.

Bug: T307188
Change-Id: I6f8288d31fecc6827a7a9e5e9705239e15c86ae2
2022-06-10 16:40:06 +02:00
Bartosz Dziewoński d6b5001580 Fire new 'wikipage.tableOfContents' hook to update TOC after save
Bug: T294950
Bug: T307480
Depends-On: I6cf76c870124c162dc1bcbc2f7e9ca0c5fdcd10e
Change-Id: Icaeda68ded94a04edef7a3629385eeb232048684
2022-06-09 11:31:50 -04:00
Reedy 9ee13d8471 Remove global class aliases
Change-Id: Id9b021f47d2ec181e5267e454a39ed3cafdec9d2
2022-06-06 17:23:23 +00:00
jenkins-bot df6b5fab51 Merge "Bump requested Parsoid HTML version to 2.4.0" 2022-05-25 00:01:18 +00:00
jenkins-bot bb7f777ffe Merge "Zero-configuration VisualEditor for mainline" 2022-05-25 00:01:15 +00:00
Tim Starling b9b6695c5a Use new ResourceLoader namespace
Extensions using Phan need to be updated simultaneously with core due
to T308443.

Bug: T308718
Depends-On: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
Change-Id: I9a20c25b9cea26e1fbe0f0434a0800632e9e0fc7
2022-05-24 22:59:39 +00:00
C. Scott Ananian ede9ffbd43 Bump requested Parsoid HTML version to 2.4.0
Visual Editor currently requests MediaWiki DOM version 2.0.0
when talking to Parsoid.  Since Parsoid treats that as a request
for 2.4.0, its current version, and Parsoid doesn't have a
2.4.0->2.0.0 downgrade path, passing the latest Parsoid version
(2.4.0) should make no difference in practice -- but would better
match current reality.

Change-Id: Ia2bc0c1981db6f573a69fb1910cef4304c80ae00
2022-05-20 15:01:09 -04:00
C. Scott Ananian 57dc7aa630 Zero-configuration VisualEditor for mainline
Now that Parsoid's ServiceWorkers have been merged to core, this adds
support for "zero configuration Visual Editor" to the master branch.
Like earlier zero-conf work, this does not use RESTBase for stashing
or for reliable selective serialization.  Future integration work
with ParserCache will reintroduce this functionality.  Nevertheless,
this implementation should have feature parity with the "loopback interface"
zero conf VE we've been shipping since 1.35.

Bug: T305108
Change-Id: I7b5b4a6d16b07914f947cbaf498ad1d3cf2447a5
2022-05-20 15:01:09 -04:00
Arlo Breault d8aa99e35c Stop passing scrub_wikitext
It's no longer optional in Parsoid.

Bug: T297298
Change-Id: Ice36f4f4b82b0286799e9eedd164ca8d2dfc2b2e
2022-05-17 19:51:17 -04:00
Timo Tijhof 54d44ccb6c ApiParsoidTrait: Log trace as 'exception.trace' instead of 'trace'
This ensures proper redacting, and consistent discovery and formatting
for Logstash queries.

Bug: T233342
Change-Id: I9a2a96793a5b7669648d222a0d472c15c09b84d3
2022-05-15 20:21:34 +00:00
jenkins-bot 2861442874 Merge "[doc only] Update comment in ApiParsoidTrait which mentions renamed file" 2022-05-11 13:22:47 +00:00
C. Scott Ananian 26df6d45c2 [doc only] Update comment in ApiParsoidTrait which mentions renamed file
This file was moved in 3f0f302577
(July 2019).

Change-Id: I310f8ad171cb927b93f61d4a7677741c3cb8faf1
2022-05-10 20:31:24 -04:00
Bartosz Dziewoński 4ebf2ae8bf Restore global context fiddling to fix FlaggedRevs edit notices and checkboxes
Partially reverts aed5bcf7d0.

Bug: T307852
Change-Id: I6aee2266c6b4dce560196c87b518ac25a493623a
2022-05-11 00:08:41 +02:00
jenkins-bot e0da7b6c8c Merge "ApiVisualEditor: Inject WikiPageFactory, UserFactory & HookContainer" 2022-05-05 21:11:42 +00:00
Mark A. Hershberger 3022b0e4e6 Hooks::onRecentChangeSave: Don't pass null to explode(), avoiding PHP 8.1 deprecation
Change-Id: Iaf2ad6b37c86e1555aaffe6dd08d9e511b319256
2022-05-02 12:11:19 +00:00
Derick Alangi 189e09e382
ApiVisualEditor: Inject WikiPageFactory, UserFactory & HookContainer
Change-Id: I940d266e10fc76329bebcdf18ac991b01a2a7a4f
2022-04-29 12:16:59 +01:00
Bartosz Dziewoński a420141b2a ApiVisualEditor: Fix 'stash' param validation (it's a boolean)
Bug: T306190
Change-Id: I49a479f79d220c7436364f7543bae9e091fff6a2
2022-04-19 21:53:03 +02:00
Umherirrender 47d1d4b385 Remove usage of protection related deprecated Title function
Bug: T306131
Change-Id: Id551a318a9bb1047e449e0ad284b8f73c8886aad
2022-04-14 22:06:02 +02:00
gerritbot 41fa36d7a9 Fix usage of ApiBase::PARAM_* deprecated constants
The ones that are replaced with ParamValidator

Bug: T275455
Change-Id: I9dc1a587ded43d7211b1518b0b34d8dbb29381bf
2022-04-04 01:30:46 +02:00
Kosta Harlan 9241add01e Allow hook implementations to modify params
This is needed because the $params array is then passed on to
ApiEditPage, so if the hook implementer wants to alter the data used
with the edit, it needs to be able to modify the $params.

See I494d72a42d9103c28c4d44077cfe0f1269fc7b00 for an example where
GrowthExperiments would like to modify the 'tags' parameter for an
edit.

Depends-On: Idd052281898f99e4f13f241d5633294b59b29329
Bug: T304747
Change-Id: Ia4842a1593028f5fa145de167ccf9b72efa81351
2022-03-29 11:31:30 +00:00
Reedy 239fbb64e4 Namespace rest of the extension
Change-Id: I4f3e2793099d81401035ea282f268a3afaa03067
2022-03-14 22:27:15 +00:00