Commit graph

19414 commits

Author SHA1 Message Date
WMDE-Fisch ecb00afdab Move MWTemplatePlaceholderPage styles to own file
Change-Id: I5eb98c58a8f429622273fbead492bcca12177aee
2022-06-28 14:10:44 +02:00
jenkins-bot 18924032e2 Merge "Move CSS in MWTransclusionDialog closer together" 2022-06-28 10:05:04 +00:00
Adam Wight 978cefa13b Move template dialog sidebar container into forked BookletLayout
Bug: T310867
Change-Id: I7d2a882b99e4796ecc6594b1cfb638eecd985de2
2022-06-28 12:02:01 +02:00
Adam Wight 2dd9405e38 Move last remaining sidebar event handler into forked class
These are internal to the two-pane layout and sidebar, so the dialog
doesn't need to be involved.

Bug: T310866
Change-Id: I5f05bc119dc213d8e31db62a3808a2fadaf35d99
2022-06-28 11:35:22 +02:00
jenkins-bot a4024d85e0 Merge "Simplify OutlineControls CSS a little more" 2022-06-28 09:29:50 +00:00
Thiemo Kreuz 31d75a1738 Move sidebar-related event handlers down into BookletLayout fork
Bug: T311069
Change-Id: I95fd2637ef4c39f8547e676dcfb5de333d5278e9
2022-06-28 11:27:02 +02:00
jenkins-bot 1ce7340e55 Merge "Remove old code to focus first input" 2022-06-28 09:19:36 +00:00
WMDE-Fisch b04231bc46 Move CSS in MWTransclusionDialog closer together
Change-Id: I96c21479066f806ed1ec40f38a264ba76230d42c
2022-06-28 10:59:56 +02:00
jenkins-bot 51cd862fce Merge "Adding canGoBack to the properties" 2022-06-28 08:55:53 +00:00
Thiemo Kreuz 77ce583167 Simplify OutlineControls CSS a little more
This is a direct follow-up to I7f22e4b. I found that the way the
margins have been arranged became a little more complicated with
I7f22e4b. This patch tries to go back to the – I think – simpler way
it was done before.

It should look the same as before down to the pixel.

Bug: T311223
Change-Id: I2c7789922078fa98f15f0b65de4c0efdf878a13a
2022-06-28 10:50:33 +02:00
WMDE-Fisch bc1e3efa4b Adding canGoBack to the properties
As disussed in Id23d3ac5e1715387c78916adeb8ca5f675005a5c

Change-Id: I1368199a4b709d5634ca6e20f04323a0227065be
2022-06-28 10:35:44 +02:00
Adam Wight d5f2767605 Remove unused parameter to focus
The one usage of this wasn't working.  FIXME: maybe we want to
restore the behavior, to focus the first parameter in the dialog
after opening.

Bug: T310866
Change-Id: Ibe0151fbedb3a9716bb231b5d398c4ae670fd667
2022-06-28 09:54:39 +02:00
jenkins-bot e8ece4da06 Merge "Drop unused "editable" configuration from template dialog" 2022-06-28 07:28:12 +00:00
jenkins-bot 8c94e2b5aa Merge "Move template dialog sidebar clearing to more appropriate place" 2022-06-28 07:13:27 +00:00
Thiemo Kreuz b0ce363e2b Drop unused "editable" configuration from template dialog
This defaults to false. It looks like this default is used in the
MWTemplateDialog base class. However, it also looks like this base
class is never used on it's own. All users we know use the subclass
MWTransclusionDialog where "editable" is true.

https://codesearch.wmcloud.org/search/?q=%2C%5Cs*ve%5C.ui%5C.MWT(emplate%7Cransclusion)Dialog&files=%5C.js%24

In the process I also remove some comments that literally repeat the
code and don't add any knowledge because of this.

Bug: T310867
Change-Id: Ie245aab80d1e77a8406f5591062e9cf49fd9613f
2022-06-28 09:11:31 +02:00
jenkins-bot e0112df947 Merge "Unhoist variables & remove dead code from BookletLayout fork" 2022-06-28 07:07:36 +00:00
jenkins-bot 5d2d36f9d7 Merge "Remove dead code (not) selecting first template parameter" 2022-06-28 07:03:22 +00:00
jenkins-bot 6641f7da85 Merge "Move .addPromptedParameters() calls to more canonical places" 2022-06-28 06:59:49 +00:00
jenkins-bot ad9630a535 Merge "Cleanup CSS for the forked OutlineControls" 2022-06-28 06:58:13 +00:00
Thiemo Kreuz 0a5b47eee3 Unhoist variables & remove dead code from BookletLayout fork
Declaring variables only when they are needed makes the code more
readable.

