Commit graph

120 commits

Author SHA1 Message Date
Thalia
62b4cee23f TitlesMultiselectWidget: display pending element
Create a PendingTextInputWidget and use it in
TitlesMultiSelectWidget instead of the multiline
text area for users who have JavaScript.

Bug: T210080
Change-Id: I824fea6a3df580d342e6087ab901fec025f0e70b
2018-12-05 21:08:38 +00:00
Volker E
ed42e2fae2 HTMLCheckMatrix/CheckMatrixWidget: Adding th to thead
Improving semantics, which also reflects in screen readers.

Change-Id: I552a61a6e1892ebed86d9434366bd932f6f7a602
2018-11-16 15:27:19 -08:00
Volker E
50c878ca79 CheckMatrixWidget: Re-instate HTMLForm CheckMatrix styling
Adding `tbody` with extra class and add additional `thead`.

Bug: T209667
Change-Id: I3f707f667df11e9bfd5ce1fcc51ccde0cd12e9be
2018-11-16 12:38:44 -08:00
Thalia
a61d51af9e TitlesMultiSelectWidget: pass through 'input' config
Also set 'autocomplete' to false in the 'input' config
in Special:Block.

Bug: T208551
Change-Id: I0376e4ce809aeb48496530cdd5d39ac9142c28bd
2018-11-13 19:29:04 +00:00
Thalia
8fec7ed09a TitlesMultiselectWidget: rename 'limit' config to 'tagLimit'
To avoid conflicting with TitleWidget config.

Bug: T209057
Change-Id: Ia0dbc49f38a116202eb2658b7556fb7f0627f1bb
2018-11-13 19:29:04 +00:00
Thalia
61a6a0445b TitlesMultiselectWidget: pass through additional configs
Pass through 'limit' and 'showMissing' configs.

Also set 'showMissing' to false for partial blocks.

Bug: T208626
Bug: T208627
Change-Id: Ifa75e2d390bf349226ad69d68adcdcaf742ab560
2018-11-13 19:28:54 +00:00
jenkins-bot
d4cc4f2b4f Merge "Render namespace lists in the user's language" 2018-11-07 15:14:20 +00:00
jenkins-bot
ecee5cd7c7 Merge "Use PHP 7 '??' operator instead of if-then-else" 2018-10-24 21:58:04 +00:00
Moriel Schottlender
07a5c71646 TitlesMultiselectWidget: Add a widget that allows selection of multiple titles
Add the widget in both PHP and JS for OOUI, and into HTMLForm
definitions.

In JS, the widget uses the engine from mw.widgets.TitleWidget
with the async support from OO.ui.mixin.RequestManager.

The PHP version provides a textarea, like UsersMultiselectWidget.php
which is then infused if JS is available.

Also, add highlightSearchQuery option for TitleWidget to allow for
not highlighting the partial search query the user typed in, if the
UI requires it. This option (highlighting partial result) is already
optional in the TitleOptionWidget, so this config exposes that
optionality in the TitleWidget widget for its menu children.

Notes:

HTMLTitlesMultiselectField is a duplication of HTMLUsersMultiselectField
except for:
- The configuration variable changed to 'titles' (from 'users')
- OOUI modules were adjusted for the TitlesMultiselectWidget
- The PHP version instantiates a MediaWiki\Widget\TitlesMultiselectWidget

TitlesMultiselectWidget is a duplication of UsersMultiselectWidget
except for:
- $usersArray was renamed to $titlesArray
- getJavascriptClassName returns the correct js class for
  mw.widgets.TitlesMultiselectWidget for infusion.

Bug: T197109
Depends-On: I675316dddf272fd0d6172ecad3882160752bf780
Change-Id: Ie96947a35f70b76731e16ae5b85de815dfa4a8ce
2018-10-24 00:46:48 +00:00
Fomafix
43244db9a2 Use PHP 7 '??' operator instead of if-then-else
Change-Id: If9d4be5d88c8927f63cbb84dfc8181baf62ea3eb
2018-10-21 21:46:46 +02:00
James D. Forrester
b162e8ae78 Follow-up 3481e3b2: Drop disablability of ExpiryInputWidget before 1.32 is cut
No longer used anywhere(?); we'd rather not have to explain the temporary
variable in the MediaWiki 1.32.0 release notes if we can instead just not ship
it.

