Commit graph

10 commits

Author SHA1 Message Date
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
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
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
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
Gergő Tisza 1ff0ac60cd Fix merge problem with categories
Change-Id: I628bffeb4cac16cf50def6d5562fb9e2b9fa8933
2014-02-05 01:46:55 +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 056651ed33 Renaming things for consistency: DataProvider -> Provider
Change-Id: Ia1f022baef02b477296c9664e7280c75b1c84515
2014-02-04 23:51:48 +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
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