Bug: T310859
Change-Id: I454cc622dc5e83ec2c148d0bf59c62124dbd85e8
2022-06-28 08:52:24 +02:00
Thiemo Kreuz fd0b32fe31 Remove dead code (not) selecting first template parameter
This code was meant to select the first parameter of a template the
moment it is added. It's at least partly broken because it doesn't
consider the so called "prompted" parameters that have been added
just a few lines above. It's a questionable feature anyway. We are
going to refine all focus-related behavior anyway. Let's remove this
broken stuff and reimplement it later (probably in a different place)
when we continue working on this.

The FIXME was added in I720ce1a.

Bug: T311223
Change-Id: I1801efe38387b5e7a1b76417c1e5d7db4e4b96d0
2022-06-28 08:42:59 +02:00
Translation updater bot c716ab294c Localisation updates from https://translatewiki.net.
Change-Id: I137073ca319be860062bfcde57b41dd186e8f5fe
2022-06-28 08:40:29 +02:00
Thiemo Kreuz 76f563c929 Move .addPromptedParameters() calls to more canonical places
This was done in 3 rather "random" places:
1. Whenever a template is manually added. But rather late, after the
   template was added, in an event handler that is about focus
   behavior. It should not continue to manipulate the template that
   was just added.
2. When the dialog opens with a template preloaded by name, as it is
   done from the citation menu.
3. When the dialog is about to finish loading.

This patch fixes 2 issues:
* Get rid of a duplicate call (number 2 and 3) when using the
  citation menu.
* Move number 1 to a place where it's executed much earlier, and
  only when the user clicks "add template" in a template placeholder.
  There is no other way to add a template to an existing transclusion,
  but it's still a more appropriate place I feel.

Bug: T311069
Change-Id: I8a65ad703b95ba2092e9ef73493e9903e96b0dd6
2022-06-28 08:40:24 +02:00
Adam Wight 28bdc0a9fb Remove old code to focus first input
This still works for a dialog with just the template placeholder,
because the page is already chosen as "current" in the stackLayout.

Bug: T310866
Change-Id: Ibc1d33b02d34f70548d9f7365e085847ef0b2a51
2022-06-28 08:27:04 +02:00
Bartosz Dziewoński 61a7269261 Update VE core submodule to master (c5804af0a)
New changes:
a035f62f6 Localisation updates from https://translatewiki.net.
c5804af0a Handle Shift+Enter at the start/end of pre nodes too

Bug: T60773
Change-Id: I2fa0bda7ea2a831f62c5df428d0352bb31c4d823
2022-06-27 23:23:38 +02:00
WMDE-Fisch f1d4793862 Cleanup CSS for the forked OutlineControls
Includes moving CSS that already moved from the TemplateDialog CSS
file to the DialogLayout LESS file.

Width and height had no effect. Neither on desktop/mobile. I guess
the control's height covers for that. Float could be removed due to
the flex layout.

Some more specific rules could cover for the !important overrides.

Change-Id: I7f22e4be37c8f227845aed97281faefe26241091
2022-06-27 21:10:21 +02:00
jenkins-bot 1e094a8868 Merge "Fix broken error message 'visualeditor-saveerror'" 2022-06-27 19:07:18 +00:00
jenkins-bot 4eac26c3cd Merge "Use $.html to refresh page after save" 2022-06-27 17:53:26 +00:00
Ed Sanders 327bd736c5 Use $.html to refresh page after save
Pre-parsing with $.parseHTML is not required as we
1) no longer modified the DOM before appending
2) trust the HTML coming from the API

Change-Id: If549a0e647ce830d4f5de2bb94c08a895e460667
2022-06-27 17:34:19 +01:00
jenkins-bot b44132753b Merge "Remove unused resetScroll function" 2022-06-27 15:11:20 +00:00
jenkins-bot d34c95e4ff Merge "Fork OutlineControlsWidget" 2022-06-27 15:02:14 +00:00
Adam Wight bbe0356f43 Remove unused resetScroll function
Also removes some logic that could only be reached when
`this.scrolling` is true.

