Commit graph

3303 commits

Author SHA1 Message Date
Adam Wight b079440068 Fix template dialog parameter padding on mobile
In the mobile view, parameters don't have left padding so some styles
should only be applied to the desktop stylesheet.

Bug: T304167
Change-Id: I1846512c21aae36f212fe142b7d96ac91e46854b
2022-03-21 09:53:22 +01:00
Ed Sanders 58f6f0195a Remove delete button from template context
Currently in VE desktop, items which can be deleted with
delete/backspace do not have this button. If that situation is
considered a problem it sould be solved consitently for all
focusable nodes as part of a wider fix.

Adding a delete button to template contexts makes them inconsistent
with other focusable nodes.

Bug: T274263
Change-Id: I2f7508a605852274ba8f40b2afd1dfd56600aa36
2022-03-20 18:09:31 +00:00
Ed Sanders f6ea2e3457 Fix resize of MWAceEditorWidget when setting up
Bug: T303964
Change-Id: Ic8efbd7df74213fddaec987aff60e733f9550db2
2022-03-18 22:30:54 +00:00
Adam Wight bf7f022686 Fix right padding on inline descriptions without the new sidebar
This fixes a styling issue with inline descriptions, for the scenario
when the inline description feature is enabled but the new sidebar is
disabled.

Bug: T304167
Change-Id: Ida4da4605da5143de2a27725d87d5876aea7065c
2022-03-18 17:16:48 +01:00
jenkins-bot 401da7ee13 Merge "Remove MWDismissibleMessageWidget and use MessageWidget's showClose option instead" 2022-03-17 11:43:33 +00:00
jenkins-bot cada5a3ab8 Merge "Extract template scrollToTop method" 2022-03-15 12:17:50 +00:00
Ed Sanders 5b92c66e97 Use new config option signature when building sequences
Change-Id: Id93327e9afdad8d761a079b17b47e7bbe32bd5e2
Depends-On: I1011602514f0f21c5764b14563d8213ecc19f49a
2022-03-11 17:12:54 +00:00
WMDE-Fisch 96dc96da8d Extract template scrollToTop method
Also putting the findFirstSelected to where it belongs.

Bug: T302965
Change-Id: Ibc56abfdf84a0b5eade5b6a44903d769f424206d
2022-03-11 12:30:51 +01:00
WMDE-Fisch 824648b32a Streamline hide unused handling
Extracted the state change so we do not need the `internal` var.

Change-Id: I0ce1afab35abf3e0e656ad1a3601513d55406537
2022-03-11 12:02:32 +01:00
jenkins-bot 4a8ca84ecc Merge "Scroll template outline into view when hiding unused" 2022-03-11 10:22:37 +00:00
WMDE-Fisch 037e7ad0b2 Scroll template outline into view when hiding unused
Due to the stickyness we need to scroll the header and the first
visible item from the parameter list to have the best result in all
cases.

We also only want to scroll when the user triggered hiding the
fields. Not when the template outline view is initialized.

Bug: T302965
Change-Id: I84d293888a7dbf13ec655c293c0fc3a79edca698
2022-03-09 19:45:07 +01:00
WMDE-Fisch e5277dd838 Fix missing padding on inline descriptions
Bug: T303386
Change-Id: Id0567102d9c8d7f0f3740085027713a2574141ef
2022-03-09 13:08:52 +01:00
Thiemo Kreuz eb25116734 Block Ctrl+Del/Backspace when Remove button is inaccessible
* I can't guarantee this fixes T301914. But I suspect the bug can not
be triggered any more with this plus If9b6050 in place.

* I wasn't able to reproduce the issue locally. But I learned that
  1. it's related to the hotkey, and
  2. it's because the dialog looses focus, and the focus ends on the
     VE surface in te background. Pressing Esc there closes VE. That's
     intended behavior.

* I tried to use .trigger( 'click' ), but it doesn't make much of a
difference. The only magic check is if the button is disabled. But no
visibility checks are done.

Bug: T301914
Change-Id: I2f66fc2411144c60cd08baae58452d336b4e9802
2022-03-02 11:56:29 +00:00
Thiemo Kreuz 836d36bc16 Skip initial creation of unused parameter widget
In a test case with 200 templates where all but a few parameters are
unused the loading time is cut in half.

Bug: T300974
Change-Id: Ice850cb9e5e95b9e3a19ff511b3a4f32117c7199
2022-03-02 10:19:46 +00:00
Ed Sanders 1b5550f485 Move var declarations inline
Mostly ve-mw/ui and a few left overs.

Change-Id: Idea0c94d974e661c49af8ad4545cd8fd98179ca8
2022-03-01 17:50:24 +00:00
jenkins-bot 976272fa41 Merge "Fix spacing between sticky find bar and field list" 2022-03-01 14:42:32 +00:00
jenkins-bot 46cfbc74bd Merge "Added check for hotkey action on input or textareas" 2022-03-01 12:00:20 +00:00
Svantje Lilienthal fb95572429 Added check for hotkey action on input or textareas
Bug: T301913
Change-Id: If9b6050c378836157fa1df5b9782ba4632890f1a
2022-03-01 10:14:52 +00:00
jenkins-bot a6d771dd00 Merge "MobileSaveDialog: Also add 'content' class to preview panel" 2022-02-28 23:45:18 +00:00
Thiemo Kreuz 5a92880da5 Fix bad visualization of empty suggested value
Bug: T299430
Change-Id: I9a0d26c7fc88e1a0c2c68152b3e15a9ba7662991
2022-02-28 08:49:08 +01:00
Ed Sanders 3f1eb8992f Fix spacing between sticky find bar and field list
Bug: T300899
Change-Id: Ieac47d58eb1037edcd82e0d7ee5c98e125c4e78c
2022-02-24 10:40:37 +00:00
Thiemo Kreuz 0d989b6fee Never collapse newly added templates in transclusion dialog
Bug: T300640
Change-Id: Id400951cf98f1eda780700d726fc10afbc1eaa90
2022-02-22 11:37:21 +01:00
Ed Sanders b4f3ecbc5c MobileSaveDialog: Also add 'content' class to preview panel
This isn't used yet as NWE is not enabled.

Change-Id: I2ea4697c2a5ba57f537e646e3d0fb7d89fd04c7b
2022-02-22 00:23:35 +00:00
jenkins-bot 839a62829d Merge "Add and fix default values in parameter documentation" 2022-02-21 13:41:51 +00:00
jenkins-bot 8c1ad11a7d Merge "MWEditSummaryWidget: Handle multi-line comments" 2022-02-21 13:39:01 +00:00
Thiemo Kreuz bc0a34b0ed Add and fix default values in parameter documentation
Same random finds while working on something else. I carefully
checked and made sure these methods are actually called without the
optional parameter.

