Page MenuHomePhabricator

Clicking image on-wiki triggers MediaViewer
Open, In Progress, Needs TriagePublic

Description

An image click on-wiki should trigger MediaViewer according to user's preferences, if possible.

Event Timeline

Dominicbm changed the task status from Open to In Progress.Jan 23 2023, 7:13 PM
Dominicbm moved this task from Backlog to In Progress on the View-it! board.

To get this to work, we would probably have to re-initialize MediaViewer after View it!'s carousel has loaded. I've done some investigating, and also got some guidance from @Tgr.

The entire page could be entirely re-initialized using a wikipage.content hook. We may also be able to process individual images using mw.mmv.bootstrap.processThumbs($container).

The real messy part is that MediaViewer only processes images in a thumbnail format. There have been attempts in the past (e.g. this script) to re-initialize MediaViewer after initial page load; in this script, they create dummy thumbnails for use by MediaViewer.

This sounds possible to implement, albeit with messy code and unclear side effects.

Might be easier to go the other way around and add a clean API to MediaViewer. That would be T59298: The viewer box should not depend on the current page.