Commit graph

93 commits

Author SHA1 Message Date
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 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
Sam Smith a286166f88 Remove EventLoggingSchemas entries
The MediaViewer and MultimediaViewer* instruments were disabled circa
October 2021 in Ie7dd8739efc. However, the EventLoggingSchemas entries
are still included in the ext.eventLogging RL module, which is fetched
on the majority of pageviews.

At the time of writing it is not clear whether the instrumentation code
will be archived. If it is not archived, it should be migrated to the
Event Platform, in which case the EventLoggingSchemas entries can be
reinstated.

Bug: T310890
Change-Id: I2e99664f4c00513dc61fdf9f3b53da241902e13d
2022-06-17 14:53:16 +01:00
jenkins-bot 3a97d5dc47 Merge "Namespace extension" 2022-02-23 06:19:04 +00:00
Sébastien Beyou a10359e6e6 Replace deprecated jQuery.throttle/debounce
This requires MediaWiki 1.38 for mw.util.throttle.

Bug: T213426
Change-Id: I3f689eea837ef72de9ab7afb68578093eab8db20
2022-02-10 13:22:52 +01:00
Reedy e49e7da070 Namespace extension
Change-Id: Ic480033a3a2418e41d39aaf777872587c11f1786
2022-02-06 15:24:30 +00:00
Iniquity 5803ea79eb Remove discussion and help links from footer
Bug: T133899
Change-Id: Ide631cd8bd98ff5084a8c406515c53b8a0cb033a
2022-02-06 01:15:02 +00:00
Umherirrender 7b9375ef82 Remove PHP entry point
Copy description from entry point to extension.json

Bug: T140850
Change-Id: I25fc5ffdceb6e4c882c885d89780421e18375df4
2021-12-05 16:02:34 +01:00
vladshapik 0e00f3e2f7 Avoid using User::getOption
Remove using of User:getOption since this method
will be hard-deprecated. Now it is soft-deprecated.

Bug: T296083
Change-Id: Ic7d52a3be7bcfef8827d3fa33b663fbe05fef3f8
2021-12-01 17:31:55 +01:00
Reedy a78f97419c Convert to manifest_version 2
Bug: T252470
Change-Id: I0ec17528558cca78a2e3c44a7fce00c80a0892fd
2020-06-12 10:07:29 +00:00
Timo Tijhof ece9f65067 Remove redundant dependency on 'mediawiki.notify'
The 1 line of code this contained, to lazy-load mediawiki.notification,
and forward the function call is now part of mediawiki.base,
and required no dependency.

Bug: T233676
Change-Id: I15e135f7e91ef2a608f7ee915ae3f530c47e5734
2020-04-08 16:46:49 +00:00
DannyS712 d46bb28023 extension.json - don't use array syntax when hooks only have 1 handler
Change-Id: Icea2021ab6c9a500de3025a471a657ee9dccea02
2020-03-11 10:42:07 +00:00