Commit graph

2934 commits

Author SHA1 Message Date
Thiemo Kreuz 96adda0d13 Add safe-guard for early template dialog resize events
I can't reproduce this error, but I feel better having this safe
guard in place. In theory it's possible to trigger resize events
before the TransclusionModel is initialized.

Change-Id: I4bbac0f73873813629ff854ee728465c6e2a4ba7
2021-10-27 12:50:20 +02:00
Thiemo Kreuz 597bacd63b Fix rebase mistake in TransclusionDialog class
I6909b3f0b2c153b7ee9995441e995ffa793eab40 was rebased, but
I0226ca7d39e04a69617c0d8a5d3c293cfc9e0709 was merged in the meantime.

Bug: T293202
Change-Id: I3cfec9ebc135eaf998a0982f458cfe75bfb2f01c
2021-10-26 10:34:26 +02:00
jenkins-bot 3e74dd7b9a Merge "Use <span> for the outline part headers" 2021-10-25 12:06:27 +00:00
WMDE-Fisch 37e7f930c4 Use <span> for the outline part headers
We're mainly interested in the layout of a button here. From a
semantic perspective this is just a header to an editable area
and not a button.

Bug: T291284
Change-Id: I683cca2e7d6549e652bd03ae1e46f4eff8c07d0a
2021-10-25 12:11:10 +02:00
jenkins-bot a932e5b6b3 Merge "Fix/cleanup template dialog methods dealing with parts vs. items" 2021-10-25 10:02:04 +00:00
jenkins-bot 6484f8dad3 Merge "Rework all code using template type related conditions" 2021-10-25 08:55:32 +00:00
jenkins-bot dbbf62e1b7 Merge "Make text fields and related information accessible to screen readers" 2021-10-22 12:40:37 +00:00
jenkins-bot 4de710ca71 Merge "Add a11y label to sidebar parameter selection" 2021-10-22 11:51:44 +00:00
Svantje Lilienthal b2852f5cb5 Make text fields and related information accessible to screen readers
Bug: T291273
Change-Id: I0746bf42eee321a4c239dd56b2008610a0d21488
2021-10-22 13:49:41 +02:00
jenkins-bot 6653b2cab7 Merge "Use cheaper jQuery constructor for minor template param label" 2021-10-22 11:38:13 +00:00
jenkins-bot 9a0d34aeae Merge "Add title to sidebar search" 2021-10-22 11:34:04 +00:00
jenkins-bot 8a295512d3 Merge "Don't try to focus a removed template parameter" 2021-10-22 11:09:46 +00:00
Thiemo Kreuz 29ef00fa29 Rework all code using template type related conditions
This is a more radical change, compared to the previous patch.
I will post more detailled explanations as comments on Gerrit.

Change-Id: I6909b3f0b2c153b7ee9995441e995ffa793eab40
2021-10-22 10:42:16 +00:00
WMDE-Fisch 6e7332193b Add title to sidebar search
Also to improve screen reader a11y.

Bug: T291284
Change-Id: Ib56d3ee542cb880edd7788ff524a72436e102627
2021-10-22 12:34:57 +02:00
WMDE-Fisch 79f1270593 Add a11y label to sidebar parameter selection
Bug: T291284
Change-Id: I581800d2c92c06c3585ac48be0242860f476022b
2021-10-22 12:31:24 +02:00
jenkins-bot 66bcfc856b Merge "Set aria-multiselect on OutlineParameterSelectWidget" 2021-10-22 08:53:14 +00:00
Thiemo Kreuz 0a13fd9459 Use cheaper jQuery constructor for minor template param label
This is done for a lot of the elements in this class. They are trivial
jQuery elements instead of OOUI widgets. While we usually want to use
OOUI widgets, this is different in this case. Think of a template with
1000 parameters.

Bug: T291284
Change-Id: Ie1960ee706dca17aa4963c23a2e89c1cfff106f9
2021-10-21 15:55:13 +02:00
WMDE-Fisch b84d5f99d6 Set aria-multiselect on OutlineParameterSelectWidget
Bug: T291284
Change-Id: Iedb731d528b7f73c188aaa40eba74ba18dc8781e
2021-10-21 15:54:01 +02:00
Thiemo Kreuz 937352a138 Don't try to focus a removed template parameter
The event "focusTemplateParameterById" targets the right side of the
dialog. The input field for the parameter should be focussed. This
doesn't make any sense when the parameter was just removed (i.e.
unselected).

