Commit graph

391 commits

Author SHA1 Message Date
Gilles Dubuc b0d885e4dc Remove all survey-related code
Change-Id: I67285260c13a1e8d3c37365bb80a7156c0fecd4e
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/794
2014-07-16 21:27:53 +00:00
jenkins-bot 116d29a651 Merge "Remove trainling dot from download attibution text to not break URLs" 2014-07-07 16:30:56 +00:00
jenkins-bot 6faaa01ad3 Merge "Convert non-standard class-names (mw-mlb, multiediaviewer-)" 2014-07-07 16:29:47 +00:00
jenkins-bot 1294e824c9 Merge "Add functionality to TruncatedTextField to toggle full text" 2014-07-02 13:29:14 +00:00
Gergő Tisza c5c450f91b Add functionality to TruncatedTextField to toggle full text
Change-Id: I34db79faa80ee5d1b3518aafd9b866cc9cdcc45b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/396
2014-07-02 15:26:21 +02:00
Gergő Tisza 4a05b97dc9 Remove trainling dot from download attibution text to not break URLs
When formatting the attribution as plain text, make sure that the
source parameter (which typically ends with an URL) is not followed
by a '.', which could break autolinking when e.g. the text is
copied into a mail.

Change-Id: I5406fe3a55bc4ef6802b32d5a3d533ce9f49b361
2014-07-02 01:11:02 +00:00
Gergő Tisza 890d7721df Convert non-standard class-names (mw-mlb, multiediaviewer-)
Change-Id: Iab48c9df461b3405ea35d2da7f98fb6812e86b59
2014-07-02 01:02:41 +00:00
Gergő Tisza 4adde1685a Show help tooltip for "view original file" button on image click
Change-Id: Ia9e20f55bcdd0482e78a6e9aa5a0625ec2717e78
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/712
2014-06-30 21:12:29 +00:00
jenkins-bot 02216b5ed3 Merge "Add section for attribution of downloads" 2014-06-30 18:36:07 +00:00
Reedy 5c3846a74b Drop execute bit
Change-Id: I6c9f8ea6251bf6a7ed2a5684e5eaa572530a4fb9
2014-06-30 18:34:02 +01:00
Mark Holmquist a4e6bc22d9 Add section for attribution of downloads
Click on the button to expand, click the X to collapse again.

Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/598
Change-Id: I6d2512cca0184437273329e6553c6524d6953404
2014-06-30 10:38:11 -04:00
jenkins-bot 5abf15890e Merge "Fix URL handling for global usage list" 2014-06-27 17:41:17 +00:00
Gergő Tisza 033e7debcf Fix image download test to not rely on assets outside the codebase
We should probably have a proper test image eventually, so that
we can use e.g. image dimensions to double-check the results, but
this way at least our tests won't get broken by unrelated changes
in other repos.

Change-Id: Iffffd94fde99c53da59217a5181ad0560fce314c
2014-06-25 22:10:56 +00:00
Gilles Dubuc eef5fe7897 Add Safari to browser tags
The test passes on Cloudbees, we can now add the tag to make
it official

Change-Id: Id0ada2fbdb7e3fea1429d0cbec52b24e5815c4ac
2014-06-25 21:43:29 +00:00
Gergő Tisza deafff7046 Fix URL handling for global usage list
Also add integration tests to make sure URL generation works OK

Bug: 63908
Bug: 64910
Bug: 66147
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/570
Change-Id: I448f42e294102a633f74c305dd0a226e7dbe955d
2014-06-25 21:41:04 +00:00
Gergő Tisza f7ae77e79e Remember last reuse tab selection
Change-Id: Ic9b5d0ecc49b6361bfaa0e83b7340648ea2e6a72
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/660
2014-06-25 02:19:49 +00:00
Gergő Tisza 427d9f0272 Fix failing test
The Vector skin directory was renamed to uppercase, apparently.

Change-Id: Ied94356f13a661101ee3ba101503229c4bce5a79
2014-06-24 20:19:38 +00:00
Gergő Tisza 5e3808a14e Make the metadata panel opening affordance more obvious
- rearrange DOM structure of above-fold part of the metadata panel:
  - rename .mw-mmv-controls to .mw-mmv-above-fold
  - the above-fold part is a single positioned div now, with height
    explitcitly set
  - less LESS gymnastics, above-fold height is a single variable
  - add paddings to the p elements instead of the containers
  - make all title elements align to baseline (except the logo which
    would look horrible)
- discard some CSS which was superfluous
  - overspecified sizes/positions
  - some top/bottoms for staticly positioned elements
- get rid of the .mw-mmv-drag-affordance div, since a full-width bar
  wouldn't really make sense on the bottom of the above-fold section
- flip the chevron and place it to the bottom of the above-fold part;
  add colors etc. per spec
