From 727dca17ee04826bba47b36d0ce5330f0f814d69 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Wed, 15 Apr 2009 09:36:53 +0000 Subject: [PATCH] * Special:AllPages: Move hardcoded styles from code to CSS --- RELEASE-NOTES | 1 + includes/DefaultSettings.php | 2 +- includes/specials/SpecialAllpages.php | 51 ++++++++++++++------------- skins/common/shared.css | 17 +++++++++ skins/modern/rtl.css | 4 +++ skins/monobook/rtl.css | 5 +++ skins/simple/rtl.css | 5 +++ 7 files changed, 60 insertions(+), 25 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 223ac7eb37..0092726b05 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -164,6 +164,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Added new hook 'MessageCacheReplace' into MessageCache.php. For instance to allow extensions to update caches in similar way as MediaWiki invalidates a cached MonoBook sidebar +* Special:AllPages: Move hardcoded styles from code to CSS === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index ee97f32af6..86d855c503 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1477,7 +1477,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '210'; +$wgStyleVersion = '211'; # Server-side caching: diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index bded883574..ad46d29446 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -114,8 +114,7 @@ class SpecialAllpages extends IncludableSpecialPage { * @param integer $namespace (default NS_MAIN) */ function showToplevel( $namespace = NS_MAIN, $from = '', $to = '' ) { - global $wgOut, $wgContLang; - $align = $wgContLang->isRtl() ? 'left' : 'right'; + global $wgOut; # TODO: Either make this *much* faster or cache the title index points # in the querycache table. @@ -198,13 +197,13 @@ class SpecialAllpages extends IncludableSpecialPage { } # At this point, $lines should contain an even number of elements. - $out .= ""; + $out .= Xml::openElement( 'table', array( 'class' => 'allpageslist' ) ); while( count ( $lines ) > 0 ) { $inpoint = array_shift( $lines ); $outpoint = array_shift( $lines ); $out .= $this->showline( $inpoint, $outpoint, $namespace ); } - $out .= '
'; + $out .= Xml::closeElement( 'table' ); $nsForm = $this->namespaceForm( $namespace, $from, $to ); # Is there more? @@ -213,11 +212,17 @@ class SpecialAllpages extends IncludableSpecialPage { } else { if( isset($from) || isset($to) ) { global $wgUser; - $out2 = ''; - $out2 .= '
' . $nsForm; - $out2 .= '' . - $wgUser->getSkin()->makeKnownLinkObj( $this->getTitle(), wfMsgHtml ( 'allpages' ) ); - $out2 .= "
"; + $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ). + ' + ' . + $nsForm . + ' + ' . + $wgUser->getSkin()->link( $this->getTitle(), wfMsgHtml ( 'allpages' ), + array(), array(), 'known' ) . + " + " . + Xml::closeElement( 'table' ); } else { $out2 = $nsForm; } @@ -233,7 +238,6 @@ class SpecialAllpages extends IncludableSpecialPage { */ function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) { global $wgContLang; - $align = $wgContLang->isRtl() ? 'left' : 'right'; $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) ); $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) ); // Don't let the length runaway @@ -248,7 +252,7 @@ class SpecialAllpages extends IncludableSpecialPage { "$inpointf", "$outpointf" ); - return ''.$out.''; + return '' . $out . ''; } /** @@ -264,8 +268,6 @@ class SpecialAllpages extends IncludableSpecialPage { $fromList = $this->getNamespaceKeyAndText($namespace, $from); $toList = $this->getNamespaceKeyAndText( $namespace, $to ); $namespaces = $wgContLang->getNamespaces(); - $align = $wgContLang->isRtl() ? 'left' : 'right'; - $n = 0; if ( !$fromList || !$toList ) { @@ -299,8 +301,7 @@ class SpecialAllpages extends IncludableSpecialPage { ); if( $res->numRows() > 0 ) { - $out = ''; - + $out = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-chunk' ) ); while( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) { $t = Title::makeTitle( $s->page_namespace, $s->page_title ); if( $t ) { @@ -316,13 +317,13 @@ class SpecialAllpages extends IncludableSpecialPage { $out .= ""; $n++; if( $n % 3 == 0 ) { - $out .= ''; + $out .= "\n"; } } if( ($n % 3) != 0 ) { - $out .= ''; + $out .= "\n"; } - $out .= '
$link
'; + $out .= Xml::closeElement( 'table' ); } else { $out = ''; } @@ -370,11 +371,13 @@ class SpecialAllpages extends IncludableSpecialPage { $self = $this->getTitle(); $nsForm = $this->namespaceForm( $namespace, $from, $to ); - $out2 = ''; - $out2 .= ' + +
' . $nsForm; - $out2 .= '' . - $sk->makeKnownLinkObj( $self, - wfMsgHtml ( 'allpages' ) ); + $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ). + '
' . + $nsForm . + '' . + $sk->link( $self, wfMsgHtml ( 'allpages' ), array(), array(), 'known' ); # Do we put a previous link ? if( isset( $prevTitle ) && $pt = $prevTitle->getText() ) { @@ -399,7 +402,7 @@ class SpecialAllpages extends IncludableSpecialPage { $wgOut->addHTML( $out2 . $out ); if( isset($prevLink) or isset($nextLink) ) { - $wgOut->addHTML( '