Change-Id: Ie75b1edaebe9d0444b98e66cb56a5c7774393bea
2021-10-21 08:46:37 +00:00
Isabelle Hurbain-Palatin 3a3437007a Handle annotation tags as nodes rather than metaitems.
Preserve the place of annotation meta tags; adds information for the
users about annotation and, if necessary, annotation range extension.
The messages and individual handling of annotations for the annotation
range can be defined by the extensions: see I0b58a418 for an example
of how that can look like.

The structure of this patch closely follows the one from I104e7abbd
(handling of <noinclude> et al.).

Bug: T261181
Change-Id: I39029e4a63d22b37107edec066006557bcff34bf
2021-10-21 10:39:04 +02:00
jenkins-bot 1d6d0b6264 Merge "Change template dialog hotkeys" 2021-10-20 18:35:30 +00:00
WMDE-Fisch 2f9fe11231 Change template dialog hotkeys
Changed to be less conflicting see investigation in ticket.

Bug: T290262
Change-Id: If2b75cb1dd8bb26c685f8e51beebfa0e6ab6599c
2021-10-20 10:53:44 +02:00
Adam Wight 5a451e0dd8 Workaround to prevent removing the selected item
Removing the selected item causes StackLayout to select (and scroll
to) its first item.  To prevent this, we preemptively unselect.

Note that even when an unselected item is removed, StackLayout still
clears the selection, so this patch doesn't lose any useful
behaviors.

Fix should be pushed down into OOUI, unless there's a use case where
we want to select the first item?

Bug: T293635
Change-Id: I0c1fddfa32b76621a9f1328c8173f0158386aee8
2021-10-20 00:07:18 +02:00
Bartosz Dziewoński 9f9f27eb08 Fix unintentional raw HTML message
Change-Id: Ib5d37d4bdc8a36f7b077995d35cea70fb84e4476
2021-10-18 22:37:25 +02:00
jenkins-bot dfa08be3f5 Merge "Don't close the old sidebar when the add parameter button is pressed" 2021-10-18 14:02:21 +00:00
jenkins-bot 99f7acddf7 Merge "Auto hide the sidebar when only a single placeholder is present in narrow mode" 2021-10-15 08:13:41 +00:00
jenkins-bot 2873d4b328 Merge "Fix broken focus when using the add parameter button in the old sidebar" 2021-10-15 08:08:06 +00:00
jenkins-bot c5e6c9f9e1 Merge "Minor documentation fixes" 2021-10-14 19:07:09 +00:00
Andrew Kostka bf846d2313 Don't close the old sidebar when the add parameter button is pressed
Change-Id: I635d741a028196d9ad3b68cb26e5eac58b199fe5
2021-10-14 13:59:46 +02:00
Andrew Kostka 18964cdf2c Fix broken focus when using the add parameter button in the old sidebar
Bug: T293203
Change-Id: I9b9658ea05afe9c0d76e0956e8037842f540f74d
2021-10-14 13:43:35 +02:00
Svantje Lilienthal 9b9c6ff492 Remove focus from first input field when clicking on template name in sidebar
Bug: T293250
Change-Id: I017bd9fa5e566762b78e354f9ff94902b2c8968a
2021-10-14 10:25:34 +00:00
Andrew Kostka 0350b742c8 Auto hide the sidebar when only a single placeholder is present in narrow mode
Bug: T293202
Change-Id: I0226ca7d39e04a69617c0d8a5d3c293cfc9e0709
2021-10-14 11:37:23 +02:00
Ed Sanders 295d139ef1 Minor documentation fixes
Change-Id: I6822c04c8d160431510e62752783e6829950dc36
2021-10-13 14:02:57 +01:00
Andrew Kostka 0fa54f2f9e Check whether to show the sidebar after adding the parts
Bug: T292852
Change-Id: I18309164ae4838d9a7aa9fc842012806fbd0c845
2021-10-11 10:50:05 +02:00
Thiemo Kreuz dc85603c0e Remove redundant variable from TransclusionOutlineWidget
Change-Id: I27a890069748d9e689c96fa7c515568fb38e9973
2021-10-08 13:38:44 +02:00
jenkins-bot 871dd4486c Merge "Fix sidebar bottom position when pressing Ctrl+Shift+E" 2021-10-08 11:19:51 +00:00
jenkins-bot 990d5372e9 Merge "Fix first click on parameter page causing bad scroll" 2021-10-08 10:50:15 +00:00
Thiemo Kreuz f77ef7d7f4 Fix/cleanup template dialog methods dealing with parts vs. items
Some cleanup to improve readability and reduce the amount of code.
Relevant bits:
* One method name was wrong. It can actually return parameter ids,
  not only top-level part ids.
