Update formatting for gallery related files
Change-Id: Ib3381bca8a6c7fb28a3054d6b4f0493140c1cb75
This commit is contained in:
parent
c3bef4243e
commit
1e5ea537f8
5 changed files with 19 additions and 19 deletions
|
|
@ -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;
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
*/
|
||||
|
||||
class NolinesImageGallery extends TraditionalImageGallery {
|
||||
|
||||
protected function getThumbPadding() {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue