From 9ffa5fc24f3c272462ca6433cf742bbda229d00a Mon Sep 17 00:00:00 2001 From: Danny B Date: Sat, 12 Jul 2014 13:34:30 +0200 Subject: [PATCH] Special:Allpages replace table with unordered list * better accessibility * better customizability * less output html code Change-Id: I99b3ad5f94fdc3dfa0f2f9935e1bb00808d2fece --- includes/specials/SpecialAllPages.php | 26 +++++-------------- .../mediawiki.special/mediawiki.special.css | 17 ++++++++++-- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/includes/specials/SpecialAllPages.php b/includes/specials/SpecialAllPages.php index e4b606d3f4..3d68a78e7f 100644 --- a/includes/specials/SpecialAllPages.php +++ b/includes/specials/SpecialAllPages.php @@ -213,32 +213,20 @@ class SpecialAllPages extends IncludableSpecialPage { ); if ( $res->numRows() > 0 ) { - $out = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-chunk' ) ); + $out = Xml::openElement( 'ul', array( 'class' => 'mw-allpages-chunk' ) ); while ( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) { $t = Title::newFromRow( $s ); if ( $t ) { - $link = ( $s->page_is_redirect ? '
' : '' ) . + $out .= 'page_is_redirect ? ' class="allpagesredirect"' : '' ) . + '>' . Linker::link( $t ) . - ( $s->page_is_redirect ? '
' : '' ); + "\n"; } else { - $link = '[[' . htmlspecialchars( $s->page_title ) . ']]'; + $out .= '
  • [[' . htmlspecialchars( $s->page_title ) . "]]
  • \n"; } - - if ( $n % 3 == 0 ) { - $out .= ''; - } - - $out .= "$link"; - $n++; - if ( $n % 3 == 0 ) { - $out .= "\n"; - } - } - - if ( ( $n % 3 ) != 0 ) { - $out .= "\n"; } - $out .= Xml::closeElement( 'table' ); + $out .= Xml::closeElement( 'ul' ); } else { $out = ''; } diff --git a/resources/src/mediawiki.special/mediawiki.special.css b/resources/src/mediawiki.special/mediawiki.special.css index 7ac8154b7b..0356fc741e 100644 --- a/resources/src/mediawiki.special/mediawiki.special.css +++ b/resources/src/mediawiki.special/mediawiki.special.css @@ -16,15 +16,28 @@ } /* Special:Allpages */ -table.mw-allpages-table-form, table.mw-allpages-table-chunk { +table.mw-allpages-table-form { width: 100%; } +table.mw-allpages-table-form tr { + vertical-align: top; +} .mw-allpages-nav { text-align: right; margin-bottom: 1em; } -table.mw-allpages-table-form tr { + +ul.mw-allpages-chunk { + margin: 0; + padding: 0; +} +ul.mw-allpages-chunk li { + border-top: 1px solid #ccc; + display: inline-block; + margin: 0 1% 0 0; + padding: .2em 0; vertical-align: top; + width: 31%; } /* Special:BlockList */ -- 2.20.1