Commit graph

19534 commits

Author SHA1 Message Date
jenkins-bot ee760ee2a6 Merge "Fix forgotten "setPage" property because of merge conflict" 2022-08-01 09:37:40 +00:00
jenkins-bot c3e92534d9 Merge "Use the same styling for add template and add parameter buttons" 2022-08-01 09:10:19 +00:00
Thiemo Kreuz cdb9766752 Fix forgotten "setPage" property because of merge conflict
The rename in I5a16ab4 was done the exact same time a new usage was
introduced via Ibb717ca. Neither patch shows a conflict. Still there
is one.

I remove the extra `|| null` line because it is just not needed. We
don't need to set the property to null when it was already null.

Bug: T312213
Change-Id: Id3f025786c9412e8c1946434113c41356da08098
2022-08-01 09:42:25 +02:00
Translation updater bot 799c0b86ea Localisation updates from https://translatewiki.net.
Change-Id: I5851d2c86d2ae51dbc44f791387d40456e93667b
2022-08-01 08:23:49 +02:00
Translation updater bot fb8a9396ed Localisation updates from https://translatewiki.net.
Change-Id: I5b58f46c1baf929867084da6a7e3450d5d12fce9
2022-07-29 08:54:32 +02:00
Bartosz Dziewoński b88bd21447 Update VE core submodule to master (2a60d67df)
New changes:
d0912cb0a Update OOUI to v0.44.2
2a60d67df Localisation updates from https://translatewiki.net.

Change-Id: I9d62494d5e1720dbde02c9a9acadd79b89583c46
2022-07-29 00:58:18 +02:00
C. Scott Ananian d668492e58 ApiVisualEditorEdit: Transition from 'hidetoc' to 'showtoc' in API result
Bug: T314000
Depends-On: I1644a74370b42b04d0db167879f7de2207ebfcf5
Change-Id: I823f26652b9770ea577daee32bff05864a7498bb
2022-07-28 14:55:27 +00:00
Andrew Kostka dc91a39f8b Use the same styling for add template and add parameter buttons
Bug: T314052
Change-Id: I62d4e282b0e8f0a32e37e144db358144224119f1
2022-07-28 16:24:15 +02:00
jenkins-bot 6422e69821 Merge "Minor code cleanups in forked BookletLayout and related" 2022-07-28 12:59:10 +00:00
jenkins-bot 13c2a24f6c Merge "Prefer adding parameter to currently focussed template" 2022-07-28 11:34:38 +00:00
jenkins-bot 52c155f43f Merge "Fix "null is not a string" error in event logging code" 2022-07-28 10:41:15 +00:00
jenkins-bot 15c56b442c Merge "Remove unused template dialog title message" 2022-07-28 10:25:12 +00:00
Translation updater bot 461a6bea84 Localisation updates from https://translatewiki.net.
Change-Id: I1a944644e38391c26d61cb691aa86a4edf6aff2f
2022-07-28 08:58:20 +02:00
Thiemo Kreuz 741dbe5ccf Minor code cleanups in forked BookletLayout and related
E.g. renaming variables and moving code around. No functional change.

Change-Id: I39e76356c62a0d1bcdf1d20bc8215f09604ad07d
2022-07-27 16:04:27 +02:00
jenkins-bot f67033a82d Merge "Log incompatible skin warnings" 2022-07-27 12:47:01 +00:00
jenkins-bot 94268009c9 Merge "Remove dead code, deleting parameters is not possible" 2022-07-27 09:41:51 +00:00
Thiemo Kreuz b085d6cf24 Prefer adding parameter to currently focussed template
Instead of the template that's currently selected. That's confusing,
e.g. when you click one of the search fields, search for a parameter,
can't fine it, and press ctrl+shift+d to add an undocumented
parameter. Or you navigate the list of parameters with the cursor
keys, can't find the parameter you are looking for, and press
ctrl+shift+d to add it.

Still falls back to the selection when the focus is outside of the
sidebar.

We suggest to merge this before UX review, and review it later in
demo time. It's easy to undo if necessary.

Bug: T313388
Change-Id: I9848dd0af4fe821526dafc18bbd7cb1ab0e68cfc
2022-07-27 09:17:23 +02:00
Thiemo Kreuz 91b5cea852 Remove unused template dialog title message
The message "visualeditor-dialog-template-insert" was added in 2021
via I5da4003. It was used as a dialog title in
ve.ui.MWTemplateDialog.js. In 2021 we introduced three new messages
via Ib9b76ca. One of them still says the same as the old message, but
got a new key assigned. It appears like we forgot to remove the old
message.

Change-Id: Ie3854114197e3f36b48bb7efd8dd96a1f9651198
2022-07-27 08:54:31 +02:00
Translation updater bot d70e425fc9 Localisation updates from https://translatewiki.net.
Change-Id: I9edc9a6a56dc59abb0a8a0b8519024238edaec46
2022-07-27 08:27:02 +02:00
Gergő Tisza 591796df12
Log incompatible skin warnings
Log a client error when VisualEditor cannot load because of an
incompatible skin (which is not supposed to happen in practice).

