Commit graph

733 commits

Author SHA1 Message Date
gladoscc 84a8df8808 Show (tm) symbol if applicable
ImageData will now parse for restrictions (this part has not been
implemented in CommonsMetadata yet), and an orange trademark label
will be displayed next to the license label if there is a 'trademarked'
restriction.

Bug: T77717
Change-Id: Ib03f9708d1e4ff0b5befddc2688b274e2c7ce1f7
2015-01-15 18:21:30 +11:00
m4tx 9a6039b580 Improve error messages UI for Media Viewer
Bug: T77272
Change-Id: I97ffa70903da32c66697c52969cfec2df03c1d57
2015-01-14 08:24:27 +01:00
gladoscc 40738c832a Display the file name in metadata panel
This patch adds the file name to the metadata panel, after the license
item. The namespace prefix is included and set to a static 'File:'.

The Title class already converts underscore to spaces.

The icon is from @Pginer-WMF.

PS: This has been a frequent annoyance for me, I'm glad to be working
on this patch!

Bug: T76680
Change-Id: I7d1f4ce67a6776ac017f8afe49cb3102b267af5c
2015-01-13 19:45:43 +11:00
m4tx b2aaae4b19 Fix download panel not showing on rclick after pressing esc
Bug: T86389
Change-Id: Ic158c579c4a7a6e48bcbd9cdfb724712b1e2fece
2015-01-13 01:06:59 +01:00
Namit d66509e2de Open the download panel when an image is right clicked
Many users right-click on images as a way to download them.Due to this,
they may get a scaled-down version which is used for display purposes and
also not given guidance on how to attribute.

Bug: T75999
Change-Id: I30655a0dda4430b494a393f1fa708fce6ca6fafe
2015-01-07 22:48:00 +05:30
gladoscc 7f4ce833d4 Log right-clicks on the image
Record how many users right-click on the image in MediaViewer, with the
assumption being they're intending to download the image. However, that
image has been resized and is not the original.

The event is logged even if the metadata panel is open, as the user probably
still intended to download.

Bug: T75962
Change-Id: I223ed957bcc60646adf9c9a00d2d9ca18ad128e6
2015-01-01 13:24:32 +11:00
Geoffrey Mon cf67495467 Allow bold and italic text
Added mmv.HtmlUtils.htmlToTextWithTags()
  which is similar to htmlToTextWithLinks()
  but allows <b> and <i>
Added test for mmv.HtmlUtils.htmlToTextWithTags()
Most text fields now use htmlToTextWithTags()
  except Permission field which is not supposed to
  have HTML

Bug: T69887
Change-Id: I16833f218e2f64586aa13925356fa2b8b7ec3100
2014-12-31 01:01:50 +00:00
jenkins-bot f65d846b81 Merge "Add mw.mmv.viewer shortcut for current MediaViewer instance" 2014-12-31 01:01:00 +00:00
jenkins-bot ac7bfa9274 Merge "Show alt-text in export dialog and for lightbox image" 2014-12-30 21:00:09 +00:00
Geoffrey Mon 8ba4ff03c8 Show alt-text in export dialog and for lightbox image
Pass alt parameter from mmv.bootstrap.js to mmv.js and
set it as a parameter on the displayed lightbox image.
Include the alt text in the embed text.

Bug: T66519
Bug: T75923
Change-Id: I29503eb582ac2bc8cf89f737a3bcb787b660d918
2014-12-30 15:47:25 -05:00
jenkins-bot 9119af8534 Merge "More accurate looking for image caption" 2014-12-30 08:56:22 +00:00
m4tx eb7d6ef537 More accurate looking for image caption
MediaViewer now handles Template:Multiple_image. Instead of looking
for caption in whole thumbnail container, it tries to find the
closest one to the image.

