Commit graph

103 commits

Author SHA1 Message Date
James D. Forrester 00c8c54a7b build: Update MediaWiki requirement to 1.43
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: Ie042ed29c2dbe1381862a6e0a5ac5e5ad432d679
2024-08-22 17:46:12 -04: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 64e0cfeab5 Make thumbnail bucket widths configurable using wgMediaViewerThumbnailBucketSizes
Bug: T269987
Change-Id: Ib1b590c5c6fe353a86ac1527d19617975113ff8a
2024-08-09 15:56:48 +02:00
Derk-Jan Hartman a9bd92c734 Support djvu thumbnails in Mediaviewer
Bug: T72912
Change-Id: Ib71a60eef98d845be69c2fa4ac2044bb43a1c5b9
2024-07-04 21:28:39 +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
jenkins-bot 66bdd243f7 Merge "Update AUTHORS" 2024-06-15 20:35:53 +00:00
Simon Legner c16d9fe1c2 Update AUTHORS
Content has been generated using the following command and .mailmap from mediawiki/core:
$ git log --format='%aN <%aE>' | sort | uniq --count | sort --reverse --numeric-sort

Change-Id: I107d75032b1ff57d2718db6f74958e0ea8bfecb2
2024-06-15 08:52:46 +02:00
Simon Legner 048c359806 Remove obsolete class IwTitle
Bug: T77349
Change-Id: Idc81f0d97ebfef725bcdb93ca50deac197d67590
2024-06-13 21:11:58 +02:00
jenkins-bot c754f877a6 Merge "Add loading bar while loading mmv module" 2024-05-31 20:10:23 +00:00
Derk-Jan Hartman c1a38cfe9e Add loading bar while loading mmv module
When opening the media viewer, we immediately display a black frame,
as we wait for the dependencies etc to load.

Add a codex indeterminate progress bar to this phase as we wait, so
the user has feedback that something is happening.

Bug: T77230
Change-Id: Ibba98150ac2e8034fbfcd586309632704cf0b606
2024-05-31 19:50:19 +00: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
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
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
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 199800afeb Add Simon as an author
Simon has done extensive work modernizing the multimedia viewer
extension so I think he should be recognized by a credit.

Change-Id: Ie094a933d2fcfa57784014c3ff0e71d6c6eb9945
2024-05-15 15:04:53 -07:00
Ed Sanders f1f9038471 Restore success notification for copy-to-clipboard buttons
UI interactions should always provide some visual feedback,
and the mw.widget version of this triggered a notification.

Bug: T340258
Change-Id: I1f9850541d23e362c2cd73c3797d1f03bcfc7ca1
2024-05-07 20:47:27 +01:00
jenkins-bot d6832e40ed Merge "Use CodexModule instead of codex-styles/codex-search-styles" 2024-05-05 12:22:57 +00:00
Simon Legner 12b7b18bb2 Use CodexModule instead of codex-styles/codex-search-styles
Bug: T356689
Change-Id: I3943acea4684a0b2cb2d151ca6bab71e06105f42
2024-05-05 14:20:41 +03:00
Simon Legner 3d1fdfa4e1 Remove obsolete stylesheets
Obsolete since I539d1b5f0d7e3c02f767807da57324ea6a36ad5b.

Bug: T340258
Change-Id: I234882d70e4c29d50153ef66aa12462f91a550c7
2024-05-05 11:54:19 +03:00
Simon Legner b124f28092 Remove OOjs dependencies
Bug: T340258
Change-Id: I100b1cf1563b41357fad27203a2af687442f076b
2024-05-05 05:16:30 +00: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
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
gerritbot 65cf8fc812 Update UserOptionsLookup's FQN
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here.

Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: If63fb03b90f797a38a07f0d88f663e25cac75770
2023-11-29 12:39:36 +00:00
Fomafix 622f44121f Replace global variables by inject MainConfig
Change-Id: I53322a15e53bfe4e0de6d12253aff74071c339c3
2023-10-23 20:42:49 +00:00
Fomafix 72745a5f28 Use type hint UserOptionsLookup for private variable declaration
Also use alphabetical order of the __constuct parameters.

Change-Id: I448103eabdb88372709eb529118f0f5d17baee8a
2023-10-23 20:15:46 +00:00
jenkins-bot 01652054b3 Merge "Remove unused core JavaScript modules that ship with MediaWiki core" 2023-10-05 23:58:00 +00:00
Hannah Okwelum c9eed0a3b5 Remove unused core JavaScript modules that ship with MediaWiki core
Bug: T335723
Change-Id: I89e389b532cd80af488255ebe88e403a10ae3a38
2023-10-05 16:53:45 -07:00
Simon Legner 6ee3f05104 Use Codex styles for buttons in mmv.ui.download.pane
Bug: T340258
Change-Id: I30a7ab4a6732fd87a68c67593d322be2347b2ff8
2023-09-28 10:02:57 -07:00
Umherirrender fb1de7786c Improve special page handling in onBeforePageDisplay
Avoid creating of Title object to get the "fixed special name" (which is
the localized name) and compare that against the local name of the
current page, just use the SpecialPageFactory to get the canonical name
(which is the english internal name, not the english visible name) and
compare against the list of canonical allowed pages (adjust the existing
list to the canonical names, that are "old" names in different cases)

Change-Id: Ia6f6574bf6e65c75f8977ff016feda6ecdca3776
2023-09-23 00:03:01 +02:00
James D. Forrester 8d95d367a5 build: Update MediaWiki requirement to 1.41
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I833380e20616462633f2e0b84bfd9a823ad085e4
2023-08-19 13:54:25 +08:00
Umherirrender ad1f6a6ee0 Use HookHandlers for core hooks
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.

