Page MenuHomePhabricator

Investigate possibility to use MediaViewer for images not present in the DOM
Closed, DeclinedPublic

Description

For a proper implementation of T71456: [Story] Use MediaViewer on commonsMedia properties on Wikibase repo we would need a way to make the MediaViewer work for images that are not present in the DOM.

In my experimental gadget, I work around that by adding small thumbs of the pictures I want to cover to mw.util.$content (but hide them visually). I would be nice if that could be avoided.

Event Timeline

hoo updated the task description. (Show Details)

The old task for that was T59298.

You'd probably have to kill off mw.mmv.MultimediaViewer.thumbs and replace it with some kind of iterator object that can return the mw.mmv.LightboxImage for the next and previous images (or an array of them if you want to be forwards-compatible with probably-never-going-to-happen features like T77156). Or if you can get the list of thumbnails at page load time, you can leave that part alone and just change the thumb list generation logic in mw.mmv.MultimediaViewerBootstrap.

The nontrivial part of the change will be figuring out what to do with mw.mmv.LightboxImage.thumb which is the thumbnail that will be used as the blurred, low-resolution placeholder while loading, and is assumed to be already present in the DOM (or could be a detached fragment, but in any case, loaded).

I talked about this with @Lydia_Pintscher and we decided that it's not worth it for us, as we want to add the thumbnails anyway (thus this would just be an intermediate step).