From 1e5ea537f88c8eb9e4bdfa536f26ff51517d3e5b Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 24 Nov 2013 19:36:13 +0100 Subject: [PATCH] Update formatting for gallery related files Change-Id: Ib3381bca8a6c7fb28a3054d6b4f0493140c1cb75 --- includes/gallery/ImageGalleryBase.php | 5 ++--- includes/gallery/NolinesImageGallery.php | 1 - includes/gallery/PackedImageGallery.php | 4 +++- .../gallery/PackedOverlayImageGallery.php | 9 +++++---- 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 f85f3a71cf..491f12dfa1 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 6b0d0fa63b..70f5bd93c0 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 963ee6b9c1..1cb1fd9575 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 bba06fcfe5..ec35db2f5c 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 = '
'; + return "\n\t\t\t" . $outerWrapper . '
' . "\n" - . $galleryText - . "\n\t\t\t
"; + . $galleryText + . "\n\t\t\t
"; } } @@ -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 c6e6dd36d9..2ee2d37fa6 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" . '
  • ' - . '
    ' - . $thumbhtml - . $galleryText - . "\n\t\t
  • "; + $output .= "\n\t\t" . '
  • ' + . '
    ' + . $thumbhtml + . $galleryText + . "\n\t\t
  • "; } $output .= "\n"; @@ -195,8 +193,8 @@ class TraditionalImageGallery extends ImageGalleryBase { # http://bugzilla.wikimedia.org/show_bug.cgi?id=1765 -Ævar return "\n\t\t\t" . '
    ' . "\n" - . $galleryText - . "\n\t\t\t
    "; + . $galleryText + . "\n\t\t\t"; } /** @@ -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 ) { + } } /** -- 2.20.1