mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-24 08:13:38 +00:00
Support mw:File as well as mw:Image
Bug: T273505 Change-Id: I5734593936e620b4c74789080263ef1ea3b99c9d
This commit is contained in:
parent
f13d696748
commit
65cba344ad
|
@ -156,6 +156,9 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
this.$parsoidThumbs = $content.find(
|
this.$parsoidThumbs = $content.find(
|
||||||
|
'[typeof*="mw:File"] a.mw-file-description img, ' +
|
||||||
|
// TODO: Remove mw:Image when version 2.4.0 of the content is no
|
||||||
|
// longer supported
|
||||||
'[typeof*="mw:Image"] a.mw-file-description img'
|
'[typeof*="mw:Image"] a.mw-file-description img'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -298,7 +301,12 @@
|
||||||
var bs = this,
|
var bs = this,
|
||||||
$thumb = $( thumb ),
|
$thumb = $( thumb ),
|
||||||
$link = $thumb.closest( 'a.mw-file-description' ),
|
$link = $thumb.closest( 'a.mw-file-description' ),
|
||||||
$thumbContainer = $link.closest( '[typeof*="mw:Image"]' ),
|
$thumbContainer = $link.closest(
|
||||||
|
'[typeof*="mw:File"], ' +
|
||||||
|
// TODO: Remove mw:Image when version 2.4.0 of the content is
|
||||||
|
// no longer supported
|
||||||
|
'[typeof*="mw:Image"]'
|
||||||
|
),
|
||||||
link = $link.prop( 'href' ),
|
link = $link.prop( 'href' ),
|
||||||
alt = $thumb.attr( 'alt' ),
|
alt = $thumb.attr( 'alt' ),
|
||||||
title = mw.Title.newFromImg( $thumb );
|
title = mw.Title.newFromImg( $thumb );
|
||||||
|
@ -512,7 +520,13 @@
|
||||||
|
|
||||||
mw.mmv.durationLogger.start( [ 'click-to-first-image', 'click-to-first-metadata' ] );
|
mw.mmv.durationLogger.start( [ 'click-to-first-image', 'click-to-first-metadata' ] );
|
||||||
|
|
||||||
if ( $element.is( 'a.image, [typeof*="mw:Image"] > a' ) ) {
|
if ( $element.is(
|
||||||
|
'a.image, ' +
|
||||||
|
'[typeof*="mw:File"] a.mw-file-description, ' +
|
||||||
|
// TODO: Remove mw:Image when version 2.4.0 of the content is no
|
||||||
|
// longer supported
|
||||||
|
'[typeof*="mw:Image"] a.mw-file-description'
|
||||||
|
) ) {
|
||||||
mw.mmv.actionLogger.log( 'thumbnail' );
|
mw.mmv.actionLogger.log( 'thumbnail' );
|
||||||
} else if ( $element.is( '.magnify a' ) ) {
|
} else if ( $element.is( '.magnify a' ) ) {
|
||||||
mw.mmv.actionLogger.log( 'enlarge' );
|
mw.mmv.actionLogger.log( 'enlarge' );
|
||||||
|
|
Loading…
Reference in a new issue