Commit graph

102 commits

Author SHA1 Message Date
jenkins-bot
f8ab4e5ffe Merge ""spellcheck" attribute for HTMLForm "text" and "textarea"" 2015-06-25 10:17:54 +00:00
Ori Livneh
c099155a17 ellapsed => elapsed
Also fix some files that don't end with a newline.

Change-Id: Id0672d685b929a5832b42f733dad49683536180a
2015-06-23 03:32:33 +00:00
umherirrender
6b24d10b6d Fix some line indent of string concat
Change-Id: I5883c9cd57d106168648b4502051b4b49046fea2
2015-06-19 20:52:43 +02:00
jenkins-bot
f0c8631a0f Merge "Remove unneeded empty lines at begin of if/else/foreach body" 2015-06-19 18:25:57 +00:00
umherirrender
70f3afd548 Remove unneeded empty lines at begin of if/else/foreach body
An if body must not begin with an empty line

Change-Id: I62b058be337fcc85a120fcd3dadce564db59a271
2015-06-19 20:05:45 +02:00
umherirrender
3169b369e0 Fix tooltip for invert checkbox on Special:NewPages
Tooltip has to be a 'name', not a parsed message,
because it goes through Linker::getTooltipAndAccessKey

Also propagate tooltip from the checkbox to the label to have a bigger
area for the mouse to trigger the tooltip. This is usally done for other
checkboxes on Special:Watchlist.

Follow-Up: I5c03dc543b910aab27a26a5a223341be50893cf3
Change-Id: If8dd9d66f57f63afe5df02d0d6b4cf70ba5d91c3
2015-06-19 15:57:26 +00:00
Florian
fd10cd5b95 Use HTMLForm for Special:Export
* Transform all input fields to use HtmlForm as preparation for enabling
  MediaWiki UI eveywhere.
* Remove protected whitespace for HTMLCheckField (adds empty line to div-layout)
* Add a new HTMLForm input field "Text with Button" and "Namespaceselector with Button"

Bug: T73434
Change-Id: I53cc019c3ca94cec8f3c05500d0c604c1af7f688
2015-06-14 16:48:26 +00:00
Daniel A. R. Werner
62d54bed13 "spellcheck" attribute for HTMLForm "text" and "textarea"
"spellcheck" attribute requires literal "true" or "false" values and can not
just be implemented by adding it to the list of HTMLFormField::getAttributes's
$boolAttribs.

Change-Id: I5882e71af2ca64d367a1824634f61e16097e341d
2015-06-13 15:23:48 +02:00
Florian
091936eb2e HTMLForm: Break long lines
Change-Id: Ia09a28ccc361d1a54069bd23a412831fe9c20f34
2015-06-05 03:12:35 +02:00
Kunal Mehta
fbf72b866c OOUIHTMLForm: Access context after parent constructor is called
This avoids "ContextSource::getContext (OOUIHTMLForm): called and $context
is null. Using RequestContext::getMain() for sanity"

Change-Id: I20c2bb58b3a0e5e259241a3715ee8fdf4b57e148
2015-05-27 23:02:58 -07:00
Kunal Mehta
ede0147134 HTMLForm::factory() doesn't throw MWExceptions
Change-Id: I0104bf1dd9ebb813aa37f92b21515a964ca2a709
2015-05-27 22:37:33 -07:00
jenkins-bot
5eda39e04b Merge "Implement OOUI display format for HTMLForm" 2015-05-24 12:22:29 +00:00
Florian
300bf47a9a Fix false Namespaceselector value for "all" on Special:LinkSearch
Added the ability to define the value in HTMLSelectNamespace.

Bug: T98496
Follow-Up: I8503c391a40f1654f8570578a9de9015d86c9845
Change-Id: Ic6a871507a027d28b3aeb1efeb9abbceb5734a9e
2015-05-23 20:07:50 +00:00
Mark Holmquist
e85bd04bcd Implement OOUI display format for HTMLForm
Bug: T85291
Change-Id: I6ffe93c16d6b209a0ab08d714ad8ddaefb6acd52
2015-05-23 16:10:08 +02:00
Daniel A. R. Werner
def394bea7 Added documentation for HTMLFormField's "hide-if"
Change-Id: I410c58dc0586cfe97e39668c9608ce0d9e10a08b
2015-05-18 22:16:58 +00:00
jenkins-bot
8b82353738 Merge "Use HTMLForm for Special:LinkSerach" 2015-05-07 01:25:01 +00:00
Bartosz Dziewoński
9172be5a0c HTMLForm: Add wfDeprecated to isVForm
Change-Id: Idd8eb9cf63794c5a71439c130ad28564e6d3e750
2015-05-01 22:17:50 +00:00
Florian
e072d7bd8c Use HTMLForm for Special:LinkSerach
* Convert Special:LinkSearch to use HTMLForm for preparation of MediaWiki
  UI everywhere