Bug: T85354
Change-Id: I18d982a4bf245c4925213d83a3410274d499845e
2014-12-30 09:50:18 +01:00
gladoscc c0c50a8d35 Add mw.mmv.viewer shortcut for current MediaViewer instance
Bug: T76923
Change-Id: I38142b541d58e66fcef6e6e589507dcf30b1b3be
2014-12-30 18:23:48 +11:00
jenkins-bot dc8c2bc545 Merge "Change "view terms" to "hide terms" once clicked" 2014-12-29 22:37:53 +00:00
m4tx dac77cafc4 Change "view terms" to "hide terms" once clicked
metadataPanel overrides the grow() and shrink() methods in Permission
class instance, so the text is changed also when user clicks the
"view more" link inside the box.

Bug: T71233
Change-Id: I66fe57980c6f469d86e3d52b67d01e06a3a14270
2014-12-29 23:23:07 +01:00
jenkins-bot af4f85a326 Merge "Show custom Attribution line instead of Author/Credit when available" 2014-12-29 21:15:33 +00:00
Sn1per e4b8e860c8 Show custom Attribution line instead of Author/Credit when available
- Adds attribution variable to Image model
  - In mmv.ui.metadataPanel and mmv.EmbedFileFormatter, display
      attribution line instead of author and credit when it is set
  - Update junit tests for mmv.model.Image and mmv.EmbedFileFormatter

Bug: T67445
Change-Id: Idfe542a1542d28cf8d27c1720ab0bd54324b2f37
2014-12-29 15:56:05 -05:00
gladoscc db01284c6e Ignore events with modifier keys
I've combed through the entire codebase for keydown, keyup, keypress
and .which and I've only found one case where modifier keys are not
ignored for keyboard shortcuts.

Bug: T68329
Change-Id: I10ca2b89b9eb5addd7c706cf796331b5206d6bef
2014-12-29 17:52:44 +11:00
Namit 36ad534988 Ignore generated captions on special file related pages
Most special pages which list images generate a caption using
various information and MediaViewer displays this caption.It should
fall back to the file description instead.

Bug: T85234
Change-Id: I5448e5de7d6f8de9852a2a845400299b6b51b8ef
2014-12-24 23:19:01 +05:30
jenkins-bot ba5acde550 Merge "Make "and X more" message more flexible for translators" 2014-12-18 09:00:14 +00:00
Gilles Dubuc b3e281237c Log Last-Modified header in performance logger
Bug: T78767
Change-Id: If747453b32cbe1db7e307193609af9eaa2bdcc7d
2014-12-17 11:31:45 +01:00
jenkins-bot 5c869aa9ec Merge "Rough logging of metadata panel scrolling" 2014-12-09 09:53:50 +00:00
Gergő Tisza 361464a55e Remove superfluous write of ensureEventHandlersAreSetUp flag
Change-Id: Ie28f58ea7d7b92f9eced46d94490bde9df69daa5
2014-12-08 21:58:20 +00:00
Gergő Tisza fdbefc27fc Rough logging of metadata panel scrolling
Logs metadata panel open/close by scroll. When the panel is opened
via keyboard or the "view terms" button, both a normal and a scroll
opening event is logged (same for closing). When the panel is opened
in fullscreen mode, neither event is logged.

Change-Id: I09092b8b6c20e6fea03b4fe59c811d7b441ca224
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/559
2014-12-08 21:56:51 +00:00
Gergő Tisza 07f7b837fa Close panel on canvas click + fullscreen mouseleave
Also remove the unused mmv-image-click event and fix a bug
where links got right-aligned when the panel was opened in
fullscreen mode.

Change-Id: If538ac420da4aae3908ac96978491f89c5b53493
Bug: T76029
2014-12-08 14:52:52 +01:00
Gilles Dubuc 30029b8b78 Track the most recent upload time for performance events
Change-Id: I673f9487deea15dc148452a3a4d6b91563a2c417
Bug: T76035
2014-12-03 16:15:20 +01:00
Gergő Tisza b5d3f9ef6c Make "and X more" message more flexible for translators
Also make sure part of it is not a link to avoid two links
ending up next to each other + fix a small documentation bug.