- fix stripe button horizontal spacing

Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/706
Change-Id: Ic37b4150288055c3fae8d22919ed7b1249db1f09
2014-06-19 21:14:56 +00:00
Gilles Dubuc 4e752dd08d Track optin/optout events
Change-Id: I07eeef7a2304df4b70be252929737dad84522afb
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/558
2014-06-19 11:23:03 +02:00
jenkins-bot 0c80fcd992 Merge "Make optout link more AJAXy" 2014-06-19 09:01:54 +00:00
Gergő Tisza c01cb55f4d Make optout link more AJAXy
Make it grey, unclickable and change text while waiting for the
AJAX request.

Change-Id: Ic5c2923944658d5be04217cdfe62e1d8608a478f
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/723
2014-06-19 10:42:04 +02:00
jenkins-bot 30a1940737 Merge "Change "learn more" to "more details about this file"" 2014-06-19 08:17:53 +00:00
Gergő Tisza 2616546468 Change "learn more" to "more details about this file"
Several people complained that "Learn more on Wikimedia Commons"
is not clear: it can be interpreted as a link to the Commons
main page, the text does not suggest that the link will be related
to this specific file. The new wording tries to address this.

Change-Id: Ia605cc30c4ca57598f7cebdde60061800a10b6e7
2014-06-18 19:10:11 +00:00
Gergő Tisza c594a5610a Make max-height computation more stable
Instead of setting the parent's height as max height of the
<img> element, find the first parent which has a non-automatic
height (that would be .mw-mmv-image-wrapper).

With the old structure, the height of the parent element could
be determined by the height of the image, which would then be
written back into the max-height of the image, messing up the
aspect ratio. I did not see this in the wild, but it was easy
to reproduce by changing the timing of the resize handler (in
particular, I tried to call the resize handler before loading
the new resolution, to make the UI more responsive, and ran
into this problem). This cannot happen anymore now.

This also fix a bug on some browsers (IE 10, maybe iOS Safari)
where the size of the image could be slightly larger than the
available space, and the bottom of the image was obscured by
the metadata panel. I am still not sure how exactly that
happened, but it was related to the <img> parents with automatic
heights having incorrect height. After making sure the <img>
has a max-height derived from an element with non-automatic
height, I cannot reproduce the bug on IE 10 anymore.

Change-Id: I193aefc42e6d6072717643659a9e4c0c8b7c7e93
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/698
Bug: 66244
2014-06-17 21:20:00 +00:00
jenkins-bot a4e2dc6962 Merge "Make MediaViewer ignore images which are in 'noviewer' class" 2014-06-13 23:34:23 +00:00
Gergő Tisza 92ea8edbc5 Make MediaViewer ignore images which are in 'noviewer' class
This includes images where the <img> element has that class
(achievable with [[File:Foo.png|class=noviewer]]) and also those
where some parent element has it.

Change-Id: I666be026828ea9ecb6e8c93d3f5ad1e3c190f81e
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/511
2014-06-13 23:32:32 +00:00
Mark Holmquist ea610f8256 Tooltips for loads of things
Change-Id: I993bf60909024453a14de85af6239bded02eb8a6
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/546
2014-06-12 12:27:04 -07:00
jenkins-bot 6e5a1cb185 Merge "Add opt-out/opt-back link" 2014-06-11 22:47:29 +00:00
jenkins-bot b53f7b2e60 Merge "Add functionality to check & set opt-in flag from code, also for anons" 2014-06-11 21:48:13 +00:00
Gergő Tisza 3cebfe32bc Use Repo.isCommons() for deciding whether an image is from Commons
Change-Id: Id6b523d218a9abc9e886da4000962c6523d25dc0
2014-06-11 21:14:14 +00:00
jenkins-bot 114890cc43 Merge "Add "zoom" but really just view-file" 2014-06-11 02:38:52 +00:00
Gergő Tisza 5bd730894d Add opt-out/opt-back link
Change-Id: I998b7ad3ecb0b7e815f9ff0d5f871267b91c109d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/703
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/704
2014-06-11 02:24:17 +00:00
Gergő Tisza e8c7c537a2 Add functionality to check & set opt-in flag from code, also for anons
Adds anew mmv.Config class to centralize localStorage handling issues,
adds AJAX option setting, adds getting/setting opt-in flag from
localstorage.

Change-Id: I25762ccb8c9bccd694c30a6f1c5d3c8611a5ecbc
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/703
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/704
2014-06-11 01:11:12 +00:00
jenkins-bot 9ec13a97cd Merge "Show Commons link to logged out users" 2014-06-10 22:19:17 +00:00
Mark Holmquist b2039ad7eb Add "zoom" but really just view-file
The zoom icon should get replaced Real Soon Now - looking at you, pginer

Change-Id: I88c1d4fb95e034e0f2fe618eb7309754ea1c283e
2014-06-10 15:07:12 -07:00
jenkins-bot 4ff614cf1b Merge "Toggle metadata panel on up/down keypress" 2014-06-10 21:31:22 +00:00
Gergő Tisza 4f54b81c03 Toggle metadata panel on up/down keypress
Previously 'up' brought the panel up, and 'down' brought it down,
which might conflict with expectations on scrolling. Up/down keys
now move the metadata panel to the opposite state, no matter what
the current state was.

Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/697
Change-Id: I53079d81042afb86354bf44e9dfd662adf1576cb
2014-06-10 20:10:42 +00:00
Gergő Tisza 92e68e4013 Show Commons link to logged out users
Change-Id: I899cb36a5d25342325266b68a3fd8058f3129e78
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/429
2014-06-10 00:30:14 +00:00
Mark Holmquist fc02ce0dc8 Use original URL when setting download for original
Messed with the download tests a bit too.