* Add support for dir= tag in HTMLTextField

Bug: T73439
Change-Id: I8503c391a40f1654f8570578a9de9015d86c9845
2015-04-19 21:10:45 +02:00
Florianschmidtwelzow
e4f5c50652 Use HTMLForm for Special:FileDuplicateSearch
* Prepare the usage of MediaWiki UI.
* Add new HTMLForm output mode "inline" (very close to "raw")

Bug: 71436
Change-Id: I12240aaf624dff5219b344648b20373594b5ec46
2015-03-29 17:23:12 +02:00
jdlrobson
60e9f3159e Enable mw-ui-radio styles on Special:Preferences
This makes the styling of the mobile version of Special:Preferences more consistent
http://localhost:8080/wiki/Special:Preferences/skin?useformat=mobile

Change-Id: I67aaf1bf5e0e2eaccf948ecacd1860e6e3b31b04
2015-03-04 11:59:10 -08:00
jenkins-bot
642504832e Merge "htmlform: Simplify implementation of loadDataFromRequest()" 2015-02-17 13:36:15 +00:00
jenkins-bot
c928d9cfb7 Merge "Make HTMLTagFilter disappear totally when $wgUseTagFilter = false" 2015-02-16 13:18:46 +00:00
This, that and the other
83795eaece Make HTMLTagFilter disappear totally when $wgUseTagFilter = false
Previously the label displayed but the input field didn't.

Bug: T78432
Change-Id: Ia84ac611f76c98495a5b3f90c0ce01b6e1e404a3
2015-02-17 00:02:51 +11:00
Timo Tijhof
d62a2b76b1 Replace dev.w3.org with more permanent or stable urls
* Sanitizer: dev.w3.org/html5/spec-preview
  Follows-up 8e8b15afc6.
  Use stable reference to www.w3.org/TR/html5 instead (currently
  from October 2014) instead of an old preview branch from 2012.

* parserTests: dev.w3.org/html5
  Follows-up 959aa336a1.
  Url is now a dead end. Replaced with link to a draft from around
  that time. The relevant section no longer exists in the curent
  spec as it got split off into a separate spec. Maybe this one:
  https://url.spec.whatwg.org/#percent-encoded-bytes

* Parser, HTMLIntField: dev.w3.org/html5
  Use stable reference to www.w3.org/TR/html5 instead.

* HTMLFloatField.php: dev.w3.org/html5
  Url is now a dead end. Draft from around that time:
  http://www.w3.org/TR/2011/WD-html5-20110525/common-microsyntaxes.html#real-numbers
  The section "Real numbers" no longer exists in the current spec,
  but the Infrastructure chapter has a section on floating point
  numbers that describes the same sequence now.

Change-Id: I7dcd49b6cd39785fb1b294e4eeaf39bda52337b2
2015-02-14 14:21:33 +00:00
Timo Tijhof
713afe4548 htmlform: Simplify implementation of loadDataFromRequest()
Change-Id: I30d1c186c9e3eb67130b798af987f275316828de
2015-02-14 07:16:43 +00:00
Brad Jorsch
e754dfaf4d HTMLForm: Support hide-if for HTMLCheckMatrix
It outputs multiple table rows, and each one needs the class and data
attribute.

Change-Id: I6667c3ea0e10167d941cb214d76889b389af79a3
2015-02-07 08:55:58 -05:00
Bartosz Dziewoński
52c29a7a87 HTMLFormField: Don't abuse mClass for VForms
Various fields use this differently than I thought, breaking things.
Let's add a separate variable.

Change-Id: Ia974a42c2a905cbc9e8405d9f03c10c8ad692864
2015-01-14 15:00:39 -08:00
Bartosz Dziewoński
f338a1cf31 HTMLForm: Separate VForm code to a subclass
…and in general, work with the existing HTMLForm design for defining
display formats, rather than against it.

