An image click on-wiki should trigger MediaViewer according to user's preferences, if possible.
Description
Related Objects
- Mentioned Here
- T59298: The viewer box should not depend on the current page
Event Timeline
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.