Commit graph

17663 commits

Author SHA1 Message Date
Adam Wight a2daf5f6c6 Method for getting the currently selected element
Continue refactoring booklet pane access.

Bug: T284632
Change-Id: I866f8550d269d05b40eaddf8abb4ed5be03f902d
2021-06-10 15:32:07 +02:00
Adam Wight 44035a2384 Introduce a new class to encapsulate booklet inter-pane wiring
Begin to extract the wiring between a sidebar and the content pane of
the template dialog booklet layout.  Eventually, this helper class
will present a high-level interface like "addPart(id)" and will take
care of creating the outline item, content page, and connecting
events.

Start very simple, take over the "focus" method.

Bug: T284632
Change-Id: I7bc73cc4386b99d95941fc6ed88ab5bd998de014
2021-06-10 15:30:51 +02:00
Thiemo Kreuz df419335bb Rename MWTransclusionDialog.setMode() to toggleSidebar()
This reflects better what the method actually does. This patch
is a direct follow-up for the renames started in Ib029fd4.

Change-Id: Ie3e87139a5c2f5ac196e0fcc02fb897fadc99177
2021-06-10 14:05:40 +02:00
Andrew Kostka 0c310d03d3 Use a new tab when linking to the project page for feedback
Bug: T284560
Change-Id: I13e7461299ccd1a584e0f661a5506e7b52b8fe4b
2021-06-10 13:06:35 +02:00
WMDE-Fisch ecf317e0bd Fix message keys to show options in template dialog
The names of the messages keys are very confusing. The order was set
wrong during refactoring in Ib029fd48b393d2ab7d7cff6c842789e22989e944.

We should rename the keys in a follow up in sync with translatewiki.

Bug: T284649
Change-Id: I43794d80b7df7d00441cb583ca53bcab03999e65
2021-06-10 10:50:40 +00:00
Svantje Lilienthal 1a707e2aad Add message linking to project page for feedback
Bug: T284560
Change-Id: I8ac45db4844c8ccb65595e8bfe3fb68be9bb02ee
2021-06-10 11:28:42 +02:00
Translation updater bot e62fe58edc Localisation updates from https://translatewiki.net.
Change-Id: Ic267006bab8209d6a3d823dd424f507edbfca665
2021-06-10 08:35:07 +02:00
Thiemo Kreuz 0ad9e90c37 Use term "wikitext" when working with TempWikitextEditorWidget
This reflects better what the widget actually does.

However, the config option `value` as well as the method
`getValue` are not renamed. These intentionally mirror a OOUI
convention.

Change-Id: I26e733b760501e57b3314d5da2d65bfdd4b38346
2021-06-09 10:23:36 +02:00
Thiemo Kreuz 190237ee28 Rename sidebar state to distinguish from multiple transclusion
This dramatically simplifies the "mode" flag in
MWTransclusionDialog. The main reason to touch this code is:
The flag appears like it will be "single" when the dialog
contains a single template, and "multiple" when there are
multiple templates. But this is not true.

What the flag really does is show/hide the sidebar. The sidebar
is needed to be able to create multi-part templates. But a
dialog that already contains multiple templates can be set to
"single" mode (i.e. the user can collapse the sidebar), and
vice versa.

This patch focuses on private details inside of this class, but
keeps the terminology of a "mode" in some places. E.g. the
messages are not renamed to not cause unnecessary trouble for
translators.

Change-Id: Ib029fd48b393d2ab7d7cff6c842789e22989e944
2021-06-09 09:44:08 +02:00
Thiemo Kreuz 858f0d51c0 Make use of Array.some() in a few places
some() is IE9+, so fine to use with our current compatibily
matrix.

Change-Id: I8d4a1b5326417bb4d23b47d72e5548f5def5784e
2021-06-09 07:34:50 +00:00
Translation updater bot 23a3f1f6d2 Localisation updates from https://translatewiki.net.
Change-Id: Ib01be2b16643e1c729a1d526802a79a5956d10f4
2021-06-09 08:29:11 +02:00
jenkins-bot 28256b3ca4 Merge "Support watchlist expiry" 2021-06-08 20:31:30 +00:00
Bartosz Dziewoński 53c59f35f6 ve.ui.MWSaveDialog: Tweak margins of checkboxes
Previously, if the checkboxes were shown on multiple lines (e.g. due
to a FlaggedRevs checkbox), there would be uneven margin at the
bottom. There was a special case to fix this only for the watchlist
expiry not-checkbox.

Change-Id: I006049cf23e6d42519bfa15b7ec30ea1bc5d08ac
2021-06-08 20:16:44 +00:00
Ed Sanders 857014fae9 Support watchlist expiry
Bug: T251348
Change-Id: I017a54784c758c5e97fb640721bd456adc0fbab5
2021-06-08 20:14:45 +00:00
jenkins-bot eca1ef82f2 Merge "Rewrite MWParameterPlaceholderPage.onParameterChoose() for readability" 2021-06-08 19:35:17 +00:00
jenkins-bot 2b0da3e338 Merge "Update template dialog title when multiple transclusions present" 2021-06-08 08:14:11 +00:00
Thiemo Kreuz 8d7c55aa71 Rename "value" to "wikitext" in TransclusionContent… classes
This class represents a raw wikitext snippet. There is also no
base class that would require us to follow a generic
getValue/setValue naming scheme.

