From: umherirrender Date: Wed, 23 Sep 2015 19:40:51 +0000 (+0200) Subject: Load module mediawiki.page.gallery.styles for all ImageGalleries X-Git-Tag: 1.31.0-rc.0~9853^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=27700d276f96ed57f6d97263af13b5628af00a88;p=lhc%2Fweb%2Fwiklou.git Load module mediawiki.page.gallery.styles for all ImageGalleries Move the added module from Parser.php to TraditionalImageGallery, because there the gallerybox class is added to the html and at the moment all core image galleries are extending the traditional one. That brings the styles back for special pages like Special:NewFiles, Special:MostImages and also on category pages with media files. Follows Ib1aef04dc4fece78e6615386ecaef6a9f368f49e Bug: T113511 Change-Id: I32697c2c65824d7622c1840330d6074ebb68b488 --- diff --git a/includes/gallery/TraditionalImageGallery.php b/includes/gallery/TraditionalImageGallery.php index 0df6f84635..0934f6aa09 100644 --- a/includes/gallery/TraditionalImageGallery.php +++ b/includes/gallery/TraditionalImageGallery.php @@ -46,6 +46,7 @@ class TraditionalImageGallery extends ImageGalleryBase { array( 'class' => 'gallery mw-gallery-' . $this->mMode ), $this->mAttribs ); $modules = $this->getModules(); + $modules[] = 'mediawiki.page.gallery.styles'; if ( $this->mParser ) { $this->mParser->getOutput()->addModules( $modules ); diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 677da63bd7..c07a08ac98 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -5326,7 +5326,6 @@ class Parser { $ig->setParser( $this ); $ig->setHideBadImages(); $ig->setAttributes( Sanitizer::validateTagAttributes( $params, 'table' ) ); - $this->getOutput()->addModuleStyles( 'mediawiki.page.gallery.styles' ); if ( isset( $params['showfilename'] ) ) { $ig->setShowFilename( true );