Commit graph

249 commits

Author SHA1 Message Date
James D. Forrester 65112a7e10 Show different icons for different result types
* Disambiguation
* Redirect
* Not found
* Page exists

Bug: T93694
Change-Id: Ic4a60c95e37de372e8d0c12878dece67a2662343
2015-04-29 17:51:34 +01:00
Ed Sanders 702fc724d7 Follow redirects in the link inspector API
Show redirect targets first, then any redirects to it
immediately after.

Change-Id: Ifde579410b4fbf42e0598e4b069963162333da55
2015-04-29 11:53:40 +01:00
Ed Sanders df6a570f82 Only pull description from wikibase
Filters out 'alias' and other terms not being used yet.

Change-Id: I5d155c76b85de1e5d1d5fb234f565fd6f1658766
2015-04-29 11:17:24 +01:00
Ed Sanders 377f6e4eea Separate inputting of internal and external links
* If the user switches to external links, clear the input
* If the user types something with a protocol, automatically switch
  them to external links. If they manually switch back to internal,
  remember that and don't auto switch them again.
* If the user inputs something without a protocol into the external
  link box, prepend 'http://'

Bug: T93699
Bug: T93700
Change-Id: Ia0e3a04f34077e7bd56254112dafd86ad865cbe2
2015-04-29 11:17:24 +01:00
suchetag 00745cda87 Replacing current order of link suggestions
Replace current, sectioned, order of link inspector suggestions
(existing, redirect, disambig) with order from API.

Reduce number of matches to 5, and show new page suggestion last.

Bug: T93698
Change-Id: Ida887d889730d7749041942636d24e181c335697
2015-04-29 11:17:11 +01:00
jenkins-bot d8c0f9e8b3 Merge "Link inspector images and descriptions" 2015-04-27 23:51:38 +00:00
suchetag 3963b1daf2 Link inspector images and descriptions
Fetches images from PageImages extension and descriptions
from Wikibase.

Bug: T93693
Bug: T93694 (partial)
Change-Id: I1bea6b7b57ab951e79468cfa00e9eecddc113d18
2015-04-28 00:23:40 +01:00
jenkins-bot 1b4fecb61b Merge "Keep the parameter list expanded after it was expanded once" 2015-04-24 16:52:29 +00:00
Moriel Schottlender 3a7b99f6a6 Keep the parameter list expanded after it was expanded once
In the template dialog, keep the parameter search widget expanded
with all parameters showing if it was already expanded once.

Also keep the parameter list available after inserting each parameter
instead of asking the user to click the add details repeatedly.

Bug: T95696
Change-Id: I14a47dbea5c69532238e7e67290e613121fdc40e
2015-04-24 17:45:04 +01:00
Ed Sanders d7ac742fbe Fix old dates
Change-Id: Ib98878221eb26c6582c304247122fa420bccb029
2015-04-23 16:01:33 +01:00
jenkins-bot 3375b2fcb9 Merge "Rearrange images when the media search window resizes" 2015-04-22 01:14:18 +00:00
Moriel Schottlender 1d1079e7fc Rearrange images when the media search window resizes
This is a quickfix to make the masonry fit recalculate itself after
the window is resized. It is most significant for orientation changes
in mobile devices, as those lead to a resizing of the window and a
complete reorganization of the masonry fit rows.

Bug: T95017
Change-Id: Ibf3c74ea21d42f4a159d0b855be5672c8455639f
2015-04-21 17:57:17 -07:00
jenkins-bot cd0cc27720 Merge "Show template description in the template search" 2015-04-17 09:28:23 +00:00
Moriel Schottlender a669a4fc52 Show template description in the template search
For each template result, ask for the templatedata description. If
that description exists, show it under the template result.

Bug: T53436
Change-Id: If28d1eb082edca6f50c6c15c933a0b7d014eaeaf
2015-04-16 12:30:55 -07:00
Moriel Schottlender 1ab496d65a Use the preview widget in context items
Use the newly created preview widget to render consistent previews
of references in the context items and search widget.

Depends on ve-core fix Ia7e96e048e4b

Bug: T93042
Change-Id: I3a7f6402018924a18efbb49ba61a16787c41f1f4
2015-04-16 01:47:16 +00:00
Roan Kattouw 95bffa22a0 Stop using this.$
Has been a backwards-compatibility alias since OOjs UI 0.7.0.

Change-Id: I17d7c03e9d1b9fa991d88444d22abfd403269ee0
2015-04-14 02:54:01 +01:00
Moriel Schottlender de4a1d7012 Set default size to category popup widgets
Don't rely on this.$element.width()/height() when showing the
category widget popups - instead use the default sizing. If one
thing goes wrong and the popup is clipped, all subsequent popups will
have a smaller and wrong sizing.

