Commit graph

2553 commits

Author SHA1 Message Date
Bartosz Dziewoński 51a8541255 Replace references to actionsToolbar
Target#actionsToolbar and Target#toolbar refer to the same object
since change dfaed62d3632d381db9682c603b3ddbeed182292 in VE/VE
(barring bugs like T335469). Once we no longer use the old name,
we'll be able to remove this backwards-compatibility alias.

Bug: T335469
Change-Id: I577e8ae6a857519eb0e8181543ca0a96b515e019
2023-04-27 15:51:35 +02:00
jenkins-bot 1f4bd72f18 Merge "Add narrowConfig for 'Insert' and 'Publish changes'" 2023-04-13 22:23:48 +00:00
Ed Sanders 9c61620fac Add narrowConfig for 'Insert' and 'Publish changes'
Bug: T92315
Change-Id: I4d35e7bc3d04312fc15632acae06cc43839bbf11
2023-04-12 23:05:08 +01:00
Ed Sanders 2df6c004a3 Drop some IE hacks
Change-Id: I97b0f1b8cb5e799d151177c43dc8a990cf6015bd
2023-04-12 16:32:59 +01:00
Ed Sanders 55eefc366b Remove convertToWikitextOnPaste flag
This was introduced as a temporary flag for
DiscussionTools, and was removed in I0514e8f8.

Change-Id: Ia8d82baf4b93cf7de53b58ba19fa31856f1bc011
2023-03-29 18:43:36 +01: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
Bartosz Dziewoński 766bdedf70 Centralize EditAttemptStep logging code in WikimediaEvents
* Use the new mw.track() handlers from WikimediaEvents
* Ensure that 'integration' and 'mode' are set on init
  events, since they're not guessed in the handler any more
* Remove the setting of 'editingStatsId' tracking parameter,
  now happens in WikimediaEvents by setting an API AJAX option
* Replace ve.track with mw.track in VE-MW, so that we don't have
  to copy the events manually here and in other extensions

This must be merged together with WikimediaEvents change
Iace4d53a972396ca5b8713000570cc47c9986034 (but we can't use
Depends-On, because CI requires code here to be removed first).

Bug: T332438
Change-Id: I0ef0a96aafdf89a4ebe32131a85b18c25744bb2c
2023-03-24 21:48:45 +01:00
Bartosz Dziewoński 1cdb641116 Simplify timing tracking code
Peel off some layers, remove some unused computation,
remove code from ve.init.mw.trackSubscriber.js (which
is to be removed in T332438).

Change-Id: I4073b9a2a4b2af06f30e603a9d2a1968203f3b6d
2023-03-24 21:48:14 +01:00
jenkins-bot dc9fe4344f Merge "stylelint: Auto-fix selector-pseudo-element-colon-notation" 2023-03-17 18:00:34 +00:00
Ed Sanders 860d9ae926 Render category diff
Bug: T161290
Depends-On: I118e85d7fa8202717db3a323e3e3dd9bc8a25be5
Change-Id: Iaa401b130bd81b8960f799dc9de6f172d9ba86a3
2023-03-15 13:10:23 +00:00
Ed Sanders 7954f5897c Update VE core submodule to master (f5142bc0d)
New changes:
1b912ce6b ve.ui.DiffElement: Don't override margin on added/removed block elements
a43720b34 [BREAKING CHANGE] Move ve.dm.MetaList to ve.dm.Document
e7d6d2317 ve.dm.VisualDiff: Include metadata in diff

Local changes:
* Use new ve.dm.MetaList API

Bug: T331925
Change-Id: Id21c122d48519013a5c3325cc4bc316cedcb63f6
2023-03-14 23:07:14 +01:00
James D. Forrester ffc2b27bf9 stylelint: Auto-fix selector-pseudo-element-colon-notation
Depends-On: I0cc0c16c5adae09090a30453431fe492f3475a69
Change-Id: Ie975f0534f32e46face9ab2ba0e0d3af11533de6
2023-03-12 22:03:06 +00:00
jenkins-bot b5b4d42b3b Merge "Target#tryTeardown should succeed when target isn't active" 2023-02-07 16:41:05 +00:00
Bartosz Dziewoński 5736f8ead6 Target#tryTeardown should succeed when target isn't active
It makes other code easier to write when we want to make sure
that no target is active.

Change-Id: Ica75f8334ef32ffbcc59109a46624acdf271847d
2023-02-07 00:03:07 +01:00
David Lynch d8fd73d72a Avoid error if watchlist has been toggled before editing
onWatchToggle didn't cope with the case where there was already an event
in the hook-queue when it was registered during setup

Bug: T328955
Change-Id: Ic80f707e86ba3c9f88097cac8aec8c6b3cc32cee
2023-02-06 15:58:45 -06:00
Ed Sanders 722e639ccb Update VE core submodule to master (b5c670c7a)
New changes:
0cf02db3a [BREAKING CHANGE] Pass Target to UI Surface and use instead of ve.init.target

Local changes:
* Pass target to surface

