Commit graph

15 commits

Author SHA1 Message Date
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
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
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
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
Bartosz Dziewoński
ecc073bb89 TitleInputWidget: Correct links when 'relative' option used
Previously, the links in the suggestions dropdown also pointed to
the relative version, e.g. "/wiki/Foo" instead of "/wiki/Template:Foo".

This also corrects missing dependency for mediawiki.util, which
is no longer used directly (although mediawiki.Title depends on it,
so the code worked correctly in spite of missing dependency).

Follow-up to ddca1c657e.

Change-Id: I8f9293636c597cd617e68b4c238d7424915cf351
2015-07-16 19:09:53 +00:00
jenkins-bot
6f8a05822e Merge "TitleInputWidget: Correct CSS class name in PHP code to match JS code" 2015-07-15 04:08:05 +00:00
Bartosz Dziewoński
f648ab4039 TitleInputWidget: Correct CSS class name in PHP code to match JS code
Change-Id: If05c5fbc052310b0b663da6ff283d821ed00ea73
2015-07-14 22:27:47 +02:00
Kunal Mehta
47d36ab999 TitleInputWidget: Override getJavaScriptClassName and remove infuse hack
Necessary after 2be338cc99a9e in OOUI.

Change-Id: I402636297b510ed93ed3d38f11b302448c6fd24a
2015-07-09 14:50:18 -07:00
Kunal Mehta
ddca1c657e TitleInputWidget: Add 'relative' option
Currently the JavaScript widget will return a value that is relative to
the namespace, so for "Category:Foo", it will return "Foo". This is
problematic for server-side forms that want a full title returned, so
make this configurable.

Change-Id: I605df2ca41831cae1c8f0a3331600d4487e7798f
2015-07-05 23:40:18 -07:00
Roan Kattouw
85e7751452 Add a PHP implementation of TitleInputWidget
From the PHP side it's really just an infusable TextInputWidget.

Change-Id: I607339c2e967e502f85164c9b1ea79dc0a17c9cc
2015-06-30 00:03:27 +00:00