Bug: T192620
Change-Id: Icfb82f228512ed45f1a27ce3e565fbc5fc09f39c
2018-10-16 19:21:40 +00:00
Erik Bernhardson
9f28aa0709 Render namespace lists in the user's language
Asking users to select from a list that is in a namespace
other than their user language can be quite difficult.
Transition a number of use cases. This was applied via a flag
to avoid unexpectedly changing extensions also utilizing
the namespace selector.

Pages updated:
* Special:Search
* Special:Watchlist
* Special:RecentChanges
* Special:Contributions
* Special:Import
* Special:WhatLinksHere

Bug: T174057
Change-Id: I3fdac72179a124849ef7ad1e0e54eb66396c3c6e
2018-10-12 11:27:20 -07:00
Erik Bernhardson
c49b8bf0d5 search: Fix DYM typos in widget
* DYM link was triggering the 'go' feature due to fulltext misspelled
* all ids are of the form mw-search-*, except one. Make it the same
  (WikimediaEvents code was expecting everything to be mw-search-*)

Bug: T206232
Change-Id: Ib91ccf28879b8af2a8c0f2a40b9fe3ec4259a730
2018-10-04 08:32:16 -07:00
Erik Bernhardson
d7ec79785f Give search results a consistent css class to select
Results with and without thumbnails only share an li, and that li
cannot be specifically targeted. Add a class to the li so anything
that wants to deal with individual results can target them.

Bug: T189242
Change-Id: I9b19c5e3d7d72d4be3a5ffdf280bf07b870ff3c0
2018-09-13 11:54:48 -07:00
Bartosz Dziewoński
1ddc66a395 HTMLCheckMatrix: Treat row/column labels as HTML in OOUI mode
We were incorrectly escaping them. They are supposed to be already
correctly escaped HTML.

Also improve documentation and really allow 'tooltips' to be optional.

Bug: T203325
Change-Id: I1f92479bf1989e1529b18b8b206b61db1257eb87
2018-09-03 21:37:31 +02:00
Bartosz Dziewoński
65b11b8fee Use PHP 7 '??' operator instead of '?:' (round 2)
A few issues have snuck in since I33b421c8cb11cdd4ce896488c9ff5313f03a38cf.

Change-Id: Ib75470a7a3c19e2d48f498b396eee6ed733690e4
2018-09-03 20:48:10 +02:00
jenkins-bot
b79bc0a274 Merge "OOUIfy CheckMatrix in PHP and JS" 2018-08-22 20:09:12 +00:00
Moriel Schottlender
5a430cdc1c OOUIfy CheckMatrix in PHP and JS
This is to make sure that the design is similar, but also so
that the widget can be read in JS where needed and that we
can toggle the disabled state on/off through the whole widget,
that is made from a series of checkbox widgets.

Bug: T199946
Change-Id: I9943b0aa1746fdfb60c7d4c88d6d4d7ac0589a2c
2018-08-22 21:31:27 +02:00
jenkins-bot
5cd37c7a64 Merge "Resolve deprecation warnings in iw search widget" 2018-08-21 00:36:55 +00:00
Erik Bernhardson
f9e4244845 Resolve deprecation warnings in iw search widget
The old iteration api has been deprecated, but looks like this
call wasn't caught in the patch that introduced it.

Change-Id: I435bacdb185e09127606217982ca70a1bec60301
2018-08-20 14:58:26 -07:00
Umherirrender
40d3ce8d17 Reduce calls to MediaWikiServices::getInstance()
In some functions MediaWikiServices::getInstance() was called twices or
in loops. Extract the variable to reduce calls.

Change-Id: I2705db11d7a9ea73efb9b5a5c40747ab0b3ea36f
2018-08-18 06:02:39 +02:00
Aryeh Gregor
90d4f56fe4 Mass conversion of $wgContLang to service
Brought to you by vim macros.

Bug: T200246
Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
2018-08-11 22:44:29 -06:00
Tim Eulitz
e314d4025f Add wrapper to search form widget
This wrapper element will be used to prevent the search page from
jumping after AdvancedSearch has finished loading.

Bug: T199226
Change-Id: I8d9d68862c57f7de82ea050bf847d6bcdacdd47a
2018-08-09 14:49:57 +02:00
Prateek Saxena
820a18762f SelectWithInput: Add 'disabled' property on main widget
…also HTMLSelectAndOtherField and HTMLSelectOrOtherField now
pass the 'disabled' field when creating the input widget.