Bug: T76465
Change-Id: I128ec7034b0bb9784fb78d1a5ce90d195555848e
2014-12-02 22:49:29 +00:00
Gergő Tisza d280920121 Fix inconsistencies in attribution text
* use the same text for plain and HTML format
* use the same text whether or not a deed URL is set

Bug: T76030
Change-Id: Iea53766b2e2031206d707838551bd82dba29e8c4
2014-12-01 21:14:16 +00:00
Gergő Tisza 485944ba9d Show "and X more authors" when a file has multiple info templates
Bug: T74082
Change-Id: If53e3e364d07ef35a93b3b24430441d390aaf66e
2014-11-27 07:24:26 +00:00
jenkins-bot 9c6d50e55a Merge "Text changes for better handling of PD and nonfree licenses" 2014-11-26 14:52:39 +00:00
Gergő Tisza 05d803e17a Text changes for better handling of PD and nonfree licenses
Bug: T70687
Change-Id: I84e0094559e5b438fcb33b8511dc0184435c1a37
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/1004
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/631
2014-11-26 02:21:50 +00:00
jenkins-bot 1cf878a004 Merge "Fix some metadata panel scrolling/text truncation bugs" 2014-11-25 10:14:51 +00:00
jenkins-bot f441a9893f Merge "Change text truncation logic to more closely follow panel state" 2014-11-25 10:05:47 +00:00
Gergő Tisza 0997b82650 Fix some metadata panel scrolling/text truncation bugs
* isOpening was calculated too early, so whenever the panel was
  partially open and opened up fully via the forceDirection
  parameter of toggle(), it was logged as the wrong direction.
  (I think the only way for this to happen is via clicking on
  "view terms" while the panel is partially open.)
* scrolling did not go all the way to the bottom when text was
  truncated as the target position was calculated before untruncating.
* panel position was not preserved in some cases where it could have
  been because the attempt to restore it happened before untruncating
  the text, when the panel was not high enough.

Change-Id: I47a96d42c80e0a00d95023526ede3b5bbf18a52c
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/983
2014-11-22 06:22:35 +00:00
Gergő Tisza e7f720506f Change text truncation logic to more closely follow panel state
Several related changes to text truncation:
* remove untruncate-on-click so untruncated text is selectable
  (untruncate will happen on click to the canvas are instead,
  to be implemented in a followup patch)
* simplify the truncate/untruncate logic to be wholly based on
  panel open/close state, and fix a bug which made panel state
  and text truncation state inconsistent when prev/next
  navigating while keeping the panel open.
* remove several variations on scrolling the panel in favor of
  using toggle + remove some other unused truncation-related code
* fix a minor unrelated style bug which made truncate/untruncate more
  jarring than it had to be when the title was short by making the title
  higher on panel open even though the text did not use the extra height
* align title ellipsis better
* make sure clicking on the truncated title works even if the click is
  between lines and so misses the inline box of the <span>

Change-Id: Ie0b3afb3833102b6a9812cb7fe2df78ec5eb8396
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/983
2014-11-22 06:22:33 +00:00
Bartosz Dziewoński b3ef344efc Update for OOUI OptionWidget (and subclasses) changes
OptionWidget constructor now accepts a 'data' config option instead of
a separate 'data' parameter.

See I7ee78b6d.

Change-Id: Ie54e9db788cbe846cd2d173498c7fe17bafc126e
2014-11-22 01:01:29 +01:00
Gilles Dubuc 00d345f8b4 Rename Performance to PerformanceLogger
Change-Id: Iacfde35851cf8f617c4672d3ea466d4f0e2e448f
2014-11-21 11:07:40 +01:00
Gilles Dubuc 0e01796a3c Track how long users are viewing images for
This is complete, but it would be better if the HEAD request
was actually aborted by Varnish when the viewDuration parameter is
present, or if the hit pointed to a script that does that.