Change-Id: Iab36fd130258322985b5d6e7f8e1f7b4ee235ba2
2022-02-21 13:19:21 +00:00
jenkins-bot 2a72f4e290 Merge "Remove not needed self = this indirections" 2022-02-21 12:57:41 +00:00
Thiemo Kreuz 3c042049bf Use .bind() syntax where it makes code more readable
This focuses on a few trivial cases where the syntax helps making
the code more readable. One level of indirection is gone with this.

Change-Id: Ibf25d7eaa06952e69b36bd5a78a48d04ac62890c
2022-02-21 10:34:03 +00:00
Thiemo Kreuz 58e27f56d6 Remove not needed self = this indirections
These are only needed when we need to access a specific `this` from
within another `function () {}` context. This is not the case in the
situations here.

This is split from Ibf25d7e to make it smaller and easier to argue
about.

Change-Id: Ide1476de91fc343aa992ad92a1321d3a38b06dd0
2022-02-21 10:52:24 +01:00
Lucas Werkmeister 957036fa19 MWEditSummaryWidget: Handle multi-line comments
The `.` character class matches any character *except* line terminators,
but edit summaries can contain those. Use [^] to match truly everything
in the comment part. (In the section part, I assume `.` is okay.)

Bug: T302103
Change-Id: I29fcdd7489d118674bab5cfe5c0a15b8e4efac64
2022-02-18 19:54:03 +01:00
jenkins-bot 962d95a51f Merge "Add ctrl/cmd backspace hotkey to delete part" 2022-02-09 12:04:25 +00:00
WMDE-Fisch ce230afa09 Disable hide unused widget when all are selected
I bit more logic was needed to make sure, the state of the widget
resets when all unused fields are added during search.

Bug: T299811
Change-Id: I3006c233fda5490e323bc3a3e631bf0c1199bda3
2022-02-09 09:23:14 +00:00
WMDE-Fisch 4b2931276c Add ctrl/cmd backspace hotkey to delete part
Bug: T300971
Change-Id: Ie8752d632fba6a15cbf45176b71b3c77a7171360
2022-02-08 16:17:12 +00:00
jenkins-bot 7d297a20e9 Merge "Wire move/delete hotkeys to button functionallity" 2022-02-08 16:09:22 +00:00
jenkins-bot 5634e5e378 Merge "Hide unused paramters by default on multipart" 2022-02-08 15:58:16 +00:00
WMDE-Fisch b35ea59de5 Hide unused paramters by default on multipart
Covers the base functionality to hide the parameters. Performance
optimizations could be done in a follow up.

Bug: T300640
Change-Id: Ia99b5da392273f1445e475a0720a656460612dcf
2022-02-08 15:56:40 +01:00
WMDE-Fisch ef87088198 Wire move/delete hotkeys to button functionallity
The behavior is now consistant with what would happen when the
buttons are triggered.

Instead of emitting a button click I directly wired the methods
that will by triggerd by the click. This might make it easier to
remove the old sidbar later.

To avoid movement when the buttons should be disabled, an
additional check was added to the onMove method. It's not identical
to the more complex check in the outlineControlsWidget, but should
be enough for our use case. The onDelete method already just does
nothing if nothing is selected.

Bug: T300971
Change-Id: I8a278c9657c91fd648944b5a8c1204c9fff75b7e
2022-02-08 15:41:01 +01:00
jenkins-bot 098791f6c7 Merge "Add vector-body class to diff/previews" 2022-02-07 23:38:15 +00:00
Ed Sanders 5739da585a Add vector-body class to diff/previews
Bug: T287733
Change-Id: I6a4befb2a29489c767df5896a86ef6a607938685
2022-02-05 22:51:05 +00:00
Ed Sanders b0e32c22fa Remove MWDismissibleMessageWidget and use MessageWidget's showClose option instead
This option was added in 0.43.0. Now that the close button is handled,
the remaining functionality (store a flag in local storage, and fixing
link targets) doesn't really justify a separate class, especially as
it's currently only used once.

Change-Id: I0fd81cadccc077dbf957302f9f41409c5a1f4f20
2022-02-03 16:37:52 +00:00
jenkins-bot 440620ae73 Merge "Show a keyboard shortcut when hovering over a toolbar button" 2022-02-01 12:33:39 +00:00
Thiemo Kreuz 7298834211 Follow naming convention for static methods
Change-Id: Ie2d7fb061fcb46765ba8796911425d58218736d1
2022-01-27 09:12:23 +01:00
Adam Wight 7e7ad97bf6 Don't wrap unknown actions with confirmation
For example, the "apply changes" button was producing a confirmation
dialog.

Bug: T300095
Change-Id: I77e53cc0cf62ff7c0aca052568384e20490ce7ec
2022-01-26 14:40:58 +01:00
jenkins-bot 1f8e56a333 Merge "Move copyright warning message parsing from RL module to API" 2022-01-26 11:07:03 +00:00
jenkins-bot 4e41b70758 Merge "ve.ui.MWLinkInspectorTool: Parse "education popup" text as wikitext" 2022-01-25 18:41:56 +00:00
jenkins-bot 219e25fb8f Merge "ve.ui.MWEducationPopupWidget: Allow formatting in the popup text" 2022-01-25 18:39:28 +00:00
Bartosz Dziewoński 8080bd2f5d Move copyright warning message parsing from RL module to API
Parsing it in the RL module caused the module cache key to depend
on the parse, which is slow and makes ResourceLoader sad. The usual
approach for solving this (I206bb05d28) can't be used, because of
how EditPage generates this message.

Bonus #1:
Generate the message for the correct page title. MediaWiki allows
customizing it per-namespace or even per-title, which we haven't
supported before.

Bonus #2:
Pass the context for message localisation (depends on I5f7c77970d).
EditPage::getCopyrightWarning() was parsing messages without the
interface flag, causing some needless processing elsewhere.

Depends-On: I5f7c77970d0525c0ff394f8bd72c69dcb5d00623
Bug: T298822
Change-Id: Iaa626f0e6379a5a370f9c465cea8528bb5bde7f7
2022-01-24 22:19:04 +00:00
WMDE-Fisch 5b4e53148d Confirm before close when all parameter values are deleted
Do show a confirmation when editing templates without parameters,
but don't show the confirmation when you're only on the template search
page.

Bug: T299394
Change-Id: I8205bb6a0f92b7b535a80f7f6a43674f1aa5b51b
2022-01-24 11:43:27 +01:00
Adam Wight a7ba729d8c Refactor confirmation logic
Shouldn't change behavior.

Split from I8205bb6.