Bug: T312632
Change-Id: I2ccfaa584d7a05e10170a66d446bd4e476dcc775
2022-07-26 17:51:30 -07:00
jenkins-bot 1d34b069ad Merge "ve.init.mw.Target: Use mw.libs.ve.targetSaver.getHtml in getWikitextFragment" 2022-07-27 00:07:35 +00:00
C. Scott Ananian 43231df98a VisualEditorParsoidClient: use the new PageConfigFactory::create() signature
Depends-On: I79a2773bf6d2366593b31555afd0b548b66d222a
Change-Id: I40b0c7159c493f7ff12085f9845fc5399102df2f
2022-07-26 21:21:40 +00:00
jenkins-bot e06cdeadb1 Merge "ve.ui.MWGalleryDialog: Fix "Alternative text" not being readonly sometimes" 2022-07-26 20:26:17 +00:00
jenkins-bot f7d9da3317 Merge "Start altText as null to avoid empty alt for new gallery images" 2022-07-26 20:00:52 +00:00
jenkins-bot 7e55a99917 Merge "Add a checkbox to use the image caption as the alt text for galleries" 2022-07-26 20:00:48 +00:00
Bartosz Dziewoński d2f7796744 ve.ui.MWGalleryDialog: Fix "Alternative text" not being readonly sometimes
Depending on the order in which this code executed, sometimes the
dialog initialization would overwrite the readonly state set by item
initialization.

They should simply all check both conditions.

Change-Id: I6a18f1e074f118423438c017b3e4e34e75579e5d
2022-07-26 21:50:19 +02:00
Bartosz Dziewoński ea5597be83 Update VE core submodule to master (1ab6be70d)
New changes:
e34ab94c4 Localisation updates from https://translatewiki.net.
f6524d778 MobileActionsContextItem: Use 'copy' icon
a8ecafebe Localisation updates from https://translatewiki.net.
5bb6f2bec Localisation updates from https://translatewiki.net.
f7a8fad02 ve.init.Target: Don't generate actions toolbar when empty
9ecf20daa sa.Target: Move pageMenu to main toolbar

Bug: T312766
Change-Id: If2f381099d65058949d9b366d72e840b71c0064b
2022-07-26 17:21:21 +02:00
jenkins-bot c595901528 Merge "Tab to first template parameter in list, not to the selection" 2022-07-26 14:45:04 +00:00
jenkins-bot 20f255d0f9 Merge "Fix filtering not clearing "currently selected page" state" 2022-07-26 14:36:02 +00:00
jenkins-bot 4997f3d41d Merge "Move getters for the currently selected part to two-pane layout" 2022-07-26 12:30:41 +00:00
Thiemo Kreuz d922c12957 Remove dead code, deleting parameters is not possible
This code was for when the dialog had a trash can icon for every
parameter, and parameters could actually be deleted. It's unreachable
now.

We missed this when removing the old workflow.

Change-Id: Ic94df506ea84009a1e1863a4e9847a70498df448
2022-07-26 13:21:39 +02:00
jenkins-bot 72b3a31571 Merge "Fix Ctrl+D and Ctrl+Shift+Y hotkeys to add parts" 2022-07-26 09:23:50 +00:00
jenkins-bot 2185393d96 Merge "Fix Ctrl+Shift+D hotkey to add undocumented parameters" 2022-07-26 09:20:48 +00:00
Thiemo Kreuz 72c136182c Remove unused pieces of code from two-pane layout
The toggle feature is not used. The method is always called with a
bool.

Bug: T313489
Change-Id: Id05398ea837355f93df597674e817e3e4f0f8481
2022-07-26 10:41:45 +02:00
Translation updater bot bf829f4681 Localisation updates from https://translatewiki.net.
Change-Id: If8f03962e2280a53b18bc6057eea8ce8aefcd6ee
2022-07-26 08:26:05 +02:00
Arlo Breault 5bfdff2197 Start altText as null to avoid empty alt for new gallery images
Bug: T310624
Change-Id: I26ffb386fa4de5ed6128da8d08da1df2576f3755
2022-07-25 22:43:28 -04:00
jenkins-bot ce2cdc6a1e Merge "ve.ui.MWTemplateDialog: Fix dialog becoming inert" 2022-07-25 16:03:50 +00:00
jenkins-bot 801d017417 Merge "Add missing check to confirmation dialog's "closed" handler" 2022-07-25 15:27:06 +00:00
Bartosz Dziewoński 9e954b7c20 ve.ui.MWTemplateDialog: Fix dialog becoming inert
OOUI support for multiple modal window managers is hacky, and only
works correctly when the managers are attached directly to <body>.
Remove the wrapper that doesn't seem to be necessary.