' ); + $wgOut->addHTML( '


' ); if( isset( $prevLink ) ) { $wgOut->addHTML( $prevLink ); } diff --git a/skins/common/shared.css b/skins/common/shared.css index c7eca9cc76..31b5df3b7a 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -300,6 +300,23 @@ td#mw-emailuser-sender, td#mw-emailuser-recipient { font-weight: bold; } +/* Special:Allpages styling */ +table.allpageslist { + background-color: transparent; +} +table.mw-allpages-table-form, table.mw-allpages-table-chunk { + background-color: transparent; + width: 100%; +} +td.mw-allpages-nav, p.mw-allpages-nav { + text-align: right; + font-size: smaller; + margin-bottom: 1em; +} +table.mw-allpages-table-form tr { + vertical-align: top; +} + /* Special:Prefixindex styling */ table#mw-prefixindex-list-table, table#mw-prefixindex-nav-table { diff --git a/skins/modern/rtl.css b/skins/modern/rtl.css index d2dcacecec..ab22827bc9 100644 --- a/skins/modern/rtl.css +++ b/skins/modern/rtl.css @@ -152,6 +152,10 @@ html > body div#mw_contentholder ul#filetoc { display: block; } +/* Special:Allpages styling */ +td.mw-allpages-nav, p.mw-allpages-nav { + text-align: left; + /* Special:Prefixindex styling */ td#mw-prefixindex-nav-form { text-align: left; diff --git a/skins/monobook/rtl.css b/skins/monobook/rtl.css index 9b8e4f44d4..19e5e9d403 100644 --- a/skins/monobook/rtl.css +++ b/skins/monobook/rtl.css @@ -240,6 +240,11 @@ html > body div#bodyContent ul { html > body div#bodyContent ul#filetoc { display: block; } + +/* Special:Allpages styling */ +td.mw-allpages-nav, p.mw-allpages-nav { + text-align: left; + /* Special:Prefixindex styling */ td#mw-prefixindex-nav-form { text-align: left; diff --git a/skins/simple/rtl.css b/skins/simple/rtl.css index 53b3dc0cf5..d49ef01ec1 100644 --- a/skins/simple/rtl.css +++ b/skins/simple/rtl.css @@ -174,6 +174,11 @@ table.filehistory th { html > body div#bodyContent ul { display: table; } + +/* Special:Allpages styling */ +td.mw-allpages-nav, p.mw-allpages-nav { + text-align: left; + /* Special:Prefixindex styling */ td#mw-prefixindex-nav-form { text-align: left; -- 2.20.1