Bug: T299394
Change-Id: I32876939d4f61c3be8e756c6eba6f74ea98c11f1
2022-01-24 11:43:27 +01:00
jenkins-bot d355ee1c88 Merge "Minor code cleanup in MWTransclusionOutlineTemplateWidget" 2022-01-24 08:11:43 +00:00
Thiemo Kreuz be5a752c8e Minor code cleanup in MWTransclusionOutlineTemplateWidget
Change-Id: I98904756e8ab9069634f644dc4d8631d1c0ee8fb
2022-01-23 17:09:46 +00:00
Bartosz Dziewoński 8bcb50b6a2 Fix showing caption and alt text fields in media and gallery dialogs
We were using addItems() incorrectly, and it stopped working after
change Ib1241f93d214e8a7d2f757a120f84de3879575af in OOUI.

Bug: T299818
Change-Id: I2d00cb929673a419789ca6f8bc308721373e1da8
2022-01-22 03:27:22 +01:00
Andrew Kostka 856ad0fc03 Show a keyboard shortcut when hovering over a toolbar button
Bug: T299490
Change-Id: I5af6ecf10b90c6a85bccc8489584322e1ba20bd5
2022-01-21 20:08:20 +01:00
jenkins-bot 9ec8a68891 Merge "Link to a list of keyboard shortcuts from the template help dialog" 2022-01-21 18:28:30 +00:00
jenkins-bot ae3d442dc7 Merge "Restore a way to delete transclusions on mobile" 2022-01-21 16:31:00 +00:00
Andrew Kostka eaa438abcb Link to a list of keyboard shortcuts from the template help dialog
Bug: T299487
Change-Id: Ieef99eeb9c43817981e2ae5b5340a58c2aca4920
2022-01-21 17:24:34 +01:00
jenkins-bot fdd195a241 Merge "Update accept button in confirmation dialog" 2022-01-21 16:22:30 +00:00
jenkins-bot 3982a3bfba Merge "Fix transclusion node double clicks being tracked differently" 2022-01-21 15:47:34 +00:00
WMDE-Fisch cede096333 Update accept button in confirmation dialog
The only places where this dialog is used now will have the same
button labels and format. We want to use "normal" destructive here
so no additional "primary" styling.

It seems that the focus on the action will only be applied
automatically when it is primary. So extra code is needed.

Bug: T299647
Change-Id: Ib5250b79e85d27ea197b83c6380863d0749e5d89
2022-01-21 15:32:58 +00:00
jenkins-bot c37d6f86e8 Merge "Hide parameter search when there are only 3 params" 2022-01-21 14:18:41 +00:00
jenkins-bot 8fa3a7a4eb Merge "Update the context menu title for multipart templates" 2022-01-21 11:40:58 +00:00
Andrew Kostka d4fff29148 Update the context menu title for multipart templates
Bug: T299495
Change-Id: I082a4e925c15ba5966a575127046e33f2fc3f62a
2022-01-21 11:51:31 +01:00
WMDE-Fisch 6cb0e7477e Hide parameter search when there are only 3 params
The search field is of not much use when there is not really anything
to search. It wastes more space than the actual list of parameters.

Approved by UX, see T298259#7626538.

Bug: T298259
Change-Id: I01784a1c463d8b0b504897b20179719f91597d19
2022-01-21 11:23:49 +01:00
Andrew Kostka 8da9661e11 Add a title to the templates help button
Bug: T299499
Change-Id: Ibb4aca479674668d6c14b8ace037433fa305dc35
2022-01-21 11:11:46 +01:00
jenkins-bot 4015ad1bf5 Merge "Defer creating template parameter widget for 0 parameters" 2022-01-21 08:52:37 +00:00
Bartosz Dziewoński 49a4ac0463 ve.ui.MWLinkInspectorTool: Parse "education popup" text as wikitext
Bug: T298837
Depends-On: I0b8ba7c13e97868ab79dcec5c132d0b30dcc9c60
Change-Id: I9258cb7521e43a62cffb5b3698f25e6801f8ae92
2022-01-20 22:57:07 +01:00
Bartosz Dziewoński 9f54e34764 ve.ui.MWEducationPopupWidget: Allow formatting in the popup text
Bug: T298837
Change-Id: I0b8ba7c13e97868ab79dcec5c132d0b30dcc9c60
2022-01-20 22:55:44 +01:00
Bartosz Dziewoński 65d723b62b Restore a way to delete transclusions on mobile
For most nodes, isDeletable() returns false on desktop and true on
mobile. Change e0bbf0b979 meant to
change the desktop version to depend on the new config settings, but
accidentally changed mobile too.

Bug: T298828
Change-Id: I8ec5e8031a27eee18c16dfcd267937cc76722c50
2022-01-20 22:39:55 +01:00
Thiemo Kreuz 28a74445f0 Fix transclusion node double clicks being tracked differently
Double clicks have been tracked as "window-open-from-command", but are
now tracked as "window-open-from-context". This patch changes this
back.

Bug: T297773
Change-Id: Icabc5db526c35d681d077043c54ca009b2296bbe
2022-01-20 15:41:08 +01:00
jenkins-bot 835464802a Merge "Disable edit button while loading template dialog" 2022-01-20 13:50:51 +00:00
jenkins-bot 2cbe4f7d6f Merge "Fix left margin of hide unused and checkboxes" 2022-01-20 13:07:07 +00:00
jenkins-bot 16e188e815 Merge "Defer creating template parameter search when it's not needed" 2022-01-20 12:52:19 +00:00
jenkins-bot d4b354a1ba Merge "Removed left padding in parameter description" 2022-01-20 12:31:34 +00:00
Thiemo Kreuz 8fd1b6d8b8 Defer creating template parameter widget for 0 parameters
From the user's perspective nothing changes. A template without
parameters doesn't show anything. (Technically there was an empty
<div>, but it doesn't do anything.) The moment the first parameter
is added the required sub-widget is created and available from there
on.

This saves loading time and memory, especially when a multi-part
template contains many templates without parameters.

Bug: T298259
Change-Id: Ib1bd2cd0be4fece4acc92e6e5f63133a7986cf81
2022-01-20 12:06:03 +00:00
Svantje Lilienthal adb85f341a Removed left padding in parameter description
Bug: T299518
Change-Id: Iaa7118a111cfbc1856bbe7c1ff6917587ba6c395
2022-01-19 14:40:06 +01:00
WMDE-Fisch 0e4c6104ef Fix left margin of hide unused and checkboxes
The checkboxes are actually indented a bit more than the search box
with this change the extra indentation is applied and the hide
button text is alligned accordingly.

