mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-09-24 18:59:45 +00:00
Merge "Only add handlers on image thumbnails"
This commit is contained in:
commit
822018c418
|
@ -17,6 +17,16 @@
|
|||
|
||||
( function ( mw, $ ) {
|
||||
var MultiLightbox, LightboxImage, lightboxHooks,
|
||||
validExtensions = {
|
||||
'jpg': true,
|
||||
'jpeg': true,
|
||||
'gif': true,
|
||||
'svg': true,
|
||||
'png': true,
|
||||
'tiff': true,
|
||||
'tif': true
|
||||
},
|
||||
|
||||
iiprops = [
|
||||
'timestamp',
|
||||
'user',
|
||||
|
@ -49,6 +59,11 @@
|
|||
fileTitle = mw.Title.newFromImg( $thumb ),
|
||||
index = urls.length;
|
||||
|
||||
if ( !validExtensions[fileTitle.getExtension().toLowerCase()] ) {
|
||||
// Not a valid extension, skip this one
|
||||
return;
|
||||
}
|
||||
|
||||
$links.data( 'filePageLink', filePageLink );
|
||||
urls.push( new LightboxImage( fileLink ) );
|
||||
urls[index].filePageLink = filePageLink;
|
||||
|
|
Loading…
Reference in a new issue