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
* 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
Add an info panel to the MediaDialog to show the user information
about the chosen file from the new extmetadata API.
Also, change the way results are viewed:
* Present the search results with their proper ratio.
* Use masonry fit for the search results.
* Change the resizeToBoundingBox method in ve.dm.MWImageNode to accept
a specific side constraint, either 'width' or 'height'. This is also
going to be useful for adding and calculating 'scale' considerations
that affects the image height.
* Add info panel with details from extmetadata including author, license,
date of upload and creation, etc.
* Get descriptions and data according to wiki language.
Bug: T78161
Bug: T74061
Change-Id: I7b4d019825aa89dd178665bd9492a07af15954ac
Having MWCategoryInputWidget inherit from ButonWidget makes things a lot easier.
The mousedown behaviour and the positioning of the popup need work but
that is unrelated to this patch.
Bug: T78039
Change-Id: Ic43e64a6a74b8679a15aa8031207ab722e061ab4
Follows-up b0e8900, 447e8de, d3f26e65.
Contrary to binding a reference, this-overiddes for inline
functions gets messy and fragile. There's also a minor
performance overhead that can be avoided. No separation of
concerns, eiter, as the object is held by the closure.
Also:
* Remove left-over instances of @method.
* Remove redundant '0' argument to setTimeout.
* Use null instead of $ for apply() on static methods like $.when.
* Use .empty().append() instead of .html(). Does the same but
without additional overhead and without confusion association
with "html" which isn't used (it doesn't serialise and re-parse
or clone, it just appends when given one or more nodes).
Change-Id: I797a3667c67d52568150be9be5d043d149f22077
Make the image results align to the full width of the dialog. This
fix uses dynamic values of the width of the container rather than
a hard-coded value so it should work properly on all themes.
Bug: T78050
Change-Id: I05bb0d8a8b13c246840382b12e098d0579180016
Aside from the confusion and differences between substr() and
substring() and IE8 bugs with substr(), substr() was removed from
the spec as of ECMAScript 5. It's been standardised in the
optional Annex B section of ES5.
Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1
New changes:
5e60f12 Ensure clipboard key is removed from paste target
32397d8 Update OOjs UI to v0.4.0
Local changes to compensate for new OOUI version, and updated wfUseMW call.
Change-Id: I005f7b23a36e04f1305d4aa037c19a5c7db9a699
canonicalQueryValue can be null at this point, so let's not insert it
into an array that contains strings.
Bug: T76868
Change-Id: I8096a9c1017e883d28124bf807d2d375ae98452a
To do things like strip off invalid invisible characters from the end of names.
(see bug)
Also rename that function because it covers more than just hidden status now
Bug: T74080
Change-Id: I8374695a991c4d3e397992ad9277b99d9288eec4
New changes:
ff237d4 Fix z-indexes in core
e88d43e Localisation updates from https://translatewiki.net.
cf61803 Consistently use ve.ui.WindowManager everywhere
f9dfdb8 Update OOjs UI to v0.1.0-pre (23565e7519)
f79f7e3 Update OOjs UI to v0.1.0-pre (8f8896196f)
c8201dd Update OOjs UI to v0.1.0-pre (9ed4cf2557)
Local changes for the breaking change to OptionWidget and sub-classes.
Change-Id: Ife6abd312d4dc97be67cb84eea4cb9c6a0a31b1d
* A subclass of MenuItemWidget from OOUI, MWLinkMenuItemWidget, is introduced that, when used in MWLinkTargetInputWidget for both
external and internal links, returns actual page links.
* MWInternalLinkMenuItemWidget is extended from MWLinkMenuItemWidget to support the internal links.
* LinkCache is being used in MWInternalLinkMenuItemWidet to stylize the links. Thus, getting rid of some old css classes.
Bug: 51205
Change-Id: I3ac18dabd514ca539fff1db3c67ae97931c3d4fc
This code was somehow broken by Ia47bc897 (wtf, how?)
Actually removing it seems to do no harm (wtf?), as far as I've been able to tell...
Bug: 72906
Change-Id: If7eb34a20cc8060b594a567278241b02a8ee327a
Now that we have .getTitle() as a method in MWTitleInputWidget, replacing the callers
of MWTitleInputWidget.getValue() with .getTitle(). This fixes a bug in the .getTitle()
method in MWTitleInputWidget which was not taking the namespaces into account before.
Also fixes: the error when entering "Talk:" as a template title. The button to add template
remains disabled when "Talk:" is given as an input to the title here.
Bug: 71998
Change-Id: I1e629a61ec8b035d93a4b7acfecab81934019166
This was needed to make the ComboBoxWidget initialize
its selection, but Idcbf38c53 makes that happen automatically.
Depends on Idcbf38c53 in oojs-ui.
Bug: 72783
Change-Id: I8d3a014f862ece7f4f201af205a8a7ca6c365eaa
MWCategoryInputWidget:
* Use @inheritdoc
* Don't modify data parameter in getLookupCacheItemFromData()
MWLinkTargetInputWidget:
* Remove this.choosing in favor of setLookupsDisabled()
* Explicitly close menu on choose
* Remove manual emission of change events
** This looks ridiculous, it doesn't seem to be necessary,
and it causes infinite event loops. But I'm very curious
why this was added in the first place.
* Remove onLookupInputChange override that is now unnecessary
* Use {} rather than [] for fake empty result
* Prevent programmatic focus from opening the menu
MWTitleInputWidget:
* On choose, close menu and disable lookups while changing value
* Use @inheritdoc
* Remove mentions of "template" from getTitle() documentation
Bug fixed:
* When choosing a suggestion in MWTitleInputWidget,
new suggestions would be loaded and the menu would reopen
Depends on Iecae9b582 in oojs-ui.
Change-Id: I716f99bb464a5cebd4f17701197f768e4e0e02a9
A method isValid() is added to MWTitleInputWidget which would validate the titles given as inputs
Bug: 71249
Change-Id: I7749165652bd3c0bb08ca42289a425fe8e25483d
A method for getTitle() is added which can return the valid title,
or, it can return null, in case the value isn't a valid title
Bug: 72468
Change-Id: I8a13afc9a66c167fe25010743c0d9e1424133d96
These disappeared when DecoratedOptionWidget was split
out of OptionWidget in I508c1555 in oojs-ui back in July,
and apparently no one noticed.
Make MWParameterResultWidget and MWMoreParameterResultWidget
inherit DecoratedOptionWidget instead of OptionWidget so
the icon config parameter is recognized again.
Change-Id: I08d8a0466c211a29eb62043131725073dece4eb5
The correct parameter is &redirects=. Which we really don't want
to use anyway, because if Foo->Bar, using &redirects=1 would
cause a search for "Fo" to return "Bar" as a search suggestion
with no explanation why (and "Foo" wouldn't be visible).
This isn't unsurmountable, we could put in handling similar to
how the category widget handles redirects, but what this code
is trying to do by passing this parameter is definitely wrong.
Change-Id: Idd12c03aaef897d7c1dc70b2a7692e7d71980efe
OOjs UI killed the 'hide' event that was running this code in the dialog refactor
back in July (Id121fc3a), but left it documented (along with 'show').
Just use the 'toggle' event instead.
Bug: 72168
Change-Id: I172fac81c4cbb89505522011aed57db57ccbc52f
Instead of putting these popups in an overlay, put them
in the category widget. This makes scrolling work more
nicely, and makes things easier to deal with in general.
This requires that the popup position itself using
getRelativePosition(), because it's no longer in an
overlay. This also means these popups should now position
themselves correctly no matter where they are.
Change-Id: I09a1e5891a897d634c41d386a2307fe3df2a9157
Changes:
* Override ve.ui.SurfaceWidget for use in MW
* Add mw-body-content class to surface view container
* Assert 1em sizing for surface view container to prevent
mw-body-content from applying its own sizing
* Add new scripts and styles to RL config
Bug: 71652
Change-Id: Iac86facdc0c7a0e48c0f3617e2f6c2e7f001525e
We really shouldn't need the inner overlay for this,
we should be able to deal with popups being in
oo-ui-window-overlay. But for now, we're not, and
this fixes the current problems.
Depends on If16d16d2b in oojs-ui.
Bug: 72052
Change-Id: Ie06056b96db19ac4caf1f9c0e3a1c49cfddc6682
The previous check for RTL did not properly recognize
when the UI was in RTL, since the element in question has no explicit
'dir' attribute. The test now uses $element.css( 'direction' ) which
is inherited, and produces a correct result.
Change-Id: Ie30c2038428b10709dc30cb8320bdc94d76a5a18
The TextInputWidget class inherited by MWCategoryInputWidget,
already has a keypress listener that emits an "enter" event on
the OO.ui.Element object for us to listen to. No need to duplicate
that logic again.
Change-Id: Ia47bc8976f22dfe7e3a6fb6068dc4b6e03a3357b
Now that we use staging in the meta dialog, the following
sequence is possible:
* Add Category:Foo in UI (adds to DM and adds a widget)
* Remove Category:Foo in UI (removes from DM, removes widget)
* Click Cancel to leave meta dialog
** popStaging()
*** Undo removal of Foo (adds to DM, does not add a widget)
*** Undo addition of Foo (removes from DM, tries to remove nonexistent widget)
Add a check so trying to remove an already-removed widget
doesn't cause a JS error.
Bug: 71471
Change-Id: I34690364ce302b858e2a4429dbb97b57d39aae5f