Bug: T271019
Change-Id: I57dac8d590b5afa7524000d93c8477a10148c052
2023-08-14 20:47:02 +02:00
Simon Legner de2349a509 Use Codex styles for buttons in mmv.bootstrap
Bug: T340258
Change-Id: I11fdbabae0ed996ed2e830259ccd3e02c3f035fc
2023-07-17 20:19:05 +00:00
Simon Legner 48b6c76601 Notify user and close MMV if image from route not present on page
Fixes: only a black screen without any controls or messages is shown

Bug: T77327
Bug: T336619
Change-Id: I53687fce2c767ff6681707da424b974ecf51675a
2023-06-12 19:13:48 +00:00
Simon Legner 74a76718d7 Use packageFiles in mmv.test
Bug: T337030
Change-Id: Iaea2deec35003e306a8e1f12f890879c80cd8289
2023-05-21 06:41:31 +00:00
Simon Legner 35cd0f18c0 Use packageFiles in mmv
Bug: T337030
Change-Id: I90cdfb626c176b27b59db6b92b9edd6b2fe49b68
2023-05-20 09:34:56 +03:00
jenkins-bot 91bb566fec Merge "Use packageFiles in mmv.ui.ondemandshareddependencies" 2023-05-19 16:45:57 +00:00
Simon Legner 4709abae0a Use packageFiles in mmv.ui.ondemandshareddependencies
Bug: T337030
Change-Id: I09b4d1fecd1940a1a767d2033c4449b5002a88a8
2023-05-19 18:08:39 +03:00
Simon Legner 26f4c60495 Use packageFiles in mmv.ui.reuse.shareembed
Bug: T337030
Change-Id: Ic54d1a1a40ee5318f65ee1245e261db7059583ba
2023-05-19 18:05:56 +03:00
Simon Legner d0066039ac Deep-link to the license section of a file page
The necessary anchor link depends on the language used on Wikimedia Commons:

* https://commons.wikimedia.org/wiki/File:GATEWAY_(Moon_Space_Station).png?uselang=en#Licensing
* https://commons.wikimedia.org/wiki/File:GATEWAY_(Moon_Space_Station).png?uselang=de#Lizenz
* Ref: https://commons.wikimedia.org/wiki/Template:License-header

Remove jsduck due to lacking support for ES6 string templates.

Bug: T336708
Change-Id: Ib71e647682835baa71bd375ae3098966ae01f26c
2023-05-19 13:57:54 +00:00
Jon Robson 00b65d02cd Remove jquery.tipsy and use OO.ui instead
Bug: T77402
Change-Id: I63328cf86872019fc9832162b26ffa8075382acd
2023-05-05 16:32:00 +00:00
Simon Legner d2ab19fdac Remove most uses of jquery.tipsy in MediaViewer
Tipsy was added in I993bf60909024453a14de85af6239bded02eb8a6 however
has since been deprecated and usage is discourage.

Falling back to standard HTML `title` attribute display seems fine. Some
buttons (such as previous/next arrow) have not had a tipsy tooltip.

To be done separately: TipsyDialog which is used for StatusInfo

Bug: T77402
Change-Id: I2f7ae189734ba6d6e67ca703a42ae899ec56729d
2023-05-02 18:21:57 +00:00
Volker E bee73f7520 styles: Replace old variables calls with skin variables
Replacing 'mediawiki.ui/variables.less' `@import`
with new skin-aware 'mediawiki.skin.variables.less' standard.
Also replacing and removing scattered WikimediaUI Base variables
with new skin variables.

Also
- replacing several static values with new Codex design tokens featuring
  skin variables for following properties:
  - `background-color`
  - `color`
  - `border*`
  - `border-radius`
- replacing local variables with new skin variables where applicable.

Bump required MediaWiki core version to >= v1.41.0.

Bug: T319381
Bug: T332541
Co-Authored-by: Volker E. <volker.e@wikimedia.org>
Depends-On: I04f9e48a1cf9dee915cf51e1e12b17ff0a595a06
Change-Id: Ie834b3f652bd22d9bf96c112166a5b7fcc3ecf2d
2023-04-16 03:32:27 -07:00
Timo Tijhof cd4da296c2 mmv: Use mediawiki.router instead of underlying oojs-router module
This is in preparation for merging the two modules in core and not
exposing oojs-router directly. mediawiki.router is merely 1 line
of code to hold a singleton, and indeed it appears there is no need
for multiple instances to exist given it communicates exclusively to
and from the 'window' object, which is also a global singleton.

Change-Id: Ice09b523dfbefd67493175554eeb525771e8f29d
2023-03-06 02:34:13 +00:00
alistair3149 00ae50ea49
Allow WebP to be previewed in viewer
WebP support was added to core but MMV was not updated to
allow WebP to be previewed. This should enable the functionality.

Bug: T282202
Change-Id: I4fd6a0a2189a58faa6bccfc1282de57b8beb16cc
2023-01-05 09:25:27 -05:00
Sam Smith 34e4968b2c Remove instrumentation
The MediaViewer and MultimediaViewer* instruments were disabled circa
October 2021 in Ie7dd8739efc.

This patch removes those instruments and any supporting code and data.
Notably, this patch does not remove the mw.mmv.logging.ViewLogger
instrument, which is responsible for logging image views.

Bug: T310890
Change-Id: I97d41be93849b2ae9d1adba6660546ea716657fd
2022-07-05 17:41:24 +00:00