No longer needed as MediaWiki is no longer serving JavaScript to IE8
users.
I noticed some possible candidates for removal in the less files as well
but left those alone as this task seems specific to JavaScript.
Bug: T123443
Change-Id: Ibf6d551798ff03a227b46dcb55bcf31899dad974
Remove `constructive` extension of button and remove it with more
generalized `.mw-ui-progressive` class and rely on progressive color.
Also make use of central mediawiki.UI's variable.less file.
Bug: T136209
Change-Id: I22f365419c41dd888824dbfeb4b3c995713ac5a5
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
When exit button is clicked in the full screen mode, the lightboxinterface
detaches itself but the "jq-fullscreen-change.lip" even is never fired.
This leads to issues as described in T74843 and similar.
Bug: T74843
Change-Id: Id3a68844fd2405fcf289741d54b0602c8e337a3d
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
These text fields contain file names and license informations that tend
to contain very loooooooooong words. These make the field hard to use
and hard to read, especially when the browser decides to add a horizontal
scroll bar to the already pretty short text field. Some browsers do a
proper word wrap by default, others may not. I suggest to add this
explicitely.
Bug: T69835
Change-Id: I3f32270c1c0310e83288b5f4e260feb474006297
Make it more gender-neutral and better-looking:
- No necktie
- A frame around the icon similar to the frame of a photograph
Change-Id: I05ec5a5a546b19f08ac9a6ab1470b769025e076b
This makes sure that MediaViewer works correctly when content
is changed via frontend code (such as a VisualEditor edit or
an AJAX preview).
Bug: T97010
Bug: T110493
Change-Id: I9c57af281ed7f416521d80512f95a79150ce13a2
When cookies are disabled in Firefox, merely referencing window.localStorage is
enough to cause Firefox to throw a SecurityError exception. (See the referenced
bug for reproduction instructions.) This causes MMV to fail to start.
Bug: T109110
Change-Id: I28399cf8b63328ee34316b785f2d091f6f052224
Currently, if VisualEditor saved an edit, it replaces the current content
with the new content, which removes all already added event listeners, e.g.
on thumbs, added by MMV.
Add a new hook handler to the postEdit JavaScript hook to re-add all event
handlers to the thumb images to cover this case and enable MMV on a page
after a finished VE edit.
Bug: T97010
Change-Id: Ic1ee0b52265363978640358510cab89db4de2bb8
Bug with history.pushState in Edge fixed in Win10 build 10240;
Dave Storey is asking us to remove the workaround to keep our
code pure and them honest ;)
Reverts I6ea4d367
Bug: T104381
Change-Id: I5f53416dda7c31662330dc5ec67e1bbea55dace7
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
When attempting to clear the hash state via history.pushState(),
MS Edge in Windows 10 build 10159 errors out with the helpful
"Unspecified Error".
Catching the exception and trying again with a "#" works around
the error and doesn't look any worse than the non-pushState code
path -- and should have no side effects when the bug is fixed.
Bug: T104381
Change-Id: I6ea4d367af64f85018b06b859ce688053a1caf0f
The first item (license) of the list on the right side of the
metadata panel wasn't large enough (due to some recent global style
change that I couldn't track down) and the top of the next item was
visible. Added fixed height to prevent that. Also centered the
credit/license text which looked sloppy.
Bug: T101391
Change-Id: I848917ebb9c378c3210646486a87a6497d31a168
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
No stable versions of IE have an '-ms-linear-gradient'. Any lines using
the same have been removed.
Bug: T100285
Change-Id: I9fccb3f2208433d2759949a39b86b46d5b71eac1
Should fix intermittent issues happening with the browser tests,
which can't currently tell the difference between the placeholder
and the final image.
Bug: T90589
Change-Id: Ibfdff4721ce5f37831863110ad1a2f9650b24d5e
It seems that IE11 sometimes does not keep the aspect ratio when
the width DOM property is set but height is not.
Also attempt to clarify what the two similar canvas setters are
good for, to the extent I could figure it out.
Bug: T89679
Change-Id: I9c87e2146e3d99d1ee00d7c00142b2ae1c3d7951
EventLogging uses sendBeacon now so there is no danger of losing
clicks because the browser navigates away. (On modern browsers,
anyway; but we can live with being a little imprecise on older
browsers. We don't use link click stats much, anyway.)
Bug: T89533
Change-Id: Id83f60585d11f06610d8514c211f0116c60ea936
Canvas height is calculated as viewport height minus above-the-fold
height but the latter did not take into account the padding. This
was probably broken last autumn when the above-the-fold contents
were rearranged, but the max-height rule on the image masked the
error so we did not notice until that rule was dropped.
Bug: T89631
Change-Id: Id53cd9c176528da33b393e5ed807d6f2e0886413
The share/embed tab bar used some hacks to disable MenuSelectWidget's
normal behavior of disappearing once a selection has been made; after
the last OOUI update this doesn't work anymore.
This commit makes some small changes to make it work again:
* replace .show() with .toggle() as the widget uses a custom
show/hide mechanism now
* reorder some calls - .toggle() has no effect as long as the menu has
no options
* disable autoHide which would hide the menu when the user clicks
outside (didn't test if it is really needed but seemed reasonable)
Also undoes some CSS changes that came with the update.
Bug: T89531
Change-Id: I3688ec21250bf2eb8dbfd67e306e857028d71fc7
License icons have been updated for consistency with mobile media viewer.
File icon has been changed to match the former ones in color.
Change-Id: I8bc102755829b65ebace9608ca47a3bc2201da4a
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
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
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
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
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
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
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
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
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
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
* 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
* 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