Commit graph

30 commits

Author SHA1 Message Date
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
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
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
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
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 feedc430d5 Merge "Fixes for the scroll-up affordance" 2013-12-29 15:05:24 +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
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 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
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
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
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 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
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
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 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