Change-Id: I6b7f6b5eb8642db1a81aff05663636813a21fe06
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/470
2014-06-09 18:30:07 +00:00
Gergő Tisza f9d06141f4 Make JSHint enforce ES3 compatibility
Also fix ES3 compatibility errors.
Upstreamed issue with sinon.stub().throws():
https://github.com/cjohansen/Sinon.JS/issues/488

Change-Id: I93b0d575484089b293d94ea860d245def4646cb4
2014-05-28 22:58:33 +00:00
Gilles Dubuc 7161ac3cc4 Record sampling factor in EventLogging calls.
Change-Id: I3966bf5dfe9ed607bda8e87f3b1924de37716dcf
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/619
2014-05-22 09:30:37 +02:00
jenkins-bot 1d897bcb17 Merge "Highlight chevron when the wrong direction is pressed" 2014-05-22 00:05:11 +00:00
Gergő Tisza 1ad28140c3 Fix text selection behavior in reuse panel
The jQuery update broke onDomEvent('focus') in OOjs UI. This is a
workaround which fixes the issue by binding on the input/textarea
elements directly, instead of their parents.

This introduces the annoying side effect that the metadata panel jumps
a bit when the embed HTML text is selected. (Just for that one, yes.
Weird.) Still better for now than no selection at all.

Change-Id: Ifa4c0600d7b4c0c64487596cbcabd5b4f4a12a19
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/638
2014-05-21 22:00:46 +00:00
Timo Tijhof 35ec99eb50 Use example.{com,net,org} instead of proprietary domains
http://foo.com/bar was making a request to some random server
responding with HTTP 500 Internal Server Error.

Change-Id: I17f2e0908b849455db5ab1790b15c2344337c24b
2014-05-20 16:34:54 +02:00
Gilles Dubuc c7fe85154b Highlight chevron when the wrong direction is pressed
Change-Id: I0d43c58a16fa805611f9fdef329b5ab6a32ed651
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/554
2014-05-19 11:01:31 +02:00
jenkins-bot 32c09c5786 Merge "Wait some more for the close button to appear" 2014-05-17 00:07:11 +00:00
Gergő Tisza 171b13149e Add sampling to unsampled event logging
Has issues:
- needs dependency injection
- needs to be DRY
- should not load mw.eventLogging when we are not in sample

Due to urgency this will be fixed in another commit.

Change-Id: I0df067a619109a7c945f82c8d33fa2e621217f0b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/619
2014-05-16 18:43:55 +00:00
Gilles Dubuc eedc57c1c9 Wait some more for the close button to appear
During the warmup steps Media Viewer might take some time
to open, which might be why the close button won't appear in
less than 5 seconds

Change-Id: I3b17d46c3343f2b1ff33aaaf55faa4adb71cb218
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/618
2014-05-16 11:36:12 +02:00
jenkins-bot 44311cddd4 Merge "Revert "Minimal zoom implementation"." 2014-05-16 08:29:49 +00:00
jenkins-bot eecde58ff8 Merge "Add 1 pixel of tolerance to the basic test." 2014-05-15 20:42:52 +00:00
Gilles Dubuc c6411d3c6a Add 1 pixel of tolerance to the basic test.
This is the first failure that the E2E test is running into when being
run on IE9

Change-Id: I60fe8764196ecc60e2c365576349cf902a069ddb
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/577
2014-05-15 20:41:08 +00:00
Gergő Tisza ab7b339143 Revert "Minimal zoom implementation".
Per the design meeting, we are abandoning this feature for now - there is not enough time to ensure it is of acceptable quality.

This reverts commit 4329d453ec.

