| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Adds a CSS-only version of Codex Radio via HTMLRadioField.
Iterates through the list of options obtained from `getOptions()`
and generates the HTML markup for each radio input, radio icon,
and radio label. The three elements (input, icon, label)
combined make a single Codex Radio. The Radios are appended to
an empty `$html` string variable. The function returns the
concatenated HTML markup.
Bug: T359015
Change-Id: I73b2e95cff0bc50ba1bc70457d65e286592288ac
|
|/
|
|
| |
Change-Id: I7f85d931d3b79da23e87b4e5692b2e14be8fcaa0
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Codex implementation of HTMLNamespacesMultiselectField and
HTMLTitlesMultiselectField falls back to a simple `<textarea>`, which is
also what the OOUI implementation does if JS is not available. However,
OOUI sets rows=10, which results in a much more reasonably sized
textarea then HTMLTextAreaField's default of rows=25.
Pass rows=10 to HTMLTextAreaField, but allow the field params to
override this.
Change-Id: I1e9a1ab6b4a71fb247bfe7861a49bb6cfeb61f54
|
|
|
|
|
|
|
|
|
|
| |
Add support for generating a Codex TextArea via
HTMLTextAreaField, then add Codex handlers to
HTMLNamespacesMultiselectField and HTMLTitlesMultiselectField,
which fall back to a TextArea.
Bug: T359015
Change-Id: I659241f56fae8aa60e25ad0c65b62e8465edad99
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch enables use of a Codex component for the following
HTMLFormFields:
- HTMLExpiryField
- HTMLSelectAndOtherField
- HTMLSelectField
- HTMLSelectOrOtherField
It also adds a new public static method to HTMLTextField that
takes in attributes and returns the HTML for a Codex text input.
Note that the Codex CSS-only Select does not yet support an
error state, so this has not been implemented here.
Bug: T359015
Change-Id: I6857813b9dbe09ae68d6cafdc87351d01626266a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Refactor the HTMLButtonField, HTMLCheckField, and HTMLTextField
classes to include getInputCodex() methods, rather than checking
if CodexHTMLForm is being used.
- Add error classes if applicable.
- For HTMLCheckField, ensure that tooltips are propagated to the
wrapper div instead of the label, so a tooltip will display no
matter which part of the component you're hovering over
(including the space between the input and label text).
Bug: T359013
Change-Id: I0ead69e2b6b33f48949a2dfe40140f2ef957bc06
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's a dropdown, not a drop down, therefore rename:
* Html::listDropDownOptions → Html::listDropdownOptions
* Xml::listDropDownOptions → Xml::listDropdownOptions
* Html::listDropDownOptionsOoui → Html::listDropdownOptionsOoui
* Xml::listDropDownOptionsOoui → Xml::listDropdownOptionsOoui
* Xml::listDropDown → Xml::listDropdown
In PHP, method names are case-insensitive, therefore we can do this
without a breaking change or deprecation.
This also matches the naming convention in OOUI.
Change-Id: Ifda13ba9dee316709c424636ec3b285de8d0e9b1
|
|
|
|
|
| |
Bug: T347541
Change-Id: If2d5868c23339ecc06fc76a66bc77b41cd10607d
|
|
|
|
|
| |
Bug: T353458
Change-Id: I09e66c3223018ec47e0549ee7f6a590b676f4eef
|
|
|
|
|
|
|
|
|
|
|
| |
* Switch out raw Exceptions, mostly for InvalidArgumentExceptions.
* Fake exceptions triggered to give Monolog a backtrace are for
some reason "traditionally" RuntimeExceptions, instead, so we
continue to use that pattern in remaining locations.
* Just entirely give up on PostgresResultWrapper's resource vs. object mess.
* Drop now-unneeded false positive hits.
Change-Id: Id183ab60994cd9c6dc80401d4ce4de0ddf2b3da0
|
|
|
|
|
| |
Bug: T353458
Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Removing the config variable in a separate change:
Ib9966bc6a4a94f771cb99a5aa52fb6a1dc826ca5
(just in case something depends on its existence).
Bug: T182050
Change-Id: Ic3e038df16fc540ec7f6bcb9a54d73f8d596d305
|
|/
|
|
|
|
|
| |
migrate users
Bug: T356544
Change-Id: Ibcc13c92a48b3fd2a33914418dfbefb0dd890c82
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Or just remove it. It's not needed when the structure is already an
array. PHP will happily initialize multi-dimentional arrays when
needed.
Change-Id: I93845e8d6f870d147bd55cfe3827bc94b375d0ba
|
|/
|
|
|
|
|
|
|
|
|
|
| |
The main benefit is that IDEs, static analyzers and such are now
able to understand that this refers to code from the
HTMLFormFieldCloner class. This was completely hidden before.
Also fix a mistake in the documentation for getNearestField. This
was accidentally copying the getNearestFieldValue documentation,
which does return mixed.
Change-Id: Ie4204bc967013825d9d73d30f264b07ff0c9e846
|
|\ |
|
| |
| |
| |
| |
| | |
Bug: T327007
Change-Id: Ibe8a4b2d77b530b9612285e422cbb3eca14d532e
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Helps bot operators adhere to the principle of least privileges.
Grants can now be restricted to allow editing (and other write
operations) for upto 25 listed pages. The page IDs are persisted within
the bp_restrictions field of bot_passwords table, and in the session
metadata.
This restriction is checked only as part of expensive checks in
PermissionManager, since they are not applicable for UI actions.
Bug: T349957
Change-Id: I3d228eb97664d040a160c5b742d9176fdfae9a43
|
|
|
|
|
|
|
|
|
|
|
| |
Earlier, loadDataFromRequest() returned MWRestrictions object only in
case of valid input, and the original string if invalid. Now, an
MWRestrictions object is returned in all cases, on which we now have a
validity field. This also de-duplicates the check to find the invalid IP
address(es).
Bug: T349957
Change-Id: Iadb762b572cf0e7d2b92dbc4912804a3ddb48e74
|
|
|
|
|
|
| |
Bug: T290790
Bug: T254222
Change-Id: I69e8217c408acca6bd7f19e7e274b255336dccd2
|
|
|
|
|
|
|
|
|
|
| |
This is a composite field meant for a specific purpose, rather than a
fundamental component.
No sub-classes were found in Code Search.
Bug: T349957
Change-Id: Idfb526a341b95322b698a5992b72f5ee8aabf497
|
|
|
|
|
|
|
|
| |
Using a flag depends on the *-mode query param, so won't care about
the default value of empty input being 0, empty string, or null anymore.
Bug: T347229
Change-Id: I389adfdf941a8cfd96a68b66120a209b5f38fbbe
|
|
|
|
|
| |
Bug: T166010
Change-Id: Id13dcbf7a0372017495958dbc4f601f40c122508
|
|
|
|
|
| |
Bug: T166010
Change-Id: Ibda1e8be0f23c6262a32b607f8260cad36f188fc
|
|
|
|
|
| |
Bug: T166010
Change-Id: Ia2e5a7367cc8cdbd8a7b845ae2fd5d776ff22891
|
|
|
|
|
|
|
| |
This has been approved as part of RFC T166010
Bug: T321882
Change-Id: I6bbdbbe6ea48cc1f50bc568bb8780fc7c5361a6f
|
|\ |
|
| |
| |
| |
| |
| | |
Follow-Up: I834cc0e07fc1e705753df6866a5eeda2ac77fb8e
Change-Id: I69e022c8c64e35aa88e93ea02b66380f481bf070
|
| |
| |
| |
| |
| |
| |
| | |
Introduced a new param for HTMLUserTextField allowing external users.
Bug: T344978
Change-Id: I586869f024b928c5d74a8514ba876ab22d664c95
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This class is used heavily basically everywhere, moving it to Utils
wouldn't make much sense. Also with this change, we can move
StatusValue to MediaWiki\Status as well.
Bug: T321882
Depends-On: I5f89ecf27ce1471a74f31c6018806461781213c3
Change-Id: I04c1dcf5129df437589149f0f3e284974d7c98fa
|
| |
| |
| |
| | |
Change-Id: Ibfc8ad6375555cfafb649dc96c91b5415a8ea0ff
|
|/
|
|
|
| |
Bug: T321882
Change-Id: I48c10343295c4eb3d9ef8037343b0070e928f040
|
|
|
|
|
|
|
|
| |
See T194067 for what this patch is supposed to fix, additionally,
We introduced a new method to escape the result of `getLimitSelectList()` in ImageListPager because phan was shouting. In HTMLRadioField.php on line 67, I converted the label value to a string because HtmlSnippet accepts only a string
Bug: T194067
Change-Id: I9cc81df0d3225dce4dca50361be9e2561e50e260
|
|
|
|
|
|
|
|
| |
Mock the needed dependencies to avoid database access when possible, and
add the test to the Database group otherwise.
Bug: T155147
Change-Id: Ic5c39ab35ab4d993721713285180f072497a5a40
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes:
* Use Codex markup instead of mediawiki ui markup
* We limit what can be customized by the skin
* Current rules for touch area and snapping of
inputs is moved from Minerva into core so other skins
benefit from the styling
* A placeholder text is adding to the "real name" field.
* Introduce CodexHTMLForm
Bug: T182050
Change-Id: I834cc0e07fc1e705753df6866a5eeda2ac77fb8e
|
|
|
|
|
|
|
|
|
| |
Motivation:
* Avoid code duplication.
* Hopefully make it easier to read.
* Also order stuff from cheap to expensive, if possible.
Change-Id: I575e3f2027ce60a0d0885be5b9bd3e07bc035eee
|
|
|
|
|
| |
Bug: T328220
Change-Id: I3c36835fbd90acc301731e2b33ae4815cd4b0cc5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Function is documented to return string and
parent class also has this check
1) SpecialPageFatalTest::testSpecialPageDoesNotFatal
trim(): Passing null to parameter #1 ($string) of type string is
deprecated
/workspace/src/includes/htmlform/HTMLForm.php:1971
/workspace/src/includes/htmlform/HTMLForm.php:1535
/workspace/src/includes/htmlform/OOUIHTMLForm.php:286
Change-Id: I40d0ca4af001ab8ee6e182ab49988c9507db6eac
|
|
|
|
|
|
|
|
|
|
|
| |
This is the more native way of doing things, which avoids syncing
different states between the toggle and the hidden widget.
The DOM structure is also better and don't confuse screen readers.
Bug: T333496
Bug: T334705
Bug: T336107
Change-Id: I47de69459b96f172153065094eb4113584bb435a
|
|
|
|
|
|
|
|
|
| |
The HTMLRadioField is seldom used, and never inside an
HTMLVForm and never without OOUI so this code is serving no
purpose.
Bug: T182050
Change-Id: I51e54058194cf1bc8398dc78136423d10108a0e9
|
|
|
|
|
|
|
|
|
|
| |
TitlesMultiselectWidget and NamespacesMultiselectWidget both default
to false, meaning click-to-edit on the tags is disabled. Allow this
to be overridden from the corresponding PHP form fields.
This helps to provide a workaround for the related bug: T334711
Change-Id: I4014c5ba7fea0647da6ec6c420342a41ac90518b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Inappropriate @inheritDoc usage. Arguably all @inheritDoc is
inappropriate but these are the ones PHPStorm flags as misleading
due to the method not being inherited.
* Doc comment type does not match actual argument/return type.
* I replaced "@return void|never" with "@return void" since never means
never, it doesn't make sense for it to be conditional. If a method
can return (even if that is unlikely) then @return contains the type
that it returns. "@return never" means that there is no such type
because the method never returns.
* Incomplete/partial/broken doc tags
Change-Id: Ide86bd6d2b44387f37d234c2b059d6fbc42ec962
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Illegal string offset and invalid argument supplied to foreach, due to incorrect type information
* Array internal pointer reset is unnecessary
* $hookData unused since MW 1.35 due to incomplete revert
* array_push() with single element
* Unnecessary sprintf()
* for loop can be replaced with str_repeat()
* preg_replace() can be replaced with rtrim()
* array_values() call is redundant
* Unnecessary cast to string
* Unnecessary ternary. Often the result relies on short-circuit evaluation, but I find it more readable nonetheless.
Change-Id: I4c45bdb59b51b243fa96286bec8b58deb097d707
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is moderately messy.
Process was principally:
* xargs rg --files-with-matches '^use Title;' | grep 'php$' | \
xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1'
* rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \
xargs rg --files-with-matches 'Title\b' | \
xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1'
* composer fix
Then manual fix-ups for a few files that don't have any use statements.
Bug: T166010
Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a
Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
|
|
|
|
|
|
|
|
|
|
|
|
| |
HTMLFormField::getDefault is documented to return mixed, which includes
null, but WebRequest::getText is documented to allow strings only.
The use of WebRequest::getText cannot be replaced with
WebRequest::getVal in the multiselects, because there are working with
\n and WebRequest::getText provides normalisation for \r\n
Bug: T330526
Change-Id: I5df0141fb254a7e2939994daa9ded1a7a126231a
|
|
|
|
|
|
|
| |
Since this method exists, it seems conceptually wrong not to override it
in the subclasses. This also makes the field types easier to extend.
Change-Id: I655a94944805079de670d4e568e4e8d2b7a9bb8b
|
|
|
|
|
|
| |
The value should be a newline-separated string, not an array.
Change-Id: Ief6a1262d482407321f18912181f2960ac7820cd
|
|\ |
|