Bug: T310866
Change-Id: Id60cfd9d72fd0e38872f58386ea0f0b64a268214
2022-06-27 14:50:00 +00:00
Adam Wight 6de61ccf77 Fork OutlineControlsWidget
Bug: T311223
Change-Id: Id2f9fc89c607c8001e8b150add1ffbcaa318993a
2022-06-27 16:46:11 +02:00
Adam Wight b1a12aeaab Simplify focusing a parameter
We can use setPage, thereby removing a dependency on the
OutlineSelectWidget.

Bug: T310866
Change-Id: If097c9218fe56e63d9c003b10789c94513c20c93
2022-06-27 13:36:46 +02:00
Adam Wight 33d9f9958b Remove findClosestPage logic
This causes one small behavior change: when deleting one of several
wikitext transclusions or a part following a template without
parameters, the selection would previously be set to the *previous*
part, and now it's the *next* part.  This is arguably more consistent
with the behavior when removing eg. templates with parameters, after
which the next part is selected.

Doesn't affect removing parameters.

TODO: We might want to restore the already-broken behavior to focus
the first parameter of a newly-inserted template.

Bug: T310866
Change-Id: Ic5f47e31512d1a3949caf60613bd05b9a3bdf478
2022-06-27 13:36:44 +02:00
jenkins-bot 36e534719c Merge "Remove unused events from forked BookletLayout" 2022-06-27 08:58:39 +00:00
jenkins-bot 198616cdd1 Merge "Add initial tests for ve.ui.MWTwoPaneTransclusionDialogLayout" 2022-06-27 08:51:43 +00:00
Translation updater bot bf6eecb1e4 Localisation updates from https://translatewiki.net.
Change-Id: I18e3adacec441e1678e5214e9ba9fd42aecbeddd
2022-06-27 08:18:54 +02:00
jenkins-bot 93b18174c1 Merge "Avoid preloading base translation page in editor" 2022-06-26 19:17:17 +00:00
Andrew Kostka 54f4b47794 Add initial tests for ve.ui.MWTwoPaneTransclusionDialogLayout
Bug: T311116
Change-Id: Ie4e1f9f203055f68add6fea0cf04b03215a32942
2022-06-26 17:15:11 +02:00
Umherirrender ab823c0115 Replace deprecated WikiPage::factory
Remove WikiFilePage instance check, isLocal exists also on WikiPage and
newFromTitle never returns null

Bug: T297688
Change-Id: I925771a84afe4402fdb0f201c0b562c7028c44b2
2022-06-24 23:06:39 +02:00
Thiemo Kreuz 8788077754 Move template dialog sidebar clearing to more appropriate place
This place is much better in so far that it much more obviously gives
us the guarantee that the sidebar and the content pane are always in
sync.

Bug: T311069
Change-Id: I01a7914fcba5d573abb957d0e34fa895874bd94e
2022-06-24 15:24:58 +02:00
jenkins-bot 48863bc5bd Merge "Order transclusion CSS/LESS files alphabetically" 2022-06-24 13:13:41 +00:00
jenkins-bot 958082378b Merge "Merge set handler into two-pane class" 2022-06-24 13:11:21 +00:00
WMDE-Fisch a556661fc7 Order transclusion CSS/LESS files alphabetically
Should have no dependencies on the order in that case.

Change-Id: I9f0dacbc76875f27e6def2b883b0b22bfda6d055
2022-06-24 14:51:17 +02:00
jenkins-bot 2fd536469b Merge "Reduce barely used "autoFocus" code in template dialog" 2022-06-24 12:47:07 +00:00
jenkins-bot 5d1486fadf Merge "Merge some CSS rules into the layout less file" 2022-06-24 12:37:52 +00:00
jenkins-bot e54d380992 Merge "Remove newSidbar CSS and merge CSS rules" 2022-06-24 12:32:20 +00:00
Adam Wight 32a14d888b Merge set handler into two-pane class
Bug: T311069
Change-Id: I4cb7e63349904588bb27541d176378aa874d0a63
2022-06-24 12:32:16 +00:00
Thiemo Kreuz 5201c03d04 Reduce barely used "autoFocus" code in template dialog
According to my test one of the two places where this property was
used is impossible to reach with the property set to false. This is
the one I remove in this patch.

This also removes a related method that is entirely unused.

Bug: T310867
Change-Id: I9579a5d894d60560cec77dad7f1e796f8dfca06f
2022-06-24 14:01:57 +02:00