The OOUI versions of these HTMLFormFields would get enabled
right after infusion even they were disabled in PHP. This
makes sure that they remain disabled.

Change-Id: Iddd8ad81731dba7bdcb599d6fe104cb259b11733
2018-07-25 12:02:50 +05:30
David Causse
46c17ddb1f Deprecate usage of SearchEngine:transformSearchTerm
This method was introduced in 4115586000
to support the prefix URI param introduced by the InputBox extension.
There are no reasons that this logic is exposed to SearchEngine users
and should be handled internally by SearchEngine implementations
that supports it.
Previously the search query was updated, now the prefix param will passed
along using SpecialSearch::$extraParams.

Bug: T198318
Change-Id: I33518d3f3ddee741ff4f3b47eb4928009bea66d1
Depends-On: I67c7f1886dd6a2d07c12015e2711c138e9f140e9
2018-07-17 14:41:08 -07:00
Jack Phoenix
358b2d1d77 Pass $opts by reference to subscribers of 'SpecialSearchPowerBox' hook to allow them to modify it
wikiHow added a new hook called 'SpecialSearchPowerBoxOpts', which was passed only &$opts, so that the Finner extension can unset the $opts array. Enhancing the pre-existing hook is a better solution in this case.

Change-Id: I091cbdc78fc779144554d8420a95435b7048c407
2018-07-14 22:42:41 +00:00
Volker E
e9d7882e92 UsersMultiselectWidget: Reduce default non-JS rows to 10
Reducing non-JS textarea `rows` attribute value to a more sane
default of `10`.

Bug: T194525
Change-Id: I6457ff354023a68d3e878e62161912dea4ff3d70
2018-07-09 19:35:39 +02:00
Erik Bernhardson
c2a308075f Convert SearchResultSet to typical iteration
The funky iteration here was at best annoying. Switch
it over to an iterator based approach with appropriate
BC code to simulate the old iteration style.

Depends-On: I19a8d6621a130811871dec9335038797627d9448
Change-Id: I9fccda15dd58a0dc35771d3b5cd7a6e8b02514a0
2018-06-11 13:35:41 -07:00
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
Kunal Mehta
e0193327bd Fix MediaWiki.Commenting.LicenseComment.InvalidLicenseTag errors
Change-Id: I936c3f5fca1a0061f215e80469f5d882cb32ee29
2018-05-23 16:23:42 -07:00
David Barratt
3481e3b2e0
Create Expiry Widget with Date Time Selector
Special:Block needs a date time selector for easier selection of expiry. To
accommodate this cleanly, a new Expiry Widget is created that handles this
logic.

Bug: T132220
Change-Id: I2853a2ca0ae6ccead3978f4bb50a77c2baa3a150
2018-04-19 20:24:08 -04:00
Prateek Saxena
11c9616e38 mw.widgets: Add SizeFilterWidget and its PHP implementation
Bug: T183765
Change-Id: Ieb551e901405749489059366de9af6316f369cc0
2018-03-01 17:38:37 +00:00
Kunal Mehta
0535765366 widget: Fix changes of copyright year
Fixes up e8b10f6804.

Change-Id: I474e508a2bd4d783272eda87c1cc91f5597bc1b1
2018-01-24 12:07:34 -08:00
jenkins-bot
2b6f3f0adc Merge "Simplify documentation headers of includes/widgets/…Widget.php files" 2018-01-24 19:14:56 +00:00
jenkins-bot
35b9d17334 Merge "Deprecate old interwiki search result widget" 2018-01-11 13:35:36 +00:00
Erik Bernhardson
d95f644e80 Deprecate old interwiki search result widget
Update the flag for new interwiki sidebar from unset means disabled
to unset means enabled. Deprecate the old rendering widgets to be
removed at a later date per deprecation policy.

Change-Id: I80d8375bbd3e1fabc9b2432b6875d17a96aee099
Related: I9a488438
2018-01-10 12:46:42 -08:00
Thiemo Mättig
e8b10f6804 Simplify documentation headers of includes/widgets/…Widget.php files
Most notably: The documentation header repeats the file name. This
appears to be fully automatically generated, but does not add helpful
information.

