Commit graph

119 commits

Author SHA1 Message Date
addshore
63dd31cd31 Add access modifiers to htmlform classes
Change-Id: Id8c0f0676b3200993af3cec493efc99839211bcc
2016-11-04 11:40:42 +01:00
This, that and the other
07782d176b New HTMLForm size filter field; add size filter to Special:Newpages
The conversion of SpecialNewpages to HTMLForm seems to be half-finished.
It's not using HTMLForm to read in the request query, which means we have
to roll our own logic. Kind of defeats the purpose of using HTMLForm in
the first place.

When ProtectedPages is converted to HTMLForm (T117722), it can use this new
field type.

Bug: T12817
Change-Id: I069609fbb37b18c3df25156779ad7ac7cd5d6813
2016-10-27 12:23:18 +11:00
jenkins-bot
4465a9fb5a Merge "HTMLForm: Add OOUI support for 'multiselect' with 'dropdown' => true" 2016-10-18 20:39:12 +00:00
Brad Jorsch
627148d2bb HTMLDateTimeField: Properly handle empty input
i.e. don't parse it as "now" in date or datetime mode.

Bug: T148200
Change-Id: I5a3839540222160e8d7376b5b961147c41d48885
2016-10-14 12:39:31 -04:00
Bartosz Dziewoński
96ef35a58a HTMLForm: Add OOUI support for 'multiselect' with 'dropdown' => true
Using CapsuleMultiselectWidget.

Change-Id: I816739bc3acd40ee9d8b67e19ff3e4296fce66d3
2016-10-04 19:50:44 +02:00
Volker E
7e8539d10e Replace deprecated constructive with progressive
Replacing deprecated `constructive` mediawiki.UI CSS class and OOjs UI
flag  with `progressive`.

Bug: T146923
Change-Id: I524b9722ee49692c55bb1f97d34d8a28068716ee
2016-09-30 13:18:52 -07:00
jenkins-bot
793069b261 Merge "HTMLForm: Add HTMLDateTimeField" 2016-09-26 17:14:52 +00:00
Brad Jorsch
12bdc84219 HTMLForm: Add HTMLDateTimeField
And to do that, an OOUI PHP widget for
mw.widgets.datetime.DateTimeInputWidget too.

Bug: T146340
Change-Id: Iaa8b5892b6c3a1f3698cef59684cc3cdc9d483ea
2016-09-26 12:08:56 -04:00
Gergő Tisza
3090a1d1f8 Add HTMLFormField class for MWRestrictions and use it for bot passwords
Change-Id: Ib50238e3be5eec63eb5df97154b60dc4ca33d581
2016-09-22 20:50:36 +00:00
jenkins-bot
196db34293 Merge "Display an error message when the validataion of a radio input fails because user did not provide any input." 2016-09-11 23:56:41 +00:00
Huji Lee
1e7b73bb06 Display an error message when the validataion of a radio input fails because user did not provide any input.
Bug: T107486
Change-Id: Ie3a9cc11f285cadec1dde32f820643d1aabd0d1b
2016-09-11 19:47:55 -04:00
Bartosz Dziewoński
d23ebca2b9 HTMLFormField: Move 'flatlist' handling to fields that use it and document
Change-Id: I5dc6ad71880a741c41757bc64d236971edfbabfa
2016-08-24 15:22:32 +00:00
Bartosz Dziewoński
7191028ade HTMLMultiSelectField: Add 'dropdown' option for 'mw-chosen' behavior and document
Previously, you could pass 'cssclass' => 'mw-chosen' in the form
descriptor for a 'multiselect' field, and it'd be automatically
converted to a text field with a dropdown allowing values to be
selected. This is not very intuitive (unless you know what the Chosen
library is) and was not documented anywhere except for release notes.

The new recommended and documented way to achieve this is by passing
'dropdown' => true. Old way is supported for backwards compatibility.

Also, add the 'jquery.chosen' module to the page server-side.

Change-Id: I3a025e1c3c7571e930a35e020d73d558fdc433d0
2016-08-22 17:58:53 +00:00
Bartosz Dziewoński
6a366c3300 HTMLForm: Refactor loading of modules required to infuse fields
Rather than have a master list in autoinfuse.js (duplicated in
hide-if.js), we put this information in each field class and put it
in the generated HTML as a separate 'data-' attribute. This also
allows new fields defined by extensions to be correctly autoinfused.

Change-Id: I3da75706209cbc16b19cc3f02b355e58ca75fec9
2016-08-22 17:35:35 +00:00
Bartosz Dziewoński
f50cee1375 Do not automatically infuse any OOjs UI widgets
This is not really what we had in mind when developing the infusion
feature and I think it's not helpful. Most of the time there is just
no benefit; a ButtonWidget generated in PHP and in JS behaves and
looks pretty much the same, and rebuilding it through infusion is a
small performance hit. If you're not adding any event handlers, it only
makes sense for various dropdowns, which have themed styling.

For the primary use case of adding JS behaviors to PHP widgets you
need to call OO.ui.infuse() anyway to get a reference to the JS
widget, and not infusing automatically should make it easier to reason
about your code. Infusion tries to be very transparent, but it can't
hide the fact that the DOM is re-built, making your references to DOM
nodes from before infusion useless and losing anything from PHP that
wasn't included in the config (e.g. custom attributes).

This commit removes automated infusion from mediawiki.page.ready
and adds some custom code in mediawiki.special.movePage and
mediawiki.htmlform. I see only two extensions using infusable OOjs UI
widgets in Gerrit (ArticlePlaceholder and ExtensionDistributor) and
neither should be affected by this change.

Change-Id: I56608c537fc57c5c54960b0603694f2612f45618
2016-08-19 03:29:31 +02:00
Florian Schmidt
ac4f758dee Type hint array for HTMLFormFieldCloner::getInputHTMLForKey()
I was a bit fast with merging I18edfcb62f7b21f2c1990c73944ee6a956fd4901,
because I think, type hinting the type of the parameter would make sense,
too.

Bug: T142912
Change-Id: Id397847c6c078047f3daa84db68ccf3e629ca531
2016-08-15 16:41:20 +02:00
Brad Jorsch
a979689003 HTMLFormFieldCloner: Pass enpty array, not null, to avoid warning
Bug: T142912
Change-Id: I18edfcb62f7b21f2c1990c73944ee6a956fd4901
2016-08-15 10:13:54 -04:00
Gergő Tisza
3cc87a8b12 Allow closures as HTMLInfoField values
This makes it possible to parametrize info fields so they can be
easily altered.

Change-Id: I17328cf3f1a710096c64b17dde0864cb9be3892d
2016-08-02 21:22:31 +00:00
Bartosz Dziewoński
15692fa6d4 Move HTMLFormField subclasses to a separate directory
It's getting more difficult to navigate the files in includes/htmlform/
with every new field and every new helper class that is being added.

Change-Id: I92ce2356baf6151f17b2440970d5abdf86503820
2016-08-01 07:58:56 +00:00