Commit graph

19215 commits

Author SHA1 Message Date
Adam Wight 9922e1c61e Use natural language rather than the brand name
Bug: T306283
Change-Id: I6dcf99d6997d8272ede4e07f0783efa374be59fb
2022-04-27 15:10:07 +02:00
Translation updater bot e7e35a8e38 Localisation updates from https://translatewiki.net.
Change-Id: I7f909904d39900b41f4f4a48539154d86f4dd7cd
2022-04-27 08:08:54 +02:00
Ed Sanders b428b296e5 ArticleTarget: Ensure dataPromise rejects when switching fails
Requires switchToFallbackWikitextEditor to return a promise.

We can now pass dataPromise to the progress bar shown when
switching editors, so it hides if the switch fails.

Also fix logic for when a failed load is not retried.

Bug: T306763
Change-Id: I752ca505e7957b392202d44455b1e21b6e50fa63
2022-04-26 16:32:52 +01:00
Translation updater bot bb30610511 Localisation updates from https://translatewiki.net.
Change-Id: I15d053d07e7a3f5a0ef4d32a42aa52e8825dbd90
2022-04-26 08:55:03 +02:00
Translation updater bot 056d6fb259 Localisation updates from https://translatewiki.net.
Change-Id: I2280b543c6e13d0307e1f9db7f2dcbc081548d56
2022-04-25 08:19:21 +02:00
jenkins-bot 55c496b2b5 Merge "More tests for pasting external links" 2022-04-22 22:44:30 +00:00
Translation updater bot fd50480eab Localisation updates from https://translatewiki.net.
Change-Id: Ic4ee4ec60a1d399dd3f05b1605940d5e1c09bc74
2022-04-22 08:23:55 +02:00
Bartosz Dziewoński d33d88a186 More tests for pasting external links
Change-Id: I2281be66b901d0c969c75869faa4fa632d33118b
2022-04-22 04:43:51 +02:00
rvogel f69438fae6 Check for external url protocols during conversion
If links get pasted into VE and they lack a "//" in the `href`, they
are automatically considered to be "internal", thus being converted into
`[[...]]` wikitext links.

In case of pseudo protocols like `mailto:` this should not be the case.

This patch uses MediaWiki core settings to check if a `href` value is an
external protocol known to the application.

Bug: T297575
Depends-On: I2e584f6d5adc6b2d735e79cea64f2beeb5f2c36d
Change-Id: I2b383106450e02cc6bcc1b99d547ff2ed7832b4c
2022-04-22 01:36:41 +02:00
Thiemo Kreuz 8831887e3c Update template search fallback to max out at 10
Before, the fallback algorithm was somewhat adaptive, trying harder and
harder the fewer CirrusSearch results have been found. This updated
algorithm guarantees that 10 results are shown.

Warning: You might see only 9 results. The reason is a bogus, unrelated
behavior in the mw.widgets.TitleWidget in core that's used as a base
class here. There is a "showMissing" option that's apparently enabled
by default, and prepends a non-existing title from the main namespace,
ignoring the "namespace" option. This extra result from the wrong
namespace is later dropped by the very same widget.

This code here sees 10 results before the bogus one is dropped.
Disabling "showMissing" causes other issues. We would need a series (?)
of custom hacks to work around all this, but this seems inappropriate.
Let's live with 9 for the moment.

Bug: T303524
Change-Id: I2c577c9ef2752b6c6cd360f4023e151e9272fcd5
2022-04-21 09:25:00 +00:00
Thiemo Kreuz 50497ee7f3 Drop assumption that all template search index start at 1
The main advantage of this change is that it drops the assumption
that the index starts with 1. This is not necessarily the case when
we prepend extra search results. Dropping this assumption here allows
to simplify such code.

* The incoming list of pages is guaranteed to be an array.
* There is no point (any more) that could cause the array to become
  sparse.
* Note we still make a copy of the `origPages` array at some point,
  e.g. on `.filter()`.

Bug: T303524
Change-Id: Ifbd92bb052155c613d2ca21ab6d54a0b3ef28c0c
2022-04-21 11:23:48 +02:00
Bartosz Dziewoński 46d9ebe521 Update VE core submodule to master (6609cde00)
New changes:
249c1f3e6 Allow testing import rules in ve.ce.Surface paste tests

Bug: T297575
Change-Id: Ib41fd70066f2052d9e493985a6d1dbf6f1e089a0
2022-04-21 02:10:15 +02:00
Volker E b8df5d8f01 build: Replace 'stylelint-config-wikimedia' reference by 'support-modern'
Grades (here 'grade-a') were deprecated in a previous version of
'stylelint-config-wikimedia'.