Change-Id: I38ac0ae97dd5d7c38cdcdcfb31f736b19837bd5a
2015-04-02 16:50:25 -07:00
jenkins-bot ef304b3755 Merge "Fix choose event listeners" 2015-03-30 21:41:40 +00:00
Trevor Parscal a3c2ed7d27 Don't position category popups -10px up
Bug: T94114
Change-Id: I05ddbeb42b49dab925fe9b46caf12c6201e68441
2015-03-27 12:14:09 -07:00
Ed Sanders 0a2fa11a4e Fix choose event listeners
* Choose can't emit with null
* Connect search straight to results' choose event.

Change-Id: I434829511ea70859d14e26f39095e0d094dea6c0
2015-03-27 10:51:06 +00:00
jenkins-bot 557e0e28ad Remove use of ve.indexOf and ve.getObjectKeys
Change-Id: Icbaa729209605fca8018e4bcbbe29c9ded64e7f2
2015-03-10 17:28:00 +01:00
Bartosz Dziewoński 4c22083d07 ve.ui.MWLinkTargetInputWidget: Fix documentation
This function was not returning a jqXHR for a long time. It's usually
a mw.Api promise, but might be something else.

Change-Id: I59975cc9dfbea70e5ae666fcc9915f10bd199e4d
2015-03-06 11:14:34 +00:00
jenkins-bot 1a40f3c048 Merge "Add a threshold to 'read more' calculation in media dialog info" 2015-03-04 19:15:01 +00:00
Moriel Schottlender 06f29f343a Add a threshold to 'read more' calculation in media dialog info
When calculating whether to show the 'read more' button on fields
that are configured 'descriptions', use a threshold to check if
the height is enough to be shown.

Bug: T87265
Change-Id: I0601e4fa92cb58903641a146500cf560bc029425
2015-03-04 11:04:53 -08:00
Alex Monk 9246fcd2ff MWCategoryWidget: Remove entries from this.categories when appropriate
So for example MWCategoryWidget#getCategories doesn't return stuff that was removed.

Bug: T89923
Change-Id: Id99ea2e3b7c74e186bacbcf796b6df3a131a37b1
2015-02-27 22:05:58 +00:00
Moriel Schottlender f0f8f52080 Refactor MWMediaResultWidget to resize better
For the masonry view, the result widget resizes itself according to
the rows and other images in the row. Up until now the resize was
a bit buggy, occasionally missing height/width values. This is
mostly due to rounding errors, but also due to a small double
calculation that is now fixed with this code.

Change-Id: If18adc5280e4bdbb9174b7c7e6e4eadf3c1ab26d
2015-02-26 16:42:14 -08:00
Alex Monk 8e48f94580 Use mw.Api to run requests rather than our own stuff in ve.init.mw.Target
Bug: T58659
Bug: T89435
Change-Id: I18162f04c50f48606378aed62ee99fccdc3159f6
2015-02-25 01:57:22 +00:00
jenkins-bot bd4289241a Merge "Adjust Queue and Provider to work with generalized parents" 2015-02-24 18:42:40 +00:00
Moriel Schottlender 093cf012ea Adjust Queue and Provider to work with generalized parents
Generalize MWResourceQueue and MWResourceProvider so they are
extending the general classes from ve-core. This also allows for
tests in ve-core on the resource queue system.

* Depends on ve-core change I5346081317e *

Change-Id: If34cd99334f4ccb93015c3646f68ae3040b9c5d7
2015-02-17 17:22:21 -08:00
Moriel Schottlender 07034a7774 Normalize external links from the API
In beta labs some local files displayed their links without http://
make sure they all are normalized to have the prefix.

Change-Id: Ia19de9b31e234138603495f06750d202654a8788
2015-02-17 11:05:48 -08:00
Moriel Schottlender d1ff9e125e Make sure category widget methods call parent class methods
Mouseover and click events in the category widget should also call
their parent method.

Depends on the ooui change Ie576f4422

Change-Id: I73b574b28a5a60e4f046f3008407dbf4b1323b58
2015-02-13 18:29:20 +00:00
jenkins-bot ac9f81cd2c Merge "Refactor MWMediaSearchWidget to use a queue and providers" 2015-02-07 01:15:38 +00:00
Moriel Schottlender aa9eb95455 Refactor MWMediaSearchWidget to use a queue and providers
Change the media search widget to work with resource queues and
providers. Create providers based on the user's filerepo settings
and aggregate their responses with the media queue. Stop asking
for more results from providers that are depleted.

Also fixes a rather nasty infinite-loop bug where the API returns
only very few images, and the UI keeps asking for more.

Bug: T78161
Bug: T88764
Change-Id: I65aed3446cd1f056476c56e6e04522c70e49e595
2015-02-06 16:45:56 -08:00
Bartosz Dziewoński a3becc245a ve.ui.MWTocWidget: Rename .toggle property
It conflicts with the #toggle method. This happened to work because we
never called .toggle() here, but 8a53b2cd introduced such a call.