Bug: T313690
Change-Id: I4134c0f50d28a364dcf15b426bd9b59a4f7a985d
2022-07-25 17:01:12 +02:00
Thiemo Kreuz cbc90ff90a Remove dysfunctional "no outline" mode from template dialog
The dialog is unusable when there is no outline. See T313489 for a
longer explanation.

Bug: T313489
Change-Id: Ib2cc9c363d3596a16f6f1c4aef03ca216abf6b1f
2022-07-25 14:45:18 +00:00
jenkins-bot 5bdb15f8fd Merge "Document what "current page" means in two-pane layout" 2022-07-25 13:41:23 +00:00
Thiemo Kreuz 59c2ee6242 Add missing check to confirmation dialog's "closed" handler
Apparently this can be undefined when Esc is pressed. Note this code
cleanup related to but does not fix T313690.

Bug: T313690
Change-Id: Ia4658f8e00a68ed4cc3a6ddb0a932b3218b813dc
2022-07-25 13:53:12 +02:00
Translation updater bot 576f27e3d5 Localisation updates from https://translatewiki.net.
Change-Id: Id8ba7dd358d976435816667f17ab2a06aab7da65
2022-07-25 09:51:04 +02:00
Translation updater bot f4497c9ddd Localisation updates from https://translatewiki.net.
Change-Id: I480a16f3d6d2a3ca838deb4fd4bc0879d940f686
2022-07-25 08:39:48 +02:00
Arlo Breault 94c4d619a7 Add a checkbox to use the image caption as the alt text for galleries
The need for something like this was anticipated in
I2bf43c7e83283f43e047229eb53c244918fcbb0c.

As of version 2.5.0 of Parsoid's output, if alternate text is missing
for an image but a caption is present and image isn't displaying the
caption (ie. it isn't a thumb or frame), then the text content of the
caption will be set as the alt attribute.  Parsoid will then drop the
alt attribute when serializing if it matches the caption text, since
it's unnecessary.

However, if the caption is modified and the alt text isn't, the alt will
be serialized.  This is likely to be unexpected to editor.  They may
have missed that the both the caption and alt are populated in VE and
only edited one place.

Since all of the above is happening only for images where the caption
isn't visible, it doesn't appear to be a much used feature since, at
least for inline images, the experience of caption editing was already
less than optimal.

However, because of a quirk in how galleries are rendered in Parsoid,
this affects gallery caption editing, which is visible and presumably
used more often.  See T268250 for a discussion on an improved gallery
structure.  But for now, gallery images are effectively inline and set
the alternate text, thus subject to the above.

Here we add a checkbox so that the default is to ignore the alt if it's
the same as the caption.  And only make use of it if it differed
originally or was explicitly unchecked to modify.

Bug: T311677
Change-Id: Idf297d8a98995971c5835b0cea56c3317a3626e2
2022-07-22 15:46:55 -04:00
Thiemo Kreuz c821ca154b Document what "current page" means in two-pane layout
Change-Id: I37b26a9f01031d4910ff773977a89eb46a4c19ac
2022-07-22 18:12:15 +02:00
Thiemo Kreuz c2c5a2b938 Fix filtering not clearing "currently selected page" state
This patch also removes an obsolete comment.

Bug: T313388
Change-Id: Ie292c07fb096f89a226d7a2239e3dd2883dd91d7
2022-07-22 17:10:48 +02:00
Thiemo Kreuz 1491315c04 Move getters for the currently selected part to two-pane layout
Turns out we have two concepts, now represented by two methods:
1. A top-level part can only be moved or removed when it is actually
   selected. This is relevant for the toolbar buttons and for the
   keyboard shortcuts/hotkeys. We intentionally block the buttons
   and hotkeys when a parameter is selected.
2. Adding a new part or parameter is always possible, no matter if a
   top-level part or parameter is selected. This is again relevant
   for the toolbar buttons and hotkeys.

Bug: T313388
Change-Id: I17caf8fce9d8f1ebe21660cf8c6d91ace8423490
2022-07-22 15:53:10 +02:00
Thiemo Kreuz 21ab6bc5f6 Fix Ctrl+D and Ctrl+Shift+Y hotkeys to add parts
Same issue as in the previous patch, but less intrusive. It was always
possible to add a new part, but it was often inserted at the wrong
position. It worked only as intended when a top-level part was
selected. When a parameter was selected, the new part was always
appended to the very end of the transclusion, not after the selected
template.

This is now a little bit of duplicate code. We might extract this to
a method in a later patch.

Bug: T313388
Change-Id: I1327222969d1d315bdacf3998f366d88c4c26bd5
2022-07-22 15:25:59 +02:00
Thiemo Kreuz c86134a9ec Fix Ctrl+Shift+D hotkey to add undocumented parameters
The hotkey was only working when a top-level part was selected, not
when a parameter in a template was selected.

Some outdated helper methods are now marked as deprecated. They will
be replaced and removed in later patches.

Bug: T313388
Change-Id: I5ffe45fd00c36b97ee36dc0ba6831db5a941c731
2022-07-22 15:22:07 +02:00