r63671 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63670‎ | r63671 | r63672 >
Date:09:43, 13 March 2010
Author:raymond
Status:ok
Tags:
Comment:
* (bug 21981) Add parameter 'showfilename' to <gallery> to automatically apply the names of the individual files within the gallery
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -6352,6 +6352,97 @@
63536353 !! end
63546354
63556355 !! test
 6356+Gallery (with options)
 6357+!! input
 6358+<gallery widths='60px' heights='40px' perrow='2' caption='Foo [[Main Page]]' >
 6359+File:Nonexistant.jpg|caption
 6360+File:Nonexistant.jpg
 6361+image:foobar.jpg|some '''caption''' [[Main Page]]
 6362+image:foobar.jpg
 6363+</gallery>
 6364+!! result
 6365+<table class="gallery" cellspacing="0" cellpadding="0">
 6366+ <caption>Foo <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a></caption>
 6367+ <tr>
 6368+ <td><div class="gallerybox" style="width: 95px;">
 6369+ <div style="height: 52px;">Nonexistant.jpg</div>
 6370+ <div class="gallerytext">
 6371+<p>caption
 6372+</p>
 6373+ </div>
 6374+ </div></td>
 6375+ <td><div class="gallerybox" style="width: 95px;">
 6376+ <div style="height: 52px;">Nonexistant.jpg</div>
 6377+ <div class="gallerytext">
 6378+ </div>
 6379+ </div></td>
 6380+ </tr>
 6381+ <tr>
 6382+ <td><div class="gallerybox" style="width: 95px;">
 6383+ <div class="thumb" style="padding: 19px 0; width: 90px;"><div style="margin-left: auto; margin-right: auto; width: 60px;"><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>
 6384+ <div class="gallerytext">
 6385+<p>some <b>caption</b> <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a>
 6386+</p>
 6387+ </div>
 6388+ </div></td>
 6389+ <td><div class="gallerybox" style="width: 95px;">
 6390+ <div class="thumb" style="padding: 19px 0; width: 90px;"><div style="margin-left: auto; margin-right: auto; width: 60px;"><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>
 6391+ <div class="gallerytext">
 6392+ </div>
 6393+ </div></td>
 6394+ </tr>
 6395+</table>
 6396+
 6397+!! end
 6398+
 6399+!! test
 6400+gallery (with showfilename option)
 6401+!! input
 6402+<gallery showfilename>
 6403+File:Nonexistant.jpg|caption
 6404+File:Nonexistant.jpg
 6405+image:foobar.jpg|some '''caption''' [[Main Page]]
 6406+File:Foobar.jpg
 6407+</gallery>
 6408+!! result
 6409+<table class="gallery" cellspacing="0" cellpadding="0">
 6410+ <tr>
 6411+ <td><div class="gallerybox" style="width: 155px;">
 6412+ <div style="height: 152px;">Nonexistant.jpg</div>
 6413+ <div class="gallerytext">
 6414+<p><a href="https://www.mediawiki.org/wiki/File:Nonexistant.jpg" title="File:Nonexistant.jpg">Nonexistant.jpg</a><br />
 6415+caption
 6416+</p>
 6417+ </div>
 6418+ </div></td>
 6419+ <td><div class="gallerybox" style="width: 155px;">
 6420+ <div style="height: 152px;">Nonexistant.jpg</div>
 6421+ <div class="gallerytext">
 6422+<p><a href="https://www.mediawiki.org/wiki/File:Nonexistant.jpg" title="File:Nonexistant.jpg">Nonexistant.jpg</a><br />
 6423+</p>
 6424+ </div>
 6425+ </div></td>
 6426+ <td><div class="gallerybox" style="width: 155px;">
 6427+ <div class="thumb" style="padding: 66px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><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>
 6428+ <div class="gallerytext">
 6429+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br />
 6430+some <b>caption</b> <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a>
 6431+</p>
 6432+ </div>
 6433+ </div></td>
 6434+ <td><div class="gallerybox" style="width: 155px;">
 6435+ <div class="thumb" style="padding: 66px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><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>
 6436+ <div class="gallerytext">
 6437+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br />
 6438+</p>
 6439+ </div>
 6440+ </div></td>
 6441+ </tr>
 6442+</table>
 6443+
 6444+!! end
 6445+
 6446+!! test
63566447 HTML Hex character encoding (spells the word "JavaScript")
63576448 !! input
63586449 &#x4A;&#x061;&#x0076;&#x00061;&#x000053;&#x0000063;&#114;&#x0000069;&#00000112;&#x0000000074;
Index: trunk/phase3/CREDITS
@@ -68,6 +68,7 @@
6969 * Ahmad Sherif
7070 * Antonio Ospite
7171 * Azliq7
 72+* Bawolff
7273 * Borislav Manolov
7374 * Brad Jorsch
7475 * Brent G
Index: trunk/phase3/includes/parser/Parser.php
@@ -4372,6 +4372,11 @@
43734373 $ig->useSkin( $this->mOptions->getSkin() );
43744374 $ig->mRevisionId = $this->mRevisionId;
43754375
 4376+ if( isset( $params['showfilename'] ) ) {
 4377+ $ig->setShowFilename( true );
 4378+ } else {
 4379+ $ig->setShowFilename( false );
 4380+ }
43764381 if( isset( $params['caption'] ) ) {
43774382 $caption = $params['caption'];
43784383 $caption = htmlspecialchars( $caption );
Index: trunk/phase3/RELEASE-NOTES
@@ -26,6 +26,8 @@
2727 * (bug 10183) Users can now add personal styles and scripts to all skins via
2828 User:<name>/common.css and /common.js (if user css/js is enabled)
2929 * (bug 22748) Add anchors on Special:ListGroupRights
 30+* (bug 21981) Add parameter 'showfilename' to <gallery> to automatically apply
 31+ the names of the individual files within the gallery
3032
3133 === Bug fixes in 1.17 ===
3234 * (bug 17560) Half-broken deletion moved image files to deletion archive without

Status & tagging log