Commit graph

57 commits

Author SHA1 Message Date
Jan Drewniak
48e15a4af5 adding data-attribute to sister-search sidebar results.
Adding source identifier (iwprefix) data-attribute
to interwiki search sidebar results.

Change-Id: I9e11a368fe4f5d79d81503fb4db1cc1649723839
2017-06-16 21:04:01 +02:00
Thiemo Mättig
e16191caa3 Remove unused and unnecessary imports
Change-Id: I26e623a4e4ba965c07670369a90c8a95185ea1e4
2017-06-12 15:50:43 +00:00
David Causse
9f24c73773 Properly check that the port key is present
Bug: T167301
Change-Id: I009c3d8e5805ddd2b75640ba582a648663c72b47
2017-06-07 18:46:42 +02:00
David Causse
6ffa1e302e Add 'show-multimedia-search-results' to SearchEngine feature data
Let the search engine controls if multimedia results have to be shown
in the new interwiki sidebar.

Bug: T164925
Change-Id: Ie3ccb28bf73110b136475e9527a2653bf06b8e45
2017-05-11 09:45:04 +02:00
Jan Drewniak
a0f492fffc Revised styling of sister-search sidebar.
Various improvements to the sister-search sidebar:

- using WM project favicons
- scoping CSS specific to sister-search sidebar
- making sister-search items more compact

Bug: T160724, T158938
Change-Id: I2794121ab83cbd4e2b8868150e4d61db376fa63b
2017-05-08 23:00:36 +02:00
Paladox
54c56da85a Fix php code style
Preparation change for updating mediawiki code sniffer to 0.8.0

Change-Id: Ib0b3fe4afea9096ffa3a1347b4f7e07d3398b0b2
2017-05-05 12:03:54 +00:00
Prateek Saxena
a6b31205ac mw.widgets: Add SelectWithInputWidget and its PHP implementation
Bug: T106999
Change-Id: Ic158bec3c463fba5099b05f41c9686f833e1c313
2017-04-24 10:19:55 +02:00
Mikhail Popov
489f7e0b54 Hold number of search results in a data attribute
Current way of counting returned search results (e.g. for
Event Logging) relies on counting the appropriate elements
in the search results page's DOM, up to the limit the user
requested (e.g. 20 by default). This allows us to record
the total number and the offset, useful for event logging.
For example, if we wanted to know whether the user viewed
2nd or 3rd set of search results.

Change-Id: Ic8601e9eeddac84ba8e0d7dc6f127bf360b6f90f
2017-04-19 11:29:45 -07:00
Fomafix
7a3418ae33 Use consistent spaces at start and end of comments
Change-Id: Idbb09b69aa1ef4e46433319aaea62f34f0dbc038
2017-03-30 22:06:40 +02:00
Bartosz Dziewoński
e218f21d44 mw.widgets.SearchInputWidget: Do not pass type: 'search' to TextInputWidget
Causes deprecation warnings.

Most of this code is copy-pasted from OO.ui.SearchInputWidget.

Bug: T148471
Change-Id: I81d52ba938a8b90c5d2c173f1f2682d9e3300e43
2017-03-14 21:44:42 +00:00
Jan Drewniak
dfac17c488 Minor fixes for second sister search AB test
These are a few minor fixes to improved the
UX of the new sister search sidebar.

- Making the link color on sister search results blue
- Fixing the order of the multimedia search results widget
- added a more explicit 'more results' message instead
of the current '(more)' message.
- aligning the top of the sidebar with the top of the regular
search results.
- fixing a typo in the multimedia widget.

Bug: T158935
Change-Id: Iaae603cc217b7847bebfa61b050b7c86bdd19f14
2017-03-14 12:26:28 +01:00
Eddie Greiner-Petter
d6709386bf Remove redundant input from search form
A hidden input 'profile' gets added within the search form widget no
matter what profile is loaded at the moment.  This is done in
shortDialogHtml along with a few other hidden fields. The same hidden
field is added a second time in optionsHtml if the profile 'advanced' is
run. Remove this redundance.

Bug: T158869
Change-Id: I3be598702dbe9fa2cfe0fdd6c23fe6d88477626d
2017-03-04 01:41:19 +01:00
Bartosz Dziewoński
6f2177e00e SearchFormWidget: Move hidden fields below the ActionFieldLayout
I think ideally, these would be at the end of the form, but there
are some hooks below which can produce arbitrary HTML and potentially
want to override these with their own fields, so I'm avoiding any
revolutionary changes to the field order here.

