Commit graph

17 commits

Author SHA1 Message Date
jenkins-bot
38d59dd213 Merge "Improve hidden field validation" 2014-09-16 00:10:13 +00:00
Bryan Davis
69e4c91ff5 Apply csshelpclass to vform help
Ensure that a form field which sets 'csshelpclass' and is rendered as
a vform receives expected styling.

Change-Id: Ibe082e07fe846334bd4dc257c9c0df8db23a1957
2014-08-23 16:10:17 -06:00
Brad Jorsch
788526c2d1 Improve hidden field validation
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
2014-07-31 14:04:00 -04:00
umherirrender
b883e8c7c0 Cleanup some docs (includes/[e-l])
- 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
2014-07-24 19:43:03 +02:00
Derric Atzrott
0cda6a5182 Adding css styling option for help option in HTMLForm
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
2014-07-16 20:17:07 -03:00
Bartosz Dziewoński
a88f8a496b mediawiki.ui: Rename .mw-ui-vform-div → .mw-ui-vform-field
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
2014-06-26 17:34:20 +00:00
Brad Jorsch
e9d4d06276 HTMLForm: Add "cloner" type
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
2014-05-02 15:02:40 +00:00
Brad Jorsch
c310e7b40c HTMLForm: Add hide-if
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
2014-05-02 14:57:34 +00:00
umherirrender
dcf6955e5c Fixed some @params documentation (includes/*)
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
2014-04-20 23:33:05 +02:00
jenkins-bot
78288c39a3 Merge "Fix number of parameters passed on recursive function call" 2014-02-28 16:30:34 +00:00
Marius Hoch
9e66a63af8 Use inContentLanguage for dropdown messages in HTMLFormField
to restore b/c for now.

Bug: 61942
Change-Id: I2741ef940d83eeb564e89e20378fb4004cfe5b83
2014-02-28 03:13:03 +01:00
Reedy
b0223bc648 Fix number of parameters passed on recursive function call
Error is from If4175332405d26c7ff2e8fbe100bcad61762ce6f

Change-Id: I2deabd42462e4009118ff5578e4da95cab51107a
2014-02-27 21:20:46 +00:00
Brad Jorsch
f88fcb7461 HTMLForm: Allow i18n of 'options'
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
2014-02-19 23:26:23 +00:00
Siebrand Mazeland
f077c4b1d6 Update formatting
Change-Id: I18aff576262479c9bb1c56eb8e1d1aaae200e4b1
2014-02-06 09:27:05 +01:00
Alexandre Emsenhuber
cb9a9a7b47 Add support for "tabindex" in HTMLFormField subclasses
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
2014-01-25 04:31:01 +00:00
addshore
8fa2314b2e Formatting fixes in includes/htmlform/*
Change-Id: Iee9e4f3fcf8491022ffe97c74312871f97f8ce9c
2013-12-09 14:23:05 +01:00
addshore
976276338a Split includes/HTMLForm
Change-Id: I6eabfdb064c0e35b69efe9d6142e94df4128b632
2013-12-08 23:13:56 +01:00