Change-Id: I0891a2f6c0ae0121429a47c39221e99b9653e8e3
2021-06-08 09:27:47 +02:00
jenkins-bot 69e17ef432 Merge "ve.dm.MWLanguageVariantNode: Fix "undefined" appearing for some nodes" 2021-06-08 07:15:48 +00:00
Translation updater bot 14acac5558 Localisation updates from https://translatewiki.net.
Change-Id: Ifc3c8b2005958f5283db864560c0070216b53d1b
2021-06-08 08:36:43 +02:00
Thiemo Kreuz b81c18a017 Fix and update documentation in template dialog related code
Some of this was copy-pasted but forgotten.

Change-Id: I08c48e8e0a4cf17ec0888e4ce85427f4da825776
2021-06-07 23:47:23 +00:00
Thiemo Kreuz 7fdc560fb8 Rename "sequence" to "ordered parameter names"
There are 2 methods with the same name, but they are very
different. This makes it much easier to understand the
difference, I hope.

Change-Id: Ie1f049b2b14e1fe23f078e281ee797da29dfe3db
2021-06-07 23:24:17 +00:00
Thiemo Kreuz 6f72b7a391 Move initialization of optional elements into if block
This does have a few advantages:
* Less code is executed and less memory consumed when these
  elements are not needed.
* Code that belongs together is together.
* No local class properties are created when they are not
  needed in the code below.

This patch is kind of a proof of concept. It touches only a few
classes we currently actively work with. If this change is fine
we can change some of the other classes the same way.

Change-Id: I9f548765034f1f69799fff41aeb6c147ff28b82d
2021-06-07 20:53:34 +00:00
James D. Forrester 8fa0781a48 Update VE core submodule to master (3891890c2)
New changes:
a95611236 Set aria-hidden on pasteTarget
3891890c2 Localisation updates from https://translatewiki.net.

Bug: T283853
Change-Id: I9e2f657b8bba82fea0a9b0d97f94aec1849d44a5
2021-06-07 13:13:32 -07:00
Bartosz Dziewoński 90e76e7c52 ve.dm.MWLanguageVariantNode: Fix "undefined" appearing for some nodes
The variable `html` had the value of undefined and was treated as a string.
This would then be displayed on the editing surface.

Change-Id: I4682ea121aa37f06cac41dde618af847586ae01e
2021-06-07 21:34:55 +02:00
Translation updater bot 9a0534894d Localisation updates from https://translatewiki.net.
Change-Id: I992d929b4b31f55fdba4113a7104853b960560a1
2021-06-07 08:43:33 +02:00
jenkins-bot d268ae4e55 Merge "Make .ve-init-mw-target-surface styles not apply to nested non-target surfaces" 2021-06-05 03:31:24 +00:00
jenkins-bot f98d8da688 Merge "Fix adding 've-init-mw-target-surface' class only to main surface" 2021-06-05 03:31:21 +00:00
Bartosz Dziewoński a4cafb1691 Update VE core submodule to master (1f76dea7e)
New changes:
6cde8742e i18n: Rename keys for error messages in rebaser

Local changes:
* Rebaser i18n message renames

Change-Id: I0c2e3a956c81f625822bacd40835dc4fadb57211
2021-06-04 23:53:02 +02:00
Bartosz Dziewoński 9c2c4b82c7 Make .ve-init-mw-target-surface styles not apply to nested non-target surfaces
The class .ve-init-mw-target-surface is used on the same element
as .ve-ui-surface. This element contains surface overlays
.ve-ui-overlay, which can contain other .ve-ui-surface elements
(inside inspectors), which would then erroneously have the target
surface styles applied.

Bug: T284312
Change-Id: I8d20a830dc48f6a098b0f9e9a7c7c1656de0fe56
2021-06-04 20:48:18 +00:00
Bartosz Dziewoński 32ecfe4caf Fix adding 've-init-mw-target-surface' class only to main surface
Bug: T284312
Change-Id: Ic5320f6747907542285674d386c7a59c9e857f0a
2021-06-04 20:48:08 +00:00
Bartosz Dziewoński 6bcf1b9ca5 Update VE core submodule to master (7ab2ebb0f)
New changes:
4a5ebddd8 Localisation updates from https://translatewiki.net.
564cfaa37 Localisation updates from https://translatewiki.net.
1a670fa34 Fix lang list
22d56eb7a Localisation updates from https://translatewiki.net.
73182560c Remove dependency of the model registry from ve.dm.Transaction
058ea2c2c Fix toolbar dialog header collapse when in another dialog
3e88dfab3 i18n: Sort keys