Change-Id: I27c113ffecb617d442557163722ea5181ed0b2f4
2014-05-15 20:40:41 +00:00
Gergő Tisza d74b4dce4f Fix failing focus tests
jQuery 1.9 changes how $.focus() calls are handled: instead of
directly calling the handlers, it just invokes the DOM element's
focus(), and leaves it to the browser's event handling to trigger
them. This can fail for several reasons (e.g. element is not
attached to document, element is already focused, browser bugs such
as http://bugs.jquery.com/ticket/13363 ), so we are using
triggerHandler('focus') instead, which calls the handlers directly
without simulating actual browser events. Since these are unit
tests verifying event handler attach/unattach behavior, not
acceptance tests verifying actual event handling behavior, that
should be okay.

Change-Id: I65ecda28ace4f380ad33d6212e12069e18001232
2014-05-15 19:20:47 +00:00
Gergő Tisza 4329d453ec Minimal zoom implementation
Just a link to the full-size file for now.

Since the link must be to a PNG/JPEG/GIF (so possibly a thumbnail),
and we want to cap the size, we might need to get the URL from the
API, but we need to open the new window right away to avoid popup
blockers, making this patch quite complicated.

Change-Id: I9ce9d2a2d27b75470eae2806d9f9ce2f95f4dac2
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/588
2014-05-15 01:04:23 +00:00
jenkins-bot eeb5f4bd38 Merge "Improve DurationLogger test code" 2014-05-14 19:35:52 +00:00
jenkins-bot 3353a3e1a2 Merge "Fix IE9 support" 2014-05-14 19:21:14 +00:00
Gilles Dubuc 8a4c062343 Improve DurationLogger test code
More dependency injection, cleaner sinon calls

Change-Id: I4b15a6aa9bca3b89f85ad15eed02e33c291b754d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/571
2014-05-14 12:24:31 +02:00
Gilles Dubuc 7d5a82c571 Fix IE9 support
- Fix JS error on pushState
- Fix blur issue where blur(0px) filter would blur anyway
- Fix wrapper sizing issue where its size would be 0 when measured

Bug: 65225
Change-Id: If9279cd56f55f71f261ec54dda8228194988b9ae
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/597
2014-05-14 12:06:27 +02:00
Gergő Tisza 40b125565d Extract metadata panel scroll/log/animate logic into separate component
Change-Id: I2441d64c094a9bfbae7a4712ff4c78efa13a62a7
2014-05-13 18:57:38 +00:00
Gergő Tisza 8a118816a5 Do not log a metadata event when the user presses the wrong key
Do not log metadata-open when panel is already fully open and the
user presses the open key. (Same with close).

Also a completely unrelated code simplification.

Change-Id: I1f26b8669aa496d68b61d9a432430bf0864e8533
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/559
2014-05-12 21:29:12 +00:00
Gergő Tisza d964b3fd09 Fix url encoding in URL guesser
Change-Id: I99757913cd2fe5170db37c79a2d2986b12b5aa45
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/594
2014-05-09 22:44:57 +00:00
Gilles Dubuc 8a9f23dab7 Remove the threshold where a load is considered to be coming from the browser cache
We'll filter those out in SQL instead.

Change-Id: I2b7c019e20fa224480035b67c64b5666d21ba55c
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/563
2014-05-06 16:59:53 +00:00
jenkins-bot 9e0df0dd4c Merge "Refactor progressbar & blur handling" 2014-05-01 23:12:22 +00:00
Gergő Tisza fec24e02f7 Refactor progressbar & blur handling
This tries to fix a number of related issues:
* the blurred thumbnail was visible for a split-second sometimes
  when switching back to an already-loaded image. (Presumably when
  JS was sluggish enough to take more than 10 ms to execute.) We
  now check whether the promise is pending before showing a placeholder.
  (More generally, a lot of unnecessary logic was executed when paging
  through already loaded images, like displaying the placeholder, so
  this might make the UI a bit more responsive.)
* the blur could get stuck sometimes - I have seen this a few times,
  but have never been able to reproduce it, so I'm only guessing, but
  maybe the timing was really unfortunate, and we switched back less
  than 10 ms before loading finished. We now remove the blur on every
  branch, just to be sure.
* adding a progress handler to a promise might not have any immediate
  effect, so when switching to an image which was loading, the progress
  bar reacted too late. We now store the progress state per thumbnail
  so it is always available immediately.
* the progress would animate from 0 to its actual state whenever we
  navigated to the image. The change on paging is now instant; the
  progress bar only animates when we are looking at it.
* switching quickly back and forthe between a loaded and a loading
  image resulted in the loading image becoming unblurred. This seems
  fixed now, I'm not sure why. Maybe the "skip on non-pending promise"
  logic affects it somehow.

Also removes some unused things / renames some things which were
confusing, and makes an unrelated fix in the image provider, which kept
amassing fail handlers.

Change-Id: I580becff246f197ec1bc65e82acd422620e35578
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/489
2014-05-01 21:09:28 +00:00
Gergő Tisza 88f766bfc3 Reanimate metadata panel when viewer is reopened
Change-Id: I776a27358b2da17a35234aa8cb649a49df4a651d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/548
2014-05-01 12:05:26 +02:00
Gilles Dubuc 5f7af0cede Catch exceptions raised by localStorage write operations
Also adds dependency injection to the metadata panel
for cleaner tests.

Change-Id: I3f062ff88c03ad3baca00461bff486a883776eb1
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/530
2014-05-01 12:00:31 +02:00
jenkins-bot 553a9f142d Merge "Disable JSONP cache breaking in jQuery" 2014-05-01 09:50:32 +00:00
Mark Holmquist 969c5bfda9 Add preferences link after "help"
Reused message from the top-right menu.

Change-Id: Id37712e332bf8fed56edaa9ae8f7e04a2a5a5f42
2014-04-30 22:49:09 +00:00
Gergő Tisza 7a4a8e90ad Disable JSONP cache breaking in jQuery
Change-Id: Ie3b80b0c2f8ce734c6d08418c7b19a7e24c2d5eb
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/547
2014-04-30 22:39:17 +00:00
Gergő Tisza 6d301dcd12 Do not handle clicks if MediaViewer could not be loaded.
mmv.bootstrap will not try again to handle clicks if it failed
for the first time.

Change-Id: Idd55d7dc6c1388070895f8630bdcd51763a94d86
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/527
Bug: 63801
2014-04-29 16:04:17 -07:00
jenkins-bot 5980cd7322 Merge "Use sinon.js to test the thumbnail fetching" 2014-04-29 21:27:10 +00:00
Gergő Tisza b6953ba06f Use sinon.js to test the thumbnail fetching
Change-Id: Ida6143e29e54d90f26e7888aced1d207b3bfa702
2014-04-29 21:24:12 +00:00
Gilles Dubuc 8ab6ef23c8 Adds new performance metrics
- duration between early click and replayed click
- duration between replayed/post-replay click and first image display
- duration between replayed/post-replay click and first metadata display

Change-Id: Ia308db7580fd89538b9a9c8b0fea89fa2a4c77d2
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/515
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/508
2014-04-29 14:08:49 -07:00
Gilles Dubuc 0d51b0128d Preload Media Viewer js/css when hovering thumbs
Change-Id: I6f56c9d3d908f1980d2a3b29bea857d828fdaf0e
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/430
2014-04-29 13:36:47 -07:00
jenkins-bot fa8cf649bf Merge "Make progress bar less erratic" 2014-04-29 08:00:11 +00:00
Gergő Tisza 7ee0cf3fcd Make progress bar less erratic
Solves the bug, and makes the code slightly cleaner, but it
still does not inspire confidence (e.g. use of viewer flags
by a bunch of callbacks that can run for a background image).
Also, the tests seem underspecified.

I'll follow up with some more refactoring.

Change-Id: I2557abcec173691ffce21185bf1a939f1644ba8c
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/489
2014-04-24 23:55:26 +00:00
jenkins-bot 2ed46d3c06 Merge "User custom user agent to identify production test runs" 2014-04-24 23:14:16 +00:00
Cmcmahon 7b0cef0fe8 Merge "Set correct license link location in E2E test" 2014-04-24 18:18:32 +00:00
Gilles Dubuc e4a9b6c62c User custom user agent to identify production test runs
It's important that when we generate the graphs based on
EventLogging data, we have a foolproof way to filter out
local runs that happened during development.

Change-Id: Ifc65d3b4bfb96946a8e8d59d080a6c5ee6552533
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/509
2014-04-24 16:52:13 +02:00
Gilles Dubuc 353ce92d79 Set correct license link location in E2E test
* Remove login since it's not longer needed
* Point to a new smaller test page instead of Lightbox_demo
 which should make the tests run much faster
* Tweak selenium scroll workaround which seems to be speed-dependant

Change-Id: I247ae6a5044ecc93b6f3839f1b9ed955b488b5a7
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/475
2014-04-24 15:50:06 +02:00
jenkins-bot 476a0be245 Merge "Skip userinfo request if no message depends on the gender." 2014-04-23 23:47:34 +00:00
Gergő Tisza 846019a08a Make License.isCc() really return booleans
Before it returned undefined if the license had no internal name,
which caused unexpected behavior when used with $.toggle().

Change-Id: I1dcee6c999982fde47f9d388381fc670d81a6c5d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/494
2014-04-23 20:30:03 +00:00
Gergő Tisza ec883d84ef Skip userinfo request if no message depends on the gender.
Change-Id: I85bc617efc87ed1c4526eb74470bb6182910d9fc
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/435
2014-04-23 00:59:23 +00:00
Gergő Tisza d1a6592185 Add more survey languages (fr, de, pt/pr-br)
For pt speakers pt-br is shown until we get a pt translation

Related core commit: If2c57846f4dfb05ea58f36b25e3d8185d2a6e70e

Change-Id: I595446dc59c1bca2ea0b977be9d26f17192d3bc4
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/481
2014-04-22 22:03:32 +00:00
Gergő Tisza c304baf0ba Show metadata panel immediately.
Change-Id: Ie71eb1d29e3863b99687a75da69fad9a1ead552c
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/458
2014-04-22 16:10:25 +00:00
jenkins-bot 5007968d4f Merge "Split the progress bar into a component of its own." 2014-04-22 09:19:41 +00:00
jenkins-bot 61b5de0d22 Merge "Cache API responses" 2014-04-22 08:58:44 +00:00
Gergő Tisza 284a936aff Cache API responses
Cache API responses, both on Varnish and in the user's browser.
The imageinfo request is not cached, since that would make it very
hard to test metadata template edits. Everything else is cached for
one day.

Change-Id: I9149cf40d4448a424073eefd1eb442c70c977687
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/435
2014-04-22 10:56:52 +02:00
jenkins-bot a057ee476e Merge "Open license deed in new tab" 2014-04-22 08:48:12 +00:00
jenkins-bot 2471bbe136 Merge "Display correct file type on download button" 2014-04-22 08:31:27 +00:00
Gergő Tisza 3bddd3fcb7 Open license deed in new tab
Not convinced this is a good thing (file description page still
opens in same window so it is somewhat inconsistent) but suddenly
leaving the lightbox to show the deed feels like a very unintuitive
behavior to me.

Change-Id: I2cca3e4241fd1bb2848c11cf425aa75aad8c4a30
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/472
2014-04-22 00:21:11 +00:00
Gergő Tisza f04f5984d5 Display correct file type on download button
Works, but awkward - the extension name changes a little later than the button
text itself. This is hard to avoid since we don't know beforehand
what the thumbnail type is - we have to wait for the API request.
(We can't do thumbnail URL guessing here since we cannot catch the 404 error.)

In general the whole API handling here is not so good, with a separate API
request going out when we should just get all size options in a single request,
when the user opens the reuse panel.

Change-Id: I502b7cb4e99d8af348d7d1967eb8343ec0f926fe
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/471
2014-04-21 23:51:15 +00:00
Gergő Tisza c9e92da374 Split the progress bar into a component of its own.
Change-Id: I131b0d1b8ec992a7c7ad388021febea5a0303d16
2014-04-21 22:27:59 +00:00
Gergő Tisza c1b2b1bb2c Show 'view terms' when we can't figure out the license
...since there probably still is one, and our failure to parse it
just makes it more important that we direct the user to the file
page.

Change-Id: Id31f95021f059ccf4bf9893b1146f3807dcabdcb
2014-04-19 00:42:47 +00:00
Gergő Tisza b00eca6ade Collect license handling code, remove unused data attribute
This just shuffles code around, should not change behavior.

Change-Id: Ieb0102300c8444f18444fae38e5ea813d8f682e5
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/472
2014-04-19 00:39:21 +00:00
jenkins-bot 29a241ae36 Merge "Test to compare the performance of MMV and the Commons File: page" 2014-04-17 10:51:10 +00:00
Gilles Dubuc bf213ed978 Test to compare the performance of MMV and the Commons File: page
- Runs combinations of cold/warm browser cache and average/large window size
- Sends events with EventLogging that will allow us to generate limn graphs

This should run separately from the other cucumber test we already
have. This one needs different environment variables  because it needs
to run against production wikis instead of beta wikipedia

Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/378
Change-Id: I53b521ca2759c493aae6fe6e59be8d448e0f15d7
2014-04-17 12:32:15 +02:00
Gergő Tisza dd9a9718c3 Use thumbnail guessing
Change-Id: I2335af257fd23c9367b6839dfc6050840a905aa2
2014-04-17 10:35:33 +02:00
Gergő Tisza e03b9345c2 Guess thumbnail URLs without extra API call
Given a sample thumbnail URL and the original width/height
this provider tries to guess the thumbnail url for a given
size.

Change-Id: I2966b60978ab763864475851d8a79370bd422dc4
2014-04-17 01:21:35 +00:00
jenkins-bot 67f0272f1e Merge "Add history back button test to E2E" 2014-04-16 22:16:08 +00:00
jenkins-bot bd9b268107 Merge "Fix E2E scroll assertion logic" 2014-04-16 22:10:44 +00:00
jenkins-bot 8217b97462 Merge "Load moment.js on demand" 2014-04-16 20:32:21 +00:00
Gergő Tisza 9b1e756c3b Replace current URL generation logic with routing classes
* deduplicates URL generating/parsing code
* gets rid of spaces in URLs
* fixes error for file names with / in them (in case they exist;
  current MediaWiki seems to disallow such names anyway)

Change-Id: I5aad43f6af1b99523c597c39befcc9db1ecab83a
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/371
2014-04-16 12:51:38 +02:00
jenkins-bot e78d391037 Merge "Add routing classes" 2014-04-16 10:51:02 +00:00
Gergő Tisza 0b614c78e3 Add routing classes
Adds a Route class hierarchy for various URL schemes and a Router
class to convert Route classes to and from URLs.

Right now we only have two(-ish) schemes, but in the future we want
to be able to show related images which are not present on the current
page and need shareable URLs for those as well; also we might want
to specify other things in the URL than the current image (the reuse
box being open was one thing discussed); this will be a good framework
to add features like that.

The MainFileRoute class will be used by #416.

Change-Id: I489126a0ada37f91a22a2f48a4e686140a28d162
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/371
2014-04-16 12:40:17 +02:00
jenkins-bot ffdc63aa4c Merge "Do not load too-big thumbnails for SVGs" 2014-04-16 10:23:40 +00:00
Mark Holmquist 68bb702eaa Fix issues with file page link
TIL about setup/teardown in qunit

Change-Id: Ib283285bea401be251ec3f46a2dbd01623fe895e
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/452
2014-04-15 15:42:11 -07:00
Mark Holmquist 0ed174a306 Do not load too-big thumbnails for SVGs
Change-Id: Iae75105151bfcd0e974fc292794802c77eb26ea4
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/448
2014-04-15 11:21:05 -07:00
Gilles Dubuc ac9f5d8c96 Add history back button test to E2E
The scrolling logic has broken specifically when navigating with the
back button (as opposed to pressing the "close" button). This change
aims to test that scenario.

Change-Id: Ibe31b319c882b7de2a84ae143652144093c50f1c
2014-04-15 16:25:22 +02:00
Gilles Dubuc fe399fc71c Fix E2E scroll assertion logic
It turns out that cucumber/selenium will automatically scroll
to the element you want it to click on. As a result we have to do
the same in order for the assertion to be correct when coming back to
the article.

Change-Id: I7d3b6609cfe7cdae9c08a6d723d652ad1a6a7055
2014-04-15 16:09:18 +02:00
Gilles Dubuc 7ff5b22873 Load moment.js on demand
Change-Id: I881d38ea201f314fcf364766bb589f56c9e6b057
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/444
2014-04-15 14:13:27 +02:00
jenkins-bot a3cb95e2d2 Merge "Restore article scroll after closing Media Viewer" 2014-04-14 19:23:15 +00: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
jenkins-bot e4e68115f5 Merge "Load oojs-ui on demand when "use this file" is clicked" 2014-04-14 17:29:58 +00:00
Mark Holmquist 244a5e70b0 Miscellaneous fixes to truncatable text fields
Should make the e2e tests pass again.

Change-Id: I2a610468837f53d10fd9e7f2fa6d0937407e6f26
2014-04-14 17:19:59 +02:00
Gilles Dubuc eb6386bb5b Load oojs-ui on demand when "use this file" is clicked
Change-Id: Ia3b6b91c7ff0cb223f5f312eb901726fb6adcf35
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/426
2014-04-14 11:50:05 +02:00
cmcmahon 6ec33facf6 update test to pass with new locator
Change-Id: I49aec9bbfd590cc6111bed73fa1150e0f93d5bc6
2014-04-11 16:00:13 -07:00
jenkins-bot 6dae43b0cf Merge "Fix commons icon to avoid pixelation" 2014-04-10 18:12:34 +00:00
jenkins-bot 911e87adde Merge "Add truncatable text field, use for some fields" 2014-04-10 12:13:46 +00:00
Gilles Dubuc 779b91d405 Fix commons icon to avoid pixelation
The CSS to make the favico twice as big was looking horrible in
Firefox and possibly other browsers. Since we're already
special-casing commons, let's apply a proper SVG instead of the
favico.

Change-Id: Ie32302342eba7aa37bd310c013a9f4d7f9ae187e
2014-04-10 13:20:39 +02:00
Mark Holmquist 1ae138c9e7 Open MMV on hash change on file pages, add link
Change-Id: I4aa53d50bcd4880f341dfb59b7a451e2d5bda2ad
2014-04-10 09:34:01 +02: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
Gilles Dubuc a7778cb799 Selects html embed by default for logged-out users
Change-Id: Ie472905f0188637157632050ad0571043f04b324
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/379
2014-04-10 00:06:54 +00:00
Mark Holmquist 40feb61dbe Add truncatable text field, use for some fields
Source + author are one such field, title is another.

Loads of the mingle card will be split out.

Change-Id: Ib2937cc55304118f82e5b2e87b822b2b2811ef2b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/243
2014-04-09 15:53:37 -07:00
Gergő Tisza ee113af8f5 Make Commons link more prominent
Change-Id: Id546de9671fdc00ba73b01a1bc6398f2da2a6a2b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/270
2014-04-09 21:45:39 +00:00
jenkins-bot 4c08160eb3 Merge "Fix issues with size menus after oojs-ui update" 2014-04-09 18:54:15 +00:00
Aaron Arcos 71fec37579 Fix issues with size menus after oojs-ui update
These should fix all the issues we have now with the size menus.

Change-Id: Ief2e5e653330b01c9787e04a10b1b2c425da705e
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/407
2014-04-09 11:46:51 -07:00
jenkins-bot c42f5425f9 Merge "Show tooltip when all sorts of conditions are met" 2014-04-09 09:40:53 +00:00
Gergő Tisza 404bcd3989 Make categories behave
The way categories were handled made it impossible to add anything
after them (they always ended up as the last child of the parent
container). This commit fixes that, and also moves the repo link
behind them (as required by #270).

Change-Id: I7c561c43897054e60028bd524d8ad5ea85f39e36
2014-04-08 19:58:13 +00:00
Gilles Dubuc 22bdbd4041 Show tooltip when all sorts of conditions are met
Change-Id: I987d5d517c3db2409e138b85b90115260d9116bd
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/261
2014-04-08 18:33:24 +00:00
jenkins-bot f163f2f30e Merge "Add named timeouts to mw.mmv.ui.Element" 2014-04-08 09:48:11 +00:00
Gilles Dubuc 204d582a3a Add site/language conditions for feedback button
Only show the survey button if the user's language matches and the site is
enabled, and log which site we are on.

The corresponding site configuration commit is
Ic07432649906890785769ce5127761e2c84316e2

Change-Id: I575bb286f4289489b80505c901f5a9e7aeecec8b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/261
2014-04-08 11:37:24 +02:00
Gergő Tisza 660553c58e Fix some OOJS-UI issues
* intializeSelection was removed
* selectItem is replaced by chooseItem, sort of
  (selectItem does not always update the UI, I think?)
* remove old workaround, bug  was fixed upstream

This fixes the download button and unbreaks lots of unittests.
It does not fix the "Loading" text in the embed tab.

Change-Id: Iec7bf9ad5b516001231c7ba46fda962671aaddd8
2014-04-08 01:35:30 +00:00
Gilles Dubuc 3df526b919 Fixes various bugs in IE
- error caused by select() called during focus event
- HTMLElement not existing in older IEs
- filter rotation for older IEs causing black background bug in IE9
- IE9 lacking progress would have its progress bar never reach 100% and disappear
- Handle e.which value for clicks on IE < 9

Change-Id: I5727ef3f2a9f9aa77eac930f93320e6ce5964c78
2014-04-07 22:00:11 +00:00
Gergő Tisza a01266854d Add named timeouts to mw.mmv.ui.Element
Change-Id: Ie07b0239aa21f590ef969ac864f60e71848c4bcb
2014-04-07 21:20:59 +00:00
Gergő Tisza b35cd14b63 Rename setRepoInlineStyle to setInlineStyle
Forgot to do this when I originally extracted it.

Change-Id: Iaa31ede4e151513652e1a05a44daa1ff636fbc85
2014-04-04 22:02:16 +00:00
Gergő Tisza f297de60bc Hide metadata top button texts
Also make sure that the reuse dialog is positioned right, no
matter where its button is.

Also fixes some minor documentation problem with mw.mmv.ui.canvas
which I noticed in the process.

Change-Id: I86feed07738ebef012e63861ed909f3449b85a53
2014-04-04 09:11:58 +02:00
Gergő Tisza 0b63c1a936 Only show file description page button for logged-in users
Change-Id: I206787ad2768f14d9705c29267dbee09b7b44705
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/226
2014-04-04 08:56:53 +02:00
Gergő Tisza 052fd5d3f1 Add metadata button to go to file description page directly
Change-Id: I0f2c2b24aece3b806d572a0ed41dce8031e6ae6b
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/226
2014-04-04 08:45:56 +02:00
Gergő Tisza 871b49dff2 Feedback button
MVP implementation, just a link that opens the survey in a new tab

Change-Id: I9f2fb85cc47ce2be4cf57679bf37f0bda13084b7
2014-04-03 23:14:18 +00:00
Gergő Tisza 47a8bda392 Create StripeButtons class, convert reuse button to use it
Also do a bunch of refactoring to:
* keep LESS rules in more sane locations so it is not as hard to get an overview
  (most of the metadata panel rules were in mmv.less)
* move mmv.mixins.less up one directory as it is not specific to the UI
* move the SVG icons as all of them were related to the UI
* remove the marging-right hack which was used to keep the title text from
  overflowing the button; instead use a float and overflow properties to make
  sure text that is too long gets hidden

Change-Id: Icc8ea2e766be67d86ae98c734721b2185bd6c36e
2014-04-03 23:13:12 +00:00
Aaron Arcos 10a4fbef14 Fix problems with size menus for embed and download
I think this takes care of all the different mutations of
weird states that happen when going from a small to large
images and transitions in the middle, see card/386.

Change-Id: I80527d746614c0bbda7a1084061d292e5d6394a8
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/386
2014-04-02 23:22:15 +00:00
Gilles Dubuc 961d47432b Download tab, basic download and preview
* Following design, use split button to display a pulldown
menu with possible image sizes. The download happens by
sending the special "download" parameter to the server.

* Offer link to preview image in the browser.

Change-Id: Ic9d895fead04c9128186c7376a0bb09f3596335c
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/79
2014-04-02 23:00:28 +00: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
jenkins-bot 53a641b63a Merge "Rename Buttons to CanvasButtons" 2014-03-30 08:47:39 +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 fd5f3e2e7b Make $.animate a noop in some tests to avoid conflicts
Tests which trigger real animations conflict with tests using
Sinon.js fake timers. As a quick fix, disable animations in those
tests.

Change-Id: I1a5e9fbee853cc29621c6ccf286bd2191241fd2f
2014-03-29 20:56:06 +01: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
Gergő Tisza b9b1529e9b Add more information to embed HTML
Adds site link, license link and long name, replaces internal license name
(we don't have it for most licenses) with short name.

Also fixes some problems in previous changesets that I stumbled on,
renames things to be more consistent/less misleading, and makes
EmbedFileInfo a thin container for existing classes. (That results
in a lot of Demeter's law violations, but it means one less model
to remember, which is a good thing since our property names are
often not very informative (e.g. EmbedFileInfo.url and
Image.url which had completely different meanings))

We always have the site information for embed texts (comes from the repo
API); that part of the tests was pointless, but now that EmbedFileInfo
depends on Repo they became impossible to maintain, hence the
deletion of half the test cases in getThumbnailHtml().

Change-Id: I94e1d0aca14e2a7d5fad983412090add8ad6bfa3
Mingle:  https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/369
2014-03-27 19:14:06 +00:00