TitlesMultiselectWidget: Add a widget that allows selection of multiple titles
authorMoriel Schottlender <moriel@gmail.com>
Thu, 30 Aug 2018 00:33:32 +0000 (17:33 -0700)
committerJforrester <jforrester@wikimedia.org>
Wed, 24 Oct 2018 00:46:48 +0000 (00:46 +0000)
commit07a5c71646a120a41a51b254499c3364b11a68d3
tree3e912c7e1d1bba74ed334a9058824bdd04d94381
parenta562611e5b1a998c09dee0cf3022a1ba3935397a
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
autoload.php
includes/htmlform/HTMLForm.php
includes/htmlform/fields/HTMLTitlesMultiselectField.php [new file with mode: 0644]
includes/widget/TitlesMultiselectWidget.php [new file with mode: 0644]
languages/i18n/en.json
languages/i18n/qqq.json
resources/Resources.php
resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
resources/src/mediawiki.widgets/mw.widgets.TitlesMultiselectWidget.js [new file with mode: 0644]