diff options
author | Siebrand Mazeland <s.mazeland@xs4all.nl> | 2013-11-24 19:36:13 +0100 |
---|---|---|
committer | Siebrand Mazeland <s.mazeland@xs4all.nl> | 2013-11-25 06:40:43 +0100 |
commit | 1e5ea537f88c8eb9e4bdfa536f26ff51517d3e5b (patch) | |
tree | 16c795e2a99abc5cfa3771744d3baabcb27dcb52 /includes/gallery | |
parent | c3bef4243e93ea3e713bbf6853ddf7fd664390c9 (diff) | |
download | mediawikicore-1e5ea537f88c8eb9e4bdfa536f26ff51517d3e5b.tar.gz mediawikicore-1e5ea537f88c8eb9e4bdfa536f26ff51517d3e5b.zip |
Update formatting for gallery related files
Change-Id: Ib3381bca8a6c7fb28a3054d6b4f0493140c1cb75
Diffstat (limited to 'includes/gallery')
-rw-r--r-- | includes/gallery/ImageGalleryBase.php | 5 | ||||
-rw-r--r-- | includes/gallery/NolinesImageGallery.php | 1 | ||||
-rw-r--r-- | includes/gallery/PackedImageGallery.php | 4 | ||||
-rw-r--r-- | includes/gallery/PackedOverlayImageGallery.php | 9 | ||||
-rw-r--r-- | includes/gallery/TraditionalImageGallery.php | 19 |
5 files changed, 19 insertions, 19 deletions
diff --git a/includes/gallery/ImageGalleryBase.php b/includes/gallery/ImageGalleryBase.php index f85f3a71cf9d..491f12dfa149 100644 --- a/includes/gallery/ImageGalleryBase.php +++ b/includes/gallery/ImageGalleryBase.php @@ -188,7 +188,8 @@ abstract class ImageGalleryBase extends ContextSource { * * @param Array $options Attributes of gallery tag. */ - public function setAdditionalOptions( $options ) { } + public function setAdditionalOptions( $options ) { + } /** * Instruct the class to use a specific skin for rendering @@ -320,12 +321,10 @@ abstract class ImageGalleryBase extends ContextSource { ? $this->mParser->getTargetLanguage() : $this->getLanguage(); } - /* Old constants no longer used. const THUMB_PADDING = 30; const GB_PADDING = 5; const GB_BORDERS = 8; */ - } diff --git a/includes/gallery/NolinesImageGallery.php b/includes/gallery/NolinesImageGallery.php index 6b0d0fa63be8..70f5bd93c0bd 100644 --- a/includes/gallery/NolinesImageGallery.php +++ b/includes/gallery/NolinesImageGallery.php @@ -22,7 +22,6 @@ */ class NolinesImageGallery extends TraditionalImageGallery { - protected function getThumbPadding() { return 0; } diff --git a/includes/gallery/PackedImageGallery.php b/includes/gallery/PackedImageGallery.php index 963ee6b9c179..1cb1fd9575e1 100644 --- a/includes/gallery/PackedImageGallery.php +++ b/includes/gallery/PackedImageGallery.php @@ -21,7 +21,6 @@ */ class PackedImageGallery extends TraditionalImageGallery { - function __construct( $mode = 'traditional' ) { parent::__construct( $mode ); // Does not support per row option. @@ -58,6 +57,7 @@ class PackedImageGallery extends TraditionalImageGallery { // factor, so use random big number. $width = $this->mHeights * 10 + 100; } + // self::SCALE_FACTOR so the js has some room to manipulate sizes. return array( 'width' => $width * self::SCALE_FACTOR, @@ -70,6 +70,7 @@ class PackedImageGallery extends TraditionalImageGallery { if ( $thumbWidth < 60 * self::SCALE_FACTOR ) { $thumbWidth = 60 * self::SCALE_FACTOR; } + return $thumbWidth / self::SCALE_FACTOR + $this->getThumbPadding(); } @@ -78,6 +79,7 @@ class PackedImageGallery extends TraditionalImageGallery { */ protected function getGBWidth( $thumb ) { $thumbWidth = $thumb ? $thumb->getWidth() : $this->mWidths * self::SCALE_FACTOR; + return $this->getThumbDivWidth( $thumbWidth ) + $this->getGBPadding(); } diff --git a/includes/gallery/PackedOverlayImageGallery.php b/includes/gallery/PackedOverlayImageGallery.php index bba06fcfe558..ec35db2f5c43 100644 --- a/includes/gallery/PackedOverlayImageGallery.php +++ b/includes/gallery/PackedOverlayImageGallery.php @@ -22,7 +22,6 @@ */ class PackedOverlayImageGallery extends PackedImageGallery { - /** * Add the wrapper html around the thumb's caption * @@ -45,9 +44,10 @@ class PackedOverlayImageGallery extends PackedImageGallery { $captionWidth = ceil( $thumbWidth - 20 ); $outerWrapper = '<div class="gallerytextwrapper" style="width: ' . $captionWidth . 'px">'; + return "\n\t\t\t" . $outerWrapper . '<div class="gallerytext">' . "\n" - . $galleryText - . "\n\t\t\t</div>"; + . $galleryText + . "\n\t\t\t</div>"; } } @@ -57,4 +57,5 @@ class PackedOverlayImageGallery extends PackedImageGallery { * falls back to PackedHoverGallery. Degrades gracefully for * screen readers. */ -class PackedHoverImageGallery extends PackedOverlayImageGallery { } +class PackedHoverImageGallery extends PackedOverlayImageGallery { +} diff --git a/includes/gallery/TraditionalImageGallery.php b/includes/gallery/TraditionalImageGallery.php index c6e6dd36d9bb..2ee2d37fa6dd 100644 --- a/includes/gallery/TraditionalImageGallery.php +++ b/includes/gallery/TraditionalImageGallery.php @@ -21,7 +21,6 @@ */ class TraditionalImageGallery extends ImageGalleryBase { - /** * Return a HTML representation of the image gallery * @@ -171,12 +170,11 @@ class TraditionalImageGallery extends ImageGalleryBase { # Weird double wrapping (the extra div inside the li) needed due to FF2 bug # Can be safely removed if FF2 falls completely out of existence - $output .= - "\n\t\t" . '<li class="gallerybox" style="width: ' . $this->getGBWidth( $thumb ) . 'px">' - . '<div style="width: ' . $this->getGBWidth( $thumb ) . 'px">' - . $thumbhtml - . $galleryText - . "\n\t\t</div></li>"; + $output .= "\n\t\t" . '<li class="gallerybox" style="width: ' . $this->getGBWidth( $thumb ) . 'px">' + . '<div style="width: ' . $this->getGBWidth( $thumb ) . 'px">' + . $thumbhtml + . $galleryText + . "\n\t\t</div></li>"; } $output .= "\n</ul>"; @@ -195,8 +193,8 @@ class TraditionalImageGallery extends ImageGalleryBase { # http://bugzilla.wikimedia.org/show_bug.cgi?id=1765 -Ævar return "\n\t\t\t" . '<div class="gallerytext">' . "\n" - . $galleryText - . "\n\t\t\t</div>"; + . $galleryText + . "\n\t\t\t</div>"; } /** @@ -307,7 +305,8 @@ class TraditionalImageGallery extends ImageGalleryBase { * @param MediaTransformOutput $thumb The thumbnail * @param Array $imageParameters Array of options */ - protected function adjustImageParameters( $thumb, &$imageParameters ) { } + protected function adjustImageParameters( $thumb, &$imageParameters ) { + } } /** |