Commit graph

9595 commits

Author SHA1 Message Date
jenkins-bot a70826e8bd Merge "Follow-up I3412c53cc: Fix reference to target in ve.ce.MWWikitextSurface" 2023-02-12 15:14:28 +00:00
Ed Sanders 12395b0a57 Follow-up I3412c53cc: Fix reference to target in ve.ce.MWWikitextSurface
Bug: T329439
Change-Id: I67632bf62c0373e7825ccd9fbe263116928e7e35
2023-02-12 11:13:48 +00:00
Jack Phoenix eb71d7710a Loosen the edit link selector specificity in setupMultiTabs()
This allows VE to support even more skins with minimal or no changes to the skins themselves.

Partially reverts 75ff121b29.

Change-Id: I7536610459b7401015d4a033cc516c5d9a0ca5f1
2023-02-07 20:28:32 +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
jenkins-bot 257dc1bd20 Merge "Add language and direction to preview" 2023-02-02 21:21:20 +00:00
jenkins-bot e70bdb06bf Merge "Mark config parameter as optional where it is" 2023-02-02 17:08:55 +00:00
jenkins-bot 696b791127 Merge "Error logging for native URL errors" 2023-02-02 16:10:28 +00: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
jenkins-bot bd105f2fc1 Merge "Re-apply "Rewrite mw.libs.ve.getTargetDataFromHref with URL API"" 2023-02-02 09:22:45 +00:00
Bartosz Dziewoński 99b1220aca Re-apply "Rewrite mw.libs.ve.getTargetDataFromHref with URL API"
This reverts commit a92dce4999.

A workaround for the previous problem was added in ContentTranslation
in I945897a27db479986855002b389034a745bf9bef.

Bug: T325249
Bug: T325566
Bug: T327779
Change-Id: I2d9c330dc4328468a65315ec6bed1d0f53ebd1f6
2023-02-01 22:45:56 +00:00
jenkins-bot a1c1366b30 Merge "Document need to remove data-mw-section-id attributes when saving" 2023-02-01 21:15:11 +00:00
jenkins-bot 34a0634e16 Merge "Set a min-height on surface in Vector 2022" 2023-02-01 21:11:49 +00:00
Ed Sanders 4155ac51f6 Document need to remove data-mw-section-id attributes when saving
Bug: T328268
Change-Id: I429d692053c3bf02135b57471b76f72519221e99
2023-01-31 15:14:16 +00:00
Brandon Fowler 988097b09a Add language and direction to preview
Bug: T328388
Change-Id: I5ea63a743d9e497133ad6f35ba64d3a754eb7f5d
2023-01-31 00:18:14 +00:00
jenkins-bot 2fdac8851c Merge "Revert "Rewrite mw.libs.ve.getTargetDataFromHref with URL API"" 2023-01-30 14:13:38 +00:00
Bartosz Dziewoński a92dce4999 Revert "Rewrite mw.libs.ve.getTargetDataFromHref with URL API"
This reverts commit 461c76981f.

Bug: T328143
Change-Id: Ib59192c650736eac9d4a2db130c3e29720c30486
2023-01-30 13:52:53 +00:00
Ed Sanders c5cccfc85b Set a min-height on surface in Vector 2022
We could do something more complex and compute the height of the
available space, but a fixed height is a reasonable solution with
a fraction of the complexity.

Bug: T328048
Change-Id: I0b7bfa55f23afc16be43b85270666ec6a480ca32
2023-01-28 14:07:11 +00:00
Bartosz Dziewoński e52058fad3 Error logging for native URL errors
Bug: T328094
Change-Id: I7d0e3bb403db7ddbc233d6b0a770533f02883c5a
2023-01-27 10:48:45 +01:00
Ed Sanders 420c0f6c10 ve.ui.MWLiveExtensionInspector: Account for this.selectedNode being null in debounced method
Change-Id: I74ab091d3bfbdd9290429cd50688f458118701e7
2023-01-26 17:58:00 +00:00
Jan Drewniak d98e9e83e1 Fix Wikitext editor preview layout in Vector 2022
Accounts for the use of CSS Grid in Vector 2022, in
the 2017 Wikitext editor preview, by placing the heading and
content in named grid areas (`titlebar` and `content`).

Bug: T327778
Change-Id: I66a30e282e808559b4f375f5924ae0d945c058a9
2023-01-24 10:39:40 -05:00
Bartosz Dziewoński 461c76981f Rewrite mw.libs.ve.getTargetDataFromHref with URL API
At first I was going for a more minimal replacement of mw.Uri with URL,
until I discovered that this code depends on a mw.Uri bug that would be
difficult to replicate:

  // Expected: Relative URLs are accepted
  new mw.Uri( '/foo' ).toString() // => 'https://localhost/foo'
  // Expected: Protocol is optional
  new mw.Uri( 'example.com/foo' ).toString() // => 'https://example.com/foo'
  // Unexpected: Treated as empty domain with no protocol rather than relative URL
  new mw.Uri( './foo' ).toString() // => 'https://./foo'

So I went for a bigger rewrite to preserve the intent rather than the
exact logic.

I had to change some test cases to use more realistic fake data. They
previously relied on bugs in our URL handling to pass despite the base
URLs being incorrect, particularly for non-short URLs (see T270219).
In my testing non-short URLs behave the same as before in practice.

