Commit graph

596 commits

Author SHA1 Message Date
jenkins-bot c1fb20fedb Merge "Add checkered background to make black-on-transparent images visible" 2014-03-08 01:55:06 +00:00
Gergő Tisza 5a3d56f81b Merge MultiLightbox into LightboxInterface
Change-Id: I4363095e0504dd941793ba3addc7ee3cbe835536
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/178
2014-03-08 01:14:07 +00:00
Gilles Dubuc c386719cdb Some refactoring to get LightboxInterface closer to a proper UI component
* remove reference to MultimediaViewer
* move hash handling to MultimediaViewer
* make it inherit from Element, remove code duplication
* cleaner event handling life cycle (register on attach,
  unregister on unattach)

Change-Id: Ida8f68dead758a6ae3c429eb85c548af61e46801
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/178
2014-03-08 00:26:44 +00:00
Mark Holmquist 21549d7547 Do not add icons to media viewer image list
e.g. {{refimprove}} on enwiki - there is an icon of a book that is only
meant to be illustrative on the page. It interferes with the page's image
collection and the flow.

Change-Id: Icd7e5885aaf8b31fffe07bd18cc0feb0f76b848c
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/229
2014-03-06 15:26:25 -08:00
Gergő Tisza d0f76bb160 Add checkered background to make black-on-transparent images visible
Bug: 57620
Change-Id: Ibabbb6d64f9d02ff5b94431a431ebb5222e344d7
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/284
2014-03-05 21:32:34 +00:00
jenkins-bot 0fa8f80942 Merge "Get rid of global viewer instance" 2014-03-05 17:52:18 +00:00
Gilles Dubuc 8beca0b106 Get rid of global viewer instance
- split event handler setup out of bootstrap and viewer creation
- simplify the tests setup/teardown

Change-Id: Icde1db81efd6191207ba35757192c800ea2d2e91
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/278
2014-03-05 02:33:06 +00:00
Gergő Tisza 59bd5e0032 Add tests for promise rejection error logging
Change-Id: I20d0803f211cbc4a7f00b58d015b565ca5c3b49b
Mingle:https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/268
2014-03-05 01:15:28 +00:00
jenkins-bot 44b9fa127a Merge "Fix resize issues (Part III, Fin)" 2014-03-05 00:16:16 +00:00
Aaron Arcos 6b7de4b129 Fix resize issues (Part III, Fin)
Last round of fixes and refactorings regarding resize issues
and the Canvas component:
  * Consolidate all the width calculation logic inside the Canvas component
  * Consolidate image resizing logic in the Canvas component
  * Fix size problem with SVG images
  * Clean up comments and tests

Change-Id: I0198cc1e3a45f7287b9a7494f73a8f158303f886
Bug: 56454
Mingle: 239
2014-03-05 00:14:54 +00:00
Gilles Dubuc d983a13377 Test to check that events are not trapped after the viewer is closed
Also fixes overeager preventDefault in the interface

Change-Id: I5e3b05c8546e24772016b72343e241caa2e6ef0e
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/274
2014-03-04 09:28:59 +01:00
jenkins-bot a5e566e5db Merge "Add rejection logging to providers" 2014-03-04 01:35:48 +00:00
jenkins-bot 5f4f62211b Merge "Add events for image views and "use this file"" 2014-03-04 00:44:21 +00:00
Gilles Dubuc b7488716d8 Add events for image views and "use this file"
Change-Id: I9ba37038e41d81bbb8dfa96b8a7766b35d24fa5a
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/54
2014-03-03 16:30:38 -08:00
Gergő Tisza ead038c34f Add rejection logging to providers
Make sure it is easy to debug when one of the promises rejects (and
causes the whole promise chain to fail).

I'm not really happy with this, but still seemed better than adding
the same boilerplate error logging code to each provider one-by-one.

Change-Id: Idd2b638f012ef2ff250e350e2f6a60bb8b81899b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/268
2014-03-03 21:35:01 +00:00
Gilles Dubuc 28cb881cfa Network performance measurement CORS improvements
- Fixes feature check for IE6 and older browsers without native XHR
- Skip crossOrigin attribute for IE11 because it prevents caching

Change-Id: I99d6a3c97edac1af12750d5978a84b6e6f631b14
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/232/
2014-03-03 17:17:07 +01:00
Gergő Tisza a8a31b1cfc Restore normal behavior on middle-click for site link
Change-Id: I0f13cc97e69fffec64c5dd6c18f08bad44838d19
2014-03-01 00:00:31 +00:00
jenkins-bot 4dad39c117 Merge "Get rid of site-link-click waiting period" 2014-02-28 22:57:13 +00:00
jenkins-bot 31c2b4169f Merge "Fix JS error happening when closing "use this file" dialog" 2014-02-28 17:53:17 +00:00
Pau Giner a3d0a654f7 Adjustments of colours and layout
changes include:
* Aligning license and usage boxes with content above.
* Limit the maximum size for the licensing box when open.
* Adjust font sizes and colours to adjust the alance in the prominence of each part.

Change-Id: I0e4465baaf7a9f7830b95a8d731256d6b4974e17
2014-02-28 14:14:34 +01:00
Gilles Dubuc 9940833928 Get rid of site-link-click waiting period
Change-Id: Ie165cf132ed9f9e326387abba0af6d3780fa894d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/255
2014-02-28 12:11:18 +01:00
Gilles Dubuc 430ec53d3e Fix JS error happening when closing "use this file" dialog
Change-Id: I690f473ea17117bed7d30e1a858f6612f57fc33e
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/224
2014-02-28 11:52:47 +01:00
Aaron Arcos fedaa553b4 Fix resize issues (Part II)
I was going to stage this but better give you the whole enchilada,
it is not that bad, ;-). This is what I am doing:

- Delete  things that are not used anymore.
- Componentize image ui element (Canvas).

Bug: 56454
Change-Id: Ib5461639a86d9f8e0a150f6d9543a20058d31e00
Mingle: 239
2014-02-28 10:22:21 +01:00
jenkins-bot 374fe5560d Merge "Create fake user when userinfo request fails" 2014-02-28 08:48:25 +00:00
Gergő Tisza 8408c82420 Clear registered events on unattach
Bug: 62033
Change-Id: Ic23a182ac2a74864831796ce493a0c51baa4fe8b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/273
2014-02-28 03:20:40 +00:00
Gergő Tisza 822e129a37 Create fake user when userinfo request fails
Quick and dirty fix for a bug that completely breaks the metadata panel.
Should be refactored later (for a ForeignDbRepo, a missing user is
normal, for anything else it should still be treated as an error
condition, although maybe not with a rejection).

Bug: 62019
Change-Id: I433ae2bd1334593d9c5bfe0272ce7207f3fdf723
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/267
2014-02-28 03:06:23 +00:00
Pau Giner d66681c949 Small font and layout adjustments
Some styling adjustments to:
* Make description fonts not to be de-emphasized in comparison to license terms.
* Avoid metadata on the right to wrap when there is enough space.

