Commit graph

18242 commits

Author SHA1 Message Date
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
Thiemo Kreuz a3a738b4f9 Rewrite ApiVisualEditor::getAvailableNamespaceIds()
For readability. The current implementation is a sequence of
7 (!) array_…() function calls. It is also not free from bugs.
If one of the two inputs (ExtensionRegistry and Config) specifies
namespaces by e.g. canonical name, but the other by number,
the two are not properly merged. It should be possible to use
configuration to disable a namespace that would otherwise be
enabled. This currently works only if both use the same array
keys.

Bug: T291727
Change-Id: I2671f391cdc510da21eda8a1dc5ed4d2513a378a
2021-10-01 14:10:08 +02:00
jenkins-bot 50faec38c3 Merge "Don't get stuck on a narrow mode sidebar" 2021-10-01 11:07:31 +00:00
jenkins-bot 6856208c90 Merge "Better name for .selectPartByPageName() method" 2021-10-01 08:44:20 +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
Translation updater bot 6c63ce59b0 Localisation updates from https://translatewiki.net.
Change-Id: I7a88a498cb4cdda97af276dd67d4128da556b9b6
2021-10-01 09:30:29 +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 caab2a191c Pages outside of Template: namespace can have TemplateData
The TemplateData extension is not limited to the Template: namespace.
And even if pages outside of the Template: namespace typically don't
have TemplateData information, the API is still able to automatically
extract parameter information from every page.

Or:

It's rare that a page outside of the Template: namespace is used as
a template. But if it is, this is not a mistake. The code here in
VisualEditor should not try to be "more clever" than the user is. If
this is what the user want's to do, let's not block them.

Bug: T291883
Change-Id: Iaf3fd5530b74fab7cedfc85ce04c8c40632df11f
2021-09-30 18:06:32 +02: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
jenkins-bot ac0ff80b23 Merge "Hack out forced scroll to first BookletLayout element" 2021-09-30 14:55:59 +00:00
jenkins-bot 6839f8ed58 Merge "Update VE core submodule to master (14151330e)" 2021-09-30 13:38:23 +00:00
jenkins-bot dbe0af3dd4 Merge "Filter JavaScript namespacesWithSubpages to only existing namespaces" 2021-09-30 13:34:58 +00:00
Bartosz Dziewoński dab942e2d8 Update VE core submodule to master (14151330e)
New changes:
8ce707887 Localisation updates from https://translatewiki.net.
81a5c12ae Localisation updates from https://translatewiki.net.
25abe0e0b Localisation updates from https://translatewiki.net.
14151330e Localisation updates from https://translatewiki.net.

Change-Id: I535afcc7a8371e9d67063e50443c378416c2ab3c
2021-09-30 15:18:27 +02:00
Translation updater bot df70f0d06d Localisation updates from https://translatewiki.net.
Change-Id: I50e0d79e8dca3c584fc9af62ea38d5d319c8fdaa
2021-09-30 08:58:05 +02:00
DannyS712 267daeb6c6 Filter JavaScript namespacesWithSubpages to only existing namespaces
$wgNamespacesWithSubpages can include namespaces that
don't exist, no need to add them to the JavaScript configuration.

Bug: T291727
Change-Id: I1f4f3d2c2accb3d84f83262480616d05115f406c
2021-09-29 20:39:30 +00:00
DannyS712 492fcfbd9f Don't include null in the namespaces where VE can be enabled
Bug: T291728
Change-Id: I2cb168a21c559e61bf2c9e881d46f7f23110e826
2021-09-29 16:23:48 +00:00
jenkins-bot abd115c054 Merge "First QUnit test for dialog classes" 2021-09-29 11:57:30 +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
Adam Wight d70941593d First QUnit test for dialog classes
Wrote a first test, that checks the parameter checkboxes showing up.

Bug: T291155
Change-Id: Ie79272442a0d0532607fe93e9ea538635812e671
2021-09-29 10:00:34 +02:00
Translation updater bot 6c34da2922 Localisation updates from https://translatewiki.net.
Change-Id: Ie02fa2bcaade00ac363b22c7a98ae10f02d24dff
2021-09-29 09:02:25 +02:00
jenkins-bot 8b539794a7 Merge "Cover suggestedvalues feature in MWParameterPage class" 2021-09-28 16:29:08 +00:00
jenkins-bot 7f5eb2952f Merge "Remove obsolete …OutlineWikitextWidget test" 2021-09-28 16:01:45 +00: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
jenkins-bot 934ccfa305 Merge "Add unit tests for static ApiVisualEditor methods" 2021-09-28 12:14:35 +00:00
Thiemo Kreuz 3484f1927d Add unit tests for static ApiVisualEditor methods
Done for I2cb168a.

Change-Id: I29f8c127ea19abd3449ee0e2742c3ddcc4db23ba
2021-09-28 10:49:47 +02:00
Thiemo Kreuz 66d5f13dfb Remove obsolete …OutlineWikitextWidget test
The feature set is (almost) fully covered by other tests, notably
the tests for the …OutlinePartWidget base class and the other two
subclasses.

The only bit that's not covered any more is the
"visualeditor-dialog-transclusion-wikitext" message. But that's
super minor and not worth a separate QUnit test.

Bug: T291157
Change-Id: I574f9cff0baf3dff885094769c124a9e05a1d1c8
2021-09-28 08:37:47 +00:00
Thiemo Kreuz bebecdc812 Refine wording of "template name with subst/syntax" message
As discussed in T290140. This should be the final bit to close
T290140.

Bug: T290140
Change-Id: I337e4a8806e05db534874f1514e6429b93588133
2021-09-28 10:33:18 +02:00
Thiemo Kreuz 152f5edae2 Add/remove some TODO comments
Change-Id: I99bf367025ba4830fb683add93087d42dce4566d
2021-09-28 09:55:47 +02:00
Translation updater bot f8c0e5944d Localisation updates from https://translatewiki.net.
Change-Id: I08ae057b0b659cfad45e62b20b37dcda770e3a7e
2021-09-28 08:19:23 +02:00
DannyS712 e6a39d70ac Stop adding $wgSVGMaxSize to JavaScript config variables
The code that uses it is commented out

Bug: T291729
Follow-up: I7af2bc91524e832555b66f090a671672cd14f294
Change-Id: I4cceb9ca83a2274fa93783af3608b9486b773522
2021-09-27 18:45:08 +00: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
Thiemo Kreuz 33b4d0dfc6 Cover suggestedvalues feature in MWParameterPage class
… as well as improve the coverage of MWAddParameterPage a bit.

Bug: T291156
Change-Id: Ibacb602298e5200b00a23092e5b9b211c43d6719
2021-09-27 18:22:10 +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
Translation updater bot 99835a98bc Localisation updates from https://translatewiki.net.
Change-Id: I30d9b9e53f81b63e091a99b7dc6c36e03c962371
2021-09-27 08:35:55 +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 37c5e5978e Merge "Move data model tests to correct directory" 2021-09-24 11:52:36 +00:00