Ensure that a form field which sets 'csshelpclass' and is rendered as
a vform receives expected styling.
Change-Id: Ibe082e07fe846334bd4dc257c9c0df8db23a1957
Hidden fields are supposed to be ignored during validation; more
completely ensure this by checking in HTMLForm::trySubmit before calling
validate.
Also, more properly handle HTMLCheckFields in the isHidden check by
casting their booleans to strings.
Bug: 68132
Change-Id: I84f8239c299727b773015643048eed4684417733
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling
Change-Id: I41a84e8e1dec39170aa655250325ffc485eaeaef
There is now a new option named csshelpclass that can be passed in form
descriptors for HTMLForm objects. This option accepts a css class and
applies it to the help text that is provided with the help option in the
form descriptor.
Bug: 65087
Change-Id: If1bd1d12a9159895f45c9cf0fbb7992e4c7e3526
Require use of class instead of applying styling to all <div>s
This resolves a few FIXMEs and dramatically lowers the awkwardness
level of using mediawiki.ui.
'.mw-ui-vform-field' is a more descriptive name than '.mw-ui-vform-div'
and corresponds to the HTMLFormField PHP class in core which generates
<div>s with this CSS class.
We previously styled '.mw-ui-vform > div' the same way we styled
'.mw-ui-vform .mw-ui-vform-div', which was an annoying piece of magic
causing difficult to debug problems when one needed a different HTML
structure (like bug 63233). Explicitly using '.mw-ui-vform-field'
where applicable is a lot saner.
Change-Id: I6f0b8842f5fdf70b97decb165086d1a83428b259
SecurePoll is going to need the ability to have a form for stuff like
"one or more admin usernames" and "one or more poll questions, each with
one or more options".
This change implements a generic field container that simply displays as
a <ul> followed by an "add more" button, with each <li> containing
various fields including a "remove" button.
Since this is only going to show up in SecurePoll to people creating a
poll (not to general users), the current design is functional but not
necessarily beautiful. Those interested in beauty are welcome to do so
in a followup change.
Change-Id: I46fad3971739ddc961259fe32eb6e1cd265a1c06
SecurePoll will need a way to display a field only if another field has
a particular value.
We already have this for a limited case in HTMLSelectOrOtherField; this
makes it possible to specify that any particular field should be hidden
based on any other field.
Change-Id: I5d2e6fb1efba0ad97647ac140e2b9a9ac0aee06e
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Change-Id: Ifbb1da2a6278b0bde2a6f6ce2e7bd383ee3fb28a
One shortcoming in HTMLForm is that fields that use the 'options'
parameter (e.g. <select>) have no easy way for the individual labels to
be localized.
This change adds a new parameter type, 'options-messages', where the
keys are message keys rather than bare strings (similar to the
difference between 'label' and 'label-message'). It also abstracts out
the fetching of the various option parameters, and changes the necessary
field classes to use it.
Change-Id: If4175332405d26c7ff2e8fbe100bcad61762ce6f
It is already set for some fields in Special:Block, but are
discarded by HTMLForm and its fields.
Some notes:
- fields with multiple inputs (radio, select and other, select
or other) will have the same tabindex set on all elements
- Some items such as multi-select and check matrix are not yet
implemented
Change-Id: I3e1ba7f16f3a3183f231afcf60dd392ce6d6eb6b