Bug: T305762
Change-Id: I3412c53cc70346c8ba4b8b76976ba9c7535e945f
2023-02-02 23:19:40 +01:00
thiemowmde c57e86d325 Mark config parameter as optional where it is
This goes along with I3f239e0 in Cite.

Change-Id: Ife88431ef810f978f5c4466ee82405fd4c791032
2023-02-02 10:47:32 +01:00
Ed Sanders 24a89caf93 mw.Target: Allow passing storageExpiry to initAutosave
Change-Id: Idcf50a527e2386122d077c497477057657824646
Depends-On: I4557a8808145fd1a601fe9b3fa1b190f8dba0077
2023-01-21 09:42:26 +00:00
Ed Sanders 2df8a95ac3 Update VE core submodule to master (035756895)
New changes:
4355d697a Replace ListStorage with ConflictableStorage
978061f86 Update SafeStorage and ConflictableStorage with expiry functionality
79019ed88 ve.dm.Surface: Support storage expiry

Local changes:
* Pull through conflictable storage

Bug: T218663
Change-Id: I36e49c01e9f2ddb7d362d539b72a4beca925bcb7
2023-01-21 10:41:21 +01:00
jenkins-bot 8d94e10944 Merge "Replace mediawiki.Uri with native URL (ArticleTarget)" 2023-01-10 17:45:40 +00:00
Bartosz Dziewoński 2770809d1a Replace mediawiki.Uri with native URL (ArticleTarget)
Persistent global-ish properties in ArticleTarget and friends. A lot
of our own code re-uses them, and code elsewhere could refer to them
as well (although I didn't find any uses).

In one case we need to keep using mediawiki.Uri, to handle building
an array from query parameters exactly like PHP would handle it.

Bug: T325249
Change-Id: I57699ff9dd39179ca29a87b6e2d9b12c2b86eb7d
2023-01-09 20:34:27 +00:00
Nardog 17f40c29b8 Show "Continue" instead of "Try again" on button to save as another user
Bug: T190406
Change-Id: I513acdab8ba7b09c13901e070b88e34d2699fb06
2023-01-08 20:23:28 +09:00
jenkins-bot e603b1b02a Merge "Replace mediawiki.Uri with native URL (easy cases)" 2023-01-04 08:12:11 +00:00
jenkins-bot 161a6a0623 Merge "Fix post-edit notification after switching from old wikitext editor" 2023-01-04 08:12:05 +00:00
Bartosz Dziewoński fd80fae57f Replace mediawiki.Uri with native URL (easy cases)
Replacing one-off uses in various auxiliary features: only used
in function scope (or narrower), nothing else depends on them.
Some of them didn't even need to do any URL parsing or formatting.

Bug: T325249
Change-Id: Ia9a18656f67cb0a204c87605459abb9f5bbdc347
2023-01-03 22:18:01 +01:00
Bartosz Dziewoński 60b9a71f9b Fix post-edit notification after switching from old wikitext editor
Follow-up to 37b81b5ba4.

Change-Id: I2e61b265822d75cd409d57a4aec7abfbbd4d3fc4
2023-01-03 22:17:56 +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
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
Francois Pignon 1b27b12b66 Optimize some jQuery selectors
Bug: T324523
Change-Id: I5d749e222b01a4f6abbc4517a8b568ad3e73e47f
2022-12-06 00:05:06 +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
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
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
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 35138e00be DesktopArticleTarget: Fix popstate handling when action=edit (single edit tab)
This means if you load the editor on a single edit tab wiki,
then press back then forward, the editor will re-open.

Bug: T316869
Change-Id: I1ea33de7d7324a53399be9155c474a14ae21dfe8
2022-09-01 14:56:05 +01:00
jenkins-bot d81ac62283 Merge "Limit toolbar top border fix to vector-legacy" 2022-08-17 03:39:24 +00:00
jenkins-bot fd71fbe605 Merge "DesktopArticleTarget: Move updateTabs to .init so it can be called sooner" 2022-08-16 23:01:55 +00:00
jenkins-bot f03aa80f95 Merge "ArticleTarget: Move updateTabs implementation to DesktopArticleTarget" 2022-08-16 23:01:53 +00:00
Ed Sanders 1c313eddf1 Follow-up I7fb352fc: Fix scope typo in ArticleTarget
Bug: T315320
Change-Id: Iefbb5ad1cee8069e52f9f62ae2191491e263a73b
2022-08-16 15:13:22 +01:00
Ed Sanders f9ed7066c8 DesktopArticleTarget: Move updateTabs to .init so it can be called sooner
The edit tab should be active as soon as the editor starts loading
(to indicate it doesn't need to be clicked again, and that the read
tab can now be clicked).

Change-Id: I450c53eef64c25e9520d3868b4ecc95204644138
2022-08-11 14:30:48 +01:00
Ed Sanders 08b3a21b25 Limit toolbar top border fix to vector-legacy
Also move code to .init so it can apply as soon as the
editor starts loading.

Bug: T311311
Change-Id: I87b15a0c56261a9f70291749bdbc37a518506d5d
2022-08-10 20:38:20 +02:00