Commit graph

14089 commits

Author SHA1 Message Date
jenkins-bot d411175cd8 Merge "TemplateDialog: separate “Add template” messages" 2022-12-28 23:46:27 +00:00
jenkins-bot 729eb1a79c Merge "Remove redundant/conflicting ARIA label in template dialog" 2022-12-28 23:45:27 +00:00
Pols12 afca7bf0af TemplateDialog: separate “Add template” messages
Use distinct messages for section heading, button label and input
aria-label, to allow a potentially better localization.

Bug: T304121
Change-Id: I3e3b06a035e2f11f5f32face789b934e22916e49
2022-12-22 15:08:31 +01:00
thiemowmde a8fc627f3c Remove redundant/conflicting ARIA label in template dialog
The ARIA label was added via Ieeb29de. It was reusing an existing
message.

Later we added a placeholder to the same input field via I07c6e60.
Since then screenreaders possibly read two texts: "Find template" and
"Add template".

Bug: T296465
Change-Id: Icb8d5419b4a4e34a224744873c557cb873e17c40
2022-12-22 15:07:24 +01:00
David Lynch e9b2965655 Log bucket/token for the DiscussionTools mobile a/b test
Bug: T321961
Change-Id: I1e809c4405a561b75e59d2c27edbfc8a3e838f09
2022-12-16 14:44:29 -06:00
Thiemo Kreuz 8a42b05622 ve.dm.MWTemplateSpecModel: Document some large params as private class
While at it, also fix a few broken uses of `@see` where `@link` was
intended or for full names, there is no syntax needed, as JSDuck
already links those.

Change-Id: Iaeb46b05c6f2e6f00198bc2ae773c895935b4cea
2022-12-15 23:35:11 +00:00
Bartosz Dziewoński b6929d5be1 Change mw.libs.ve.getTargetDataFromHref to not return bogus data for external links
For external links, `.title` and `.rawTitle` properties previously
contained the external link corrupted with some normalization intended
for MediaWiki titles.

This was useless, and in fact no caller actually uses this value:
they all check `.isInternal` first before accessing `.title` or
`.rawTitle`.

Also, correct other parameter documentation.

Change-Id: Ieeab56548f0a3b2f81a90f0d3ae0f81d744aa67b
2022-12-14 22:57:04 +01:00
jenkins-bot 0c5f131976 Merge "Use new stable API for subtitle modification" 2022-12-14 04:12:38 +00:00
Jon Robson 612a307d68 Use new stable API for subtitle modification
Bug: T324876
Depends-On: Id8436324e2ae2fd9f488b65b3b7bfc19611870d1
Change-Id: I8e538939a6d7d4474f2e96b93040f3c68c2f98ec
2022-12-13 01:13:46 +00:00
Bartosz Dziewoński 133cacc42d Remove obsolete browser support checks for HTML5 History API
It is available in all browsers we support.

Change-Id: I6c860eadd91e6e4061ed0364be0dc8c7b750d3e7
2022-12-12 20:47:32 +01:00
Bartosz Dziewoński 237ffde471 ve.ui.MWPopupTool: Update usage of 'mediawiki.feedback'
* bugsListLink option no longer exists (I0ea65bf97d)
* bugsLink doesn't require mw.Uri

Change-Id: I9ab9d8b096a58fe0c49b296b121e5fe9a8dfd8bd
2022-12-12 19:43:14 +01:00
David Lynch 2b49b3bde7 Try/catch around mw.Uri when decoding parsoid resources
An incorrectly-encoded fragment is allowed-in-wikitext but will make
mw.Uri throw an error. e.g. `[[foo#1%bar]]`

Bug: T324976
Change-Id: I97cb85507d9ae3d648300245dd7e48cc239c4d90
2022-12-12 09:37:30 -06:00
jenkins-bot c4f9513110 Merge "Always sanitize href attribute in UI" 2022-12-09 23:40:22 +00:00
jenkins-bot 2b39fa6246 Merge "Always sanitize href attribute in CE nodes" 2022-12-09 23:38:16 +00:00
Francois Pignon 1b27b12b66 Optimize some jQuery selectors
Bug: T324523
Change-Id: I5d749e222b01a4f6abbc4517a8b568ad3e73e47f
2022-12-06 00:05:06 +00:00
jenkins-bot f6047f8642 Merge "Handle errors when rendering visual diffs" 2022-12-05 23:35:01 +00:00
jenkins-bot 4263eb1786 Merge "Adjust to changes to redlink behavior from parsoid" 2022-12-05 20:26:34 +00:00
David Lynch 83a46a7817 Adjust to changes to redlink behavior from parsoid
Redlinks now come down with a `mw:LocalizedAttrs` typeof, and have the
display URL parameters rather than being bare titles.