Bug: T158856
Change-Id: I377c0061a365930e11454a86c1e0926853789b55
2017-02-23 18:02:29 +01:00
Aaron Schulz
58ecdd060c Fix assortment of IDEA warnings
Change-Id: I3fb482232483f37bf73ebbeb405056794109e618
2017-02-11 18:12:42 -08:00
Erik Bernhardson
713de3808f The correct method is parse, not parsed
A recent patch updated these two calls to use Message::parsed(),
but it should have used the Message::parse() message.

Change-Id: I5aba40576b89f21d2b1416ca0db0d28d2a088c39
2017-02-06 14:22:07 -08:00
Erik Bernhardson
20f251618f Switch search-interwiki-caption i18n to parsed
A recent refactor of the interwiki sidebar looks to have a small
regression, in that this message used to use ->parsed() but now
uses ->escaped(). Switch back so the interiwki results on beta
render appropriately.

Bug: T149806
Change-Id: I44d0b1cd3bcc0606a0fb14e171d51bec1c310a91
2017-02-06 13:58:48 -08:00
Pmlineditor
83b4077eb3 Allow wikilinks in "Powersearch-ns"
Changed use of escaped() to parse() to allow wikilinks in
MediaWiki:Powersearch-ns. Use case is provided in T157204.

Bug: T157204
Change-Id: Ic2eb28aaf735c31b50f3365176966e2e48091e54
2017-02-06 03:27:35 +05:30
jenkins-bot
ec84fa3d7d Merge "Displaying interwiki results in sidebar" 2017-02-03 19:04:54 +00:00
Jan Drewniak
d78a470fcd Displaying interwiki results in sidebar
Displays newly designed interwiki search results in the
sidebar of the specialSearch page.

A prototype of this change can be viewed on this labs url:

http://sistersearch.wmflabs.org/w/index.php?title=Special:Search&search=mars

Bug: T149806

Change-Id: I66e4b6a502dae488d105f11cad73e145990c2327
2017-02-03 18:18:20 +01:00
jenkins-bot
fb52b78920 Merge "UsersMultiselect widget and form field." 2017-02-01 14:37:50 +00:00
Phantom42
c70f464c07 UsersMultiselect widget and form field.
New widget and html form field, which allows selecting multiple
users using convenient single-line input (CapsuleMultiselectWidget)

Bug: T131492
Change-Id: I7b6ffe7fb47e0a7083e2a956156ab0f142444398
2017-02-01 00:35:33 +02:00
Geoffrey Mon
9ce66e5b67 Option for DateInputWidget to display full month and day names
Add a "longDisplayFormat" config option to DateInputWidget to show
full month and day names when using the default locale-specific
display format.

Bug: T120733
Change-Id: I2db6892720abf86dfc9655291b1070aa7f7bf77b
2017-01-31 14:20:02 +00:00
Thiemo Mättig
fa6ade7262 Update docs/hooks.txt for ShowSearchHitTitle
Reasons:
* $text is vague. It's the label of the link. There is a function named
  getTitleSnippet, which is what I'm reusing for the variable name.
* $page is vague. It's not the page of the search result, but the search
  special page.
* $queryString is not a string but an array of strings.

I also updated https://www.mediawiki.org/wiki/Manual:Hooks/ShowSearchHitTitle
accordingly.

Change-Id: Ia18dbf5ccf7f9fcc8890ad01641d0b7ff3e6eee8
2017-01-20 10:40:28 +01:00
Chad Horohoe
256a5cf1c4 Unbreak extensions from ShowSearchHitTitle signature change
Fixes If78cb0c29ae394f16e465c15a8e8246c1b56dcea

Change-Id: Ia56f2eb4a5ed98f727f924666322e1c97b3ee183
2017-01-18 14:05:46 -08:00
Erik Bernhardson
c43655edc9 Extract 'did you mean' widget out of SpecialSearch
Bug: T150390
Change-Id: I41d767550ab4112fcd9cc4094b27a14c7d29169b
2017-01-17 15:58:00 -08:00
Erik Bernhardson
a0936780bb Extract main search result rendering from SpecialSearch
Has a pre-existing problem related to the link offset of secondary
inline results. Specifically the offset of secondary inline starts
at the provided offset, even though there may be primary results
displayed above it.

