dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add SVG versions of enhanced recent changes collapse/show arrows"
[lhc/web/wiklou.git]
/
includes
/
gallery
/
PackedImageGallery.php
diff --git
a/includes/gallery/PackedImageGallery.php
b/includes/gallery/PackedImageGallery.php
index
9149f8c
..
bb55c89
100644
(file)
--- a/
includes/gallery/PackedImageGallery.php
+++ b/
includes/gallery/PackedImageGallery.php
@@
-21,6
+21,11
@@
*/
class PackedImageGallery extends TraditionalImageGallery {
*/
class PackedImageGallery extends TraditionalImageGallery {
+ function __construct( $mode = 'traditional' ) {
+ parent::__construct( $mode );
+ // Does not support per row option.
+ $this->mPerRow = 0;
+ }
/**
* We artificially have 1.5 the resolution neccessary so that
/**
* We artificially have 1.5 the resolution neccessary so that
@@
-30,7
+35,7
@@
class PackedImageGallery extends TraditionalImageGallery {
const SCALE_FACTOR = 1.5;
protected function getVPad( $boxHeight, $thumbHeight ) {
const SCALE_FACTOR = 1.5;
protected function getVPad( $boxHeight, $thumbHeight ) {
- return ( $this->getThumbPadding() + $boxHeight - $thumbHeight/ self::SCALE_FACTOR ) / 2;
+ return ( $this->getThumbPadding() + $boxHeight - $thumbHeight
/ self::SCALE_FACTOR ) / 2;
}
protected function getThumbPadding() {
}
protected function getThumbPadding() {
@@
-43,6
+48,7
@@
class PackedImageGallery extends TraditionalImageGallery {
/**
* @param File $img The file being transformed. May be false
/**
* @param File $img The file being transformed. May be false
+ * @return array
*/
protected function getThumbParams( $img ) {
if ( $img && $img->getMediaType() === MEDIATYPE_AUDIO ) {
*/
protected function getThumbParams( $img ) {
if ( $img && $img->getMediaType() === MEDIATYPE_AUDIO ) {
@@
-52,6
+58,7
@@
class PackedImageGallery extends TraditionalImageGallery {
// factor, so use random big number.
$width = $this->mHeights * 10 + 100;
}
// 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,
// self::SCALE_FACTOR so the js has some room to manipulate sizes.
return array(
'width' => $width * self::SCALE_FACTOR,
@@
-64,14
+71,18
@@
class PackedImageGallery extends TraditionalImageGallery {
if ( $thumbWidth < 60 * self::SCALE_FACTOR ) {
$thumbWidth = 60 * self::SCALE_FACTOR;
}
if ( $thumbWidth < 60 * self::SCALE_FACTOR ) {
$thumbWidth = 60 * self::SCALE_FACTOR;
}
+
return $thumbWidth / self::SCALE_FACTOR + $this->getThumbPadding();
}
/**
return $thumbWidth / self::SCALE_FACTOR + $this->getThumbPadding();
}
/**
- * @param MediaTransformOutput|bool $thumb the thumbnail, or false if no thumb (which can happen)
+ * @param MediaTransformOutput|bool $thumb the thumbnail, or false if no
+ * thumb (which can happen)
+ * @return float
*/
protected function getGBWidth( $thumb ) {
$thumbWidth = $thumb ? $thumb->getWidth() : $this->mWidths * self::SCALE_FACTOR;
*/
protected function getGBWidth( $thumb ) {
$thumbWidth = $thumb ? $thumb->getWidth() : $this->mWidths * self::SCALE_FACTOR;
+
return $this->getThumbDivWidth( $thumbWidth ) + $this->getGBPadding();
}
return $this->getThumbDivWidth( $thumbWidth ) + $this->getGBPadding();
}
@@
-88,4
+99,12
@@
class PackedImageGallery extends TraditionalImageGallery {
protected function getModules() {
return array( 'mediawiki.page.gallery' );
}
protected function getModules() {
return array( 'mediawiki.page.gallery' );
}
+
+ /**
+ * Do not support per-row on packed. It really doesn't work
+ * since the images have varying widths.
+ */
+ public function setPerRow( $num ) {
+ return;
+ }
}
}