Change-Id: I98caba0a1f80ec342403405ba9e22d6fe657deef
2022-04-21 00:00:49 +00:00
jenkins-bot 20e26000e2 Merge "Update VE core submodule to master (86de64d69)" 2022-04-20 23:58:32 +00:00
Ed Sanders 184106418e Update VE core submodule to master (86de64d69)
New changes:
72bd71dbc Localisation updates from https://translatewiki.net.
b7f38d993 Re-apply "Fix for showing "invisible icon" when root node is hidden""

Local changes:
* Ensure templates are attached to DOM before rendering invisible
  icon in converter hack.

Bug: T305110
Change-Id: I0e4c02619b2a06b9932f214ae482093fdb0cb22c
2022-04-20 23:45:31 +01:00
Thiemo Kreuz 89e5c2fb92 Disable useless "showMissing" option in TemplateTitleInputWidget
This option is not only buggy (it just doesn't work when the namespace
option is set the same time), it is not useful in this context even
if it would work. It doesn't make much sense to suggest non-existing
templates in the context of the template dialog. If adding a
non-existing template really is what the user wants, they can still do
this by simply typing the name of the template and submitting the form.
We never need this to show up in the suggester below the input field.

The main advantage of this change is that is saves 1 useless API
request that's potentially done every time a key is pressed.

Bug: T303524
Change-Id: I903340a06d6e6490bb58f628f41903aa044ccb21
2022-04-20 14:43:29 +00:00
jenkins-bot 9c110d63ac Merge "Move "index from redirect" logic up in template search widget" 2022-04-20 14:40:18 +00:00
jenkins-bot a3e2713208 Merge "Fix misleading variable name in TemplateTitleInputWidget" 2022-04-20 14:24:30 +00:00
jenkins-bot 4efede7e33 Merge "Fix API response default in TemplateTitleInputWidget" 2022-04-20 14:23:56 +00:00
Thiemo Kreuz d3d3e1cf75 Move "index from redirect" logic up in template search widget
This separates the two steps:
1. See if items in the list of `origPages` miss their `.index`
   property, and add it if possible.
2. Later code doesn't need to care about redirects any more.

Note that `origPages` is not used for anything else. And even if,
it's not wrong to have the index for each search result on both the
redirect and the redirect target.

Change-Id: I12135f0430c944b4e33c49ece7779d7c3bb6c211
2022-04-20 14:50:36 +02:00
jenkins-bot 63da7799d5 Merge "ApiVisualEditor: Fix 'stash' param validation (it's a boolean)" 2022-04-20 07:51:51 +00:00
Translation updater bot 918c3e8a5c Localisation updates from https://translatewiki.net.
Change-Id: Ic9b84c7023a9c345b116a813018c3de965d77497
2022-04-20 08:19:25 +02: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
Thiemo Kreuz e24c8ecd2d Fix misleading variable name in TemplateTitleInputWidget
This is not a pageid, but a simple numeric index in an array. Luckily
it doesn't make a practical difference for this particluar way of
iterating something.

Change-Id: I7ec9ace00d4fba7adde17670058a0365b30f5617
2022-04-19 14:40:00 +00:00
Thiemo Kreuz 9390b5bc91 Replace non-breaking spaces in AUTHORS.txt
Change-Id: Ic9ce79e5386a0fd4b8339f37d186b264bd704537
2022-04-19 16:09:48 +02:00
Thiemo Kreuz c72d8abdc3 Remove/update template related comments that just repeat the code
Such comments don't add any new information. The method signature
alone already tells the full story.

We did this already to a lot of the template related code we touched.
This is just a bit of cleanup to make it consistent.

Change-Id: I932b620910924a16dc0d31d6c8a3ab11818316fe
2022-04-19 13:58:32 +02:00
Thiemo Kreuz d59a4366db Change TransclusionModel.nextUniquePartId() to return a string
The numeric part of these ids is never used on it's own. There is no
need to expose it.

Note we renamed the method not long ago in I6eeab8b to reflect better
what it does. This is the next step. We just forgot it back then.

Change-Id: I5da82855e99ea3a42a5d91379c6974ae9c154518
2022-04-19 13:48:30 +02:00
Thiemo Kreuz af2779fc06 Fix API response default in TemplateTitleInputWidget
The result is guaranteed to be in formatversion=2, where the list of
pages is an array, not an object.