Change-Id: I49514060dec200d93489d2b853a1dfdc1bfa5f46
2014-02-27 19:04:00 +01:00
jenkins-bot 45a0031716 Merge "Bugfixes and improvements for the progress bar" 2014-02-27 01:35:26 +00:00
jenkins-bot ccdb14634a Merge "Make it obvious that the permission text is cut off; add expand link" 2014-02-27 01:25:29 +00:00
Gilles Dubuc 9d9fff1871 Bugfixes and improvements for the progress bar
- the bar now starts at 5% for a visual indication that
something is going on
- the bar animates (fast) to 100%, instead of
disappearing immediately
- the animation logic has been fixed to avoid seeing
the bar go backwards
- added sanity check in all the callbacks to make sure
that we don't apply any changes to an image we are
not looking at anymore (including progress updates)

Bug: 58055
Change-Id: I765a61c16513e9330a412c5ec96387623ae7dbc7
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/146
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/242
2014-02-27 02:13:03 +01:00
Gergő Tisza 976ffc76d3 Make it obvious that the permission text is cut off; add expand link
Fades out the bottom of the text and adds a link to replace it
with the full HTML version. Due to the way it is positioned,
the fade + link will be invisible if the text is less then 3 lines.
The implementation is not very polished; since this will be
replaced by some JS-based ellipsis thing, I didn't want to spend
too much time on it.

Change-Id: Ib30e40fe845b85bfcf9557970efb886d28b3e5c7
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/118
2014-02-27 01:06:25 +00:00
Gilles Dubuc 1e880b68ca Ignore left/right key presses when there's a modifier
Change-Id: I8998fd27a7d60f5826802153d3ad74ab8a37c3fe
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/236
2014-02-27 01:17:53 +01:00
Gilles Dubuc 5d6d274309 Make the SVG filter inline
The external SVG doesn't work on beta, because
it's hosted on a different domain

Change-Id: Ic6ae42a33f9dbd656df051f056376aea60ac9ea3
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/146
2014-02-27 01:11:52 +01:00
Gilles Dubuc 392cc4e737 Move "uploaded by" to the right spot
As specified in the acceptance criteria, it should be
between "Learn more" and the creation date

Change-Id: Ie3e7fd55b6bb8fa5cf995fa90dd8ab45581f34bd
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/217
2014-02-26 18:19:51 +01:00
jenkins-bot 1317119e6e Merge "WIP Fix resize issues (Part I)" 2014-02-26 09:24:51 +00:00
Aaron Arcos efaae84a4f WIP Fix resize issues (Part I)
After a few false starts trying to fix LIP.autoResize(),
I noticed that it has become obsolete by our latest
improvements (bucketing and cashing), so I decided to
get rid of it and let the browser do the resizing.
I tested in Chrome/Safari/FF and this approach seems
to work fine.

Still work in progress and there are many things that should
be cleaned up regarding the image object logic but please take
a look and let me know if you have any objections if I go
this route.

Bug: 56454
Change-Id: I08207d0f1fcc9dcb69ec31c03e96cfd0c0a6c522
Mingle: 239
2014-02-26 10:22:47 +01:00
Gergő Tisza 77deada982 Fix display issues with "view terms"
Hiding the element before it is added to the document causes
a wrong display type in Firefox; changing the order of commands
fixes that.

Bug: 61936
Change-Id: I808131da25f2f70c14747238216e8973af44d029
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/118
2014-02-26 01:20:34 +00:00
Gergő Tisza 18a850869d Make sure the text of the permission box is cut exactly between lines
Change-Id: I7a0a3056f6e3734579f1e04175e04c89ced92576
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/118
2014-02-26 00:41:12 +00:00
Gilles Dubuc 77a483086f Blurred thumbnail preview + progress bar
Displays a blurred version of the thumbnail
while the actual image loads
Displays a progress bar showing the image load progress
Animates into focus once the actual image is loaded

Change-Id: I2b8bc4691c20ffb5b3f16da9a8b9d6fd1796d784
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/146
2014-02-25 14:57:33 +01:00
Gergő Tisza 109bbe6ac1 Namespacing MMV properly
Everything is under mw.mmv now.
(Also, I cut down on the number of direct global instance references a bit.)

Change-Id: I88bb3b62b82ce54126dd069b0aab4412d9404719
2014-02-25 13:16:22 +01:00
Gergő Tisza 53da285b07 Merge MultiLightbox into MultimediaViewer
* merges parent classes into child classes
* moves some files and tests to have a consistent directory structure

Change-Id: I360cc0805d8a561f5105fb063747457f67e1fccd
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/177
2014-02-25 02:00:13 +00:00
Gergő Tisza a04631c405 Show permission
Change-Id: I0b8b0626b36baba9732f7350213d8b53ec2cca95
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/118
2014-02-24 21:41:25 +00:00
Gilles Dubuc bfa530cc21 Wait for CSS to be truly loaded before opening the viewer
This is a workaround for core bug #61852

Change-Id: If7d830866993eddbf5784694514ff89aece56c5b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/258
2014-02-24 19:13:04 +00:00
jenkins-bot de9d10ce06 Merge "Better way to detect CORS support" 2014-02-24 19:13:06 +00:00
Gilles Dubuc 75dbc72e6c Better way to detect CORS support
The old technique doesn't work in Firefox and
doesn't always work in Chrome depending on
when you call it.

https://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/

Also fixes some tests that weren't overloading
the right function and were hitting the real
feature detection check

Change-Id: I0a9d6b5654efb169860ddf7e5e0551efb825920c
2014-02-24 18:53:01 +00:00
Gilles Dubuc ce58597b3b Fix hash self-reaction
* Fixes bug where the mmv would react to its own hash changes
* Adds jquery.hashchange for older browser support

Change-Id: I2d23699bb444d9eb533d239e25bc47fa96c902a9
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/254
2014-02-24 19:14:45 +01:00
jenkins-bot 79d72d391d Merge "Use cross-origin img attribute instead of data URI" 2014-02-24 09:46:59 +00:00
Gilles Dubuc e37c9b809c Fixes hash handling issues
* Fixes the bug where the browser hash would get nuked on
foreign anchor clicks
* Moves the hash handling back into the mmv itself
* Adds test coverage for the hash nuking bug

Change-Id: Iea57d0f4b9090f96e622418223d3f774923e8038
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/254
2014-02-24 08:45:08 +00:00
Gilles Dubuc 28b8f5095e Use cross-origin img attribute instead of data URI
After lots of experimenting with Wireshark and
current Chrome + Firefox on Ubuntu 13.10, this is my
current understanding of the caching when preloading images
with AJAX requests:

* on Chrome, the image request always comes from browser cache
* Firefox makes two separate requests by default
* Firefox with img.crossOrigin = 'anonymous' makes two separate
  requests, but the second one is a 304 (does not load the
  image twice)
* when the image has already been cached by the browser (but not in
  this session), Chrome skips both requests; Firefox skips the AJAX
  request, but sends the normal one, and it returns with 304.

"wish I knew this when I started" things:
* the Chrome DevTools has an option to disable cache. When this is
  enabled, requests in the same document context still come from
  cache (so if I load the page, fire an AJAX request, then without
  reloading the page, fire an AJAX request to the same URL, then the
  second request will be cached), but an AJAX request - image request
  pair is an exception from this.
