Ignore generated captions on special file related pages

Most special pages which list images generate a caption using
various information and MediaViewer displays this caption.It should
fall back to the file description instead.

Bug: T85234
Change-Id: I5448e5de7d6f8de9852a2a845400299b6b51b8ef
This commit is contained in:
Namit 2014-12-24 23:19:01 +05:30
parent 9258418a64
commit 36ad534988

View file

@ -335,6 +335,14 @@
// do not treat categories as galleries - the autogenerated caption they have is not helpful // do not treat categories as galleries - the autogenerated caption they have is not helpful
return $thumbContain.closest( '#mw-category-media' ).length; return $thumbContain.closest( '#mw-category-media' ).length;
} ) } )
.not( function () {
// do not treat special file related pages as galleries
var $specialFileRelatedPages = $( '.page-Special_NewFiles, .page-Special_MostLinkedFiles\
, .page-Special_MostGloballyLinkedFiles\
, .page-Special_UncategorizedFiles, .page-Special_UnusedFiles'
);
return $thumbContain.closest( $specialFileRelatedPages ).length;
} )
.find( '.gallerytext' ) .find( '.gallerytext' )
.clone(); .clone();
} }