Index: trunk/phase3/skins/common/shared.css |
— | — | @@ -584,6 +584,11 @@ |
585 | 585 | margin: 2px; |
586 | 586 | } |
587 | 587 | |
| 588 | +li.gallerybox div.thumb img { |
| 589 | + display: block; |
| 590 | + margin: 0 auto; |
| 591 | +} |
| 592 | + |
588 | 593 | div.gallerytext { |
589 | 594 | overflow: hidden; |
590 | 595 | font-size: 94%; |
Index: trunk/phase3/tests/parser/parserTests.txt |
— | — | @@ -7410,7 +7410,7 @@ |
7411 | 7411 | !! test |
7412 | 7412 | Gallery (with options) |
7413 | 7413 | !! input |
7414 | | -<gallery widths='60px' heights='40px' perrow='2' caption='Foo [[Main Page]]' > |
| 7414 | +<gallery widths='70px' heights='40px' perrow='2' caption='Foo [[Main Page]]' > |
7415 | 7415 | File:Nonexistant.jpg|caption |
7416 | 7416 | File:Nonexistant.jpg |
7417 | 7417 | image:foobar.jpg|some '''caption''' [[Main Page]] |
— | — | @@ -7418,34 +7418,34 @@ |
7419 | 7419 | image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla. |
7420 | 7420 | </gallery> |
7421 | 7421 | !! result |
7422 | | -<ul class="gallery" style="max-width: 206px;_width: 206px;"> |
| 7422 | +<ul class="gallery" style="max-width: 226px;_width: 226px;"> |
7423 | 7423 | <li class='gallerycaption'>Foo <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a></li> |
7424 | | - <li class="gallerybox" style="width: 95px"><div style="width: 95px"> |
| 7424 | + <li class="gallerybox" style="width: 105px"><div style="width: 105px"> |
7425 | 7425 | <div style="height: 70px;">Nonexistant.jpg</div> |
7426 | 7426 | <div class="gallerytext"> |
7427 | 7427 | <p>caption |
7428 | 7428 | </p> |
7429 | 7429 | </div> |
7430 | 7430 | </div></li> |
7431 | | - <li class="gallerybox" style="width: 95px"><div style="width: 95px"> |
| 7431 | + <li class="gallerybox" style="width: 105px"><div style="width: 105px"> |
7432 | 7432 | <div style="height: 70px;">Nonexistant.jpg</div> |
7433 | 7433 | <div class="gallerytext"> |
7434 | 7434 | </div> |
7435 | 7435 | </div></li> |
7436 | | - <li class="gallerybox" style="width: 95px"><div style="width: 95px"> |
7437 | | - <div class="thumb" style="width: 90px;"><div style="margin:26px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="60" height="7" /></a></div></div> |
| 7436 | + <li class="gallerybox" style="width: 105px"><div style="width: 105px"> |
| 7437 | + <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="70" height="8" /></a></div></div> |
7438 | 7438 | <div class="gallerytext"> |
7439 | 7439 | <p>some <b>caption</b> <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a> |
7440 | 7440 | </p> |
7441 | 7441 | </div> |
7442 | 7442 | </div></li> |
7443 | | - <li class="gallerybox" style="width: 95px"><div style="width: 95px"> |
7444 | | - <div class="thumb" style="width: 90px;"><div style="margin:26px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="60" height="7" /></a></div></div> |
| 7443 | + <li class="gallerybox" style="width: 105px"><div style="width: 105px"> |
| 7444 | + <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="70" height="8" /></a></div></div> |
7445 | 7445 | <div class="gallerytext"> |
7446 | 7446 | </div> |
7447 | 7447 | </div></li> |
7448 | | - <li class="gallerybox" style="width: 95px"><div style="width: 95px"> |
7449 | | - <div class="thumb" style="width: 90px;"><div style="margin:26px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="This is a foo-bar." src="http://example.com/images/3/3a/Foobar.jpg" width="60" height="7" /></a></div></div> |
| 7448 | + <li class="gallerybox" style="width: 105px"><div style="width: 105px"> |
| 7449 | + <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="This is a foo-bar." src="http://example.com/images/3/3a/Foobar.jpg" width="70" height="8" /></a></div></div> |
7450 | 7450 | <div class="gallerytext"> |
7451 | 7451 | <p>Blabla|blabla. |
7452 | 7452 | </p> |
— | — | @@ -7465,14 +7465,14 @@ |
7466 | 7466 | !! result |
7467 | 7467 | <ul class="gallery"> |
7468 | 7468 | <li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
7469 | | - <div class="thumb" style="width: 150px;"><div style="margin:66px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
| 7469 | + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
7470 | 7470 | <div class="gallerytext"> |
7471 | 7471 | <p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="desc"><img alt="inneralt" src="http://example.com/images/3/3a/Foobar.jpg" width="20" height="2" /></a> |
7472 | 7472 | </p> |
7473 | 7473 | </div> |
7474 | 7474 | </div></li> |
7475 | 7475 | <li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
7476 | | - <div class="thumb" style="width: 150px;"><div style="margin:66px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
| 7476 | + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
7477 | 7477 | <div class="gallerytext"> |
7478 | 7478 | <p>This is a test template |
7479 | 7479 | </p> |
— | — | @@ -7509,7 +7509,7 @@ |
7510 | 7510 | </div> |
7511 | 7511 | </div></li> |
7512 | 7512 | <li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
7513 | | - <div class="thumb" style="width: 150px;"><div style="margin:66px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
| 7513 | + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
7514 | 7514 | <div class="gallerytext"> |
7515 | 7515 | <p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br /> |
7516 | 7516 | some <b>caption</b> <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a> |
— | — | @@ -7517,7 +7517,7 @@ |
7518 | 7518 | </div> |
7519 | 7519 | </div></li> |
7520 | 7520 | <li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
7521 | | - <div class="thumb" style="width: 150px;"><div style="margin:66px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
| 7521 | + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
7522 | 7522 | <div class="gallerytext"> |
7523 | 7523 | <p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br /> |
7524 | 7524 | </p> |
— | — | @@ -7549,12 +7549,12 @@ |
7550 | 7550 | </div> |
7551 | 7551 | </div></li> |
7552 | 7552 | <li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
7553 | | - <div class="thumb" style="width: 150px;"><div style="margin:66px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
| 7553 | + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
7554 | 7554 | <div class="gallerytext"> |
7555 | 7555 | </div> |
7556 | 7556 | </div></li> |
7557 | 7557 | <li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
7558 | | - <div class="thumb" style="width: 150px;"><div style="margin:66px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
| 7558 | + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div> |
7559 | 7559 | <div class="gallerytext"> |
7560 | 7560 | </div> |
7561 | 7561 | </div></li> |
Index: trunk/phase3/includes/ImageGallery.php |
— | — | @@ -281,10 +281,7 @@ |
282 | 282 | $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ( self::THUMB_PADDING + $this->mHeights ) . 'px;">' |
283 | 283 | . htmlspecialchars( $img->getLastError() ) . '</div>'; |
284 | 284 | } else { |
285 | | - # We get layout problems with the margin, if the image is smaller |
286 | | - # than the line-height (17), so we add less margin in these cases. |
287 | | - $minThumbHeight = $thumb->height > 17 ? $thumb->height : 17; |
288 | | - $vpad = floor( ( self::THUMB_PADDING + $this->mHeights - $minThumbHeight ) /2 ); |
| 285 | + $vpad = ( self::THUMB_PADDING + $this->mHeights - $thumb->height ) /2; |
289 | 286 | |
290 | 287 | $imageParameters = array( |
291 | 288 | 'desc-link' => true, |