Commit graph

604 commits

Author SHA1 Message Date
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
Simon Legner 99275d517a Make functions in HtmlUtils class static
Bug: T337102
Change-Id: I665e6e965d8b595ef9b1b3a58164d272007c3f81
2024-05-10 18:42:24 +03:00
jenkins-bot 531a5700fc Merge "Remove obsolete SVG icons" 2024-05-05 11:37:16 +00:00
Simon Legner b52231da6d Remove obsolete SVG icons
Those icons have been replaced with Codex equivalents in I6f7b6d0f9b96168ab6d835811141ab4cede214d1.

Bug: T340258
Change-Id: I3ec630f414e2b71743d3440339c13be54db62a79
2024-05-05 12:07:31 +03:00
Simon Legner 4231322927 EmbedFileFormatter.getCreditHtml: do not escape author HTML
Bug: T267253
Change-Id: I9c5908bda124ef976e9ed5b0cc9c61f5b7607843
2024-05-05 11:09:40 +03:00
Simon Legner e0aa14529c Change attribution and download interface
- Use Codex styles for mmv.ui.reuse
- Replace unofficial component dropdown with Codex Select and Button
components.
- Drop OOUI dependencies

Bug: T340258
Change-Id: I539d1b5f0d7e3c02f767807da57324ea6a36ad5b
2024-05-05 05:16:19 +00:00
jenkins-bot 842cdb1a24 Merge "Use Codex styles for mmv.ui.download.pane" 2024-05-04 19:34:22 +00:00
Simon Legner 683b3e1caf Use Codex icons
Discussed with Justin and Matthew (designers):
- Dropping the image in "Disable Media Viewer"

Discussed with Jon:
- Resizing the next/previous arrows

Bug: T340258
Change-Id: I6f7b6d0f9b96168ab6d835811141ab4cede214d1
2024-05-04 20:54:12 +03:00
Simon Legner ea78739fd0 Use Codex styles for mmv.ui.download.pane
Bug: T340258
Change-Id: I3dc1b5ffdf8c6a810e9e16a2b7f293757cce5306
2024-05-04 20:53:09 +03:00
Fomafix 2a31c0b399 Use "optional_services" to inject service MobileContext
This change requires a soft dependency on extension MobileFrontend
in project integration/config in file zuul/parameter_functions.py.

Change-Id: I4e0c8185804a22c57f94dceae3c998e13afa3cfc
2024-04-02 19:55:01 +00:00
jenkins-bot 612ebb5c80 Merge "Public API to Check Wikimedia Media Viewer Extension Status" 2024-02-15 19:21:24 +00:00
Simon Legner c25d52ef9f Metadata: show created as well as uploaded date
Bug: T296330
Change-Id: I3ffad8c6049e839386a6c279b9b33d3841ab5d89
2024-02-14 02:27:52 +00:00
libraryupgrader 147b576b57 build: Updating dependencies
composer:
* mediawiki/mediawiki-phan-config: 0.12.1 → 0.14.0

npm:
* eslint-config-wikimedia: 0.25.1 → 0.26.0
  The following rules are failing and were disabled:
  * resources:
    * es-x/no-resizable-and-growable-arraybuffers
  * tests/qunit:
    * es-x/no-resizable-and-growable-arraybuffers

* grunt-banana-checker: 0.11.0 → 0.11.1

Change-Id: Ief610bdadaccd2325cd1b8a2cae70b7e465d8b76
2024-02-13 02:13:29 +00:00
Simon Legner 07ba0e43a9 Don't use mw.Map(), use a native Map() instead
Bug: T353076
Change-Id: I91a556becc1093e0db4c4b13e4685f2c0e084031
2024-02-08 20:21:20 +00:00
Simon Legner 1ab8d0d899 Public API to Check Wikimedia Media Viewer Extension Status
mw.mmv.isMediaViewerEnabledOnClick()

Bug: T348026
Change-Id: Ibc34e370e6bf631d9f861b9f6baa75d3f227123e
2024-02-07 20:38:01 +01:00