Breaking changes:
* HTMLForm::isVForm() is now deprecated.
* You can no longer do this:
    $form = new HTMLForm( … );
    $form->setDisplayFormat( 'vform' ); // throws exception
  Instead, do this:
    $form = HTMLForm::factory( 'vform', … );
  When using FormSpecialPage, override the new getDisplayFormat() method
  instead of calling $form->setDisplayFormat() in the alterForm() method.
  (Other display formats are not affected, only 'vform'.)

Bug fixes:
* Correctly suppress empty labels for VForm fields
* Correctly disable <fieldset/> wrappers for VForms

Other benefits:
* Reduce code duplication related to $getFieldHtmlMethod
* Introduce HTMLForm::factory() method for constructing HTMLForms

Related cleanup:
* Correctly style 'reset' buttons in MediaWiki UI mode
* Label $wgHTMLFormAllowTableFormat as a mobile-specific hack
* Display checkboxes normally in MediaWiki UI mode (removed weird
  override that only broke things). Also, always render checkboxes
  in VForms as .mw-ui-checkbox.
* self:: → static::

Bug: T85285
Change-Id: I086a84f1c8cc6a16710709b7806c7f5f96462b32
2015-01-14 19:33:34 +00:00
Aaron Schulz
6921770414 Updated some try-catch statements: MWException -> Exception
Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
2015-01-09 17:20:22 -08:00
Reedy
4d9143c7f5 Add lots of @throws
Change-Id: I09d0c13070f966fcf23d2638d8fc1328279a5995
2014-12-24 13:49:20 +00:00
umherirrender
cbdc6e53fe Make HTMLForm::formatErrors non-static to can parse message in context
One call in core already called it non-static

Avoid:
[GlobalTitleFail] MessageCache::parse called by
Message::toString/Message::parseText/MessageCache::parse with no title
set

Change-Id: Ic91e715177c0a4578825640a31ec68ecba3176e0
2014-12-19 16:31:55 +01:00
Kunal Mehta
4603f28025 Avoid GlobalTitleFail in HTMLFormField::__construct
Pass the HTMLForm parent instance in the constructor so context
is available when parsing a message.

Change-Id: I532c0d95698cbcc57294b9bd2725f33838f393a9
2014-12-17 14:20:14 -08:00
Bartosz Dziewoński
3e85dfb8ad Standardize indentation of multiline 'if'/'elseif' conditions
Always indent the continuation one level deeper, and always place the
closing parenthesis on the next line, per coding conventions.
https://www.mediawiki.org/wiki/Manual:Coding_conventions#Indenting_and_alignment
https://www.mediawiki.org/wiki/Manual:Coding_conventions#Line_continuation

Regexp used: (\t+)(if|while|\} elseif|foreach).+(?<![;}])\n\1\S

Also:
* Change to just one line if line length stays under 100 characters.
* Add "// Do nothing" comment in empty 'if' bodies.
* Change '#' comments to '//' comments near affected code.

Change-Id: I4f62658fddb5a0ed18bbf9b2231cd794683d6402
2014-11-17 15:33:34 +00:00
jenkins-bot
885a8bdc47 Merge "Allow maxlength attribute on HTMLSelectAndOtherField" 2014-11-16 23:48:45 +00:00
umherirrender
b18197dd81 Allow maxlength attribute on HTMLSelectAndOtherField
A reason on a SelectAndOtherField can have two parts, one of the scroll
down box and a free text field. The free text field is actually
unlimited.
This patch allows the maxlength on that field. To respect the concat of
the two parts, also javascript code is added, which adds a dynamic
maxlength to respect also the text from the scroll down box.

The HTMLSelectAndOtherField is only used on Special:Block,
where the maxlength attribute is now set to 255 (length of the database
field ipb_reason).

Change-Id: I5c164b41ab047e7ecf9d92db6eddcc980e2db048
2014-11-16 21:35:51 +01:00
umherirrender
709eb0a4df Always return string on HTMLTagFilter::getInputHTML
Follow-Up: I5c03dc543b910aab27a26a5a223341be50893cf3
Change-Id: I0bb0f2e2c95543089fbc3b12ebf45f93f9a90efc
2014-10-31 11:58:57 +01:00
Florianschmidtwelzow
317345b0df SpecialNewpages: Prepare for mw-ui
Use HTMLForm instead of self-built table structure, to be
prepared for use with MediaWiki UI.

