Page MenuHomePhabricator

Multimediaviewer does not open by default on banners added by WikidataPageBanner
Closed, ResolvedPublic

Description

Go to http://en.wikipedia.beta.wmflabs.org/wiki/Asia and click on the top most banner, the browser goes to the File page.
Expected behaviour: Banner should open in multimediaviewer.
WikidataPageBanner adds its banners to the page manually through a mustache template in BeforePageDisplay hook. @Tgr, Does multimedia viewer add event listeners on images which this banner might be missing? And if yes, is it possible to externally add a listener which would open the viewer?

Details

Related Gerrit Patches:
mediawiki/extensions/WikidataPageBanner : masterWikidataPageBanner add class "image" to a:link

Event Timeline

Sumit created this task.Aug 12 2015, 2:55 AM
Sumit raised the priority of this task from to Needs Triage.
Sumit updated the task description. (Show Details)
Sumit added a project: Wikidata-Page-Banner.
Sumit moved this task to Blocked on the Wikidata-Page-Banner board.
Sumit added subscribers: Sumit, Jdlrobson, Tgr.
Restricted Application added a project: Wikidata. · View Herald TranscriptAug 12 2015, 2:55 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Sumit set Security to None.
Sumit renamed this task from Multimediaviewer does not open by default on banners to Multimediaviewer does not open by default on banners added by WikidataPageBanner.Aug 12 2015, 4:13 AM
Sumit updated the task description. (Show Details)
Sumit added a project: Multimedia.
Restricted Application added a subscriber: Matanya. · View Herald TranscriptAug 12 2015, 4:13 AM
Tgr added a comment.Aug 12 2015, 5:17 AM

There are multiple issues:

  • until MediaViewer gets zoom functionality (T77151) I'm not sure there is a point in using it. It can help with download and such, but it will display the image pretty much the same way it looks on the page.
  • you have to make sure the selector used by MediaViewer finds the image
  • MediaViewer uses OutputPage::getFileSearchOptions() to decide whether to load on a specific page or not, so you would either have to change that or make sure OutputPage is aware of the image (see the comment here: https://gerrit.wikimedia.org/r/#/c/228751/ )

Change 230975 had a related patch set uploaded (by Sumit):
WikidataPageBanner add class "image" to a:link

https://gerrit.wikimedia.org/r/230975

Change 230975 merged by jenkins-bot:
WikidataPageBanner add class "image" to a:link

https://gerrit.wikimedia.org/r/230975

Sumit added a comment.Aug 12 2015, 6:06 AM

@Tgr, thanks for the quick feedback, a temporary fix has been implemented, which makes banner image like others open in MultimediaViewer.

Sumit added a comment.Aug 12 2015, 6:08 AM

@Tgr, thanks for the quick feedback, a temporary fix has been implemented, which makes banner image like others open in MultimediaViewer.

Sumit closed this task as Resolved.Aug 12 2015, 6:08 AM
Tgr added a comment.Aug 12 2015, 6:26 AM

Note that it won't work if the page has no other images (and is MediaViewer is not set up).