Depends-On: I07a8c097dba0f5572c0aedf4febdf1434063ea6f
Bug: T325249
Change-Id: I232361266c1dda795b88018c3aaa3d9ecbe42b93
2023-01-23 14:59:23 +00:00
Bartosz Dziewoński e40b73ef57 Update VE core submodule to master (b7ff5aac0)
New changes:
2201b350c Localisation updates from https://translatewiki.net.
da74736c1 Remove unused test code
d1b016e90 Minor test tweaks
551de4f0c Specify document base URLs in more test cases

Local changes:
* Specify document base URLs in more test cases

Change-Id: I0e301bef38d97fa2234aa901c787360d9fbde8a3
2023-01-23 15:57:59 +01:00
Bartosz Dziewoński a3d0ff8449 More realistic mocked data for MWWikitextStringTransferHandler tests
The actual API responses do not have <body> tags.

Change-Id: I5f2ab7d0a4ad33497868f5488e376f9467c1256b
2023-01-23 14:40:11 +00:00
Bartosz Dziewoński 0689e9247f Minor test tweaks
Change-Id: Ib20f9665534873bd1d5963664399459d3f5b4234
2023-01-21 19:15:51 +01:00
Bartosz Dziewoński 8371d24c78 Remove unnecessary test file
Change-Id: Ib81f70d290374451c5164bff7adbe4e18b9e2a8f
2023-01-21 15:09:14 +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
thiemowmde 004d92d341 Work around Firefox bug affecting LazyMultilineTextInputWidget
Before the `height: 2.5em` was applied to _both_ the visible
<textarea> and the $clone. While this shouldn't make a difference –
one of the first things .adjustSize() does is setting the $clones
height to 0 – it somehow triggered that Firefox bug.

With this patch we remove the `height: 2.5em` before handing over to
OOUI's .adjustSize(). It looks like this fixes the issue. We might
be able to revert I7560ceb then.

Bug: T317369
Change-Id: I96c2d7d7bf359ff0373d478b2b7e97c8833ba5b6
2023-01-20 12:29:12 +01:00
jenkins-bot 9272edcbba Merge "Update eslint-config-wikimedia to 0.24.0" 2023-01-18 15:04:45 +00:00
Ed Sanders e4ce6db868 Update eslint-config-wikimedia to 0.24.0
Change-Id: I8299d287721eee6cb6d2354836e82812bf57badd
2023-01-18 14:39:04 +00:00
Wout Gevaert 0b75660801 Use getImageNodes instead of custom filter
Bug: T320874
Change-Id: I4ef69ea2395f310ce48f3e32bbf202713e2c7f15
2023-01-18 13:43:38 +01:00
jenkins-bot 8d94e10944 Merge "Replace mediawiki.Uri with native URL (ArticleTarget)" 2023-01-10 17:45:40 +00:00
jenkins-bot bc936d73ce Merge "Show "Continue" instead of "Try again" on button to save as another user" 2023-01-10 01:49:04 +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
Bartosz Dziewoński 9e79a0e218 Add more test cases for mw.libs.ve.getTargetDataFromHref
Bug: T324352
Change-Id: Ie6688736cadaa9f250f176b63b44fe85009dbbbf
2023-01-07 20:00:48 +00:00
Bartosz Dziewoński 25019d7f55 Fix encoding to roundtrip links without 'rawTitle'/'origTitle'
Our encoding for the hrefs like "./Foo" that we send to Parsoid
differed slightly from how Parsoid outputs them, so to avoid dirty
diffs, we had to store the original ones we received from Parsoid
and send them back if they were unchanged.

Change the encoding to match Parsoid's exactly (by referring to the
Parsoid source code), and then remove 'rawTitle'/'origTitle'.

On a historical note, 'rawTitle'/'origTitle' were originally added to
fix other issues with links, which I hope are long behind us:
* bb45d984ca (T145978)
* fda2e6c1b5 (T44140)

Follow-up to 362df66b47, which removed
some other old stuff from the handling of Parsoid links.

Bug: T325766
Change-Id: I0ad0a655380eb2fb29b5ac01e2e399ac550ce34a
2023-01-07 20:00:42 +00: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
Bartosz Dziewoński 1165a06f47 ve.ui.MWTemplatePage: Use <p> instead of <hr> in the description
I've never liked how this looked, it feels so 1995. Let's just use
multiple paragraphs instead of a <hr> to separate the text, similar to
what we do in ve.ui.MWParameterPage. The second paragraph is already
emphasized with italics.

Change-Id: I324cd1d81e61cf8a23095b4f8aed68040eb1bd8d
2022-12-29 16:14:47 +00:00
Bartosz Dziewoński fe77d35c36 ve.ui.MWTemplatePlaceholderPage: Remove cleanup for old mw.storage entries
Follow-up to 13f5637290.

Change-Id: Iba92f42831839bbf66ecbb8963cbd44e407392db
2022-12-29 16:14:41 +00:00
Bartosz Dziewoński 62d3fc128e Remove unused message 'visualeditor-dialog-transclusion-placeholder'
Unused since e1ea921f76.

Change-Id: I88a51de0ae5583ba52bb3477625879d273150b39
2022-12-29 16:14:35 +00:00
Bartosz Dziewoński 4fb3db27e6 ve.ui.MWTemplatePlaceholderPage: Move label to real label for accessibility
By using OOUI 'label' instead of 'help', the label is associated with
the input using <label for=...> in HTML.

The result looks almost the same, except for font size. I like the
change, and I don't think it was intentional to make the font smaller
here.

Bug: T277028
Change-Id: If178ca8feb9970c9287ab6dfe51fdf0a81df1c45
2022-12-29 12:40:11 +00:00
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