Load module mediawiki.page.gallery.styles for all ImageGalleries
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 23 Sep 2015 19:40:51 +0000 (21:40 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Thu, 24 Sep 2015 14:46:47 +0000 (16:46 +0200)
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

includes/gallery/TraditionalImageGallery.php
includes/parser/Parser.php

index 0df6f84..0934f6a 100644 (file)
@@ -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 );
index 677da63..c07a08a 100644 (file)
@@ -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 );