Commit graph

38 commits

Author SHA1 Message Date
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 99275d517a Make functions in HtmlUtils class static
Bug: T337102
Change-Id: I665e6e965d8b595ef9b1b3a58164d272007c3f81
2024-05-10 18:42:24 +03:00
jenkins-bot 612ebb5c80 Merge "Public API to Check Wikimedia Media Viewer Extension Status" 2024-02-15 19:21:24 +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 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
Timo Tijhof b619d47f79 mmv.bootstrap: Avoid code duplication
Follows-up a0ce33226d (ref T348275, T349448).

Change-Id: I18bebf524686cac9e00e5d250eddd0c73c950893
2023-11-30 15:51:05 -06:00
Umherirrender a0ce33226d Skip thumbs from a.mw-file-description with typeof attribute
Skip thumbs found by the newly added selector (from 4d4e86ec) to skip
when also matched for the parsoid part of the multimedia viewer.

Bug: T348275
Bug: T349448
Follow-Up: I5ec67accab4e1cbfa90544087750016e1baab85d
Change-Id: I0c45b877565fd54b3e1cc766e4ee745a48cdea27
2023-11-03 20:53:05 +01:00
jenkins-bot 8161b14ea0 Merge "Use a.mw-file-description to find thumbs" 2023-10-12 02:04:49 +00:00
Umherirrender 4d4e86ecb2 Use a.mw-file-description to find thumbs
a.thumb is no longer outputted when $wgParserEnableLegacyMediaDOM is
false (fdd8f864 ), use the new class from 350721cc

Bug: T348275
Change-Id: I5ec67accab4e1cbfa90544087750016e1baab85d
2023-10-05 21:16:50 +02:00
Ed Sanders 2212255fe2 Add mw-no-invert class to MMV overlay
Bug: T345281
Change-Id: I2f2659809ef8e4fc2e1c752d8fd0eb3533c3cb78
2023-09-12 14:02:36 +01: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
Ed Sanders a33f7e5c57 Update linters and fix issues
Change-Id: Ib562131bbb3a9940d56602e0c4dbbe810ce7358c
2023-06-28 19:12:48 +01:00
Simon Legner 30fad6b8b8 Use ES6 features
* classes
* arrow functions
* const/let
* string templates
* Object.assign

