Some of the code encountered accessed mw.config directly,
I cleaned that up by migrating to mmv.Config, which is an
abstraction added to avoid peeking at mw.config directly.
Bug: T132064
Change-Id: I2a95ba703e6c7f46296f8e435bceec769dceebf9
Drop the title and site name. Use a shortened URL
created using the pageID for the curid query parameter.
Add pageID property to mmv.model.Image, using value already
fetched from an existing API request.
Bug: T119686
Depends-On: I0f00b986e6095bdb9b8d6af6fbc5b01995227e02
Change-Id: I9189f00bfbf7639974d66cf1921773855a77a865
On not-MMV -> not-MMV hash changes the bootstrap class has set
up and immediately torn down the overlay. Besides slowing things
down, this broke TOC navigation on Chrome in an ugly way.
Add a special case to skip the overlay loading when the new hash
does not contain #/media. This is a quick-and-dirty fix; the whole
loading and hash handling could use a rewrite.
Bug: T119854
Change-Id: I5494903dfe778e533773ff142fdf756475c2df32
Having many modules makes the startup module in the head
unnecessarily longer. Things should only be in their own
module if they're going to be loaded on demand on their
own or are a shared dependency of separate modules that
are.
This change brings down the amount of modules declared by
Media Viewer from 53 to 8. The ones that remain are
mostly things loaded on demand.
Bug: T103706
Change-Id: I5b0d29209599285b93217e96def818e641646c73
It decreases the likelihood of Varnish hits and is only 11% smaller on
average in file weight than the 800 bucket.
Bug: T102870
Change-Id: I8611791a192fa7b0e638ccfc886733b75bf30aed
These two tests fail on my local machine. I am making the two
assertions independent from
a) the order of HTML attributes (the test should not care about
the order, only if the attributes are there or not)
b) the message (both messages are possible and valid, the question
which message should appear is not part of that specific test).
Change-Id: I69b4793d365d3afebb869c787316e4242cb15b25
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
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
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
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
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
- 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
String.replace interprets a plain string as an exact text to match
against, but String.match interprets it as a regexp. Javascript is
fun.
Change-Id: I93ac31079f1f87dffdf0d5e02df2fa38ae79a6cc
* 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
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
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
Also fixes popup texts which should have been updated in the parent commit
and the panel opening mechanism which did not work when the below-the-fold
description box was display:none-d.
Change-Id: I5fc37429a7dc7a8f1517fa42375cd140d7d11674
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/589
* when the caption is available, use it as the image title
* otherwise, fall back to description if available
* otherwise, fall back to filename
* if both caption and description are available, show caption as
title and show description below the fold; otherwise don't show anything
below the fold.
Change-Id: I9738ca46620d7cf3b30f6e46790a37966d4b9eaf
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/589