Commit graph

412 commits

Author SHA1 Message Date
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
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
jenkins-bot 35e1f36b7b Merge "ApiVisualEditor: Remove $wgTitle hack, set page for {{PAGENAME}} when needed" 2022-03-10 13:07:10 +00:00
Bartosz Dziewoński 39e0e865e8 Fix handling of disabled 'mobileformat'
Boolean parameters must be omitted completely if they're false.

Bug: T303262
Change-Id: I007640b59cf0f7861c72804109e09c118c250e7c
2022-03-08 14:00:34 +01:00
C. Scott Ananian d8b3ea9561 Replace deprecated Sanitizer::removeHTMLtags() with safer ::removeSomeTags()
This also matches the current code in OutputPage::setPageTitle()

Depends-On: Ic864c01471c292f11799c4fbdac4d7d30b8bc50f
Change-Id: I018b34bb5f6e113056da9b04cc72d4318422adce
2022-03-04 14:30:47 -05:00
gerritbot 3f5108fd1e Change use of deprecated getLazyConnectionRef
Bug: T255493
Change-Id: Ic323d820547c126e91bf82cd884db9d28ffbad41
2022-03-04 17:24:00 +01:00
Matěj Suchánek 2d6b737209 Show correct button label in the missing summary notice
The button in the top-right corner says "Publish changes",
not "Publish page" (if you save an existing page).
Saving an existing page is more common then creating
a new one.

Change-Id: Ia9516932672820baa0344c77683836cc391cefc7
2022-03-01 10:57:26 +00:00
Bartosz Dziewoński aed5bcf7d0 ApiVisualEditor: Remove $wgTitle hack, set page for {{PAGENAME}} when needed
Depends on core changes I242e042317 and I6e9356a6cc to set the context
page for messages generated in Title::getEditNotices() and
LogEventsList::showLogExtract() too.

Set the context page for other messages whose overrides on Wikimedia
wikis commonly depend on it, which I checked using Global Search, e.g.
https://global-search.toolforge.org/?q=PAGENAME&regex=1&namespaces=8&title=Editingold

Depends-On: I242e042317a1e16c8d51edbf7800c8b7d70d468e
Depends-On: I6e9356a6cc3b9df9b508c3d37a0b9b75d6825efd
Bug: T300184
Change-Id: I0746618b1f6da3e5fd213d8adad9b1f4ec2fe23b
2022-02-28 23:43:54 +00:00
Thalia b0c0917f19 ApiVisualEditor: Support Special:MyLanguage for preload param
This allows nonexistent translated pages to fall back to the
corresponding page in a suitable language.

Bug: T299544
Change-Id: I43f461e9f595c364ecdaf2faccbd580fc0df6799
2022-02-25 12:23:16 +00:00
David Lynch 14f99d05fd Avoid undefined index for mobileformat
Bug: T302344
Change-Id: Icf051b6fdec627c6477a7b2abd1ba4ccd5b3a259
2022-02-22 21:23:07 +00:00
Ed Sanders 93a7f33989 ApiVisualEditorEdit: Pass useskin & mobileformat to ApiParse
Passing the useskin parameter ensures that output hooks are run
on the new page HTML. This already happens because we request
the 'subtitle' and 'categorieshtml' props which also trigger
skin mode (along with the 'headhtml' which we don't request).

However it is better for us to be explicit that we want the rendering
for a specific skin, rather than relying on these props to trigger
the correct mode.

Also pass through mobileformat param, which is added by a hook
in MobileFrontend.

Change-Id: I1cd2c5c5c13ae0b90cc32e441b453532343a434a
2022-02-18 16:59:07 +00:00
Ed Sanders 5f8c5144ca Remove 'Hook' from new hook's method name
Only the class name needs the -Hook suffix.

Change-Id: I8c600ddb24a9d3a33ed78501639032d98e1e575f
2022-02-14 23:26:05 +00:00
jenkins-bot 6df803a821 Merge "Introduce VisualEditorBeforeEditorHook" 2022-02-12 00:54:15 +00:00
Bartosz Dziewoński 8c0a6bce38 Modernize some warnings about account not being registered
Matching MediaWiki change I7a7046bf9b9765cbb82ec3caa1530de7f05e0da4.

Change-Id: I5b2587f00d00622a5e431d0fd69bdf8979b7bc53
2022-02-09 21:26:18 +01:00
Ed Sanders ef29801474 ApiParsoidTrait: Make $title optional as it is not required when $oldid set
Change-Id: I307b649bf69e72ee5ca58c394af40e31c860d463
2022-02-08 15:09:28 +00:00
jenkins-bot 934af1d42d Merge "ApiParsoidTrait: Add "@return never" for Phan" 2022-02-05 23:43:24 +00:00