* when using Ctrl-F5 in Firefox, requests on that page will never hit
  the cache (even AJAX request fired after user activity; even if
  two identical requests follow each other). When using clear cache
  + normal reload, this is not the case.
* if the image does not have an Allow-Origin header and is loaded
  with crossOrigin=true, Firefox will refuse to load it. Chrome will
  log an error in the console saying it refused to load it, but will
  actually load it.
* Wireshark rocks.

Pushed some tech debt (browser + domain whitelist) into other tickets:
https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/232
https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/233

Reverted commits:
    8a8d74f01d.
    63021d0b0e.

Change-Id: I84ab2f3ac0a9706926adf7fe8726ecd9e9f843e0
Bug: 61542
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/207
2014-02-24 07:56:40 +00:00
Mark Holmquist 1733df8dc9 Grand Unified Documentation Patch Jr.
The GRUDP is dead, long live the GRUDPJ

Change-Id: I71a22c3aa42b2eb799ce8104159e8c7e56fe13ae
2014-02-21 00:55:43 +00:00
Gergő Tisza 8b984c5ed4 Minor documentation tweaks
Change-Id: I8b513ceab06ddeb47261949061b777105cfa7b65
2014-02-21 00:45:06 +00:00
Gilles Dubuc fdeedd6a88 Fix preloadFullscreenThumnail breakage
Since there was no merge conflict and the changeset worked pre-merge, when jenkins merged the fullscreen changeset, it actually turned out to be incompatible with the new code and spews out a nasty JS error. I think from now on I'll always avoid +2ing a diff that hasn't been rebased to the latest. When looking at the diff not rebased to the latest, you just can't see the issues that might happen with the latest code merged and you certainly won't spot the potential breakage that comes with it.

In fact I think a lot of breakages we've encountered as of late were caused by this very issue.