Change-Id: I9edf15dd25ef6cc52fe931fffde69f0bd9042474
2018-01-10 13:44:05 +01:00
Umherirrender
23ef520a1c Improve some parameter docs
Change-Id: I31e983d7ac287158101b18ad95779d83537302a2
2018-01-07 11:39:08 +01:00
Bartosz Dziewoński
a0d6118af7 Put menus/popups of infused PHP widgets into the default overlay
With some special tweaks:
* Remove weird custom overlay handling in DateInputWidget that nobody
  actually used. I think if you need something special like that, you
  can just write two lines of JS code to attach the dropdown elsewhere.
* Also handle the CapsuleMultiselectWidget produced by HTMLForm's
  'multiselect' field in the same way.

Bug: T183069
Change-Id: I693f406194aeb826a3ab5bc78c97015b0b8a7fdb
2018-01-02 23:40:02 +01:00
Umherirrender
255d76f2a1 build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
Clean up use of @codingStandardsIgnore
- @codingStandardsIgnoreFile -> phpcs:ignoreFile
- @codingStandardsIgnoreLine -> phpcs:ignore
- @codingStandardsIgnoreStart -> phpcs:disable
- @codingStandardsIgnoreEnd -> phpcs:enable

For phpcs:disable always the necessary sniffs are provided.
Some start/end pairs are changed to line ignore

Change-Id: I92ef235849bcc349c69e53504e664a155dd162c8
2018-01-01 14:10:16 +01:00
Thiemo Mättig
544122a6c2 Remove self-explaining "section heading" comments from classes
I can see that "parent::__construct" literally calls the parent
constructor. I can see that stuff preceeded by the keyword "protected"
is protected. I really (really) don't need comments explaining such.

Change-Id: I7458e714976a6acd3ba6a7c93fdc27d03903df83
2017-12-28 16:12:08 +01:00
ryan10145
19c45cdb16 Changed Instances of rawParams() to plaintextParams()
Bug: T182213
Change-Id: Ibf24dee5ea19092e8a38e57f34c98f513d4c9b21
2017-12-07 20:20:40 +00:00
Stanislav Malyshev
eca3ab26d9 Fix wrong variable in ShowSearchHit call.
The code uses $size, which does not exist and never used otherwise.
The actual size HTML is stored in $desc.

Change-Id: Ida5e69c81acea6bdec75810cf7b192f9dc7cf327
2017-11-07 16:33:38 -08:00
Max Semenik
2eb312bcba NamespaceInputWidget: Fix type documentation
Change-Id: Ifc8e8be7bb7423d581f62427a4e48d70d73c714b
2017-11-04 22:48:53 +00:00
jenkins-bot
5120937028 Merge "Add attributes parameter to ShowSearchHitTitle" 2017-11-02 05:40:05 +00:00
Stanislav Malyshev
0e93f96c9a Add attributes parameter to ShowSearchHitTitle
This would allow extensions to define custom attributes on title link,
such as put information in "title", change attributes depending on
specific search hit, etc.

Now Wikidata does the same by overriding LinkBegin, but this applies
to all links, not specifically to search result link.

Since ShowSearchHitTitle is always used with the link, I think it makes
sense to enable this specific customization.

Change-Id: I19f64e0909d92e32ddf6271f74c014e8b65d5014
2017-10-23 15:42:41 -07:00
Paladox
d97455ca21 build: Updating mediawiki/mediawiki-codesniffer to 14.1.0
And moved phpcs.xml to .phpcs.xml (T177256).

Change-Id: Idaa1fe006a528c25ce34abd0a857c657c26e8b0f
2017-10-21 03:12:55 +00:00
James D. Forrester
fb4e63ba3f Update OOjs UI to v0.23.5
Release notes:
 https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.23.5

Also, replace uses of `OOUI\TextInputWidget( [ 'multiline' => true ] )`
with `OOUI\MultilineTextInputWidget()` to avoid deprecation warnings
(which cause unit tests to fail).

Depends-on: I990b14982ffb72fe981040d02c7023d13f721aaa
Change-Id: If8312c60e1547a6177f5491011badb6576f54b21
2017-10-12 14:45:39 -07:00
Ed Sanders
348d16867f Remove setting of SearchInputWidget configs to already-default values
Change-Id: I2710051386ba826895db9d9c675263847625e17f
2017-10-08 19:55:14 +01:00
James D. Forrester
8212363b18 SearchInputWidget: Don't show images
But we should also have a different class name for this, as this isn't
upstream's SearchInputWidget.

Bug: T177659
Change-Id: Ie62e8678e89b2403d769694adb23fe21a047019c
2017-10-06 13:01:14 -07:00