Commit graph

14077 commits

Author SHA1 Message Date
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
Ed Sanders 596575582c Follow-up Ieba322fd: Don't generate postedit notification now we set config var
Setting the config var then loading mediawiki.action.view.postEdit
will already trigger the notification code, so we can remove this
duplicated code now.

Bug: T240041
Change-Id: If0d1aa4e734dab7cca168e78216f229b9924bab7
2022-09-26 12:08:54 +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
Thiemo Kreuz 003f5fc82e Remove redundant/unused CSS for template parameter page
A lot of this just repeats what is already set by some other rule,
e.g. because it is the OOUI default anyway. Warning. This patch is a
little more agressive. I tested it on desktop and mobile, even with
MonoBook, and could not spot a different. Please do some more tests.

Change-Id: I0ee6e70f4f14c20d431643c53031d6d5b8df1aa2
2022-09-12 11:32:39 +00:00
jenkins-bot f153331ee3 Merge "Remove redundant "choose" event handler" 2022-09-12 10:03:52 +00:00
jenkins-bot b3443cd96c Merge "Enable template editor toolbar deeper in the stack" 2022-09-12 09:52:26 +00:00
jenkins-bot 58aacfa046 Merge "Fix parameter labels not being clickable" 2022-09-12 09:50:04 +00:00
jenkins-bot 5d24bea80a Merge "Start with last item when shift+tabbing into parameter list" 2022-09-08 12:40:40 +00:00
jenkins-bot ee9866bfc9 Merge "Make "(undocumented parameter)" part of the parameter label" 2022-09-08 11:52:52 +00:00
jenkins-bot b00c52556b Merge "DesktopArticleTarget.init: Get $targetContainer after jQuery ready" 2022-09-06 22:17:23 +00:00
Jon Robson ecfc3f18e4 DesktopArticleTarget.init: Get $targetContainer after jQuery ready
$targetContainer was calculated at the top of the file,
but it's only guaranteed to be available after jQuery ready event.

Bug: T314952
Change-Id: Id5d0c71433bfc51cb7193ee1b931a7dd8a4324d9
2022-09-04 02:43:19 +02:00
jenkins-bot 4687e27ffa Merge "Fix logic for getting the *available* preferred editor" 2022-09-01 20:41:25 +00:00
Ed Sanders a625d0b7b7 Fix logic for getting the *available* preferred editor
Factor out getAvailableEditPageEditor from getEditModeFromUri
and use instead of getEditPageEditor everywhere.

Bug: T316776
Change-Id: I34bab092b829124c52f8bc0e262a9c3aa17f2c52
2022-09-01 22:25:53 +02:00