From c2dcdf730e1b96b7090c4fdf74442970213cdbf6 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Mon, 9 Aug 2010 19:04:14 +0000 Subject: [PATCH] * (bug 8140) Add dedicated CSS classes to Special:Newpages elements Especially needed for transclution of this special page to hide unneeded elements. --- RELEASE-NOTES | 1 + includes/specials/SpecialNewpages.php | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index efbb10d31b..3bd9e30d48 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -142,6 +142,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * The HTML ID's generated for sections are now much prettier when they contain punctuation or non-English letters, so a section named "Hello?" will now result in a URL ending in "#Hello?" rather than "#Hello.3F". +* (bug 8140) Add dedicated CSS classes to Special:Newpages elements === Bug fixes in 1.17 === * (bug 17560) Half-broken deletion moved image files to deletion archive diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index e0bd30920a..c49ce9904f 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -267,7 +267,9 @@ class SpecialNewpages extends IncludableSpecialPage { $dm = $wgContLang->getDirMark(); $title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title ); - $time = htmlspecialchars( $wgLang->timeAndDate( $result->rc_timestamp, true ) ); + $time = Html::rawElement( 'span', array( 'class' => 'mw-newpages-time' ), + htmlspecialchars( $wgLang->timeAndDate( $result->rc_timestamp, true ) ) + ); $query = array( 'redirect' => 'no' ); @@ -277,17 +279,21 @@ class SpecialNewpages extends IncludableSpecialPage { $plink = $this->skin->linkKnown( $title, null, - array(), + array( 'class' => 'mw-newpages-pagename' ), $query ); - $hist = $this->skin->linkKnown( + $histLink = $this->skin->linkKnown( $title, wfMsgHtml( 'hist' ), array(), array( 'action' => 'history' ) ); - $length = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), - $wgLang->formatNum( $result->length ) ); + $hist = Html::rawElement( 'span', array( 'class' => 'mw-newpages-history' ), wfMsg( 'parentheses', $histLink ) ); + + $length = Html::rawElement( 'span', array( 'class' => 'mw-newpages-length' ), + '[' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->length ) ) . + ']' + ); $ulink = $this->skin->userLink( $result->rc_user, $result->rc_user_text ) . ' ' . $this->skin->userToolLinks( $result->rc_user, $result->rc_user_text ); $comment = $this->skin->commentBlock( $result->rc_comment ); @@ -305,7 +311,7 @@ class SpecialNewpages extends IncludableSpecialPage { $css = count($classes) ? ' class="'.implode( " ", $classes).'"' : ''; - return "{$time} {$dm}{$plink} ({$hist}) {$dm}[{$length}] {$dm}{$ulink} {$comment} {$tagDisplay}\n"; + return "{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay}\n"; } /** -- 2.20.1