Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -115,7 +115,7 @@ |
116 | 116 | if( $fol != '-' && !wfEmptyMsg( 'shareddescriptionfollows', $fol ) ) { |
117 | 117 | $wgOut->addWikiText( $fol ); |
118 | 118 | } |
119 | | - $wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription . '</div>' ); |
| 119 | + $wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription . "</div>\n" ); |
120 | 120 | } |
121 | 121 | |
122 | 122 | $this->closeShowImage(); |
— | — | @@ -135,7 +135,7 @@ |
136 | 136 | global $wgStylePath, $wgStyleVersion; |
137 | 137 | $expand = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-expand' ) ) ); |
138 | 138 | $collapse = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-collapse' ) ) ); |
139 | | - $wgOut->addHTML( Xml::element( 'h2', array( 'id' => 'metadata' ), wfMsg( 'metadata' ) ). "\n" ); |
| 139 | + $wgOut->addHTML( Xml::element( 'h2', array( 'id' => 'metadata' ), wfMsg( 'metadata' ) ) . "\n" ); |
140 | 140 | $wgOut->addWikiText( $this->makeMetadataTable( $formattedMetadata ) ); |
141 | 141 | $wgOut->addScriptFile( 'metadata.js' ); |
142 | 142 | $wgOut->addHTML( |
— | — | @@ -226,9 +226,9 @@ |
227 | 227 | $r = '<ul id="filetoc"> |
228 | 228 | <li><a href="#file">' . $wgLang->getNsText( NS_FILE ) . '</a></li> |
229 | 229 | <li><a href="#filehistory">' . wfMsgHtml( 'filehist' ) . '</a></li> |
230 | | - <li><a href="#filelinks">' . wfMsgHtml( 'imagelinks' ) . '</a></li>' . |
231 | | - ($metadata ? ' <li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>' : '') . ' |
232 | | - </ul>'; |
| 230 | + <li><a href="#filelinks">' . wfMsgHtml( 'imagelinks' ) . "</a></li>\n" . |
| 231 | + ($metadata ? ' <li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>' : '') . " |
| 232 | + </ul>\n"; |
233 | 233 | return $r; |
234 | 234 | } |
235 | 235 | |
— | — | @@ -241,8 +241,9 @@ |
242 | 242 | * @return string |
243 | 243 | */ |
244 | 244 | protected function makeMetadataTable( $metadata ) { |
245 | | - $r = wfMsg( 'metadata-help' ) . "\n\n"; |
246 | | - $r .= "{| id=mw_metadata class=mw_metadata\n"; |
| 245 | + $r = "<div class=\"mw-imagepage-section-metadata\">\n"; |
| 246 | + $r .= wfMsg( 'metadata-help' ); |
| 247 | + $r .= "<table id=\"mw_metadata\" class=\"mw_metadata\">\n"; |
247 | 248 | foreach ( $metadata as $type => $stuff ) { |
248 | 249 | foreach ( $stuff as $v ) { |
249 | 250 | # FIXME, why is this using escapeId for a class?! |
— | — | @@ -250,12 +251,12 @@ |
251 | 252 | if( $type == 'collapsed' ) { |
252 | 253 | $class .= ' collapsable'; |
253 | 254 | } |
254 | | - $r .= "|- class=\"$class\"\n"; |
255 | | - $r .= "!| {$v['name']}\n"; |
256 | | - $r .= "|| {$v['value']}\n"; |
| 255 | + $r .= "<tr class=\"$class\">\n"; |
| 256 | + $r .= "<th>{$v['name']}</th>\n"; |
| 257 | + $r .= "<td>{$v['value']}</td>\n</tr>"; |
257 | 258 | } |
258 | 259 | } |
259 | | - $r .= '|}'; |
| 260 | + $r .= "</table>\n</div>\n"; |
260 | 261 | return $r; |
261 | 262 | } |
262 | 263 | |
— | — | @@ -371,7 +372,7 @@ |
372 | 373 | ); |
373 | 374 | $wgOut->addHTML( '<div class="fullImageLink" id="file">' . |
374 | 375 | $thumbnail->toHtml( $options ) . |
375 | | - $anchorclose . '</div>' ); |
| 376 | + $anchorclose . "</div>\n" ); |
376 | 377 | } |
377 | 378 | |
378 | 379 | if( $this->displayImg->isMultipage() ) { |
— | — | @@ -428,7 +429,7 @@ |
429 | 430 | |
430 | 431 | $wgOut->addHTML( '<div class="fullImageLink" id="file">' . |
431 | 432 | $icon->toHtml( array( 'desc-link' => true ) ) . |
432 | | - '</div>' ); |
| 433 | + "</div>\n" ); |
433 | 434 | } |
434 | 435 | |
435 | 436 | $showLink = true; |
— | — | @@ -443,16 +444,16 @@ |
444 | 445 | $wgOut->addWikiText( <<<EOT |
445 | 446 | <div class="fullMedia"> |
446 | 447 | <span class="dangerousLink">[[Media:$filename|$filename]]</span>$dirmark |
447 | | -<span class="fileInfo"> $longDesc</span> |
| 448 | +<span class="fileInfo">$longDesc</span> |
448 | 449 | </div> |
449 | | - |
450 | 450 | <div class="mediaWarning">$warning</div> |
451 | 451 | EOT |
452 | 452 | ); |
453 | 453 | } else { |
454 | 454 | $wgOut->addWikiText( <<<EOT |
455 | 455 | <div class="fullMedia"> |
456 | | -[[Media:$filename|$filename]]$dirmark <span class="fileInfo"> $longDesc</span> |
| 456 | +[[Media:$filename|$filename]]$dirmark |
| 457 | +<span class="fileInfo">$longDesc</span> |
457 | 458 | </div> |
458 | 459 | EOT |
459 | 460 | ); |
— | — | @@ -484,7 +485,7 @@ |
485 | 486 | $descUrl = $this->img->getDescriptionUrl(); |
486 | 487 | $descText = $this->img->getDescriptionText(); |
487 | 488 | |
488 | | - $wrap = "<div class='sharedUploadNotice'>\n$1\n</div>"; |
| 489 | + $wrap = "<div class=\"sharedUploadNotice\">\n$1\n</div>\n"; |
489 | 490 | $repo = $this->img->getRepo()->getDisplayName(); |
490 | 491 | |
491 | 492 | $msg = ''; |
— | — | @@ -520,19 +521,19 @@ |
521 | 522 | |
522 | 523 | $sk = $wgUser->getSkin(); |
523 | 524 | |
524 | | - $wgOut->addHTML( '<br /><ul>' ); |
| 525 | + $wgOut->addHTML( "<br /><ul>\n" ); |
525 | 526 | |
526 | 527 | # "Upload a new version of this file" link |
527 | 528 | if( UploadForm::userCanReUpload($wgUser,$this->img->name) ) { |
528 | 529 | $ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) ); |
529 | | - $wgOut->addHTML( "<li><div class='plainlinks'>{$ulink}</div></li>" ); |
| 530 | + $wgOut->addHTML( "<li id=\"mw-imagepage-reupload-link\"><div class=\"plainlinks\">{$ulink}</div></li>\n" ); |
530 | 531 | } |
531 | 532 | |
532 | 533 | # External editing link |
533 | 534 | $elink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' ); |
534 | | - $wgOut->addHTML( '<li>' . $elink . ' <small>' . wfMsgExt( 'edit-externally-help', array( 'parseinline' ) ) . '</small></li>' ); |
| 535 | + $wgOut->addHTML( '<li id="mw-imagepage-edit-external">' . $elink . ' <small>' . wfMsgExt( 'edit-externally-help', array( 'parseinline' ) ) . "</small></li>\n" ); |
535 | 536 | |
536 | | - $wgOut->addHTML( '</ul>' ); |
| 537 | + $wgOut->addHTML( "</ul>\n" ); |
537 | 538 | } |
538 | 539 | |
539 | 540 | protected function closeShowImage() {} # For overloading |
— | — | @@ -602,12 +603,13 @@ |
603 | 604 | $wgOut->addHTML( "<li>{$link}</li>\n" ); |
604 | 605 | } |
605 | 606 | } |
606 | | - $wgOut->addHTML( "</ul></div>\n" ); |
| 607 | + $wgOut->addHTML( "</ul>\n" ); |
607 | 608 | $res->free(); |
608 | 609 | |
609 | 610 | // Add a links to [[Special:Whatlinkshere]] |
610 | 611 | if( $count > $limit ) |
611 | 612 | $wgOut->addWikiMsg( 'morelinkstoimage', $this->mTitle->getPrefixedDBkey() ); |
| 613 | + $wgOut->addHTML( "</div>\n" ); |
612 | 614 | } |
613 | 615 | |
614 | 616 | protected function imageRedirects() { |
— | — | @@ -746,9 +748,10 @@ |
747 | 749 | |
748 | 750 | public function beginImageHistoryList( $navLinks = '' ) { |
749 | 751 | global $wgOut, $wgUser; |
750 | | - return Xml::element( 'h2', array( 'id' => 'filehistory' ), wfMsg( 'filehist' ) ) |
| 752 | + return Xml::element( 'h2', array( 'id' => 'filehistory' ), wfMsg( 'filehist' ) ) . "\n" |
| 753 | + . "<div id=\"mw-imagepage-section-filehistory\">\n" |
751 | 754 | . $wgOut->parse( wfMsgNoTrans( 'filehist-help' ) ) |
752 | | - . $navLinks |
| 755 | + . $navLinks . "\n" |
753 | 756 | . Xml::openElement( 'table', array( 'class' => 'filehistory' ) ) . "\n" |
754 | 757 | . '<tr><td></td>' |
755 | 758 | . ( $this->current->isLocal() && ($wgUser->isAllowed('delete') || $wgUser->isAllowed('deleterevision') ) ? '<td></td>' : '' ) |
— | — | @@ -761,7 +764,7 @@ |
762 | 765 | } |
763 | 766 | |
764 | 767 | public function endImageHistoryList( $navLinks = '' ) { |
765 | | - return "</table>\n$navLinks\n"; |
| 768 | + return "</table>\n$navLinks\n</div>\n"; |
766 | 769 | } |
767 | 770 | |
768 | 771 | public function imageHistoryLine( $iscur, $file ) { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -296,6 +296,7 @@ |
297 | 297 | * The svn-version version numbers on Special:Version have been removed |
298 | 298 | * (bug 17374) Special:Export no longer exports two copies of the same page |
299 | 299 | * (bug 18190) Proper parsing in MediaWiki:Sharedupload message |
| 300 | +* (bug 17617) HTML cleanup for ImagePage |
300 | 301 | |
301 | 302 | == API changes in 1.15 == |
302 | 303 | * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions |