We currently have a default gadget that displays the image inline using jquery.ui (https://www.wikidata.org/wiki/MediaWiki:Gadget-CommonsMedia.js) but it would be much much cooler/better to use MediaViewer for this.
Description
Details
- Reference
- bz69456
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Properly add images via ParserOutput::addImage | mediawiki/extensions/Wikibase | master | +7 -1 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | hoo | T71456 [Story] Use MediaViewer on commonsMedia properties on Wikibase repo | |||
Resolved | hoo | T46727 [Story] Statement should show a thumbnail for image/video/audio properties | |||
Resolved | hoo | T192869 Image link should link to Commons and not local file | |||
Open | None | T219226 See the details of the thumbnails while editing a Wikidata entity | |||
Declined | Tgr | T147637 Investigate possibility to use MediaViewer for images not present in the DOM |
Event Timeline
Mass-removing the Multimedia tag from MediaViewer tasks, as this is now being worked on by the Reading department, not Editing's Multimedia team.
Related MV tasks: T59298: The viewer box should not depend on the current page, T77152: Support Developer Plugins/Gadgets in Media Viewer. @hoo if you have thoughts on what kind of hooks would be helpful please add it to that task!
@hoo: Can you add a link to the user script you wrote? Then I'll get it to editors and ask what they think.
If T46727: [Story] Statement should show a thumbnail for image/video/audio properties is resolved, we will get this for free :)
(Someone needs to disable the gadget in that case, though)
Once the thumbnails appear (that might need a page purge), MediaViewer will automatically pick them up.
Actually I was (slightly) wrong here, while MMV is going to pick up the images automatically, it does not automatically load.
This is because the loading of the required RL modules is not (automatically) triggered.
This is because MMV loads [ 'mmv.head', 'mmv.bootstrap.autostart' ] (for non-file pages) only if OutputPage::getFileSearchOptions is non-empty. But for Wikibase entities, getFileSearchOptions is empty, as we register images without sha1 or timestamp in ParserOutput::addImage. I'm not sure how to proceed here… I don't see how MMV would be able to find out whether images exist on a page. Maybe Wikibase should actually also set the sha1 and timestamp?
As a TEMPORARY workaround the following JavaScript could be added site-wide mw.loader.using( 'mmv.bootstrap.autostart' );.
Change 427285 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Properly add images via ParserOutput::addImage
Workaround put in place: https://www.wikidata.org/w/index.php?diff=666554247&oldid=330428534
Change 427285 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Properly add images via ParserOutput::addImage
Mentioned on wiki that the workaround can be removed on (or after) June 1st (when the change has been deployed long enough for all caches to be expired for sure).