Commit graph

24 commits

Author SHA1 Message Date
Simon Legner 8dab698605 MMV should have an affordance for which image is being viewed in the article (i18n)
Additional change:
* Bump bundle size for Codex module due to recent Codex update.

Follow-Up: I701632faa6890bd1577eb725ac4b25579fb510b8
Bug: T377791
Change-Id: I110335dabbec15c9290b771440d172c877351d5a
2024-11-01 18:03:16 +00:00
Simon Legner 69e4e77044 MMV should have an affordance for which image is being viewed in the article
Bug: T377791
Change-Id: I701632faa6890bd1577eb725ac4b25579fb510b8
2024-10-28 20:56:16 +00:00
Simon Legner fb4e80a1b1 Move HtmlUtils from mmv.bootstrap to mmv module
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
2024-10-17 22:51:20 +00:00
Simon Legner fe5687b6ef MMV options dialog: remove leftover code
Follow-Up: I707ef2c0b6b8d4d13c05182078b82ddc99e32d12
Bug: T77349
Change-Id: I2693cd36ec390e0ca059030d264276492ed0a2fe
2024-10-17 09:31:51 -07:00
Simon Legner 630a45a3ba Merge MultimediaViewer bootstrap modules
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
2024-10-16 23:20:46 +00:00
Simon Legner 81c47fb174 Fix warning icons on dark mode
Use @background-color-warning-subtle, @border-color-warning for the warning box.
Use @color-base for the warning icon.

Bug: T374871
Change-Id: I9a90d2d3a1b58d92fac7aca67660c76bc117b249
2024-10-16 15:36:23 -07:00
Simon Legner e3badef708 Remove MMV options dialog in favour of Special:Preferences
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
2024-10-08 20:56:04 +02:00
Simon Legner 4672f2eb57 ThumbnailInfo: support multi lingual SVG
Bug: T208564
Change-Id: Icf082ca0dc94bc4739fd31b795de76f8a0083b70
2024-07-01 22:49:10 +02:00
Derk-Jan Hartman 1b12172bb0 MMV: Set body background and theme-color
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
2024-06-27 21:25:01 +02:00
Derk-Jan Hartman 2a8b140ed3 MMV square buttons
- Use square cdx icon only buttons
- gray transparent brackground
- opaque background on hover, active, focus
- Some fixes to the positioning and offsets of buttons and dialogs
- Move the dialogs to be in the same container as the buttons
  This is better for accessibility but also fixes the z-index issue

Bug: T365192
Change-Id: Idbc2a309fbca15bd528aaed7ca9bed584487c4f3
2024-06-26 20:28:38 +02:00
Simon Legner 048c359806 Remove obsolete class IwTitle
Bug: T77349
Change-Id: Idc81f0d97ebfef725bcdb93ca50deac197d67590
2024-06-13 21:11:58 +02:00
Simon Legner 21438d2b22 Remove FileRepoInfo API and Repo model
Repo was only used in two locations:
1. StripeButtons.set for `isCommons` - can be replaced by `descriptionUrl.includes('//commons.wikimedia.org/')`
2. EmbedFileFormatter.getSiteLink (unused)

Furthermore:
- Simplify StripeButtons (we only have one button)
- Unwrap info objects consisting of `ImageModel` and `Repo`
- Remove unused EmbedFileFormatter.getSiteLink
- Inline EmbedFileFormatter.getCaption and EmbedFileFormatter.getLinkUrl
- Fix JSDoc type `ImageModel`

Reduces mmv bundle size from 28012 to 27246.

Bug: T77349
Change-Id: Ia4388fe4d5e1d6112a992e826453cd5799a6a4b4
2024-05-31 08:13:08 +02:00
Simon Legner 5bee6274e0 Move dialog/reuse dialog code to mmv.ui.reuse module
Initialise the corresponding dialogs upon first use by deferred loading of the mmv.ui.reuse module. Reduces code size of the main mmv module.

Bug: T77349
Change-Id: I672419e1a8af47d192843f7e7a4a038c0d8da2a3
2024-05-28 11:58:44 +02:00
Derk-Jan Hartman f8fe9c0af3 Remove the thumbnail blurring
This removes the thumbnail blurring.

The initial page thumbnail is still in place.
This too can be slightly improved as sizing up to the MMV frame is
done via JS right now, and causes a noticeable change. But we can
simply do this with CSS immediately i think.

Bug: T71609
Bug: T65504
Change-Id: If2a92689be9ee7ecd64561dc224991f31274d58a
2024-05-25 00:56:35 +00:00
Simon Legner 72ba58c134 Merge download/share/embed into mmv.ui.reuse module
Bug: T77349
Change-Id: I19f3444ac3e35d94ba3436e0c1387a1cb5b7e972
2024-05-24 18:27:03 +00:00
Simon Legner 4eaf0725a9 Remove index.js export indirection
Reduces mmv module size from 168.85kB to 167.92kB.

Bug: T77349
Change-Id: I40a4b044ca286dcda948243d5029b3377430d4ff
2024-05-21 22:12:17 +00:00
Simon Legner f00dbbb939 Remove IIFE
Remove Immediately-invoked function expression throughout production code base.

Bug: T77349
Change-Id: Ia31b556975209bbea27df8444b69d924654b181e
2024-05-21 22:31:15 +02:00
jenkins-bot bc3cc059bb Merge "Revert "Revert "Add position handling to URLs""" 2024-05-21 19:27:02 +00:00
TheDJ 24ee9dc48d Revert "Revert "Add position handling to URLs""
This reverts commit 5b89420182.

Reason for revert: restore previously reverted patch

Bug: T64039
Change-Id: Iac4486ae785f308d2a572f383073cfb73c7cb523
2024-05-21 19:09:16 +00:00
Derk-Jan Hartman f592eeea3b Remove unused code from mmv.ui
Bug: T77349
Change-Id: I9e26dc68859d9dca3c6066837253e85a19039ce0
2024-05-20 23:02:04 +00:00
TheDJ 5b89420182 Revert "Add position handling to URLs"
This reverts commit de56d4a6de.

Reason for revert: breaks resize handler. Lets revert before branch cut.

Change-Id: I1e4d57d8384ab434f17968100f8bea1bf90c40ff
2024-05-20 20:51:59 +00:00
Simon Legner de56d4a6de Add position handling to URLs
- Instantiate LightboxImage object in mmv.bootstrap
- Add LightboxImage.position field: relative position of this image to others with same file
- Add optional routing suffix /:position

Bug: T64039
Change-Id: Ic7c5889064492fc88dae33271b635c5327b091e1
2024-05-20 18:36:23 +00:00
Simon Legner c53047d181 Extract mmv.ui.restriction module
This module contains the restriction icons. The main mmv module shrinks from 196.88kB to 174.97kB.

Bug: T77349
Change-Id: I78d16b487f5272a8f779f3484c883d113db1878b
2024-05-17 20:51:05 +00:00
Jon Robson de6f1bd2c6 Monitor bundlesizes in MultimediaViewer
Bug: T77349
Change-Id: Ia3cc3a1d630c5e2528b0f46856969eb4fde960cb
2024-05-16 23:37:47 +00:00