Bug: T298259
Change-Id: I5508ab883c23e7285c023dc127529ffa4dbe58c7
2022-01-19 14:21:37 +01:00
Thiemo Kreuz 66f56f6c88 Defer creating template parameter search when it's not needed
From the user's perspective this is the same as before: When a
template doesn't have any parameters, there is no search field. The
moment the first (undocumented) parameter is added the search field
appears.

This is just delayed now. The widgets are only created the moment
they are actually needed.

This saves loading time and memory, especially in a multi-part
transclusion with many zero-parameter templates.

This also makes it a lot easier to change the minimal number of
parameters from 1 to e.g. 4.

Includes reverting the flexible header composition done in
Ib050e30a50ef965c1524e977d3a600c3ff836774

Bug: T298259
Change-Id: Ied7541d8d5c0b478a439dd31ce072e634287f181
2022-01-19 11:23:34 +01:00
jenkins-bot 770884f14f Merge "Make sidebar header and search field sticky during scroll" 2022-01-18 12:55:11 +00:00
Thiemo Kreuz 33a2f21589 Disable edit button while loading template dialog
Bug: T297773
Change-Id: I51fc0af4c3b29fd0801fc06a1dc07ad3fd7f1da3
2022-01-18 12:29:27 +00:00
jenkins-bot b4e3c3b1e5 Merge "Add mobile specific styling for TemplatePage" 2022-01-17 17:14:00 +00:00
Adam Wight a244f510c4 Make sidebar header and search field sticky during scroll
The search field will stay at the top of the window while scrolling a
single template.  In multi-part transclusions, the header will also
be sticky.

Hides the template header in single-part transclusions.

Bug: T298618
Change-Id: Ib050e30a50ef965c1524e977d3a600c3ff836774
2022-01-17 16:09:54 +01:00
jenkins-bot 2819958a8a Merge "Add button to sidebar to hide/show unused fields" 2022-01-14 11:35:19 +00:00
WMDE-Fisch 20435b319c Add button to sidebar to hide/show unused fields
Bug: T298259
Change-Id: I8e5091b97dfb19eba981b2a919b82b6f14823990
2022-01-14 11:09:04 +00:00
jenkins-bot 1150891885 Merge "Include TemplatePage styling on mobile" 2022-01-14 11:07:59 +00:00
Andrew Kostka 2e7d4dabd1 Fix positioning of the "add parameter" button on mobile
Bug: T292749
Change-Id: I8c73189fcb94541087c6d44fbe7a82d14f9c3483
2022-01-13 15:18:40 +01:00
Andrew Kostka 914d9f7aaf Add mobile specific styling for TemplatePage
Bug: T292746
Change-Id: I3f2bc156d3f1be6e78b3a5d257c0cc484a65611c
2022-01-13 14:42:41 +01:00
Andrew Kostka 8c07926d4b Include TemplatePage styling on mobile
Bug: T292746
Change-Id: I52dcc8b489598ea8a892ad6c049c20d40f410d5b
2022-01-13 14:03:02 +01:00
Adam Wight 587ba4c662 Confirm before closing template dialog
Reuse the back button confirmation dialog for the close button.  The
condition is slightly different: need confirmation if there are any
manually-entered values for any parameter AND the user has edited
the template in this session.

The "reset" action was synthetic, only used internally and not
connected to buttons or menus.  Canonically, action='' is the close
action for OOUI.

Bug: T297792
Change-Id: I4ff644c7ab24ed9ba1a4c27d762563c5d6771cfc
2022-01-12 10:47:21 +01:00
jenkins-bot 1dbfad3503 Merge "Reuse touched-content logic" 2022-01-12 08:34:09 +00:00
jenkins-bot 4f9f14f383 Merge "Replace confirmation overlay with a popup dialog" 2022-01-11 17:59:48 +00:00
Adam Wight 28e706b3dd Reuse touched-content logic
Without changing behavior, consolidate the logic for detecting
whether the editor has made changes to the template.  This is
responsible for enabling and disabling the "Apply changes" button.

Change-Id: Ic4755b13f30fb738a7cb1eebaddef0435ea61d34
2022-01-11 17:39:22 +00:00
Adam Wight cbe2fd634f Replace confirmation overlay with a popup dialog
Currently, the insert template dialog includes a back button in the
upper corner.  Confirmation of abandoning unsaved changes was
accomplished in an overlay panel.  This patch rewrites as a dialog
and updates the on-screen text.

Bug: T297792
Change-Id: Ifa2ff97c9284609ee2a784f455789c56a762ba50
2022-01-11 18:37:29 +01:00
Thiemo Kreuz 579cdaa145 Enforce formatversion=2 in template search
This is guaranteed via ve.init.mw.Target.getContentApi(). But the
ContentTranslation extension replaces this, and does not set a
formatversion. See e.g. SectionTranslationTarget.getContentApi().

Bug: T298599
Change-Id: I8768cae3153e9cbc29a8796ec21ef249f80471ed
2022-01-05 12:49:44 +01:00
jenkins-bot 717b5cf534 Merge "Use no-jquery/no-html to warn against writing HTML strings to the DOM" 2021-12-17 16:42:53 +00:00
jenkins-bot c92ea76af8 Merge "eslint: Enable no-jquery/no-append-html" 2021-12-17 16:42:42 +00:00
jenkins-bot 53ad459b27 Merge "ve.ui.MWMediaDialog: Clean up image metadata display" 2021-12-17 16:42:39 +00:00
jenkins-bot 6dc75d8283 Merge "Remove obsolete performance bottleneck from TransclusionModel" 2021-12-17 13:24:19 +00:00
jenkins-bot 26d22ee4bc Merge "Delay initialization of all invisible "add parameter" components" 2021-12-17 11:52:48 +00:00
jenkins-bot 4a1063e87a Merge "Skip bad suggestedvalues and aliases in the template dialog" 2021-12-17 11:16:21 +00:00
Ed Sanders 2098292318 Use no-jquery/no-html to warn against writing HTML strings to the DOM
This forces us to comment when we are doing this deliberately.

Change-Id: Ide1bcb64f6c6076b48e88f1f27045bd93392f8a0
2021-12-16 01:28:42 +00:00
Ed Sanders 4d13a4f4ed eslint: Enable no-jquery/no-append-html
Prevents accidentally treating plain text or user input
as HTML, which could be an XSS vulnerability.

Change-Id: Id4af48447a0907962a57340cb60aca08df9cc505
2021-12-16 02:04:11 +01:00
Bartosz Dziewoński 97be4e21ad ve.ui.MWMediaDialog: Clean up image metadata display
* Fix incorrect use of .append() instead of .text() (which was causing
  some l10n messages to be treated as raw HTML)
* Avoid escaping and parsing HTML several times when plain text was
  intended
* Remove some unused options and variables

Follow-up to 839b64d882.