Bug: 71446
Change-Id: I5c03dc543b910aab27a26a5a223341be50893cf3
2014-10-15 23:25:11 +02:00
Brad Jorsch
8a58e69b46 HTMLForm: Improve hidden field handling
HTMLHiddenField is unable to output a non-default value, which makes it
unsuitable for actually persisting changes across multiple form
submissions. To preserve compatibility with forms that aren't expecting
persistence, fixing this requires a new parameter in the field
definition.

Also, due to the unusual way that hidden fields are added to the HTML
output, they are not being correctly handled by HTMLFormFieldCloner.
Special-case that.

Change-Id: I1fde7372401299b4432d28ac61982d47d5f3bbea
2014-10-09 13:40:04 -04:00
jenkins-bot
4b9f378af4 Merge "Fix input regression affecting HTMLForms that use VForm" 2014-10-01 16:50:02 +00:00
Matthew Flaschen
c1bf30c2e5 Fix input regression affecting HTMLForms that use VForm
Although the classes (e.g. mw-ui-input) are still there,
the style module was not being loaded.

This affects forms that deliberately use VForm even without
wgUseMediaWikiUIEverywhere (since they pre-date it).

This applies at least to PasswordReset, which was added in
d32891d99f (last October).

Bug: 71448
Change-Id: Ieca36c0036d4c93244c533237eddd678564dd3c0
2014-10-01 02:17:42 -04:00
Brad Jorsch
a542468207 Restore ability for getAttributes to set HTMLTextField type
Change I47db5eab broke SecurePoll, which was relying on this.

Change-Id: Ib11bf9d34eb12f14b9636498c00ff4040b35f130
2014-09-30 12:10:45 -04:00
Prateek Saxena
930dcafb09 HtmlForm: Add @since annotation for methods added to UI standardization
Change-Id: I74f58df9de79d2ad055eaf9760763005996dc0a0
2014-09-24 18:23:33 +00:00
jenkins-bot
0d92e1088e Merge "HtmlForm: Use mw-ui-checkbox only if wgUseMediaWikiUIEverywhere is enabled" 2014-09-24 18:15:21 +00:00
Prateek Saxena
9b461e218a HtmlForm: Use mw-ui-checkbox only if wgUseMediaWikiUIEverywhere is enabled
Change-Id: I5d8f1bbcea72253d71df8c9e13253ff5612be363
2014-09-23 19:14:50 -07:00
Prateek Saxena
279d4e2883 Special:BlockList: Use mw-ui-progressive for search button
Bug: 71144
Change-Id: I56969edb6651a26ff2579e1ed9f9da34a9536e46
2014-09-23 15:24:51 -07:00
Prateek Saxena
358d2980cc Special:EditWatchlist: Use destructive button and style checkboxes
Bug: 71147
Change-Id: Icddec7a3b66ba1cc86459c2776a471391e92c8c7
2014-09-23 14:53:12 -07:00
jdlrobson
274978205c Correct button colours of preference page when $wgUseMediaWikiUIEverywhere is enabled
* Apply mw-ui-destructive to Special:Preferences/Reset
  when $wgUseMediaWikiUIEverywhere is enabled

Introduces HTMLForm->setSubmitDestructive()

Bug: 65317
Change-Id: I1d6691dce3e7dab662bda9a718e16c5caee6c041
2014-09-17 00:00:38 +00:00
jenkins-bot
38d59dd213 Merge "Improve hidden field validation" 2014-09-16 00:10:13 +00:00
Kunal Mehta
791d71bd51 HTMLFormFieldCloner: Make sure the delete and create buttons have a parent
Also fix the type in documentation.

Change-Id: I0fee2dbb9dd1db157acfba2063a2e4e40152cddf
2014-09-11 09:53:40 -07:00
Bryan Davis
dd107dda96 Apply vform styling to HTMLForm buttons
Check for isVForm() and apply styling matching the default submit button
when generating alternate form submit buttons.

Change-Id: Ia3313087248af1537ac4740694846b6ff1187b1a
2014-09-05 15:56:19 -06:00