Bug: T150390
Change-Id: Id1d6b357f45a2cf615d9412cc95dd597c724e8b6
2017-01-17 15:57:40 -08:00
Erik Bernhardson
d400f7a668 Extract search form from SpecialSearch into widget
Bug: T150390
Change-Id: Ibda84349e1f552641805d6236605c8718540817f
2017-01-17 15:12:22 -08:00
Erik Bernhardson
6e155624fa Pull rendering of single result out of SpecialSearch
First step in refactoring the search results page. Pulls out widgets
to render our two styles of search result, Full and Simple.

Bug: T150390
Change-Id: If78cb0c29ae394f16e465c15a8e8246c1b56dcea
2017-01-04 13:33:19 -08:00
Geoffrey Mon
fbc80326a6 Add PHP DateInputWidget
Bug: T120733
Change-Id: I8f80e27304a916bba16ed255c8e78073f9da3813
2016-11-01 17:37:52 -04:00
Brad Jorsch
12bdc84219 HTMLForm: Add HTMLDateTimeField
And to do that, an OOUI PHP widget for
mw.widgets.datetime.DateTimeInputWidget too.

Bug: T146340
Change-Id: Iaa8b5892b6c3a1f3698cef59684cc3cdc9d483ea
2016-09-26 12:08:56 -04:00
Bartosz Dziewoński
7c987a0235 Don't magically make MediaWiki\Widget classes infusable
For consistency with how normal OOjs UI widgets behave.
Only one usage outside of HTMLForm needed updating. There
are no usages in extensions in Gerrit.

Change-Id: I9b5de86307a13ca7355b7541e8683e4d6a10431f
2016-07-26 13:56:47 +02:00
James D. Forrester
9c83f632ef SearchInputWidget: Use isset on dataLocation in case it isn't
Change-Id: I88f4d1624ee0e1f64d8f591dd8936e875211c53d
2016-07-01 12:34:51 +01:00
Kunal Mehta
63b562b3f5 Fix file permissions on SearchInputWidget.php
Change-Id: I0c7b149a0c62f02b655e53c255ba01a92fc6c4a8
2016-06-09 16:11:29 -07:00
Florian
36784f7c35 Search: Change dataLocation default value and add docs
Implemented Krinkle's comments of the followed up commit.

Follow up I2480149

Change-Id: I8e51c0d3a3ca1690ea3ea08469a1cd52d9c151f3
2016-05-06 12:18:19 +00:00
Florian
e429497501 Convert Special:Search input to OOUI
Bug: T100898
Change-Id: I24801495dfad71f457bc4afdd28474f74b219024
2016-03-22 18:38:52 +01:00
Florian
18c6615d01 MediaWiki Widgets: Add new SearchInputWidget
SearchInputWidget is similar to a TitleInputWidget, but doesn't has
a visible loading indication, doesn't highlight the first result and
uses the opensearch api endpoint for suggestions, instead of
prefixsearch.

Extra points:
 * Improve documentation of mw.widgets.TitleInputWidget's configuration
   option validateTitle

Bug: T118443
Change-Id: I8b8098041fe2971389fa908d007d2e77255829ec
2016-03-03 16:29:40 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Florian
afd67e7bfc Fix conflicting configuration name in TitleInputWidget
config.validate is already given and used in OO.ui.TextInputWidget to
define a string/regex/method where a query is checked against. TitleInputWidget
would override it with a config option to enable/disable this check.

The config option "validate" uses the "validateTitle" name, now. There was
no usage so far.

Follow up: I732a2f56a2375d8c708e3b295996187ee209f1a6

Bug: T119075
Change-Id: Ibb47b20506d21213fc9681b6aa919ce45505e474
2015-11-19 22:29:34 +01:00
Florian
ad1c51d0e2 Allow a TitleInputWidget user to decide, if an empty value should be validated
For some use cases an empty value is valid, too, or at least, it's not a reason to
mark the form input red. Special:Search, e.g.. This change implements a new config
for MediaWiki\Widgets\TitleInputWidget, validate, which allows a user of this
widget to decide, if the value of the input type should be validated (empty -> flagged
red).

Extra points:
 * Fix php notice errors for previously added configuration
 * Added doc for previously added configuration