Change-Id: I66cafd97427756411e967de1901324af2215e3ae
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/1001
2014-11-21 00:39:29 +01:00
Gilles Dubuc c98a243639 Track image "unviews"
Change-Id: I4441b6df511f99b73bfafea0d804171435e129d2
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/998
2014-11-21 00:37:11 +01:00
jenkins-bot 3a16bf36e2 Merge "Blacklist site notice banner images" 2014-11-20 22:03:08 +00:00
jenkins-bot 7638a878f9 Merge "Add marker parameter to image requests coming from MediaViewer" 2014-11-20 21:24:19 +00:00
Gilles Dubuc b5f9a14106 Blacklist site notice banner images
Images inside the current WLA banner are getting picked up, spamming
all Media Viewer users with large-scale couscous imagery.
Couscous is nice, but too much couscous will make you bloated.

Change-Id: Ie5726be6de97da13e8dc650031285f899c2d6440
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/1011
2014-11-20 16:02:19 +01:00
Gilles Dubuc ad5040a140 Add marker parameter to image requests coming from MediaViewer
This will be needed by Erik Zachte for compiling per-file image view data.
Since Media Viewer does preloading, it skews the HTTP request-based
statistics. By marking image requests coming from Media Viewer,
it allows us to remove that bias.

Change-Id: Iac8e7770c1a379691547de4b6d47b7d54467f54d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/1002
2014-11-20 15:57:27 +01:00
Gilles Dubuc 184d59e2bf Make sure that the metadata panel isn't expanded by default in IE
Also fixes issue where stale scroll state from previous image
could be memorised and recalled when closing/reopening MV.

Change-Id: Id29c7b28887afebcb742f49b4d7c20e1210e6c1d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/996
Bug: 73337
2014-11-20 01:29:42 +00:00
Trevor Parscal a8838e4bae Update OOjs UI Class Names (549ff9ab7d)
Changes were generated by running this script:
https://gist.github.com/trevorparscal/92ccdc4c49ab033d9ba8

File content changes:
Scripts (*.js)
- TextInputMenuWidget → TextInputMenuSelectWidget
- MenuWidget → MenuSelectWidget
- MenuItemWidget → MenuOptionWidget
- MenuSectionItemWidget → MenuSectionOptionWidget
- OutlineWidget → OutlineSelectWidget
- OutlineItemWidget → OutlineOptionWidget
Styles (*.less)
- textInputMenuWidget → textInputMenuSelectWidget
- menuWidget → menuSelectWidget
- menuItemWidget → menuOptionWidget
- menuSectionItemWidget → menuSectionOptionWidget
- outlineWidget → outlineSelectWidget
- outlineItemWidget → outlineOptionWidget

Change-Id: I19ad3990837c0c565773fbb4c3d9d4d18e5f616e
2014-11-20 01:04:32 +00:00
jenkins-bot 4dc8ec2669 Merge "Track the most recent upload time for duration events" 2014-11-20 00:04:14 +00:00
jenkins-bot ee2f8f3b5b Merge "Get rid of phantom tipsy bubbles that can appear after closing" 2014-11-19 19:16:27 +00:00
Gilles Dubuc 2adf7a2008 Get rid of phantom tipsy bubbles that can appear after closing
Bug: 72516
Change-Id: Ia638688afc4d4373065c0d8a19dfcc11a7e9561e
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/1005
2014-11-19 12:13:47 +01:00
Gilles Dubuc 2a4a984ba5 Ignore fake mousemove event triggered by Chrome
These happen due to certain DOM changes. It's a hack in Chrome's
code and it seems to have gotten worse with a recent Chrome update,
causing this bug. Thankfully the fake event can be identified easily.

Change-Id: I1688054f5d57147a445db5116a6aafeb1f49ddc4
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/989
2014-11-18 19:23:34 +00:00
jenkins-bot 18ba5c1a76 Merge "Make ellipsis + ellipsis gradient cover ascender/descender glyphs" 2014-11-17 13:52:29 +00:00