Change-Id: I124257c73fe09713afefccdec8e90200e6ae433d
2021-12-16 01:52:54 +01:00
sbassett 839b64d882 SECURITY: ve.ui.MWMediaDialog: Escape plaintext image metadata fields
CVE-2021-44855

Bug: T293589
Change-Id: I691b4065e67c53c4276599c8d16c31ab5591db3a
2021-12-15 16:14:35 +00:00
Thiemo Kreuz 7cf10ea474 Delay initialization of all invisible "add parameter" components
The "Add parameter" page always starts collapsed. Even if a template
doesn't contain anything but this. But most of the content isn't
visible, unless the user presses the button. It's not only a lot of
content, it's also rather expensive, including .parseDom(),
LinkCache.styleElement(), and ve.targetLinksToNewWindow(). This adds
up in large multi-part transclusions. In an example with 200 parts
the total blocking time goes down from 2.9s to 2.4s. Which means this
is not a major bottleneck, but still worth it.

Bug: T296335
Change-Id: Ieab9fd35d145142b04d2267d8e5a2e10a4c02784
2021-12-15 08:28:16 +00:00
jenkins-bot 6bfd3ab7c0 Merge "Add link to undocumented parameter help" 2021-12-13 13:56:52 +00:00
Thiemo Kreuz 66636e1dd8 Skip bad suggestedvalues and aliases in the template dialog
Bug: T297386
Change-Id: I6456d720c923e8cff9b4500b6cfe52bc6fbc9dad
2021-12-09 16:58:13 +00:00
Thiemo Kreuz 845cd69bf5 Don't scroll to template parameters while the dialog loads
Bug: T296743
Change-Id: Icd501ae89695a202e8c264d1b5e9811e812a56d1
2021-12-09 14:57:20 +01:00
Andrew Kostka 887a01a355 Revert "Hide more button on parameter descriptions for screen readers"
This reverts commit 3e23d78d32.

Bug: T296997
Change-Id: I74a338aa4e8cb7754feaabc348b6c308f7f2eeae
2021-12-09 10:10:53 +01:00
jenkins-bot 39199ae44f Merge "Remove unused CSS from template dialog" 2021-12-07 14:43:51 +00:00
WMDE-Fisch 742aee7f9d Add link to undocumented parameter help
Bug: T284985
Change-Id: Ie5a61beed39aa3572c2a5e82dbc3711fdcd35ba8
2021-12-07 15:12:20 +01:00
Thiemo Kreuz 847ab1800b Remove unused CSS from template dialog
These pieces are only relevant when the new "inlineDescription"
feature is enabled. In other words: This can't have an effect on
the old dialog.

The 2.5em left and right are from an old styling when the
parameter pages have been indented.

Change-Id: I022b0dd94ee66f7de114c055c3f453317a7f6131
2021-12-07 13:57:18 +00:00
jenkins-bot 131f7e940d Merge "Add safe-guard for early template dialog resize events" 2021-12-07 13:08:42 +00:00
Thiemo Kreuz fd669a4d16 Remove obsolete performance bottleneck from TransclusionModel
This sorting algorithm was introduced via Ic6bc348 (T274544). Note
there is no index parameter in the .onReplacePart() handler at this
point. When a part was moved, it was removed and simply appended
to the end. The additional sorting was needed to move it back to the
correct position.

This changed a few days later via Iafe29f1. There is now an index
parameter. The .onReplacePart() handler does the same as before, but
puts the part at the correct position right away. The additional
sorting is pointless since then.

The removed code alone is responsible for 1/3 of the total blocking
time when the template dialog opens.

Bug: T296335
Change-Id: I6c3fa70b532d34cd29d59c3b48ab81ebf608d548
2021-12-06 17:36:53 +00:00
Svantje Lilienthal 65bef19f73 Prepend multipart message in onReplacePart to prevent it from moving around
onReplacePart is being called when templates are being moved up or down. 
To prevent that the multipart message gets moved around passively e.g. 
by one element being added above it, this patch adds it to the top after each movement.

Bug: T292829
Change-Id: I946c9bc4ba5e1d261aefbb28a8c642bb58964842
2021-12-06 13:58:09 +00:00
Svantje Lilienthal a2afdee49f Remove suggested values message for custom inputs
Bug: T296915
Change-Id: Iecd90b02ea5bebceda1e87ddddb43fdb71b91d9e
2021-12-03 15:28:04 +00:00
WMDE-Fisch eef0ce91f7 Parse new link in multipart message
We forgot change the way that message is build while adding the link
in 07f105fd7. Now it gets parsed correctly and the link will open in
a new tab.

Bug: T284985
Change-Id: I1ed9dfdafd08d08c5aff45f4b74c540b35ec14a1
2021-12-03 10:36:44 +00:00
WMDE-Fisch 1467800331 Remove temporary hacks that got fixed upstream
Fixes are part of OOUI v0.42.1

Change-Id: Ic133d6cc503538fb8b4319bed037bc6e8596bd1c
2021-12-02 13:27:40 +01:00
Thiemo Kreuz 35bc600aa9 Fix action icons breaking into multiple lines on narrow screens
This is only relevant with the old design. It's only noticable when
a field shows all 3 action icons: info, raw wikitext mode, and
trashcan. The last icon can wrap to the next line when the screen
is very narrow.

I tried to apply nowrap, but this causes other style issues.

Removing the arbitrary width allows the action container to be
as wide as it needs to be. I can't tell why this restriction was
there. It is in no way necessary, as far as I can see. I can only
guess it's a temporary artifact from when the dialog was designed.

Bug: T296730
Change-Id: I77129ccc3afe002ba697b1787b41d0a388d5f4b8
2021-12-01 14:57:49 +01:00
jenkins-bot 85d64d57bc Merge "Performance: Don't add empty action <div>s to template dialog" 2021-11-30 13:59:53 +00:00
Adam Wight e82eb4832c Cleanups
Split from I280f814e72.  Should have no effect on behavior.

Change-Id: I4a43cbc863c58a4977e8093fa8c1371b56ec9b90
2021-11-30 14:07:32 +01:00
Thiemo Kreuz a40947ed18 Performance: Don't add empty parameter descriptions to dialog
This does have a significant impact on the performance of the
template dialog. Not only on construction time, but also because
MWExpandableContentElement objects do some quite expensive
.updateSize() calculations the moment they become visible.

I profiled a template with (only) 200 undocumented parameters.
Construction time goes down from ~600ms to ~520ms. The mentioned
.updateSize() runtime goes down from ~300ms to ~10ms.