* I got rid of some fail-safe checks that are never needed or moved
  them to a more central place.

Change-Id: I08f2ad7bc7d3f985d6189dff170dda554f3d37c2
2021-10-08 07:43:23 +00:00
Thiemo Kreuz 25ee94ee07 Don't reset narrow screen mode when it's already active
Bug: T292693
Change-Id: I39f4655115c6162a0bc7984702bebe28f12563fe
2021-10-08 06:44:12 +00:00
Thiemo Kreuz 893a3d5cf0 Fix sidebar bottom position when pressing Ctrl+Shift+E
This patch fixes two issues:
* The bottom corner of the new sidebar was never correct because of
  a `padding: 2px` that was introduced later, but never compensated
  for.
* The moment the toolbar is shown it's not a single-template dialog
  any more. This implies minor style changes.

Bug: T290262
Bug: T292727
Change-Id: I08da73880c469085994ee4beb3fcdd973f80ae11
2021-10-07 18:46:47 +00:00
jenkins-bot 02e3aff969 Merge "Refactor how namespaces with subpages are exposed to JavaScript" 2021-10-07 17:57:11 +00:00
Thiemo Kreuz be789e6387 Fix first click on parameter page causing bad scroll
The idea of this piece of code is to make sure both sides of the
dialog show the same element. But it doesn't make sense to force the
*header* of a template into view when I clicked on a *parameter*.

Bug: T292718
Change-Id: I9945f8e54c856152f05bf717e43468ab5ab24d2f
2021-10-07 15:04:20 +02:00
Adam Wight 2f4ce7df69 Rewrite style so it can be flipped by cssjanus
"to right" is the same as "90deg", but can be matched and flipped in
rtl interfaces.

Bug: T292690
Change-Id: I985d4b0206112e07c2f5a481145b8abc88cb50ea
2021-10-07 10:11:44 +02:00
jenkins-bot 0ba300554f Merge "Move some logic into the TransclusionModel class" 2021-10-07 07:51:54 +00:00
Thiemo Kreuz 866547d081 Harden …TemplateTitleInputWidget to avoid JS console spam
I run into this in some local test. There are two reasons this code
can be reached:
* When a wiki doesn't have the TemplateData extension, the
  additional API call from line #154 will fail. But the original
  search query succeeded. We have the `originalResponse` and can
  return it. This makes the code behave as if the additional
  TemplateData API call was never done.
* But what if the original search query failed? We still end in
  line #183 – as we should. But this time it can't return anything
  but undefined. This will be considered a valid, successful API
  response. But it isn't.

There might be a better way to clean up this chain of promises.
This is the smallest fix I found.

Change-Id: I02d3d053156da222ee424382007621f314777015
2021-10-06 20:14:55 +00:00
DannyS712 2984539f42 Refactor how namespaces with subpages are exposed to JavaScript
Instead of using an object mapping namespace ids to if they have
subpages enabled or not, pass an array of the namespaces where
subpages are enabled, reducing the size of the configuration that
gets loaded on all requests. Only requires a minor update to the
JavaScript that uses the value (check for array index instead of
object value).

Bug: T291729
Change-Id: Ia0ecac71721eceed52cc90f39ecc560bdf1b7f9b
2021-10-06 20:11:37 +00:00
Thiemo Kreuz 1904698105 Move some logic into the TransclusionModel class
I moved some code around and found that quite a lot of code wants to
know:
* Is the length of this transclusion exactly 1?
* I need that 1st part.

There is more that can potentially moved from the dialog to the model.
But I don't want to make this patch to big.

Bug: T292371
Change-Id: Ia94ed0450d04dd97c4c41f5bf7c266f9a534e821
2021-10-06 16:00:18 +00:00
jenkins-bot b9fc01dc8e Merge "Fix hiding of 'add image' button in gallery dialog" 2021-10-05 19:57:37 +00:00
WMDE-Fisch 6c7f303c86 Focus initial/single template placeholder
This includes some moving of code. These helper functions seem to make
more sense in the TemplateDialog class.

Bug: T292371
Change-Id: I004405bab60a569b084f9083fefa41f44f9a5561
2021-10-05 12:58:55 +02:00
jenkins-bot 352075c815 Merge "Add more keyboard shortcuts for VE template dialog" 2021-10-05 10:05:08 +00:00