Bug: T337102
Change-Id: I757b9993a2feeed707fb4ad213944001498f3f6a
2023-06-12 16:45:08 +00:00
Simon Legner 0683f3ecc8 Remove global mw.mmv
Bug: T337030
Change-Id: I90e8507cb1b7c30f6ba29dbdec8966e84b46aff2
2023-05-21 08:02:54 +00:00
Simon Legner d82910fbb3 Use packageFiles in mmv
Bug: T337030
Change-Id: I833c7e91230272b82a2512fd55f1c7c0f61233b4
2023-05-20 10:04:41 +03:00
Simon Legner 35cd0f18c0 Use packageFiles in mmv
Bug: T337030
Change-Id: I90cdfb626c176b27b59db6b92b9edd6b2fe49b68
2023-05-20 09:34:56 +03: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
Jon Robson d41884b8e5 Fix file page integration
Bug: T335997
Change-Id: I1c7b6a9b8f0903670d1ac40e3d29239674f5365f
2023-05-04 11:39:23 -07:00
Jon Robson d556e73a00 Router handling code should be centralized into mmv.bootstrap
- mediawiki.router is available inside mmv.bootstrap so move
the handlers into the bootstrap file
- Remove direct loading of images from mmv.js instead modify
event handlers to modify the location which will trigger the loading of
the image
- Copy what we previously did in MobileFrontend (Bartosz's idea)
to allow page refreshing and escaping overlay on page load.
- Remove some no longer relevant tests

Bug: T236591
Change-Id: Ie5d33fca5174db58380a63f5cf97f44e5df10d42
2023-05-01 17:22:39 -07:00
Arlo Breault b0f83b39fb Use Parsoid's regularity to find caption
Follow up to Ic652576f84e07c9fc8ef8be216a6fc94466198a6 where this was
hinted at.

The comment about active formatting elements is removed due to
I7b4e9df8490357f44d31d6a869fa9b7a15f029ea.

Bug: T321440
Change-Id: Ifb12dac64bd7a7fb8444ac2ada557868502cf213
2022-10-27 20:17:05 +00: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
Arlo Breault 65cba344ad Support mw:File as well as mw:Image
Bug: T273505
Change-Id: I5734593936e620b4c74789080263ef1ea3b99c9d
2022-05-19 17:46:46 -04:00
Arlo Breault ae5a7aeac1 Separate processing for Parsoid thumbs
Take advantage of the regularity of the structure.

Limit selection to .mw-description links, which serves an equivalent
purpose to .image in the legacy output.

Bug: T292657
Change-Id: Ic652576f84e07c9fc8ef8be216a6fc94466198a6
2022-03-04 18:36:26 -05:00
Arlo Breault 681e1afe36 s/thumbContain/thumbContainer/
Change-Id: I57738c705b3be7aade3e5ba64c879eecc1727383
2022-03-04 18:34:06 -05:00
seddon a397ce8f88 Lightweight fix to FF Nightly/Fission scroll issue
Bug: T229484
Change-Id: Id1624e8822b81deedf8c58a3df83bd992946869b
2021-08-04 09:49:30 +00:00
jdlrobson 933d370ecf Prepare for MediaWiki UI version 2
In the next iteration of the MediaWiki UI icon styles, it will
not be possible to mix button classes with icons.

The change will result in a slight increase in height for
the settings cog which will be fixed as soon
as Ibc136a17662ae839f90babb21e0f7e8f27b7a7d5 is applied.

Bug: T191021
Change-Id: Ic976ba8cddde1515db260973b00d501f8fc7b901
2021-07-19 15:42:21 -07:00
DannyS712 5c0ef64a73 Typo fix: "the the" -> "the"
Bug: T201491
Change-Id: Ie0139401ea5826546219fc86f5efefbb76159027
2021-07-17 02:58:49 +00:00
Vedmaka ca57e8eda0 Adds viewer state invalidation into wikipage.content hook callback
When new content is added to a page ( like images LazyLoading ) the
MultimediaViewer reacts mostly correctly, except that is does not
rebuild images indexes for a viewer hence breaking next/prev order.
The patch solves this by resetting the viewer state at MMVB.processThumbs()
letting the viewer to be correctly re-initialized at later stages.

Change-Id: Ib1e3ba05f5bc84d477302e365ad7984de1a84272
2021-06-02 11:14:45 +00:00
AronDemian 72636057d8 [cleanup] Fix eslint (new version) warnings
Bug: T245930
Change-Id: I7a62e5a0a90ce0f4e4385afdae1e57722bc9ac82
2020-11-02 02:58:31 +01:00
Ed Sanders d554d7f426 Docs: Fix whitespace
Change-Id: I98dc12787f68bd8db60e5a5bcb9366daf9f2f6b8
2020-06-26 11:21:04 +01:00
Timo Tijhof caa11531b1 mmv.bootstrap: Remove direct static call to OO.Router.prototype
Follows-up Id4df92b0ebed3 where a direct call was added into
the OO.Router.prototype which is invalid.

It also didn't add much value as it literally contains just
one line of trivial code that was already used without any
shared state with the actual instance of OO.Router used.

Use location.href directly.

Bug: T77258
Change-Id: I00c018f97d6569a532e51f817a1faa2df4f2fb1a
2020-06-12 10:07:40 +00:00
Ed Sanders 5da05073f1 eslint: Enable no-proxy rule
Change-Id: I54e0073c0f35db110add7518e888081af19cd069
2019-09-20 13:25:10 +01:00
Ed Sanders 18a154b989 build: Update devDependencies
Change-Id: I46f5317976ef9f818e30b0c81018e83800535389
2019-07-31 22:59:13 +01:00
Fomafix f89d7dc878 Remove "window." for location and setTimeout
The JavaScript in core also don't use "window." for these browser
properties and methods.

Change-Id: I344573fd7ef0e73c252779b4e59a53168d16574f
2019-06-10 12:46:58 +02:00
Simon Legner b1ade19388 Adopt mediawiki.router
Bug: T77258
Change-Id: Id4df92b0ebed3fb4f4b9269862c952f3968bf957
2019-05-26 19:46:38 +02:00
James D. Forrester 9b826f022e build: Lint the rest of our JS, and make pass
Change-Id: I660bba75d2637ac67a1f7920d40e051ed67d1d45
2019-05-08 14:28:06 -07:00
Ed Sanders 1ded292f83 Remove obsolete aliases from closures
Bug: T208951
Change-Id: Ice695dfb489974faa23ba19d74cf17b06e3f6075
2018-11-12 16:33:24 +00:00
Timo Tijhof 5c9faa580e Move files to their own directory per module
Bug: T193826
Change-Id: I925b1c7be2dbbb50994ed9f1ef12b5978ba175ff
2018-07-30 15:15:25 +02:00
Renamed from resources/mmv/mmv.bootstrap.js (Browse further)