Bug: T106946
Change-Id: I732a2f56a2375d8c708e3b295996187ee209f1a6
2015-11-16 19:28:41 +01:00
Florian
924080c0f9 Make TitleInputWidget configurable, if term should be highlighted or not
Depends on: I36502da43c383373

Bug: T106273
Change-Id: I393eef9cd20bdf80e4db72891f23de08bcdfd376
2015-11-10 22:51:43 +01:00
Timo Tijhof
c23713741c build: Use my gmail address for attribution
Per the .mailmap file, my gmail address is the canonical address
for this purpose.

Change-Id: I85de941ef5f8cf9a80cc35647500c5baaa594ac3
2015-10-20 02:43:29 +01:00
Amir E. Aharoni
870dbf0659 Make lines short to pass phpcs in six files under includes/
Bug: T102614
Change-Id: I91a2d4f4bf86a22c8bb466da0e2f95ea27c571a3
2015-09-26 18:41:01 +00:00
Bartosz Dziewoński
5befb9b747 SpecialMovepage: Convert form to use OOUI controls
Recreated the form with OOUI widgets. This required putting together
ComplexTitleInputWidget to handle the split namespace+title field on
this page.

Bug: T86865
Change-Id: Ice69df851137e3454ae2c9f4c75494b18cf8a75a
2015-09-01 21:03:38 +02:00
Bartosz Dziewoński
6b79105034 TitleInputWidget: Add 'maxLength' of 255 and use $.byteLimit
Integrate $.byteLimit functionality into OOjs UI's value preprocessing
(#cleanUpValue), rather than just calling in on #$input, to avoid
validity state flashing back and forth when the value is limitted.

Bug: T106454
Change-Id: I3d24e4bf7427c9bd922ff2e24edc9583ee0aaecb
2015-08-20 17:25:18 +02:00
Bartosz Dziewoński
21d07c4e9c TitleInputWidget, UserInputWidget: Allow overriding 'infusable'
Needed for Ice69df851137e3454ae2c9f4c75494b18cf8a75a.

Change-Id: I34048dbd90dffa0409132946fb2864452ab93827
2015-08-20 15:11:34 +00:00
Bartosz Dziewoński
fab41453cc TitleInputWidget: Allow suppressing search suggestions
Needed for Ice69df851137e3454ae2c9f4c75494b18cf8a75a.

Change-Id: Ibc7846bb08abdd1ebf271dfce526dd935f38e111
2015-08-20 15:11:22 +00:00
Bartosz Dziewoński
b6046dff66 Refactor NamespaceInputWidget
* Refactor NamespaceInputWidget into two widgets: NamespaceInputWidget
  and ComplexNamespaceInputWidget. The former is now only the dropdown
  (and inherits from DropdownInputWidget), the latter is the dropdown
  plus two checkboxes.
* Change ComplexNamespaceInputWidget configuration to take nested config
  for `invert`, `associated`, and `namespace`, rather than require
  parameters like `invertName` and so on for every combination.
* Implement standalone JavaScript versions of both widgets (previously
  mw.widgets.NamespaceInputWidget could only be created via infusion
  of the PHP widget).

Bug: T99256
Bug: T106138
Bug: T109559
Change-Id: Ie2fee6d035339ceb934fca991675480db3d630d1
2015-08-20 15:10:51 +00:00
Ricordisamoa
df9ebe6f99 Fix some space-related phpcs warnings in includes/
Change-Id: I7cf7206696a5e77bc02e3630d1d88d4c176ea844
2015-08-15 08:56:03 +00:00
Bartosz Dziewoński
f0f90ef4d0 widgets: Code quality and cleanup pass
Fixing typos, enforcing coding conventions from OOUI,
renaming parameters, formatting code.

Change-Id: I92dc28c8ac3d6c00e40ad48d76730deb29edefec
2015-07-22 02:06:12 +02:00
Florian
c226b13545 Implement UserInputWidget in OOUI/MW Widgets
To use OOUI for forms with user name autocomplete, the new widget
UserInputWidget interacts like the jQuery pendant (working with css
class "mw-autocomplete-user").

It is also available in HTMLForm as "user".

Example usage: Iaeff912e6437d6ebef0d5b1919ce8cf53a7fd5f1

Change-Id: I9501c85f4288c255bbe3a5284e99b57b6169916f
2015-07-20 06:11:16 +02:00