Follow-up to 8a53b2cd.

Bug: T88831
Change-Id: I4dd955d015d2bda50e4146b0ae2ddff557dcd346
2015-02-06 22:39:05 +01:00
jenkins-bot d3206394da Merge "Use css class instead of jquery show/hide" 2015-02-06 19:08:01 +00:00
Moriel Schottlender 8a53b2cd07 Use css class instead of jquery show/hide
Replace instances of .show() and .hide() with ooui 'hidden' class
to make performance better.

Related ooui change: Ibf7c99aa4aad

Bug: T87420
Bug: T88736
Change-Id: I3af8a322e88b7ba3364f350819d6dbcdc8b13270
2015-02-06 11:03:59 -08:00
Alex Monk 4082af335b Make category widget items draggable
Depends on I859ff276

Bug: 50809
Change-Id: Idae3e293a6f7c29b70bc27c3db58e014d23b3e47
2015-02-05 16:06:45 -08:00
Roan Kattouw 1e4c3f86c6 Remove useless mixinClass call from MWCategoryItemWidget
The parent (ButtonWidget) already mixes in IndicatorElement.

Change-Id: I49fd72514d9b177eaca2b0295192384bca9e0f97
2015-02-05 13:09:58 -08:00
jenkins-bot 4d53c5d86a Merge "Increase user-input delay in MediaSearchWidget" 2015-02-02 23:47:21 +00:00
jenkins-bot d3bcefffb6 Merge "Do not send search query on whitespace" 2015-02-02 23:46:53 +00:00
James D. Forrester bed038b509 build: Bump devDependencies to latest
Updates:
* grunt-contrib-csslint  0.3.1  ->  0.4.0
* grunt-contrib-jslint   0.10.0 -> 0.11.0
* grunt-jscs             0.8.1  ->  1.2.0

For jscs, leaving requireSpacesInsideArrayBrackets to avoid headaches for now.

Change-Id: I62d34444edbba65c8bd22d2fa5e50e16cabb0042
2015-02-02 14:30:39 -08:00
Moriel Schottlender 7734e7e71f Do not send search query on whitespace
If the user inserts a whitespace to the search input we don't want
the API query to be sent out.

Change-Id: I8cd68a6039ca98e3d78c9f1aa88f4098a1a99edc
2015-02-02 14:20:29 -08:00
Moriel Schottlender 5d8108f229 Increase user-input delay in MediaSearchWidget
Increase the timeOut for the typing delay so we send search API
requests less frequently when the user types a search term.

Bug: T88188
Change-Id: Ibaf7184fb0eb9a02b460b0a66eabade791aea620
2015-02-02 14:01:49 -08:00
jenkins-bot 73e05df441 Merge "MWLinkTargetInputWidget: Check title is valid in MediaWiki" 2015-01-31 03:13:36 +00:00
jenkins-bot 071b344353 Merge "Change uses of LookupInputWidget to LookupElement" 2015-01-30 00:44:08 +00:00
Moriel Schottlender 3d60389ea0 Add a layout queue to media result widget
Use a queue for the method that lays out the result images in
the rows; this queue will only run if the widget is visible,
to make sure that the calculations of the masonry view work
as they should.

In better words: Only cue the queue if the widget is visible.

Bug: T86802
Change-Id: Ia8a30a6a5cccd98a1201443d672e4a6ab4aa946f
2015-01-28 18:01:47 -08:00
Moriel Schottlender a44e0d2e5d Lazy load the media search results
* Set the src attribute only when the image is actually
  visible in the search results.
* Display the thumbnail image we have from the search
  results and then update with a larger one from the API.
* Request for more media results on a higher threshhold,
  when the user views 2 rows above the last available
  result.
* Correct the resizeToBoundingBox and simplify it to work
  properly for a non-square bounding box regardless of
  constraints.

Change-Id: If024b0335ce6a5d2d0eafdbfdfe1030dcaac3a75
2015-01-28 17:56:54 -08:00
jenkins-bot d7c80d4cf2 Merge "MWMediaDialog: Make the dialog bigger when searching for media to insert" 2015-01-20 19:52:11 +00:00
Alex Monk f0f2912c9d Actually perform interwiki check in MWLinkTargetInputWidget
Fixes my idiocy in I4b08f1c6

Bug: T72504
Change-Id: I1a7f14fc7f7169ac85eacd4e12a56acff1fe32ae
2015-01-19 22:49:38 +00:00
James D. Forrester 7daf17fadc MWMediaDialog: Make the dialog bigger when searching for media to insert
Bug: T86397
Change-Id: I40e78441dd555dff837516220653b1c54bf5af92
2015-01-16 16:29:26 -08:00