Commit graph

10 commits

Author SHA1 Message Date
Thalia
cd3c40095c Pass allowEditTags config through to multiselect widgets
TitlesMultiselectWidget and NamespacesMultiselectWidget both default
to false, meaning click-to-edit on the tags is disabled. Allow this
to be overridden from the corresponding PHP form fields.

This helps to provide a workaround for the related bug: T334711

Change-Id: I4014c5ba7fea0647da6ec6c420342a41ac90518b
2023-04-18 18:49:43 +01:00
Gergő Tisza
bf08948bbe
Clarify documentation of TitlesMultiselectWidget::$showMissing
Bug: T254357
Change-Id: Iea2dd47f95bc3b84e8f29dff97d38fb1d989b9c7
2020-06-03 16:24:36 +02:00
Moriel Schottlender
a7fd92a95e mw.widgets.TitleWidget: Add 'excludeDynamicNamespaces' config
Allow excluding all pages that are in dynamic (negative) namespaces.

Bug: T208355
Change-Id: I9b39f66ac828bc0c100a2fc347b365f75672efb1
2019-02-14 17:26:03 -08:00
Thalia
2d2bb3720a Introduce TagMultiselectWidget.php
TitlesMultiselectWidget and UsersMultiselectWidget share
a lot of functionality, so implement a common base class.

This also adds some things to UsersMultiselectWidget:
* shows a pending element to users with JavaScript
* makes the input configurable

Change-Id: Ie6649b476c64e795254f457e3863fa7f14aa05ac
2018-12-14 15:18:11 +00:00
Thalia
1d442c19cf Fix TitlesMultiselectWidget documentation
Change-Id: I4b6bad233b4a4dfd840385f26a10bd190f6cb6b9
2018-12-10 18:28:14 +00:00
Thalia
62b4cee23f TitlesMultiselectWidget: display pending element
Create a PendingTextInputWidget and use it in
TitlesMultiSelectWidget instead of the multiline
text area for users who have JavaScript.

Bug: T210080
Change-Id: I824fea6a3df580d342e6087ab901fec025f0e70b
2018-12-05 21:08:38 +00:00
Thalia
a61d51af9e TitlesMultiSelectWidget: pass through 'input' config
Also set 'autocomplete' to false in the 'input' config
in Special:Block.

Bug: T208551
Change-Id: I0376e4ce809aeb48496530cdd5d39ac9142c28bd
2018-11-13 19:29:04 +00:00
Thalia
8fec7ed09a TitlesMultiselectWidget: rename 'limit' config to 'tagLimit'
To avoid conflicting with TitleWidget config.

Bug: T209057
Change-Id: Ia0dbc49f38a116202eb2658b7556fb7f0627f1bb
2018-11-13 19:29:04 +00:00
Thalia
61a6a0445b TitlesMultiselectWidget: pass through additional configs
Pass through 'limit' and 'showMissing' configs.

Also set 'showMissing' to false for partial blocks.

Bug: T208626
Bug: T208627
Change-Id: Ifa75e2d390bf349226ad69d68adcdcaf742ab560
2018-11-13 19:28:54 +00:00
Moriel Schottlender
07a5c71646 TitlesMultiselectWidget: Add a widget that allows selection of multiple titles
Add the widget in both PHP and JS for OOUI, and into HTMLForm
definitions.

In JS, the widget uses the engine from mw.widgets.TitleWidget
with the async support from OO.ui.mixin.RequestManager.

The PHP version provides a textarea, like UsersMultiselectWidget.php
which is then infused if JS is available.

Also, add highlightSearchQuery option for TitleWidget to allow for
not highlighting the partial search query the user typed in, if the
UI requires it. This option (highlighting partial result) is already
optional in the TitleOptionWidget, so this config exposes that
optionality in the TitleWidget widget for its menu children.

Notes:

HTMLTitlesMultiselectField is a duplication of HTMLUsersMultiselectField
except for:
- The configuration variable changed to 'titles' (from 'users')
- OOUI modules were adjusted for the TitlesMultiselectWidget
- The PHP version instantiates a MediaWiki\Widget\TitlesMultiselectWidget

TitlesMultiselectWidget is a duplication of UsersMultiselectWidget
except for:
- $usersArray was renamed to $titlesArray
- getJavascriptClassName returns the correct js class for
  mw.widgets.TitlesMultiselectWidget for infusion.

Bug: T197109
Depends-On: I675316dddf272fd0d6172ecad3882160752bf780
Change-Id: Ie96947a35f70b76731e16ae5b85de815dfa4a8ce
2018-10-24 00:46:48 +00:00