Bug: T296335
Change-Id: I280f814e722b299aae0ec6a5a2fa59292e3e5887
2021-11-30 14:07:11 +01:00
WMDE-Fisch f65eac3d66 Add placeholder for finding a template
Bug: T296465
Change-Id: I07c6e601111073b1269a3ab6c552f83e12196156
2021-11-26 16:30:19 +01:00
WMDE-Fisch bc89f1d8fd Set search icon on template placeholder search
Bug: T296465
Change-Id: I02932821b26c21eb559fdb391054b83d1da41d2a
2021-11-26 14:34:44 +00:00
Thiemo Kreuz b435f02efc Performance: Don't add empty action <div>s to template dialog
This doesn't have much of an impact on performance according to my
profiling. But I think it's worth it nevertheless. The idea is to
skip that <div> entirely when it's empty.

Bug: T296335
Change-Id: Id155725fbc2e3453acc1cdcabfdc2d687285d694
2021-11-23 21:38:19 +00:00
jenkins-bot e6b9a91ee9 Merge "Fix missing Meta+D shortcut on Mac" 2021-11-23 10:32:37 +00:00
Thiemo Kreuz ddaa6a18c1 Fix missing Meta+D shortcut on Mac
I also discovered and applied ways to make this code more compact.

Bug: T294905
Change-Id: I1edc2b3b0a77e02bf8e7ac789cabe007c5f5c527
2021-11-23 10:38:50 +01:00
jenkins-bot 1a4fb339eb Merge "Make better use of the ARIA mixin" 2021-11-22 17:18:51 +00:00
jenkins-bot 2d6cae4684 Merge "Add mw-show-empty-elt to MW surfaces" 2021-11-19 21:06:45 +00:00
jenkins-bot eb26dc10b2 Merge "MWSaveDialog: Fix specificity of margin override for monobook" 2021-11-19 17:25:41 +00:00
jenkins-bot 9f6c431fbd Merge "MWSaveDialog: Move header out of mw-body-content" 2021-11-19 17:25:38 +00:00
jenkins-bot 4c02fb7cef Merge "MWSaveDialog: Move var declarations inline" 2021-11-19 17:23:45 +00:00
Ed Sanders a4ab89648d MWSaveDialog: Fix specificity of margin override for monobook
Change-Id: Ic37d312cf10777dd5e45c0641295b2f2e766acde
2021-11-19 16:55:22 +00:00
Ed Sanders 69e367464f Add mw-show-empty-elt to MW surfaces
Bug: T295984
Depends-On: Ife0e908edc12b2eb04c5f0b4def969ce843606a0
Change-Id: I49a2b5226a770334a05a51c8ea7b835c8c2c574f
2021-11-19 16:08:53 +00:00
jenkins-bot 90643ef6d0 Merge "Prefere ve.extendObject over $.extend" 2021-11-18 21:22:16 +00:00
WMDE-Fisch c1c167a17f Make better use of the ARIA mixin
Bug: T295353
Change-Id: I7ccb1e771516df8198c6e07cbf37e9739bc0ed71
2021-11-18 15:21:47 +00:00
Ed Sanders 86c405a2e1 Prefere ve.extendObject over $.extend
Change-Id: I37fef45701653cef08de9ec699865aa4fdf477bc
2021-11-15 21:30:19 +00:00
jenkins-bot e4f444624d Merge "Only use aria description on multipart transclusions" 2021-11-15 15:34:44 +00:00
jenkins-bot 609f589557 Merge "Move feedback icon to correct position in template dialog" 2021-11-15 14:45:57 +00:00
jenkins-bot b84a6198db Merge "Update shortcut to add a part in the template dialog, take #3" 2021-11-15 14:34:52 +00:00
Thiemo Kreuz 0e1a5379da Move feedback icon to correct position in template dialog
Bug: T294839
Change-Id: Ib1a895735d795e0d38f38952fd8bce6ad3fee50e
2021-11-15 14:04:18 +00:00
WMDE-Fisch 26cab3125d Only use aria description on multipart transclusions
Moving responsibility to the part widget to check if we're in a
single transclusion.

Bug: T295353
Change-Id: I61b7891c04eb729647e2600318a97987fd88cb90
2021-11-15 12:22:12 +01:00
jenkins-bot 1cbeb7c4ac Merge "Move misplaced close button back to standard position" 2021-11-15 08:16:52 +00:00
Ed Sanders 42b5fddf61 MWSaveDialog: Move header out of mw-body-content
Change-Id: I684e3025b97b546a391a64dd647365246e37d36c
2021-11-12 23:00:02 +00:00
Ed Sanders e111c40d09 MWSaveDialog: Move var declarations inline
Change-Id: I163dc057961e8d530ba394dbb92b97e4d866d867
2021-11-12 22:54:52 +00:00
jenkins-bot d8329b36a3 Merge "Minor fixes to floating help dialog in desktop mode" 2021-11-12 16:34:17 +00:00
jenkins-bot d4a25fdbe7 Merge "Use a fullscreen help dialog for templates on mobile" 2021-11-12 16:25:32 +00:00
Thiemo Kreuz 198e62be83 Move misplaced close button back to standard position
In OOUI the close button is always on the left side. See
https://doc.wikimedia.org/oojs-ui/master/demos/?page=dialogs&theme=wikimediaui&direction=ltr&platform=desktop

The CSS hack to move it to the other side doesn't work and must be
removed. You can see the problem the moment the text is longer (which
can easily happen in translated versions).

I tried to come up with a more official way to move the button to the
other side, but gave up. One way is to replace the existing

		flags: [ 'safe', 'close' ]

with:

		flags: [ 'primary', 'close' ],
		framed: false

But this causes other style problems. Let's remove the bogus CSS
first and possibly try again in a later patch.

Bug: T294839
Change-Id: Ia6ddefd99e4a03a87b0450ab94712ff19bb268e4
2021-11-12 16:48:13 +01:00
Thiemo Kreuz dd68dd38d7 Minor fixes to floating help dialog in desktop mode
There was a remaining issue when the window was made very narrow in
desktop mode (smaller than 500px). This patch doesn't aim to really
"fix" the dialog's design in this case. The goal is to make the popup
window appear less broken, so the text can stil be read and the
buttons clicked. That's all.

This patch should not have any effect in:
a) mobile mode,
b) desktop mode when the window is wider than 500px.

