Code in mmv.bootstrap.js sets viewer.comingFromHashChange directly,
assuming it to be a class property, not a local variable.
Change-Id: I8b10243768118e84d916f50f1a48ff10463d1db4
This route has been declared legacy in 2015 via I0936ada35141ddd85e0aa232b833d315e3246ce3.
On English Wikipedia for a given day there was no usage of this
route.
Change-Id: I41b33697669500670bea6506dc45c5c6a613c502
In addition, prefer `this.ui` over passing `ui` as method argument.
In addition, hide the next/prev buttons while loading.
Bug: T77877
Change-Id: I316687f1a180605c6014e93d963ce9e5fd325850
This increases specificity of the mw-mmv-button to make
sure it wins over '.cdx-button:enabled' and
'.cdx-button.cdx-button--fake-button--enabled' that right
now sometimes fail due to load order.
Bug: T374373
Change-Id: I402aa0761615eeb0e080bb6087e0de778b6f493a
HtmlUtils is used for stripping HTML code. This is the responsibility of the individual UI components.
More specifically, MultimediaViewerBootstrap.processParsoidThumb no longer strips HTML code. Various UI components were already calling HtmlUtils.htmlToTextWithLinks. Only the error case in MultimediaViewer.loadImage newly needs HTML stripping applied.
Bug: T65504
Change-Id: If24b9c220a6ec43f35251a4ec6a716fd4ba03df6
There is no need for them to live in separate modules and they bloat the size of our ResourceLoader startup module unnecessarily.
Bug: T77349
Change-Id: Ieb830486a280e607cad3be6418c46db9c6477491
Use @background-color-warning-subtle, @border-color-warning for the warning box.
Use @color-base for the warning icon.
Bug: T374871
Change-Id: I9a90d2d3a1b58d92fac7aca67660c76bc117b249
MMV options dialog only allows to disable/enable MVV. Rely on Special:Preferences instead. Strips more than 2kB off the bundlesize.
Bug: T77349
Change-Id: I707ef2c0b6b8d4d13c05182078b82ddc99e32d12
This partially reverts commit 07ba0e43a9, which changed the test to
inject an ES6 Map rather than a mw.Map, which diminishes the value of
the test, including risk of false positive since that isn't what
the code actually accepts. See also T353076.
Change-Id: I4877d0d9820dfff42996ddbd4c9e26573d84d19c
Nowadays our HTML contains data-file-width="…" and data-file-height="…"
attributes. Previously this code was using <img width="…" height="…">
from the tiny thumbnail to calculate the aspect ratio. But this is
only a rough estimate and can be off by a significant amount of
pixels. Example:
Original image size: 4000 x 2100
Thumbnail in the article: 220 x 116
Available canvas height: 630
When using the thumbnail's size: 1195 x 630
When using the original size: 1200 x 630
I still use the old thumbnail size as a fallback just to be sure.
It's possible this is unreachable code by now. But it doesn't hurt
to keep it.
Change-Id: Iabd89762b09523249375bcbc7e4a573ef974e02e
Calling .eq( 0 ) on a jQuery set that's known to contain only a
single element is pointless and doesn't do anything. .eq() is
documented to reduce the set to a single element.
Change-Id: I3f3a08d65a0490771e0282408e8c4711f3772c99
Codex icons are auto-mirrored for RTL scripts but a pseudo-element
causes the auto-mirror selector to have incorrect order and that
builtin auto-mirror functionality of codex icons to not get trigged.
This change fixes it by adding a span to each icon so auto-mirror
can target an actual element instead of ::after pseudo-elements.
Bug: T369659
Change-Id: Ib5f9793a8ad10980d2742d1046c59306c943f960
Fixes the shadows and borders that come with an extended 'Permission
details' box to use Codex tokens that support dark mode. To test this
out, view any image from Commons with a VRT permissions template (for
example [[File:Gordon_Highlander_steam_locomotive.jpg]]).
Bug: T369531
Change-Id: Ie2873b2ef2836c5b7ac2ded860dc2404f293f119
When opening the viewer set the body background and the theme-color
to match the background of the viewer. This provides a better
experience for (esp. mobile) browsers.
theme-color has to be overriden, as it can be inferred from the top
of the browser window, but images can be all kinds of colors, so it
is better to be explicit.
Bug: T368659
Change-Id: I313745a31bf17eef612dd89630b1bbc4cb57fd45