Bug: T283458
Bug: T283598
Change-Id: I6b209d4063db37925dec64415f955a1c9709dfa9
2021-06-04 22:23:05 +02:00
Andrew Kostka 67e48a26ef Update template dialog title when multiple transclusions present
Bug: T276568
Change-Id: I530a6cd8aea4f9fcafe7a03fc5050883f1f4b37c
2021-06-04 16:48:05 +02:00
WMDE-Fisch 9ab43ee145 Fix typos
Missed these and found another one.

Change-Id: Ibc5ad8998e84d2bdffb0b89f8664271665b3b79c
2021-06-04 14:43:23 +02:00
jenkins-bot 69676950b3 Merge "Much longer descriptions of template dialog related classes" 2021-06-04 12:00:46 +00:00
Thiemo Kreuz 35de3aa143 Remove docs that repeat what the code already says
Just reading the method signature gives the exact same
information in these cases. In other words, this code is
able to explain itself.

Change-Id: I04d031f2b24c3b0d21fede2c19c64b54d30b5b0c
2021-06-04 14:00:21 +02:00
Thiemo Kreuz e13b0dae48 Much longer descriptions of template dialog related classes
The idea is to possibly rename some of these classes, based on
these descriptions. But this should be done in later, separate
patches.

Change-Id: I7f9e5b2382711b434d6dd618489fa3ed8b7a46b4
2021-06-04 13:17:59 +02:00
jenkins-bot df5238cd11 Merge "Fix duplication bug in MWTemplateTitleInputWidget" 2021-06-04 10:50:39 +00:00
Thiemo Kreuz cdafea5663 Rewrite MWParameterPlaceholderPage.onParameterChoose() for readability
The main motivation for this patch is actually the comment. The
so called "spec" contains all parameters that are present in a
template, no matter if they are present in the TemplateData
documentation or not. This is critical here.

Change-Id: I5e1c79e3859a27562a9dea1d450cec196aa572ed
2021-06-04 12:49:53 +02:00
Translation updater bot b1d1f6c2fd Localisation updates from https://translatewiki.net.
Change-Id: If0e649e01dd472f9529043363a44fe5be3ed699c
2021-06-04 08:37:42 +02:00
jenkins-bot bc0f405317 Merge "NWE: Always paste rich text as plain, and show context item to convert" 2021-06-03 18:15:59 +00:00
jenkins-bot 353373cc1b Merge "Fix a series of minor style issues in PHP code" 2021-06-03 16:22:49 +00:00
Thiemo Kreuz ad014c834d Fix a series of minor style issues in PHP code
* Mismatching capitalization.
* Unused pieces of code.
* Properties that can be constants.
* Use $this->getConfig() in special pages.

Change-Id: Ia7e2c438c5ddd3c770070701e4cbdfc79fccf009
2021-06-03 15:55:38 +02:00
Translation updater bot 10c84cbf34 Localisation updates from https://translatewiki.net.
Change-Id: I969f946dcaa771f76cdd829618797c8b329e1772
2021-06-02 14:36:10 +02:00
Adam Wight d4eee82701 Update template dialog titles: Insert/Edit
Toggle depending on whether the transclusion existed or is new.

Bug: T276568
Change-Id: Ib9b76cac7cd57245e8db2ef10879069a86a6269e
2021-06-02 12:36:38 +02:00
jenkins-bot 7fe5b6a433 Merge "Template dialog button title toggles between Insert/Edit" 2021-06-02 10:34:53 +00:00
Adam Wight c49478de60 Template dialog button title toggles between Insert/Edit
Depends on whether this is a new or existing template transclusion.

Split from Ib9b76cac7cd57245e8db2ef10879069a86a6269e

Bug: T276568
Change-Id: I4d22e32fef067b640e9a9389deffaace736c3405
2021-06-02 12:00:15 +02:00
jenkins-bot fa94c27a8d Merge "Change header titles in the template dialog" 2021-06-02 09:05:04 +00:00
WMDE-Fisch 58cf1b0344 Change header titles in the template dialog
Bug: T276568
Change-Id: I5da40032c5b83d04ae92e86372c445d7a28d0444
2021-06-02 08:48:07 +00:00
Translation updater bot 42b9c3b21d Localisation updates from https://translatewiki.net.
Change-Id: I85ea58c251fb06e30033d44dd5a68b1e9c3dcce4
2021-06-01 08:36:49 +02:00
Thiemo Kreuz e97e325ac6 Guarantee exact match when searching for a template
When the existing search results don't contain an exact match
(see previous patch), perform an additional search for the
title. This uses OpenSearch. This is recommended in multiple
places and also used in the quick search field at the top of
MediaWiki.

Again, I came to the conclusion that an isolated unit test
would be complicated and not test much anyway. Better test
on-wiki.

Bug: T274903
Change-Id: Ib575248e089ff66814400202d224deff6369c772
2021-05-31 08:31:49 +00:00