Bug: T294839
Change-Id: I3171dbb991533b91eaadba63b78d0ff40aa486dc
2021-11-11 12:23:26 +01:00
Ed Sanders 33840e88ee build: Update eslint-config-wikimedia to 0.21.0
Change-Id: I19465a5ab3bf71cd97967fd1fac41c645f05a419
2021-11-10 14:52:56 -05:00
Andrew Kostka da2df5a118 Use a fullscreen help dialog for templates on mobile
Bug: T294839
Change-Id: I1effb6ea70bcf5e9ce4e84e65431765d0d2f8125
2021-11-10 15:33:25 +01:00
Andrew Kostka 72641151e4 Implement floating help dialog for templates
Bug: T294839
Change-Id: Id224b61bd0cd57f5e970ab62db2d82dab1db9252
2021-11-09 15:28:23 +01:00
Thiemo Kreuz 5e13ccfb43 Update shortcut to add a part in the template dialog, take #3
Same as I980b72c, but with another shortcut. Again. We tried
Ctrl+Shift+X before (conflicts with RTL feature in VisualEditor), as
well as Ctrl+Alt+D (conflicts with "hide all windows" incUbuntu).

Bug: T294905
Change-Id: Iae7ba759fcd7c107ef586bd5d9ae3cdbe445cedc
2021-11-09 10:48:52 +01:00
WMDE-Fisch 3e28977087 Remove local aria-multiselectable
Added to OOUI v0.42.1 see I717ff53e18e95c72ace1c46b6236cfecb5cd8217

Bug: T291284
Change-Id: I45965181f22f9c5845f6dd44ab75e95305a43dce
2021-11-05 09:10:21 +01:00
Andrew Kostka 7f3c24b48e Update the shortcut for adding a template in the template dialog
Bug: T294905
Change-Id: I980b72c98835865c065163fa17bfcc3b9434a80b
2021-11-03 15:40:16 +01:00
jenkins-bot 3d3369298a Merge "Move id creation into AriaDescribe mixin" 2021-11-02 22:24:09 +00:00
Thiemo Kreuz 56fb18243c Move id creation into AriaDescribe mixin
Change-Id: Ifef4f3c0fee13a241488f473b561ced7b327fd73
2021-11-02 09:44:02 +00:00
jenkins-bot f223046fc8 Merge "Introducing a mixin for ARIA descriptions on parameter selection" 2021-11-01 15:56:51 +00:00
WMDE-Fisch f9fda0594f Introducing a mixin for ARIA descriptions on parameter selection
Allows setting aria labels and descriptions on elements in a
convinient way. I did not use the the .mixin. convention here for
because there's already another mixin in that folder that's also
not having .mixin. as part of its name. And then there's also no
no need to open up that extra namespace here.

If we move this upstream at some point this can be changed though.

Bug: T291284
Change-Id: I1b3d40400d539f851f13719e16ced200968a7f92
2021-11-01 13:20:00 +01:00
jenkins-bot b5a6e2e32b Merge "Support both DELETE and DEL when using template shortcuts on MacOS" 2021-10-29 16:10:37 +00:00
jenkins-bot c27c094cff Merge "Exclusively use CMD instead of CTRL for shortcuts on MacOS" 2021-10-29 16:10:34 +00:00
jenkins-bot f780c75b1f Merge "Add ARIA descriptions to sidebar widgets" 2021-10-29 10:37:55 +00:00
WMDE-Fisch dab5b5daae Add ARIA descriptions to sidebar widgets
When changing the source in the described-by attributes the screen
reader will read the text of the new source when the status changes.

Just changing the text within the elements holding the descriptions
does not work.

Bug: T291284
Change-Id: I31cc3061cf6c1f699babe41e99e0711f0eb03646
2021-10-29 12:07:53 +02:00
WMDE-Fisch 3e23d78d32 Hide more button on parameter descriptions for screen readers
Screen readers will read the collapsed content despite the fact that
it is not visible due to the way it is hidden with CSS. The more button
makes no sense for these users and is probably more confusing than
helpfull.

Bug: T291277
Change-Id: I71888d8b9565d5ee85c5e7a48965e9e9a76eb984
2021-10-29 08:48:32 +00:00
jenkins-bot c26f521cdb Merge "Set selected status to sidebar elements" 2021-10-28 12:20:39 +00:00
WMDE-Fisch ef57268b2e Set selected status to sidebar elements
ARIA-selected only works on specific elements/roles. I tried several
combinations here, the most fitting seemed to be the option role, but
that role did not work very well in FF with NVDA. It also should only
be used as direct child to a listbox e.g. with several children.

The next role that's working with ARIA-selected that seemed fitting
is the gridcell. It's still a bit hacky but works well in IE and FF
with NVDA. I suspect that that's pretty good coverage already then.

Bug: T291284
Change-Id: I85c865b0ab12d3923e472e5f36b5c07b7c722180
2021-10-28 12:40:50 +02:00
Andrew Kostka 0475812a20 Support both DELETE and DEL when using template shortcuts on MacOS
The following keyboard combinations are now supported on MacOS:

1) CMD + DELETE
2) CMD + DEL
3) CMD + FN + DELETE

(1) for keyboards without a DEL key use DELETE/BACKSPACE
(2) for keyboards with a DEL key
(3) FN + DELETE is a built-in an alias for DEL

Bug: T294519
Change-Id: I896837954b2f0b36a25484080e57d929a5abf774
2021-10-28 12:18:47 +02:00
Andrew Kostka 80fff73688 Exclusively use CMD instead of CTRL for shortcuts on MacOS
Bug: T294519
Change-Id: I8bd803b4a81ed5195ff0bb1b99b14f764d588eca
2021-10-28 11:53:38 +02:00
Adam Wight 1e82a4ce78 Still hide mode button unless in small screen mode
Bug: T294351
Change-Id: Iebd9cbc5d48711c2e85cab927d4515e6fe0a7d03
2021-10-28 10:42:44 +02:00
Adam Wight b3e5478221 Show the "other actions" toolbar when unknown buttons are available
For example, the Citoid extension adds a "change reference type"
button which should be visible when editing a citation template.

TODO: Decide whether we want to hide the "hide options" button in
this case.  This should be handled in a separate patch and possibly
in a follow-up phase, it requires deeper changes to the logic.

Bug: T294351
Change-Id: I1c6c322fe48044d7e726bf20ba7cd2eda422cd8b
2021-10-27 13:10:23 +02:00
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
Ed Sanders fe6e097d1d Fix hiding of 'add image' button in gallery dialog
Change-Id: I755abc3b28b32350f33d96e2938cb7d7d3caa5e5
2021-10-04 13:53:25 +01:00
Thiemo Kreuz dba40bab22 Reduce duplicate/dead code when checking for single templates
I hope this code is a little cleaner. This patch doesn't change how
the dialog behaves.

