Commit graph

48 commits

Author SHA1 Message Date
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
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
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
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
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
Mark Holmquist 3547f17960 Fix painful bug in eventlogging code
Change-Id: I3026aadcb28e7a8325137214512163558cccf2db
2014-01-07 17:27:28 -08: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 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
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
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
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
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 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
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
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
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
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
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
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
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
Renamed from js/ext.multimediaViewer.js (Browse further)