Commit graph

47 commits

Author SHA1 Message Date
Gilles Dubuc 700df1ecc2 Track more user actions
- metadata open/close
- next/prev
- view terms
- author
- source
- hash load
- history navigation

Change-Id: I4ea7e0b008b46577322050d692359d46374a0929
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/290
2014-04-22 10:20:36 +02:00
Gilles Dubuc 09374fc9dd Restore article scroll after closing Media Viewer
There used to be a CSS trick with the order we added things to the
page and removed them from it, but it doesn't seem possible anymore
with the new order of execution, with the overlay appearing
immediately and being taken care of inside bootstrap.

The main cause of the bug, however, was the hash reset happening
after the interface was closed.

Doing the scroll restore with jQuery.scrollTo is more future-proof
and testable in QUnit.

Additions were also made to the cucumber E2E test because QUnit
alone wouldn't have caught the hash issue.

This also cleans up custom events a little and reintroduces
pushState on browsers that support the history API.

Change-Id: I63187383b632a2e8793f05380c18db2713856865
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/439
Bug: 63892
2014-04-14 18:04:30 +00:00
Gilles Dubuc 0fd2007923 Fix z-index bug in Firefox that would make navigation buttons appear on top of the metadata panel
Also fixes other issues:
- Some code in mmv.lightboxinterface.js wasn't doing anything
- Canvas buttons were being added to the wrong element
- Several CSS rules were being declared twice, a remnant of the multilightbox days

Change-Id: I6ffa1f6a989964d3863aa9dbeb332c0e59dff2e6
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/409
2014-04-09 17:37:14 -07:00
Gergő Tisza 95111d2b73 Use mw-mmv CSS prefix consistently for all things
With apologies to anyone who gets a hundred merge conflicts
because of this :)

We had several different prefix styles (mlb-, mw-mlb-, mw-mmv-,
mw-mmv-mmv-, a few unprefixed), which was getting annoying,
and will be confusing to wiki editors who are trying to figure out
where a given style comes from. Such changes are better done before
going live because it breaks all local CSS tweaks on the wiki,
so I am renaming things now (also removing some stuff which wasnt
used anywhere).

Change-Id: I00447a25f0028e234169c6db941bedc99622eb8d
2014-03-31 21:33:12 +00:00
jenkins-bot 38fa243c49 Merge "Display black overlay while the viewer JS is loading" 2014-03-31 01:35:43 +00:00
Gilles Dubuc 685f42f05f Display black overlay while the viewer JS is loading
I went for this option because it was the fastest to implement.
I think we should wait until we make the change to core to expose
image dimensions before we consider switching to another strategy.

Change-Id: I61c9342a2d6d6fc24a24e0988b3cf7f9a06859a2
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/248
2014-03-30 09:53:20 +02:00
Gergő Tisza 7379957398 Rename Buttons to CanvasButtons
Less misleading as we have lots of buttons, and I plan to add a new
button class for the Commons/survey/reuse thing.

Change-Id: I74194e22e9066c58f9c1eba57629458b2b9148b5
2014-03-28 00:10:04 +00:00
Gilles Dubuc 49bc5edd93 Clear the cursor hiding class when attaching the lightbox
This ensures that if fullscreen was exited with the cursor hidden
reopening the lightbox should happen with a visible cursor

Change-Id: I33846234fd4c314ff9ff924e9f42d4e8c5c5bd8d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/288
2014-03-19 16:01:30 +01:00
Gergő Tisza e8c099f3b7 Fix navigation issue with alt+esc on Ubuntu/Unity.
Bug: 62580
Change-Id: Ib2c8e21ee05000f7582f6e478034664c8be881e5
2014-03-17 21:14:07 +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
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
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
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
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
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
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
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
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
Gilles Dubuc 093cfdc697 Preload fullscreen image
Change-Id: Ief72a4ab2e49538132b174fd9fcf792ddab66b3d
2014-02-20 09:43:10 +01:00
jenkins-bot b6add9a17b Merge "Hide mouse cursor when buttons are faded out in fullscreen" 2014-02-19 23:48:32 +00: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 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
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
Gergő Tisza d7706d7cb0 Fix fullscreen bug where image was replaced with self
Change-Id: I81dcadae96a778559564a786a5753323fb802b7c
2014-02-12 01:55:37 +00: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
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
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
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 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 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
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
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
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 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
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
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 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
Renamed from resources/ext.multimediaViewer/ext.multimediaViewer.lightboxinterface.js (Browse further)