Bug: T292210
Change-Id: I237812b3404437948eb76d8b36dcca2a4c688d6d
2021-10-01 15:47:09 +02:00
WMDE-Fisch 15e825c603 Add more keyboard shortcuts for VE template dialog
Bug: T290262
Change-Id: I9a3c29e9925b903c6d6f2424a4912ae1c9ecfe2c
2021-10-01 14:56:10 +02:00
Adam Wight f64522304b Keyboard shortcut to add a new template
Bug: T290262
Change-Id: Ie548d3813374466638a1b196fa4014519d7228fe
2021-10-01 12:40:15 +00:00
jenkins-bot 50faec38c3 Merge "Don't get stuck on a narrow mode sidebar" 2021-10-01 11:07:31 +00:00
WMDE-Fisch 2a4e4ea202 Don't get stuck on a narrow mode sidebar
Bug: T292210
Change-Id: I0d7d69e775d65cdabe7377851a695c8dc7ac7e67
2021-10-01 10:23:57 +02:00
Thiemo Kreuz 1731f3cc14 Better name for .selectPartByPageName() method
This method does not only select a "part", i.e. a top-level item like
a template. It also selects sub-items like template parameters. The
new name reflects this better.

Change-Id: I51a8ddbd05b283248afba5a623cc52da7b2434f5
2021-10-01 07:00:40 +00:00
jenkins-bot 3f23cc79ee Merge "Add missing @fires documentation tags" 2021-09-30 16:35:02 +00:00
Thiemo Kreuz a625669380 Add missing @fires documentation tags
Change-Id: I0c9b2aa827a6806004480b642c23f320b190b6ab
2021-09-30 15:50:33 +00:00
jenkins-bot 13e0cccb36 Merge "Fix more/less button placement for different feature flag combinations" 2021-09-30 15:02:13 +00:00
jenkins-bot 0eb7934500 Merge "Better method name for the parameter name validation update" 2021-09-30 14:56:03 +00:00
Thiemo Kreuz 7bd90b7506 Hack out forced scroll to first BookletLayout element
As a temporary standin for the mentioned OOUI patch.

Change-Id: I85d1fe542e10d83acdc0208d7cadc7a665eda0b2
2021-09-29 13:19:40 +02:00
Andrew Kostka 2e377f4497 Fix more/less button placement for different feature flag combinations
Bug: T291907
Change-Id: Ibca51ab2b1faae37890e69a977f9dc4e700acc27
2021-09-29 11:19:40 +02:00
jenkins-bot 84937964bf Merge "Add/remove some TODO comments" 2021-09-28 14:21:17 +00:00
jenkins-bot 84e6019701 Merge "Make function overridable by subclasses" 2021-09-28 14:10:00 +00:00
Thiemo Kreuz 152f5edae2 Add/remove some TODO comments
Change-Id: I99bf367025ba4830fb683add93087d42dce4566d
2021-09-28 09:55:47 +02:00
Thiemo Kreuz 61df64d7ae Better method name for the parameter name validation update
It's not only used as an event handler, but called as an ordinary
method as well. Let the name reflect this better.

Change-Id: Ie5a0d9c4cd072063a164886f18d0859327b3f267
2021-09-27 18:24:20 +02:00
jenkins-bot 33e4f6da0b Merge "Add @private tags to template dialog related methods" 2021-09-27 11:10:37 +00:00
jenkins-bot 149cdc935a Merge "Move .containsValuableData() method from dialog to model" 2021-09-27 09:46:08 +00:00
jenkins-bot c5ee1889b1 Merge "Rename misleading updateOutlineControlButtons event and handler" 2021-09-27 09:19:09 +00:00
Thiemo Kreuz ffb7d76263 Move .containsValuableData() method from dialog to model
… where it belongs.

Change-Id: I522b888e366f066b28983a18041a8728d11623df
2021-09-27 11:16:54 +02:00
jenkins-bot bb31dd62e5 Merge "Implement basic Ctrl+Shift+Up/Down/Del support in new sidebar" 2021-09-27 09:08:44 +00:00
Thiemo Kreuz 58f5882957 Implement basic Ctrl+Shift+Up/Down/Del support in new sidebar
Note this patch is somewhat incomplete. The feature fully works and
I would like to see this patch merged as it is. But whenever you
press one of the keys the focus is stolen by some element on the
right side of the dialog. This makes it impossible to e.g. press
Ctrl+Shift+Down multiple times. The idea is to work on this in the
next patch.

Bug: T290262
Change-Id: Ic67f2a696c94f1e5c71134d681161221aecbfdf6
2021-09-27 08:29:12 +00:00
Adam Wight 02c637ad16 Sync panels in narrow-view mode
Reasserts scroll and highlighting when toggling the sidebar, in the
case that the other panel is hidden (narrow-view mode).

FIXME: Doesn't reassert focus because the page.focus() and
bookletLayout.focus() methods don't seem to work, maybe the bug is
especially prominent when the item to focus was already marked
active.

FIXME: Stopped working for right-to-left sync on wikitext elements.
This is a less common use case and can be addressed in follow-up.

Bug: T290975
Change-Id: I94f5709e810c63ee5fd7729a192ac7b92686b88f
2021-09-27 10:12:36 +02:00
Thiemo Kreuz f68c1e3794 Add @private tags to template dialog related methods
… obviously only to methods that are meant to be private, i.e.
only called from within the class (and possibly tests).

Change-Id: I581558078dc7210abac5f5724f71316ac45745e6
2021-09-26 11:51:36 +02:00
Thiemo Kreuz 19bb1810c4 Rename misleading updateOutlineControlButtons event and handler
The .onUpdateOutlineControlButtons() method doesn't describe what it
actually does. This issue was introduced in I9c5478a. (Intentionally,
to not make the patch to complicated.) Let's continue to rename
things to be a) unique and b) honest about what they do.

This is an alternative to I8d98e61.

Bug: T289043
Change-Id: I4d52ffa6e9e5df2025a0c33031c1517bcb421279
2021-09-26 11:50:38 +02:00
jenkins-bot 72681d45d2 Merge "Rename outline "container" widget" 2021-09-24 11:14:30 +00:00
jenkins-bot 12e6d4dd2d Merge "Unhighlight all items when highlighting" 2021-09-24 10:47:13 +00:00
Thiemo Kreuz 63d9969861 Rename outline "container" widget
I can't really tell what insight we get from the word "container".
Every widget is a "container" in some sense, isn't it?

This widget is just _the_ outline, I would argue.

Other suggestions?

Change-Id: I1fb27ee58c1a3dd790022504e978198dadf7ea02
2021-09-24 12:32:29 +02:00
jenkins-bot 654cf8c3a8 Merge "Document the 3 ways the template dialog can be opened" 2021-09-24 09:45:56 +00:00
Adam Wight bd7a1b0997 Unhighlight all items when highlighting
This prevents multiple highlighting, which was possible to achieve by clicking
sequentially in the input fields of two parameters from different templates.

Change-Id: I404936f1569ab544b693a9bc6921381636ea8f40
2021-09-24 09:26:56 +00:00