We have had this method in all Repo subclasses for a while, but sadly
it never got used and we've unintentionally crippled foreign DB repos
for some time now.
{{fixed}}
Change-Id: I972eb739cdd56c666981d5fbc371fa53024ff359
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/217
* more robust method of obtaining URL
* decouple performance logging from providers (mostly)
* ignore fake XHR object which jQuery returns for JSONP requests
* guard for CORS requests - apparently Chrome refuses to return
certain information even with an Allow-Origin: * response header.
* Resource Timing is limited to 150 results, which causes fake
misses in debug mode. There is an API to increase the limit
but it is not implemented in Chrome. I am calling it nevertheless,
maybe IE understands it (it is present in the MSDN docs at least).
This seems to work for AJAX, CORS, JSONP, image AJAX; CORS requests
return 0 for a lot of values, per spec a Timing-Allow-Origin: *
header might help that.
Change-Id: I8353858022f51a7e70774e65513d0fa2554a5064
When the lightbox is opened, or prev/next pressed, preloads the
previous/next N images.
Technical debt introduced:
* initialization is a mess, with the viewer and the interface
randomly setting properties on each other in different phases of
execution. That got in the way and I shuffled things around
until they worked, which is obviously not the way to have a
robust system, but hopefully it will get scrapped soon anyway
in favor of a clean top-down dependency injection.
Change-Id: Idcb5c40de1ac0b3e482decd66e56c4de8ec71b6b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/155
A simple task queue which can be processed or cancelled.
Will be used to handle preloading in a more robust way.
Change-Id: Ib33f9b2d814a35538f9d4f3691fce5ba5cdc82c1
* moves generic logic into ThumbnailSizeCalculator class
* moves UI-specific logic into interface class
* fixes bug where non-bucketed sizes were served on devices with
non-standard pixel density
* fixes bug where bucketed size was compared to css size instead of screen size
for resizing
Change-Id: I8ba3380b74fcc8fb0a6ecc3f3140627411851ad0
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/196
* update paths
* make generate script return failure state on failure
* fix some issues so that it does not actually fail
Change-Id: Idd42e0d8e333c461091079aa1150b1b435e6360c
* userinfo api requests are cached now
* we use jsonp only if we have to (makes gender api calls measurable on WMF wikis)
* all API calls use providers now, provider.Api constructor can be used to
wrap mw.Api with metrics
Does not return a proper model, and gender API calls are not preloaded together
with the rest of the calls. Maybe next time.
Change-Id: I9b3ea73c65eef57e160ac8636d9e45d349150884
This reverts commit 4280dd8b83.
After product discussion, we decided this was a bad idea. Sorry, Tony.
Change-Id: Ib59d75132c2a301f83d080b0f963e2a9d8b9b277
Because we're that cool of a startup apparently
Also because organization and easy code manipulation.
Change-Id: I81ca302b6848f83034f7efed2443757bb045c4f1
Now,The lightbox interface will exit when the user clicks anywhere on
the image backdrop, which is convenient
Bug: 56402
Change-Id: I261976c81b86bf029412dff2993ee7b8c6d347e1
The issue was happening because the metadata div
was placed without waiting for dom load. Also, the code
ignored the fact that the window size might change
between page load and when the lightbox is open.
Change-Id: Ib44720a7f989803b3f59aebcd33e94f610f51325
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/141
The code was incorrectly adding the link to the first section
no matter what. This wasn't caught by the existing assertions,
so these are being improved as well.
Change-Id: I4dcbf44b504bd4cb875b4058fe5604f2a3c871b7
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/44
$.fn.msg breaks on beta for an unknown reason
Switching to mw.message which is used elsewhere in mmv
Change-Id: Id569df019c03b2f11fb513fcd3ed9ffc6eac7e91
Interface code is its own class which does not depend on the main
interface class it can be unit tested (and eventually moved into its
own file to make browsing the code easier). IMO we should aim to
eventually break up the interface into similar classes (with a simple
init/empty/set interface + custom events where it makes sense).
Also, sneak-introducing LESS!
API usage could be more effective (globalusage is a separate API call;
it needn't be), but we will have to rewrite that part soon anyway, so
it should pass for now.
Bug: 60087
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/44
Change-Id: Ibe5c323cdeab4a378316925f0c3efb3dc7ef5997
The code to load and set the image was semi-duplicated and
scattered in various places. This was the source of defects
as this code is called asynchronously and was hard to debug.
This change attemps ot consolidate all the image load logic
in one place. It also adds sorely needed unit tests.
Change-Id: I92eb1c48e2ff0808134e56b4b150e22254eb2d6e
When the multimedia panel is closed, the chevron
points upwards, otherwise it points downwards
Pressing the up and down arrows on the keyboard
opens and closes the metadata panel
Change-Id: I7dd31f3cc3d90f9342845faea2c6cfea3b40e232
This sorta has a few other miscellaneous fixes in it, but it works!
There are maybe still funky behaviours left. Test it?
Also refactor some bits, so we aren't accessing mw.mediaViewer in the
interface code.
Change-Id: I69db8e7b4ff5f994ba706fd4965688f3c26859f4
After checking all the code paths (phew !), it seems
this simple change takes care of the resolution issue
that surfaces mainly in iOS devices (see b/60388).
Bug: 60388
Change-Id: I867dd18f782126fb71eb52ec637a2b90b910050d
Next/prev caused an attach() call which in turn
replaced the lightbox elements with themselves
causing the browser to exit fullscreen mode
because the full screened element was shortly
removed from the DOM (to be replaced by the same content),
Unfortunately this cannot be covered by a test case
because the screen would have to truly go into fullscreen
mode for the bug to happen. Having QUnit go fullscreen
seems unreasonable both for local testing (annoying)
and automated testing (could fail to really fo fullscreen
because user confirmation is requested by the browser).
Change-Id: I57a2668179d6749188d7b5a3efcd06216b7747a9
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/139
This is a big change, but should change nothing except the sizes of some
files and where they all are.
There are no more ext.multimediaViewer strings ANYWHERE, so let's keep
it that way. :)
Change-Id: Ic0892f5894700938bfa01f3f9bc8e5ab8276eb72
It seems the problem was iOS specific. In retina displays the devicePixelRatio
turns out to be 2. This was making the images twice as wide. This was introduced
as a way to fix the resolution problem with some Apple devices, I suppose? Since this is not
fixing the problem I am removing it for the moment. Fixing the resolution issue implies
more changes that will be addressed in another iteration.
Bug: 60173
Change-Id: Iaff2aa6ba13ae85f905ab6d1569572881d8b5990
* Move description and caption to both be in the bottom left
* Make empty description grey and italic
* Fix problem where description was sometimes appended twice
* Move description UI stuff into a separate file, and make it more MVCy
* Tests for description UI stuff
* General framework, to an extent, for UI classes
Change-Id: Ibc8c576cd8a41c2e3cf7e13f1b9e093384fb4655
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/120
Also include the description on the right side of the page, but the caption
generally is more relevant and so should have the place of honour.
+tests
Change-Id: I512b3dd99207878233d501135b4dda0d0bd9cdd6
The foreign repo link in the details area will display the favicon
of the foreign repo when available.
Change-Id: Id946a80beeabcd526f16872efaedbdd291444d2d
Mingle: Multimedia card #107
Currently LIP.resizeCallBack was called even when lightbox was not appended, so I added a test to check the same.
Change-Id: Ie3a40a5d98f12a95b1d54e130896f67b71e927fa
Querying the uploader's gender defaults to CORS, which is disallowed
for non-WMF sites and spams the javascript console with XHR errors.
JSONP works in such cases, and has no disadvantages I can think of.
Change-Id: I9b13210e03059a46407f119045540665c48585ad
Image information and repo information are now both stored somewhere
else entirely, so we don't need to keep accessing weird API return
values to sort things out. fetchImageInfo now uses those classes to
an extent, and we now cache thumbnail URLs for different sizes.
Change-Id: Ife8293c86683ea914b1a5a60000584b501d92e55
Uses promises in the entirety of fetchImageInfo. Also removes the old
fetchRepoInfo method which was unused (basically) anyway.
Change-Id: Ie7f9a27822ecb893b99dbd755c6199769f2e6784
Not when going prev/next.
The saved position feature was probably broken as well if you
happened to press prev/next.
This was my mistake for not noticing that attach() runs on
prev/next.
Bug: 59861
Change-Id: Ic6ff4b15a54178fb5d38640317650f5676293083
fetchImageInfo() was used to load different property sets,
but had a single cache, so sometimes the results with less properties
overwrote the ones with more.
This is a dirty hack to deal with that. I will revisit once we
use promises.
Bug: 59817
Change-Id: I4f375bcc4e6fcfdb3e3fe7a30fc90a8fd44164c3
This is just a clever way of marking messages as being useful again -
this way I don't need to go through the hassle of deleting old data.
Change-Id: I6a0574eaae063014340484ffd2552f8118abb939
Makes sure that the advanced description is out of view when
the lightbox opens.
Remembers the scrollTop position that was set when the lightbox
opens, in order to restore it when it closes.
Change-Id: I534f7d718528d1e5a4911c68a524eb96cadeae90
Looks drastic at first, but grows on you.
I based this on an extreme, the firefox inner scrollbar.
Which is huge when hovered.
I kind of wish the close button was a bit bigger, though.
Change-Id: I2f47280c4e7c4bff299149de24741e3381f0b5e9
"Hey! Scroll down! Yeah, you!"
Also fixes the previous arrow button, which got disappeared at some point
Bug: 58431
Change-Id: I98676ee921dc1d3b5780046eabec7415c05f8f4f
'No description available' message has been added when description for the
given file is not available.
Bug: 56446
Change-Id: Ie239e5cd0d1b645ed149ea1ecc80197b0e84bc34
targetWidth was switched to even if the image was way smaller than it,
fixed by only changing to it if the image is too big (too-small images
should never be stretched anyway).
Change-Id: I9e3e6a358e53dbed988b730205a8afec1dbf3483
See the conversation on mediawiki.org:
http://ur1.ca/g14jv
We're trying this out as one option in combatting slow thumbnail load
times. It may or may not work very well.
Bug: 56695
Change-Id: If1211fdff87c0782c7355d654415bfd29d63d84a
The title attribute of the link that wraps the image
in "Use this file on another website" will be set to
the license and/or author of the image, if available.
Bug: 56588
Change-Id: I5f504964ec3a63e4927385cb68e90856eb4cfe37