Bug: T324352
Change-Id: Ia1776e6e1f171d227c7c402b39ca96d17fb56cdb
2022-12-05 11:55:33 -06:00
Ed Sanders 5e503eb378 Always sanitize href attribute in UI
Bug: T322704
Change-Id: I19f722c40f1f8e5b55e44d9fb11109a6f9951c06
2022-11-30 18:26:37 +00:00
Ed Sanders 7afbe7516d Always sanitize href attribute in CE nodes
Bug: T322704
Change-Id: I0ce6d57adf7c688d11f6fc39af291b44c4b5aeeb
2022-11-30 18:26:37 +00:00
Bartosz Dziewoński 1ea3bf3013 Handle errors when rendering visual diffs
There are some known bugs that we probably will not investigate
(T313809, T317455). Do something better than an infinite loading bar.

Follow-up to ee7c5d9d1a.

Change-Id: I339de7662ff68c2ea9bb1a738bb4207d1c399e59
2022-11-30 18:17:54 +00:00
Bartosz Dziewoński c9a9b619aa Only hide #siteNotice on skins where it's shown in the editable area
Bug: T324055
Change-Id: I07139358d0e20582a53fc6820ae022b9edc0ba95
2022-11-29 21:19:46 +01:00
Bartosz Dziewoński 62d80ff88d ve.init.mw.DesktopArticleTarget.init: Remove redundant selector
Hiding '.ve-init-mw-desktopArticleTarget-editableContent #toc' is not needed
when we already hide '.ve-init-mw-desktopArticleTarget-editableContent'.

Change-Id: I9f7dc5f64be1f392e846da5bcfcd0a5d17a65014
2022-11-29 20:52:03 +01:00
jenkins-bot a4919ff345 Merge "Do not grey out page title while loading NWE on Vector 2022" 2022-11-24 14:00:35 +00:00
Bartosz Dziewoński a7395a04d7 Do not grey out page title while loading NWE on Vector 2022
The "uneditable content" styles should not be applied if the page
title is outside of the editor, like on Vector 2022 since T310839.

Bug: T322725
Change-Id: I212e41e3770807d43b4c58377ce77f4521e6b489
2022-11-24 13:43:45 +00:00
Ed Sanders 4bf8955c18 Link inspector: Avoid focussing a input when it isn't visible
Bug: T321026
Change-Id: I4edcf9c0cbe13eac450bc8e05883c7506b8dbfaf
2022-11-18 13:25:40 +00:00
jenkins-bot 82c845d30d Merge "Always allow switching to visual when using DirectParsoidClient." 2022-11-07 23:04:10 +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
jenkins-bot 2b5aeaf649 Merge "Improve smooth scroll to section with visual section editing on desktop" 2022-11-06 22:53:44 +00:00
jenkins-bot a46d76bc1e Merge "Platform: Handle invalid JSON in the other path in #getUserConfig" 2022-11-06 22:47:50 +00:00
Bartosz Dziewoński 288159d65c Platform: Handle invalid JSON in the other path in #getUserConfig
I discovered recently that I had 64 KB of text stored in the
'visualeditor-findAndReplace-findText' preference.

I must have accidentally copy-pasted a whole page into the "Find"
field, the JSON that VisualEditor tried to save became invalid after
MySQL chopped off the string after 64 KB, and since then VisualEditor
was unable to update the find-and-replace dialog preferences.

Change-Id: Ib1d853263d873d969c7b015b3842524e1f7fc351
2022-11-06 22:40:40 +01:00
Bartosz Dziewoński d2bbd0ed76 Improve smooth scroll to section with visual section editing on desktop
Follow-up to 8101b6511e.
$toolbarPlaceholder.outerHeight() only needs to be added when not
using visual section editing.

Change-Id: Idc7d9d59dea9eacbb8ee584c69e6bc4798562ea1
2022-11-04 19:53:43 +01:00
Jon Robson 282d075e0c Don't log errors due to missing edit buttons
There's nothing we can do about missing edit buttons - they are likely
being scrubbed by some script or gadget, so let's not report the error.

Bug: T314952
Change-Id: Icf778074026a24561c228cbf11e583062571d0cb
2022-11-03 02:22:54 +00:00
Jon Robson 99f8a7275a wgAction is not a number
Follow up to Icd227fc54f3bc16d5ce84c419b69344ca0d21f28
Currently showing up in logs as "NaN" but logged elsewhere
so not needed.