Change-Id: I46b7dd93c55635f34c01bd8d3eee9785140b5f35
2014-02-20 10:34:48 +01:00
Gilles Dubuc 093cfdc697 Preload fullscreen image
Change-Id: Ief72a4ab2e49538132b174fd9fcf792ddab66b3d
2014-02-20 09:43:10 +01:00
jenkins-bot 3f5323608b Merge "Get article path for foreign DB repos too" 2014-02-20 08:38:03 +00:00
Gergő Tisza f2550c0fbc Fix fileUsage test breaking behavior.
fileUsage tests were applying styles to the fixture element, which
apparently does not get cleaned between tests. This was because
fileUsage.$container had different semantics from element.$container
(widget's own container div vs. parent container div). FileUsage
now inherits from Element to make sure behavior is consistent.

Change-Id: I8fab8bcf084d8b7e480655114506d9848e9d9a49
2014-02-20 09:33:34 +01:00
jenkins-bot b6add9a17b Merge "Hide mouse cursor when buttons are faded out in fullscreen" 2014-02-19 23:48:32 +00:00
Mark Holmquist c619a19711 Get article path for foreign DB repos too
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
2014-02-19 11:13:17 -08:00
Gilles Dubuc d53ca1462e GlobalUsage should utilize the right Api class
Change-Id: Ia0d0ee1d9213f98d89455f88b50616a5fbd87dcf
2014-02-19 19:18:42 +01:00
Gilles Dubuc 9a0a601278 Hide mouse cursor when buttons are faded out in fullscreen
Change-Id: Ie7bec07a9c79cb5ffde586ccd3cfdd3eac519047
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/210
2014-02-19 12:32:10 +01:00
Mark Holmquist 5df979bd65 Grand Unifying Documentation Patch
Change-Id: Id0def78beb0231270557037a9c530c770b100ce2
2014-02-18 18:27:30 -08:00
Gilles Dubuc 8a8d74f01d Avoid double requests when measuring performance of image load
Change-Id: Ib5ec4c3e4e4a410a6ee520b11bf025d7447cb542
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/207
2014-02-18 16:45:03 -08:00
Gergő Tisza 7afbc5ce92 Use provider XHR information in performance metrics + several fixes
* 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
2014-02-19 00:38:27 +00:00
Gilles Dubuc 035afe6d36 Make metadata animation more subtle
And stop showing when the user has opened the metadata once

Change-Id: Iefce36acf1b78301584ca8c1359fac94956a9440
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/213
2014-02-18 16:17:14 -08:00
Gilles Dubuc a5cddef17a Lazy-load mmv
Also removes the index inside the location hash

Change-Id: I9429ff0101ab891f2c4c6aa2d989fbef0813252d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/136
2014-02-18 15:55:15 -08:00
Gilles Dubuc c9fc2c707f Make the image and navigation buttons unselectable
Change-Id: Iec6d8a9511e2a4c508da7524c9fb0db499d1eb8a
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/214
2014-02-18 19:36:33 +00:00
Gergő Tisza 7124ece961 Switch to core's version of moment.js
Depends on core change I6aa36d34bfbe8334c87d6ca449ec19b6a8daf8e7

Change-Id: I850d318a523e51c064e57fb888c7a10c79df6f72
2014-02-18 08:37:44 +00:00
Gilles Dubuc 35690bb2f1 Get rid of lightboxHooks
Delete lightboxHooks, since most of them
haven't proven to be useful.
Replace the useful ones by jQuery events.

Change-Id: I28f99ba85666ca15979feb5c637924b98bba27a8
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/176
2014-02-13 17:47:30 -08:00
Gergő Tisza 302944352f Move jquery.throttle-debounce to core
Depends on core change I008f46cc97af10e93ad9cad35924aaf251b99aa6 (merged)

Change-Id: I0c5faa4b20274a61d95aa2067f1071d2ab462454
2014-02-13 22:54:00 +00:00
Gergő Tisza dc539cab54 Fix keydown event handling leak
Bug: 61337
Change-Id: Iee28a3e19a5a526876fb93900a12844c35b74ecc
2014-02-13 20:50:05 +00:00
Gilles Dubuc 6e127b25e2 Preload prev/next images
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
2014-02-13 10:52:40 +01:00
jenkins-bot 400ddd7b53 Merge "Add TaskQueue class" 2014-02-13 09:35:37 +00:00
jenkins-bot 52a0e16147 Merge "Fix fullscreen bug where image was replaced with self" 2014-02-13 09:14:18 +00:00
Mark Holmquist c99d830d25 Search for jsduck warnings, fail if found
Change-Id: I21e903375e5c6fbf4cb7c7f5ca52421695618011
2014-02-12 14:19:23 -08:00
Gergő Tisza 9881f9e7ae Add TaskQueue class
A simple task queue which can be processed or cancelled.
Will be used to handle preloading in a more robust way.

Change-Id: Ib33f9b2d814a35538f9d4f3691fce5ba5cdc82c1
2014-02-12 01:55:39 +00:00
Gergő Tisza d7706d7cb0 Fix fullscreen bug where image was replaced with self
Change-Id: I81dcadae96a778559564a786a5753323fb802b7c
2014-02-12 01:55:37 +00:00
Gergő Tisza f4ab39df1e Fix runaway prev/next issue
Prev/next handlers were multiplying after every click.

Change-Id: I1e21b2711cc08a6edbbd26ec844e966f7582b3c8
2014-02-11 01:12:31 +00:00
Pau Giner cc9e2daf2f Icons for share link and assessments
Added SVG assets for link (normal and hover states) and the
"assessments" trophy icon.

Change-Id: I5b5673fb8767628922c6b1ccbe658a0b3df56e0f
2014-02-10 21:48:14 +00:00
Gilles Dubuc b9a822249d Fix defullscreen icon duplicate CSS
This one slipped through the cracks again

Change-Id: If4b1e8ee3adcef6b388f3d431d6629fe7b452b81
2014-02-10 10:12:34 +01:00
Gilles Dubuc 6e896c05cc Fix fullscreen and close icons
Some styles got mangled when 111372 landed

Change-Id: I44fa82ba0b65152b01872ba58f8a7e84c6106ca5
2014-02-10 10:04:50 +01:00
Mark Holmquist a62410616d Refactor button things into a separate class
https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/124

Change-Id: Ib4b54164bccbe17e42b223880179531e8d9e6123
2014-02-10 09:40:50 +01:00
jenkins-bot 698f677cd3 Merge "Refactor thumbnail size calculation" 2014-02-10 08:11:33 +00:00
Gergő Tisza 06cc6cca1a Refactor thumbnail size calculation
* 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
2014-02-08 01:27:27 +00:00
Gergő Tisza 65129f9ed5 Fix perf log type for userinfo
Change-Id: I296a3c53005de7c27b6083662fa498f06254e946
2014-02-07 21:26:27 +00:00
Gilles Dubuc e74fc33e89 Track detailed content loading network performance
Leverages the W3C Navigation Timing API when available

Change-Id: Ief1d327d1bd8928bf5f2bf0bd4c7141a0a608a53
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/126
2014-02-07 19:37:22 +00:00
Gilles Dubuc 57434b5812 Refactor panel-related things into another class
mmv.lightboxinterface was getting way too clunky.

https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/124

Change-Id: Ie3a604b532ee853f9df673cc4d38c2c7594bdefa
2014-02-07 10:09:08 -08:00
jenkins-bot 6b22712362 Merge "Some more metadata fetch reorganizing to get rid of the dependency on UI state" 2014-02-07 09:15:21 +00:00
jenkins-bot 3f9becc01b Merge "Add Thumbnail model" 2014-02-07 09:12:15 +00:00
Gilles Dubuc e3a1bf93ba Show main metadata in fullscreen
Yay mostly-CSS work

Change-Id: Ica8dc95a8c56b56c0ee00a16b1cfbf923de04424
2014-02-07 02:43:43 +00:00
Gergő Tisza e382095c4a Some more metadata fetch reorganizing to get rid of the dependency on UI state
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/155
Change-Id: I56cfa404d148d760088baa26900db04294ab4e91
2014-02-07 01:46:26 +00:00
Gergő Tisza e33f2d263c Add Thumbnail model
Also refactor size calculation a bit - I found target/requested
harder to remember.

Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/155
Change-Id: I4781cdd7004e9a8e36875c152e1d3a335a55b7d7
2014-02-07 01:46:26 +00:00
jenkins-bot d1e966e903 Merge "Hide the fullscren button when fullscreen is unavailable" 2014-02-06 22:19:17 +00:00
Gilles Dubuc 4e85f31b27 Hide the fullscren button when fullscreen is unavailable
Change-Id: I72cff940cee1ad83f6bacfffdcfb9fdd0f16abcc
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/152
2014-02-06 14:02:52 -08:00
Gergő Tisza 289ad22b19 Fix JSDuck
* update paths
* make generate script return failure state on failure
* fix some issues so that it does not actually fail

Change-Id: Idd42e0d8e333c461091079aa1150b1b435e6360c
2014-02-06 19:10:07 +00:00
jenkins-bot ed912adff1 Merge "Userinfo provider" 2014-02-06 13:56:15 +00:00
Gergő Tisza 26d001ac6f Fix repoinfo loading bug
Change-Id: I21741a60b88f1e34faf30ef591f3e44ff4703d94
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/190
2014-02-06 00:59:43 +00:00
Gergő Tisza b013ddbefe Userinfo provider
* 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
2014-02-06 00:37:39 +00:00
jenkins-bot ec32d1e81a Merge "Hide the controls after some time when in fullscreen mode" 2014-02-05 20:13:25 +00:00
jenkins-bot 929e287637 Merge "Revert "Exit Lightbox when clicked on backdrop"" 2014-02-05 18:14:24 +00:00
MarkTraceur 3b71fecee5 Revert "Exit Lightbox when clicked on backdrop"
This reverts commit 4280dd8b83.

After product discussion, we decided this was a bad idea. Sorry, Tony.

Change-Id: Ib59d75132c2a301f83d080b0f963e2a9d8b9b277
2014-02-05 18:12:43 +00:00
Gilles Dubuc 3dd716a3f2 Hide the controls after some time when in fullscreen mode
Also removes side-effects from several tests

Change-Id: Ifdc978f56f8c4caafadc8b192756645a9378f58a
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/150
2014-02-05 10:27:10 +01:00
jenkins-bot 923a117304 Merge "Use LESS instead of CSS" 2014-02-05 02:20:40 +00:00
Gergő Tisza 1ff0ac60cd Fix merge problem with categories
Change-Id: I628bffeb4cac16cf50def6d5562fb9e2b9fa8933
2014-02-05 01:46:55 +00:00
jenkins-bot af1c2cbeee Merge "Add provider to for actual image loading" 2014-02-05 00:15:56 +00:00
jenkins-bot cba179e79a Merge "Replace old API code with providers + fix a few provider bugs" 2014-02-05 00:15:55 +00:00
jenkins-bot 97e29b9e00 Merge "Add imageinfo, thumbnail info, repoinfo provider" 2014-02-05 00:14:22 +00:00
Gergő Tisza 6068ffd58d Add provider to for actual image loading
Change-Id: I9ca9bce37c97648afa07db9f004138a791c74e65
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/123
2014-02-05 00:02:28 +00:00
Gergő Tisza 40d1a2508a Replace old API code with providers + fix a few provider bugs
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/123
Change-Id: Id7952f0a0eafa34d7c8691c63c2daccff2eea64a
2014-02-04 23:52:02 +00:00
Gergő Tisza 85a37d0e14 Add imageinfo, thumbnail info, repoinfo provider
Change-Id: I80ffec39ee6c9e0ea0b37be2fc48315063b5ff8a
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/123
2014-02-04 23:46:02 +00:00
Mark Holmquist 9d043e7ddc Fix categories empty method
+test

Change-Id: I16f19dde713709b0cf8631cb1bf0ceee6ca438a7
2014-02-04 10:10:53 -08:00
Mark Holmquist 5d61b69fbd Use LESS instead of CSS
Because we're that cool of a startup apparently

Also because organization and easy code manipulation.

Change-Id: I81ca302b6848f83034f7efed2443757bb045c4f1
2014-02-03 15:02:32 -08:00
Mark Holmquist b860ccf1b9 Move UI things into mmv/ui/
Change-Id: I39800ba45abe4ff1cb21c41062f8a1012eaca203
2014-02-03 14:46:04 -08:00
Gilles Dubuc d34fec4ff2 Add categories to the interface
Also move some things around a liiiittle bit. Not too much.

Change-Id: I7a5b8d900f5173fa20142d205e4992361b9e81a3
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/41
2014-02-03 15:09:42 +01:00
jenkins-bot 9f0641c214 Merge "Make mmv handle urlencoded hashes" 2014-02-03 10:44:42 +00:00
jenkins-bot 8024d98e71 Merge "Move providers into their own subdirectory" 2014-02-03 08:45:02 +00:00
Gilles Dubuc 67fa053687 Make mmv handle urlencoded hashes
Change-Id: Id05806be4586a3d6f04b92ace2c8195b8de016bc
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/153
2014-02-03 09:32:38 +01:00
tonythomas01 4280dd8b83 Exit Lightbox when clicked on backdrop
Now,The lightbox interface will exit when the user clicks anywhere on
the image backdrop, which is convenient

Bug: 56402
Change-Id: I261976c81b86bf029412dff2993ee7b8c6d347e1
2014-02-02 16:23:25 +05:30
Gergő Tisza e0edec21b2 Move providers into their own subdirectory
Also refactor MultimediaViewer.php a bit to get rid of all the globals.

Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/123
Change-Id: Ieca4263ecc7652dc6bc36db63b99d3813c4653e4
2014-02-01 03:49:30 +00:00
jenkins-bot 1ae5cc10f7 Merge "Fix globalusage link" 2014-01-31 22:41:12 +00:00
jenkins-bot 5d7f86bc86 Merge "Place the metadata correctly before opening the lightbox" 2014-01-31 20:53:51 +00:00
Gergő Tisza 416f04bf3b Fix globalusage link
Change-Id: Iec3aeef2e807fbc65212dbcb156ae5d9bd39bb9c
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/44
2014-01-31 18:46:20 +00:00
Gilles Dubuc b9eecfed28 Place the metadata correctly before opening the lightbox
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
2014-01-31 11:35:50 +01:00
Gilles Dubuc 5d47d1da3d Fix the "view all uses" link when there are both local and global results
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
2014-01-31 09:30:26 +01:00
Gilles Dubuc ec29c88a6e Swap position of caption and description
The design requested that the caption is displayed above the
description, not below it.

Change-Id: Ie4bd10e04b65aeaa4e367c59d3ddef790bee1e2b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/120
2014-01-31 04:04:59 +00:00
Gilles Dubuc 8bd1786ead Revert "Replace $.fn.msg calls by mw.message"
This reverts commit 1804f98ee7.

Turned out to be a caching issue, $.fn.msg() works fine

Change-Id: I087bf5cc0bbe89fdc80c64c015218a5ff9a24ee7
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/157
2014-01-30 14:11:23 +01:00
Gilles Dubuc 1804f98ee7 Replace $.fn.msg calls by mw.message
$.fn.msg breaks on beta for an unknown reason
Switching to mw.message which is used elsewhere in mmv

Change-Id: Id569df019c03b2f11fb513fcd3ed9ffc6eac7e91
2014-01-30 13:46:49 +01:00
Gilles Dubuc 30563de71d Add file usage data to MMV metadata panel
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
2014-01-30 13:03:28 +01:00
Aaron Arcos f7925a1a4f Refactor image load code, add unit tests.
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
2014-01-30 08:51:15 +01:00
Gilles Dubuc 98e03d31c8 Test metadata visibility in fullscreen mode
Add metadata visibility logic to the test
Convert the code to CSS since writing the test made me
realise that the current JS was superfluous

Change-Id: I80c2f1860cc021e9bdf09345647b288de746f1e3
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/140
2014-01-30 08:39:55 +01:00
Gilles Dubuc 02897fda9c Chevron/metadata UI behavior improvements
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
2014-01-30 02:52:53 +00:00
Mark Holmquist a86a6d5b9e Fix resize engine for fullscreen
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
2014-01-29 11:50:22 +01:00
jenkins-bot fe846f3063 Merge "Fixes bug where next/prev would exit fullscreen mode" 2014-01-28 22:39:29 +00:00
jenkins-bot d246d7709a Merge "Simple test for enter/exiting fullscreen mode" 2014-01-28 10:21:14 +00:00
Aaron Arcos 7c87033235 Request maximum image resolution in the API call.
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
2014-01-27 17:17:32 -08:00
jenkins-bot 567039c14e Merge "Fix bug that would cause the image to stay small" 2014-01-27 18:44:58 +00:00
Gilles Dubuc 2d3287e6bf Fixes bug where next/prev would exit fullscreen mode
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
2014-01-27 18:12:09 +01:00
Gilles Dubuc 6803daf3a6 Simple test for enter/exiting fullscreen mode
While writing the test I spotted a bug and fixed it

Change-Id: I781c67752781960e4be88520f53163756fc11dab
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/140
2014-01-27 17:54:03 +01:00
theopolisme b770e02d48 Enable fullscreening with jquery.fullscreen
Depends on I58138afa05c43f5a24e74fa3a30a658428c39ce0
(core patch)

Change-Id: Ib972d453bdf8172439bf6195985fcf7e248b2b8a
2014-01-27 14:14:36 +01:00
Mark Holmquist 5e98e3bcd6 Fix bug that would cause the image to stay small
When opening the lightbox, the image might stay small
because of a race condition. This is fixed using a
deferred object.

Change-Id: I4e93c7d26da47e5177abeb1dac841bf6c25a9022
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/138
2014-01-27 10:21:38 +01:00
Mark Holmquist 5b03c39c72 Move models to their own modules
Change-Id: Ib3d32496bfbc174dc136a269abf0b66cf0ae475d
2014-01-24 11:41:05 -08:00
Mark Holmquist 5e4a544133 Moving things around for module renames
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
2014-01-24 09:21:16 -08:00
Aaron Arcos f643430373 Fix to streching image b/60173.
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
2014-01-23 16:16:13 -08:00
Mark Holmquist 64c1cc2976 Fix up jsduck docs
Documentation shouldn't be this hard :P

Change-Id: I758ec6c5b3e0ba389dbb837470fa6ceea07fa67d
2014-01-23 18:31:12 +00:00
jenkins-bot d245703241 Merge "A bunch of description fixes" 2014-01-22 23:51:50 +00:00
Mark Holmquist 22d2a69979 A bunch of description fixes
* 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
2014-01-22 14:46:39 -08:00
jenkins-bot 7f67c0934a Merge "Add 'Location:' to the location message" 2014-01-22 17:13:52 +00:00
Gergő Tisza fed238fcd6 Create model & providers for file usage information
Bug: 60087
Change-Id: I0e72c1e4590714e92a365f9741633221af5b0553
2014-01-21 18:04:51 -08:00
Mark Holmquist 47cad0e607 Add 'Location:' to the location message
Actually it's a totally new message, but still.

Change-Id: I5c02b9ec59bd0c8e455aae71936625a1bae48700
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/121
2014-01-21 17:35:02 -08:00
Mark Holmquist 34047e3ba3 Fix jsduck warnings
Change-Id: I91da4956c6635088a3763c2cd79d0e685bbaf859
2014-01-21 16:28:05 -08:00
Mark Holmquist 4ce1d0d206 Add main class to jsduck
Change-Id: I774303ce4f756637bea3821ae2b2ff724351b3bb
2014-01-21 13:48:10 -08:00
Mark Holmquist bdef21d593 Adding first pass at jsduck docs
Interface, data model, and image all documented.

Change-Id: Id64da283c4bbeaae930103233f9e798b5a9db51b
2014-01-21 11:44:58 -08:00
Mark Holmquist f59962e4a3 Add location information to metadata div
Adds location in a human readable format, plus a link to geohack because
that's how we roll.

See https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/42

+more tests

Change-Id: Ie8c9b8a0caf0f13ad5341a84173381ce49da97f6
2014-01-17 17:22:44 -08:00
Mark Holmquist 6363b90bd8 Add caption to the interface in place of description
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
2014-01-17 16:37:56 -08:00
jenkins-bot b9dc9b1c2d Merge "Refactor animation, plus test" 2014-01-17 17:47:29 +00:00
jenkins-bot 32c57f38de Merge "Display the favicon of the foreign file repo when available" 2014-01-17 17:30:59 +00:00
Gilles Dubuc ddff7de9da Display the favicon of the foreign file repo when available
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
2014-01-17 14:30:25 +01:00
apsdehal f992a5f9f0 Reduce font-size for description in lightbox
Bug: 56445
Change-Id: I0d553d5089768df597a48fa0c696b5a8d29d34c7
2014-01-17 01:49:19 +00:00
jenkins-bot be163c9bad Merge "Added test if Lightbox is attached" 2014-01-17 01:46:09 +00:00
jenkins-bot fa63bdee3f Merge "Use JSONP for gender query to avoid cross-domain issues" 2014-01-17 01:44:56 +00:00
Mark Holmquist 9b28edb1be Refactor animation, plus test
Change-Id: I688c573b7fbd136782177f0b690d3aab994c6d10
2014-01-16 17:33:15 -08:00
jenkins-bot 29b1efe9b8 Merge "Clicking on the chevron should open/close the details" 2014-01-16 21:53:53 +00:00
apsdehal 08957fa129 Added test if Lightbox is attached
Currently LIP.resizeCallBack was called even when lightbox was not appended, so I added a test to check the same.

Change-Id: Ie3a40a5d98f12a95b1d54e130896f67b71e927fa
2014-01-16 21:12:02 +05:30
jenkins-bot 380e78ab0c Merge "Fix resize functions" 2014-01-15 22:24:45 +00:00
Gilles Dubuc c0bf3591f8 Clicking on the chevron should open/close the details
Change-Id: Ica8c5ae8c8f34374e946246878f3c8609d263a12
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/80
2014-01-15 09:21:58 +01:00
Mark Holmquist 0b46a65794 Fix resize functions
Change-Id: I074a704e76c5c42890d65d8235854a998f3e4af9
2014-01-14 21:39:22 -08:00
Gergő Tisza d24ba2d7c8 Use JSONP for gender query to avoid cross-domain issues
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
2014-01-14 21:49:28 +00:00
Gilles Dubuc cbf6bd7767 Make sure that the close button is always visible
Change-Id: Ib1bf72d898220442992c5a30d90a9a683d00d110
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/81
2014-01-14 16:42:52 +01:00
Mark Holmquist 89417163a9 Refactor to a data model
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
2014-01-12 12:50:34 -08:00
jenkins-bot 1061cda70e Merge "Move the arrows and the close/fullscreen button" 2014-01-10 12:19:16 +00:00
Mark Holmquist ae50fad5f5 Use promises
Uses promises in the entirety of fetchImageInfo. Also removes the old
fetchRepoInfo method which was unused (basically) anyway.

Change-Id: Ie7f9a27822ecb893b99dbd755c6199769f2e6784
2014-01-09 16:52:18 -08:00
jenkins-bot cc8977de31 Merge "Fix metadata loading" 2014-01-09 18:33:32 +00:00
Gilles Dubuc 380612c4bf Only scroll to the top when opening the lightbox
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
2014-01-09 18:11:20 +01:00
Gergő Tisza a91058adc4 Fix metadata loading
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
2014-01-09 02:30:09 +00:00
Mark Holmquist 5949748ed6 Load images normally
Removes the spinner, loads images line-by-line. Supposedly more
expected for most users.

Change-Id: Ia5fba4c8d8af681c0a95e43d34014b07e33941c4
2014-01-08 23:42:06 +00:00
jenkins-bot 666f2b3af3 Merge "Make the behavior of the lightbox more consistent with scroll" 2014-01-08 19:36:16 +00:00
Mark Holmquist da86c5f750 Version our EL profiling
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
2014-01-08 09:35:35 -08:00
jenkins-bot 65db71572c Merge "Fix painful bug in eventlogging code" 2014-01-08 17:18:28 +00:00
Gilles Dubuc 26735d8bd1 Make the behavior of the lightbox more consistent with scroll
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
2014-01-08 17:05:05 +01:00
Pau Giner 4c87c93d91 Use chevron for panel opening affordance
replaces the drag image with a chevron and adds CSS classes to
adjust the opacity changes.

Change-Id: I689c7ff3c952f1ec2b8b16258dc44b1ad095f4fa
2014-01-08 14:41:44 +01:00
Gilles Dubuc f3fd143c8a Move the arrows and the close/fullscreen button
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
2014-01-08 11:33:56 +01:00
Mark Holmquist 3547f17960 Fix painful bug in eventlogging code
Change-Id: I3026aadcb28e7a8325137214512163558cccf2db
2014-01-07 17:27:28 -08:00
jenkins-bot 055ccb8c27 Merge "Styling fixes for media panel" 2014-01-07 19:37:44 +00:00
Pau Giner 797a2d90e0 Styling fixes for media panel
Color and position adjustments for panel elements:
* Background
* Line separation
* License text

Change-Id: Ib8c5557503ec6a28b9761220a251cf4ac4742182
2014-01-07 20:05:29 +01:00
jenkins-bot 5a58b12b7b Merge "Added No description message" 2014-01-07 16:00:21 +00:00
Mark Holmquist 896a7b4c40 Animate the metadata div to show the user it's there
"Hey! Scroll down! Yeah, you!"

Also fixes the previous arrow button, which got disappeared at some point

Bug: 58431
Change-Id: I98676ee921dc1d3b5780046eabec7415c05f8f4f
2014-01-06 18:29:37 -08:00
Mark Holmquist 27e2db75f9 Make sure the post-image div is always the same height
Otherwise it flickers and is weird and stuff.

Bug: 58431
Change-Id: Ic7d7d0bededede9b3cedb4ebd8efdcfae2209127
2014-01-06 17:24:45 -08:00
Mark Holmquist c17be3b124 Fixed positioning for the image
Fix, so we can work on animating the metadata div next.

Bug: 58431
Change-Id: Ic62711f657daaa36bb82e32e98a0abee421864fc
2014-01-06 17:14:51 -08:00
jenkins-bot 85a0474997 Merge "Bigger click targets for next and previous" 2014-01-06 23:38:02 +00:00
jenkins-bot e1efb5d16e Merge "Make the imageinfo fetch more generic" 2014-01-06 23:32:22 +00:00
jenkins-bot 1b94099d7f Merge "Fix issues pointed out by aarcos" 2014-01-06 23:07:39 +00:00
Mark Holmquist 7ec7172964 Make the imageinfo fetch more generic
Also use it in the resize method

Change-Id: I0ee2fcf7daf4a2492981c8311f3a3fd7054d6ae2
2014-01-06 15:07:03 -08:00
Mark Holmquist 85d08e1d27 Fix issues pointed out by aarcos
See https://gerrit.wikimedia.org/r/#/c/95282/10/resources/ext.multimediaViewer/ext.multimediaViewer.js

A few issues with code being in two places; should probably refactor but
would prefer to get out a fix and refactor a little later.

Change-Id: Id74a01e177aeb09fe34416e7fd14759df58fda32
2014-01-06 15:02:51 -08:00
apsdehal f9ee5ec0a0 Added No description message
'No description available' message has been added when description for the
given file is not available.

Bug: 56446
Change-Id: Ie239e5cd0d1b645ed149ea1ecc80197b0e84bc34
2014-01-07 01:57:08 +05:30
Mark Holmquist f2f36376cf Fix image bucketing resize engine
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
2014-01-06 11:32:40 -08:00
Mark Holmquist e9a1c8c102 Bigger click targets for next and previous
Change-Id: Ic2bd5b80092ee34133ae6b594ac25c57ab562b03
2013-12-31 13:18:22 -08:00
Pau Giner 4c17403070 Updated icons
Icons have been updated and CSS adjusted for close and next/prev arrows.

Change-Id: I335914685de4046f3ab76ea44a44b1b02222f831
2013-12-31 09:57:58 -08:00
jenkins-bot c0fef99d23 Merge "Move 'x' button, shift arrows away from screen edges" 2013-12-30 22:03:52 +00:00
Mark Holmquist 0000664d80 Add tests for the link construction code
Always a good plan.

Also refactored a little bit, but not too much. Juuuust right.

Bug: 57842
Change-Id: I787c3770e41474edafb2fd02e01fec2c7c2b5ed6
2013-12-30 21:51:35 +00:00
Mark Holmquist f8d9a3d522 Move 'x' button, shift arrows away from screen edges
Bug: 58653
Change-Id: I290bca497a56240890d64b234e960d04bd4a001c
2013-12-30 12:36:45 -08:00
jenkins-bot fdc0c0c860 Merge "Added 'Learn more' message" 2013-12-30 18:20:27 +00:00
jenkins-bot 3d1dfe6b7d Merge "Introduce image size bucketing" 2013-12-30 18:19:49 +00:00
apsdehal fb4367f24c Added 'Learn more' message
Message was added to replace 'multimediaviewer-repository' when the file was local

Bug: 56121
Change-Id: I2c6cef2cb21f88159dc56ca7c94c4be21e553db9
2013-12-30 16:54:40 +05:30
jenkins-bot feedc430d5 Merge "Fixes for the scroll-up affordance" 2013-12-29 15:05:24 +00:00
Mark Holmquist f96d5498ca Introduce image size bucketing
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
2013-12-27 13:39:31 -08:00
jenkins-bot ea7ba8faaf Merge "Include license in title attribute of link in FileUsageDialog" 2013-12-20 00:56:39 +00:00
theopolisme 343e82cc8c Include license in title attribute of link in FileUsageDialog
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
2013-12-19 16:00:22 -06:00
Mark Holmquist ebf8da9514 Fix remote DB repos
Apparently they don't have server members, they only have descBaseUrl.
Annoying inconsistencies are annoying.

Bug: 57842
Change-Id: I56cbb6b8ba29cc03105942816f6fa0bad0d126f7
2013-12-18 13:04:34 -08:00
jenkins-bot 4752404338 Merge "Extend the post-image div height for the drag affordance" 2013-12-18 18:42:51 +00:00
Ebrahim Byagowi 4f20e53fdc Make broken middle click during refactor work again
Change-Id: Ie4c40accd1ac21c548d4ab899ffdd6c8f95af0a5
2013-12-16 18:31:02 +00:00
Aaron Arcos ffc8f4948d Add smoke test to class mw.LightboxInterface.
- Moved tests that were meant for LightboxInterface objects.
  - Fixed space naming issues.

Change-Id: Ib83904eab5fa542330ea559d420efa5f1de8c3eb
2013-12-13 10:39:13 -08:00
Mark Holmquist e68e60f464 Fix another event handler bug
No need to register the event until the interface actually loads...

Change-Id: I1bddb5478410e1868195d63762d913a07e50c0ed
2013-12-12 15:30:11 -08:00
Mark Holmquist 76532a156a Fixes for the scroll-up affordance
Fix click listener, add cursor: move

Change-Id: I1c51702d4c7dd63d64026747c5c75d2dfff14c58
2013-12-10 15:22:40 -08:00
Mark Holmquist 32796a3578 Extend the post-image div height for the drag affordance
Forgot to update the size here, so there's a weird break in the div
right now.

Change-Id: Iea46de723a2ea9a620a07a150560901c81ea9620
2013-12-10 15:02:22 -08:00
Mark Holmquist 4e29e6cd01 Fix fileLink initialisation
I guess this got torn out along the way, but I'm pretty sure this is
what I meant to do - initialize the image object with the thumbnail
URL and then replace it later.

+tests for the failure.

Change-Id: I20ef4e87c6b4b6706ad586f2aa5796736895c780
2013-12-10 11:56:54 -08:00
jenkins-bot 2cc5279e06 Merge "Move clearInterface things to mw.LightboxInterface" 2013-12-10 01:41:18 +00:00
jenkins-bot 8695964ea4 Merge "Add performance logging" 2013-12-10 01:07:39 +00:00
Mark Holmquist f144a0a403 Add performance logging
Change-Id: If6e3aec4b2547fa9768eaaf5387729ed2b427ab1
2013-12-09 17:06:01 -08:00
Mark Holmquist 1411110b3d Move clearInterface things to mw.LightboxInterface
Also fixes a bug where we didn't clear our arrow key listeners, and VE
would sometimes see lightbox loads accidentally.

+tests for .empty()

Bug: 58107
Change-Id: Ica8326891b2da1f94966dbe72c28e878934ca64f
2013-12-09 16:33:34 -08:00
Aaron Arcos c38fa2fbfe Fix resize listener leak problem.
Third try, merged latest changes and added a test.
Run loading test against a wikipedia.org image.

Change-Id: I4e5a137e0f6dbedc45ec2c8393590919e23a26be
2013-12-09 20:45:47 +00:00
vldandrew 1d667263f0 Corrected page link and problems if the link is to a remote server
Additionally some other problems were corrected.

Bug: 56787
Change-Id: I01e7dc9938b52a8f809740e582d61b1e0131916d
2013-12-05 22:06:27 +02:00
Mark Holmquist 676d1ace46 Remove oojs hack
Unnecessary now that Ifea6405c2 has landed in core 

Change-Id: I4ad8238410c01308e37aa9b61cb4e8c84817801b
2013-12-05 02:47:09 +00:00
MatmaRex 516d0168c3 File usage dialog: Only reselect on focus, not on every click
Makes it possible to view the entire content of the box without copying
the text somewhere else, or to only copy a part of the text.

Change-Id: I8ed8beaadf7e515e57ee4f11bdaef9672c980f5b
2013-12-05 00:26:28 +00:00
Aaron Arcos add9a9b435 Add a very simple resize test
Add test to verify that in case of a resize event no image
replacement takes place when api data is empty/undefined.

Change-Id: I2a880ce4b2e6c158763b1473f6a9f751922187b0
2013-12-03 23:20:51 +00:00
jenkins-bot b704f294f8 Merge "Add tests to MultimediaViewer" 2013-12-02 23:27:42 +00:00
Aaron Arcos bed5c07039 Add tests to MultimediaViewer
These are just smoke tests. I will add more in coming versions of this change.
Consolidated various cases in one tests. Added tests to validate for legit clicks.

Based on Idfbec829399ff6969cd01be3c13a8ed7a66a1fef

Change-Id: I366c7af9a5cf43361d8293183c9da117bc5d4971
2013-12-02 15:19:12 -08:00
jenkins-bot 07a937571d Merge "jshint config and fixes, FINALLY" 2013-12-02 22:00:05 +00:00
Mark Holmquist 013752ccb2 Fix a bloody silly file usage dialog bug
Return false from the click handler so it doesn't fire a popstate event
because the link is to "#"

Change-Id: I08a49e1b664dc4e6b01c1f479209428578d36843
2013-12-02 13:11:26 -08:00
Mark Holmquist 198bf44c1a jshint config and fixes, FINALLY
Every patch we've submitted up until now has been magically very good
at jshint, because I'm appropriately OCD about it, but now we can actually
point at results.

Also we'll enable voting very soon.

Change-Id: I028fa78a47778c8a4050f6b77623c6bfdc4f9c5b
2013-12-02 12:50:34 -08:00
jenkins-bot fa70bdcb74 Merge "Auto-ellipsis for filename field Bug: 56113" 2013-11-30 19:00:40 +00:00
Yaroslav Melnychuk e632d32b65 Auto-ellipsis for filename field
Bug: 56113

Change-Id: I84e28fe8fefd90c46c2bd9d2d7a25c472d8f26d3
2013-11-30 20:53:42 +02:00
jenkins-bot a36622185f Merge "Prevent multiple "Use this file" windows" 2013-11-29 21:19:13 +00:00
theopolisme 464733af21 Prevent multiple "Use this file" windows
Bug: 56501
Change-Id: Ic86feacb881d3b559d32f33fba508121f8b9ec27
2013-11-29 14:36:21 -06:00
MatmaRex 1ed2804863 Replace weird .select() reimplementation
Browsers have had a .select() method on <input>s and <textarea>s
since the dawn of the web.

Change-Id: Ib35415115291086300494ef1c6cb3063cd6b8e94
2013-11-28 21:31:04 +00:00
jenkins-bot 3ed21410a6 Merge "Fixes the UI refactor" 2013-11-28 21:30:27 +00:00
vldandrew 53ef9ed86d Fixes the UI refactor
Id44fea9008adb391817250c2897693f45bead717 pushed a bunch of stuff into the
subclass of LightboxInterface, but forgot to change the calls to "this" in
the dialog function to be sane.

Bug: 57678
Change-Id: I998240411b0970d43d401f739b383c0289163760
2013-11-28 13:26:31 -08:00
MatmaRex d47778b501 Kill !Boolean( variable )
That's an impressive abomination. :)

Change-Id: I1e3d64add5921924050ad97bfe2b1e6f6b1d46b1
2013-11-28 22:07:32 +01:00
Mark Holmquist 85eb742277 Previous and next functionality!
Adds buttons on the side, disabled at the start and end of the list of
images, that let you browse through the images on the page!

Also arrow keys!

EXCITING!

Change-Id: Ie514cd4b16bdee8a384a89d4bd1d755a24c5cdb4
2013-11-26 21:10:16 +00:00
Mark Holmquist a4c0617b1f Push history state to support links to media viewer
Also listen for popState events so users can use their browser's back
functionality to close the lightbox or go backwards, etc.

Bug: 56469
Change-Id: Id44fea9008adb391817250c2897693f45bead717
2013-11-26 13:09:54 -08:00
Amir E. Aharoni 5141f71960 Fix images and related CSS for RTL wikis
Change-Id: I18ca1003a317f12ec658aef5ecd4779325407eae
2013-11-26 00:54:18 +02:00
Mark Holmquist 5aaf1e73fe Reorganize UI to be...way sexier.
There's just no other adjective for this, it is _super_ nice.

There may be refinements later as the designers get things together.

Bug: 56499
Change-Id: I200684a19c190444587f520595186e9ae5afbea6
2013-11-21 09:47:05 -08:00
jenkins-bot 2d2dc0353b Merge "Preserve space for the description even if it is not present" 2013-11-20 19:16:59 +00:00
Gergő Tisza 15108af3b1 Preserve space for the description even if it is not present
Bug: 56494
Change-Id: I22daa18cd5d697049cc1cef2f15c8de32e0746e3
2013-11-20 11:10:21 +00:00
Mark Holmquist 24a8092a2f Measure sitename clicks too
Change-Id: Iad105fbc9d257db895660d7afac77294e7907f7a
2013-11-18 22:04:10 +00:00
Mark Holmquist 95a88d43d1 Use oojs to extend multilightbox objects
Simple now, only really aliases the classes, but we'll use them to replace
the hooking infrastructure in the near future.

Change-Id: I963a4887a717c9bb064e30fa5fb86bbccb7186a1
2013-11-18 13:50:02 -08:00
tgr 5d419682f5 Use moment.js for date formatting
Add moment.js ( http://momentjs.com/ ) as a ResourceLoader module
and use it to parse and format date strings. Moment.js seems to be
the least bad option right now; eventually it should be replaced
by i18n functionality in core Javascript modules.

Change-Id: I332655778be3d694781b83fa5dea1e59770d8866
2013-11-15 14:53:45 +00:00
Mark Holmquist 96c4b06858 Rewrite of UI initialization
Split it into a bunch of different functions.

No helper functions because apparently most of my UI code is pretty
unique and not refactorable, or at least not easily.

Change-Id: I8209fd91ec6788c26b8dea26d97c26f8231ddbbf
2013-11-14 21:38:51 +00:00
Mark Holmquist c0c9e7037f ResourceLoader consistency file moves
Keep modules in separate dirs, move images to their module dirs, and fix
up the module declarations so they still work.

Also moved viewer.svg into the root.

Bug: 56421
Change-Id: Ia84ddfd3b91c784c42d9ba243c5cfd46354f139f
2013-11-14 13:38:40 -08:00