Commit graph

618 commits

Author SHA1 Message Date
jenkins-bot 850b558e9f Merge "Remove support for legacy route #/mediaviewer/File:" 2024-10-23 15:39:26 +00:00
Simon Legner dbe57993a4 Remove support for legacy route #/mediaviewer/File:
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
2024-10-23 15:34:41 +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
jenkins-bot d882ec8a93 Merge "Merge MultimediaViewer bootstrap modules" 2024-10-16 23:38:19 +00:00
jenkins-bot 525d333998 Merge "Back button doesn't close MediaViewer if the URL has a fragment with "/"" 2024-10-16 23:33:49 +00: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
jenkins-bot 029f84c5ec Merge "Use browser provided URL object instead of mw.Uri" 2024-10-14 15:53:36 +00:00
Simon Legner a12565e8aa Back button doesn't close MediaViewer if the URL has a fragment with "/"
Bug: T361612
Change-Id: I1a516dbe62bd3a8c621a148c3fb36111128a57ef
2024-10-13 14:12:58 +02:00
Simon Legner 161adf921d Drop "About Media Viewer" link
Bug: T376972
Change-Id: I85a308afe7c805a147bfcc5e9adf0293378859f1
2024-10-13 08:46:50 +02:00
Ebrahim Byagowi 32a575f739 Use browser provided URL object instead of mw.Uri
Bug: T374314
Change-Id: I7de5ac9ba2de70e5a3a84fca1608c64ea1cd1aaf
2024-10-11 17:22:40 +02:00
jenkins-bot fc75d3aabe Merge "Remove MMV options dialog in favour of Special:Preferences" 2024-10-11 00:23:53 +00:00
Simon Legner 3d350a29ab Fix mmv.ui.metadataPanel.test.js
Regression of I3a4024ccf90e50558152d4ee012e492f49e14a0e: unless mw.messages.exists the license shortName CC-BY-2.0 is returned, breaking "License is correctly set" in setImageInfo() in mmv.ui.metadataPanel.test.

Change-Id: I35f67fa3d160d771970b5695fb93f5de7ea2d41d
2024-10-10 12:40:33 +02: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 3c11f01c5f Make remaining functions in Config class static
Bug: T77349
Change-Id: I40d3ccd34df20943b33c3923fabbd0b59a94e5ae
2024-08-11 12:03:30 +02:00
Simon Legner 01437fd521 Replace wgMultimediaViewer with config.json packageFiles
Practically, the variable wgMultimediaViewer is not used inside user common.js, see https://global-search.toolforge.org/?q=wgMultimediaViewer

Ref: https://www.mediawiki.org/wiki/ResourceLoader/Package_files
Bug: T77349
Change-Id: Ib086c6184f76ca2dbeb701f79c3b18b336ff5433
2024-08-11 11:34:46 +02:00
Simon Legner d698b8b006 Use mw.storage.get/set/remove directly
Bug: T77349
Change-Id: I5b670ed617c8359f28029cf117cfda26b635e871
2024-08-11 09:56:43 +02:00
Simon Legner 8c4186962e Use mw.Api.prototype.saveOption directly
Bug: T77349
Change-Id: I531995fd2224705a612c0f1aef8cfc545c8b4228
2024-08-11 09:48:49 +02:00
Simon Legner 6309f26238 Use mw.config directly
Bug: T77349
Change-Id: I1dff714af371a8e605f35a2ac198f4eecad28cb8
2024-08-11 09:47:04 +02:00
Simon Legner 2602867d7c Use mw.user directly
Bug: T77349
Change-Id: Ib0901b88e9d85a7544bbce386a37a56b45955ec3
2024-08-11 09:28:38 +02:00
Simon Legner aa2951f436 Use mw.storage directly
Bug: T77349
Change-Id: I8a494f20b4d9f4930fa89681857990416c0e840c
2024-08-10 14:39:31 +02:00
Timo Tijhof 70375cac12 tests: Change use of unrelated Map to mw.Map
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
2024-07-28 23:43:53 +01:00
thiemowmde ac2e3c4cbb Remove dead code from 2014 related to fullscreen pre-loading
This is disabled since 2014. See Ic145c8a for a longer explanation.

