Update formatting for gallery related files
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Sun, 24 Nov 2013 18:36:13 +0000 (19:36 +0100)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Mon, 25 Nov 2013 05:40:43 +0000 (06:40 +0100)
Change-Id: Ib3381bca8a6c7fb28a3054d6b4f0493140c1cb75

includes/gallery/ImageGalleryBase.php
includes/gallery/NolinesImageGallery.php
includes/gallery/PackedImageGallery.php
includes/gallery/PackedOverlayImageGallery.php
includes/gallery/TraditionalImageGallery.php

index f85f3a7..491f12d 100644 (file)
@@ -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;
        */
-
 }
 
index 6b0d0fa..70f5bd9 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 class NolinesImageGallery extends TraditionalImageGallery {
-
        protected function getThumbPadding() {
                return 0;
        }
index 963ee6b..1cb1fd9 100644 (file)
@@ -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();
        }
 
index bba06fc..ec35db2 100644 (file)
@@ -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 {
+}
index c6e6dd3..2ee2d37 100644 (file)
@@ -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 ) {
+       }
 }
 
 /**