Bug: T314952
Change-Id: I0bf0d428384aa35bd43be026d451d62a2c237267
2022-10-26 19:39:43 +00:00
jenkins-bot b0cdf612a3 Merge "Allow more 'rel' values on external links in Parsoid output" 2022-10-26 16:44:19 +00:00
jenkins-bot b81e8e3e2e Merge "ve.dm.MWMagicLinkNode: Fix matching RFC magic links" 2022-10-26 16:44:16 +00:00
Bartosz Dziewoński 56195923d8 Allow more 'rel' values on external links in Parsoid output
Follow-up to I4070b3b16c8b2b76a0e7a67599efd914cbde63aa.

Bug: T321437
Change-Id: I4917c208251b4bcf1d31b07e717266970cb1516d
2022-10-26 01:07:08 +02:00
Jon Robson 131d6a247d Add further debugging information
I would really like to get to the bottom of this :)

Bug: T314952
Change-Id: Icd227fc54f3bc16d5ce84c419b69344ca0d21f28
2022-10-25 00:45:44 +00:00
Bartosz Dziewoński 0a2db9c1e9 ve.dm.MWMagicLinkNode: Fix matching RFC magic links
We need to strip the protocol on both sides. This might have been broken
by Ic00b38b04ce78178c64c13bab7f1b2e4b6c5b803 in MediaWiki core.

Bug: T321437
Change-Id: I11903b767aebfdb189a8d54fbf6fb7f8ce9ffb6a
2022-10-24 17:18:05 +00:00
Bartosz Dziewoński fdb7390d27 Allow 'nofollow' on external links in Parsoid output
Bug: T321437
Change-Id: I4070b3b16c8b2b76a0e7a67599efd914cbde63aa
2022-10-24 18:49:58 +02:00
jenkins-bot e115c05504 Merge "logger: Also log VisualEditorFeatureUsage events via Metrics Platform" 2022-10-24 13:07:29 +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
Sam Smith ddb5ac3a14 logger: Also log VisualEditorFeatureUsage events via Metrics Platform
The VisualEditorFeatureUsage instrument is a candidate for migration to
the Metrics Platform [0]. The first step of the migration is to log
events both using the Event Platform directly (i.e. via
mw.eventLog.submit()) and using the Metrics Platform client (i.e. via
mw.eventLog.dispatch()).

The Metrics Platform Client can mix in additional information -
so-called context attributes [1] - based on the stream configuration.
The majority of the default values mixed into each event are already
known to the Metrics Platform Client.

Note well that the Metrics Platform client will not log an event without
one or more streams being configured to receive that event. Therefore,
this change is a NOP.

An example stream configuration is given in [2].

[0] https://wikitech.wikimedia.org/wiki/Metrics_Platform
[1] https://gerrit.wikimedia.org/g/mediawiki/libs/metrics-platform/
+/aed6738b845/js/src/StreamConfig.d.ts#31
[2] https://phabricator.wikimedia.org/T309602#7973206

Bug: T309602
Change-Id: If40fcc6cae371788b98365953218300a5c0b3ca1
2022-10-19 22:53:47 +00:00
Sam Smith 75dc014db9 Use wgWMESchemaVisualEditorFeatureUseSamplingRate config variable
... for the sampling rate for the VisualEditorFeatureUse schema.

Bug: T312016
Depends-On: I259757db0c4441a3fcfce505d5bc82dcf2acf58c
Change-Id: I4e03b442568ed695a14d280b0e8dd92e22616426
2022-10-19 07:46:18 -06:00
Ed Sanders 2a4b4f6b96 GalleryContextItem: Only count image node children
Bug: T320874
Change-Id: I524901619820482c7152d7c7b9bc4a2b9f6ee3ca
2022-10-16 00:03:26 +01:00
jenkins-bot 77565dabf3 Merge "De-duplicate replacePageContent methods between desktop and mobile" 2022-09-29 14:00:00 +00:00
jenkins-bot 2cbf2470dd Merge "ve.init.mw.DesktopArticleTarget: Fix double <div class="mw-parser-output"> after saving" 2022-09-29 13:38:40 +00:00
Ed Sanders 1992281c82 De-duplicate replacePageContent methods between desktop and mobile
Change-Id: Icab82207d516843e7f2e4ba93b8ea4ffea7cad1b
2022-09-29 01:20:55 +02:00
Bartosz Dziewoński db82eb0263 ve.init.mw.DesktopArticleTarget: Fix double <div class="mw-parser-output"> after saving
Follow-up to 327bd736c5. .html()
replaces the inner HTML, .replaceWith() replaces the outer HTML.

Change-Id: I3c963c0a54f5aee4179c37a87466dffceb8c6a87
2022-09-29 01:15:13 +02:00
Ed Sanders b8bb53b79d ArticleTarget: Only overwrite title when not loading from view page
The previous implementation tried to do this, but looked
at the query string which can be set to action=edit by VE.

Bug: T318772
Change-Id: I4f0f8d52488a6b259033232afb8ea616458275de
2022-09-28 16:44:35 +01:00