Bug: T66135
Change-Id: If0a1564676a25ba3ed2bcae099db77ec8fd3bae3
2024-07-15 11:59:20 +02:00
jenkins-bot afe1c08d2f Merge "ThumbnailInfo: support multi lingual SVG" 2024-07-04 19:30:11 +00:00
Simon Legner 4672f2eb57 ThumbnailInfo: support multi lingual SVG
Bug: T208564
Change-Id: Icf082ca0dc94bc4739fd31b795de76f8a0083b70
2024-07-01 22:49:10 +02:00
Simon Legner c872e64988 Rename whitelist to allowlist
Bug: T277952
Change-Id: I67ce70df18d9f9c86579cedcb63aa63685156b09
2024-06-27 20:50:08 +00: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
jenkins-bot 9fbea4233b Merge "Remove obsolete property LightboxImage.filePageLink" 2024-06-18 19:04:53 +00:00
Simon Legner a951a360d5 Remove obsolete property LightboxImage.filePageLink
Bug: T77349
Change-Id: I9c4fa491cb6bdc2668c6d21cc314c5290847bbc1
2024-06-13 22:17:00 +02:00
Simon Legner 048c359806 Remove obsolete class IwTitle
Bug: T77349
Change-Id: Idc81f0d97ebfef725bcdb93ca50deac197d67590
2024-06-13 21:11:58 +02:00
Umherirrender 33f327dc69 tests: Use renamed class BundleSizeTestBase
Follow-Up: I131e0d85bd14e75aaebd6f212b2e64a45d4c73a2
Change-Id: I0361c994af6320f4b8100390e8f43da3b92bb689
2024-06-12 20:38:07 +02:00
Ed Sanders a74af878a4 Convert jQuery callbacks to arrow functions
Change-Id: I0a9ddd6931ac0f4f30b638491941d624582081ca
2024-06-07 17:33:16 +01:00
Ed Sanders fa18975543 build: Update eslint-config-wikimedia to 0.28.0 and autofix
Change-Id: Iff4b874580768b008427c0bea535ab08cea14a36
2024-06-07 17:33:12 +01:00
Simon Legner 0399ffff40 Api: remove obsolete getQueryField function
Obsolete since Ia4388fe4d5e1d6112a992e826453cd5799a6a4b4.

Bug: T77349
Change-Id: I13efa32786a2ba65edbaedde214057e9efe98145
2024-06-04 19:34:30 +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
Derk-Jan Hartman 82e36ddc61 Use CSS transitions for the progressbar.
Bug: T77349
Change-Id: Ib2e5367b913eaf1f4b8920ed7e78dbdecb01ca1d
2024-05-30 20:00:07 +00: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
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
Simon Legner cfb250a57e Make functions in Utils class static
Bug: T337102
Change-Id: Ia186ba355d7da6034309453788f2f84d6b8de899
2024-05-16 21:52:14 +02:00
jenkins-bot 11efc235c3 Merge "Use jQuery.data in favour of jQuery.attr" 2024-05-15 22:11:46 +00:00
Simon Legner e50a8b604a Remove extraStatsDeferred
Seems to be a leftover from performance instrumentation I97d41be93849b2ae9d1adba6660546ea716657fd.

Change-Id: Iaba7d23fd526db772528d3ccb74889e7000b3d71
2024-05-15 20:59:58 +02:00
Simon Legner 628979d317 Use jQuery.data in favour of jQuery.attr
Ref: https://api.jquery.com/data/

Change-Id: I4ce901a8b030c4864814b8bed14dc0049fd788d7
2024-05-15 20:28:58 +02:00