Change-Id: Ic73a68c3e249a70108a6a19a89f4ff6c475794ed
2022-04-19 13:35:27 +02:00
Translation updater bot 9997ef2fa5 Localisation updates from https://translatewiki.net.
Change-Id: I7402bae95208f8b83a02335f93af84047cb257be
2022-04-19 10:16:16 +02:00
jenkins-bot f07536bfef Merge "eslint: Lint all files except those in .eslintignore" 2022-04-18 15:43:32 +00:00
Translation updater bot 2ddbb6b708 Localisation updates from https://translatewiki.net.
Change-Id: I792241e3d2b2b9f12faa059b020e99ba13f215fa
2022-04-18 10:07:08 +02:00
Translation updater bot 7de5638756 Localisation updates from https://translatewiki.net.
Change-Id: I7fa608ba7f65247d18d6090b968e983e681e42b1
2022-04-15 09:57:10 +02:00
jenkins-bot 933c65a3a9 Merge "i18n: Remove unused "VisualEditor" tab messages" 2022-04-14 22:35:31 +00:00
Umherirrender 47d1d4b385 Remove usage of protection related deprecated Title function
Bug: T306131
Change-Id: Id551a318a9bb1047e449e0ad284b8f73c8886aad
2022-04-14 22:06:02 +02:00
Translation updater bot 3fa5423da0 Localisation updates from https://translatewiki.net.
Change-Id: I76e4ce6b17980b1b36473ac91902794486ff6e55
2022-04-14 08:27:34 +02:00
Bartosz Dziewoński 0173862ba6 Update VE core submodule to master (038522816)
New changes:
038522816 Set dir/lang props on placeholder element

Bug: T306040
Change-Id: I53c6f8efae8642b2100cb8b77ba8f9c027fdb826
2022-04-14 00:02:08 +02:00
Ed Sanders c9046685fa eslint: Lint all files except those in .eslintignore
Fix resulting errors (mostly useless escape in i18n files).

Change-Id: Id29c6aecece75d4a462bddb7e547ca5b4eb5c2db
2022-04-13 15:44:49 +01:00
Ed Sanders 699899c8c4 i18n: Remove unused "VisualEditor" tab messages
Hasn't been used in years, and we no longer use the CamelCase product name.

Change-Id: I8bda918a9db3ac7bf683dc6115af7a89d04ab9b7
2022-04-13 15:43:43 +01:00
Translation updater bot 87c2ee3c79 Localisation updates from https://translatewiki.net.
Change-Id: I43f5f3e5152560d1072420d22dc603c47f373aa9
2022-04-13 08:33:05 +02:00
Translation updater bot 2de1192c6f Localisation updates from https://translatewiki.net.
Change-Id: Ic4a290b062d29caa4bdbdd70b43a1d4ad0a2f59f
2022-04-12 08:15:08 +02:00
Bartosz Dziewoński c1dcdeb43d Update VE core submodule to master (a0bf00838)
New changes:
297255a28 Localisation updates from https://translatewiki.net.
55f32beb8 Follow-up I26486e0e79: Fix when first range returns null annotation set
94ed5bb4e Don't attempt to scroll tall selections into view

Bug: T305645
Bug: T305862
Change-Id: I73dcad06e3a3b384225c16ba1b929cbe9cdaccae
2022-04-11 21:20:28 +02:00
Translation updater bot 913092d03c Localisation updates from https://translatewiki.net.
Change-Id: I9cf2c463fa3d4ead6faacbcca674ec121ce50a78
2022-04-11 08:14:52 +02:00
jenkins-bot d1e777afcd Merge "Simplify ve-mw/init/styles LESS files" 2022-04-08 22:37:10 +00:00
jenkins-bot 616fa37de4 Merge "Fill template search results with prefix matches when Cirrus fails" 2022-04-08 11:57:23 +00:00
jenkins-bot 82051a35d3 Merge "DesktopArticleTarget.init: Wait for deactivating to finish before activating" 2022-04-08 08:49:55 +00:00
jenkins-bot 49b45b0e7d Merge "Store copyright message in auto-save data" 2022-04-08 08:49:32 +00:00
jenkins-bot 95d7f74ddd Merge "Add tests for the expected properties in API result and auto-save" 2022-04-08 08:49:01 +00:00
Translation updater bot d221b2dd22 Localisation updates from https://translatewiki.net.
Change-Id: Ie37a0e143826387d29bb7f61484ef0a58a099f35
2022-04-08 08:28:37 +02:00
Bartosz Dziewoński 01bfdb17d9 Update VE core submodule to master (0fde38782)
New changes:
01cf60f3e Fix position of close button on wide tablet
f859601b4 Match padding of mobile context header & footer
f8675af1b getAnnotationsFromRange: Distinguish between "no annotations" and "no content"
176c2b334 Always assert diff sidebar descriptions

Bug: T304233
Bug: T305645
Change-Id: Icb32737e9222a537ed1fa1bdbeebf8c2a5d15363
2022-04-08 01:23:14 +02:00
Bartosz Dziewoński c8b0f17ce6 Store copyright message in auto-save data
Bug: T305225
Change-Id: Ie70587393715a461509dac6192d033a05c894f96
2022-04-07 23:03:37 +00:00