From: Bartosz DziewoƄski Date: Sat, 31 Jan 2015 13:04:56 +0000 (+0000) Subject: Revert "CategoryView modified to use css columns" X-Git-Tag: 1.31.0-rc.0~12535^2 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=1d96a7e7ecab1655180618958b5cfe3acf4e1275;p=lhc%2Fweb%2Fwiklou.git Revert "CategoryView modified to use css columns" The new feature does not work very well, and the commit breaks several unrelated things. Sorry, let's try again. This reverts commit cb5a0f20a436b90a5cfabfba84554e712b32794a. Bug: T85496 Change-Id: I018050ec0bf773e6e22e99819fe3cad91171bbd2 --- diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index d527aa802e..c898ec975e 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -89,9 +89,6 @@ class CategoryViewer extends ContextSource { ) { $this->title = $title; $this->setContext( $context ); - $this->getOutput()->addModuleStyles( array( - 'mediawiki.action.view.categoryPage.styles' - ) ); $this->from = $from; $this->until = $until; $this->limit = $context->getConfig()->get( 'CategoryPagingLimit' ); @@ -536,6 +533,9 @@ class CategoryViewer extends ContextSource { * TODO: Take the headers into account when creating columns, so they're * more visually equal. * + * More distant TODO: Scrap this and use CSS columns, whenever IE finally + * supports those. + * * @param array $articles * @param string[] $articles_start_char * @return string @@ -546,10 +546,11 @@ class CategoryViewer extends ContextSource { # Split into three columns $columns = array_chunk( $columns, ceil( count( $columns ) / 3 ), true /* preserve keys */ ); - $ret = Html::openElement( 'div', array( 'class' => 'mw-category' ) ); + $ret = ''; $prevchar = null; foreach ( $columns as $column ) { + $ret .= '\n"; } - $ret .= Html::closeElement( 'div' ); + $ret .= '
'; $colContents = array(); # Kind of like array_flip() here, but we keep duplicates in an @@ -566,26 +567,26 @@ class CategoryViewer extends ContextSource { # Change space to non-breaking space to keep headers aligned $h3char = $char === ' ' ? ' ' : htmlspecialchars( $char ); - $ret .= Html::openElement( 'h3' ) . $h3char; + $ret .= '

' . $h3char; if ( $first && $char === $prevchar ) { # We're continuing a previous chunk at the top of a new # column, so add " cont." after the letter. $ret .= ' ' . wfMessage( 'listingcontinuesabbrev' )->escaped(); } - $ret .= Html::closeElement( 'h3' )."\n"; + $ret .= "

\n"; - $ret .= Html::openElement('ul').Html::openElement('li'); - $ret .= implode( Html::element( 'li' ), $articles ); - $ret .= Html::closeElement('ul').Html::closeElement('li'); + $ret .= '
  • '; + $ret .= implode( "
  • \n
  • ", $articles ); + $ret .= '
'; $first = false; $prevchar = $char; } - $ret .= "\n"; + $ret .= "
'; return $ret; } diff --git a/resources/Resources.php b/resources/Resources.php index 4ee516ba87..6e8cd99df0 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1094,10 +1094,6 @@ return array( 'metadata-collapse', ), ), - 'mediawiki.action.view.categoryPage.styles' => array( - 'styles' => 'resources/src/mediawiki.action/mediawiki.action.view.categoryPage.less', - 'targets' => array( 'desktop', 'mobile' ) - ), 'mediawiki.action.view.postEdit' => array( 'templates' => array( 'postEdit.html' => 'resources/src/mediawiki.action/templates/postEdit.html', diff --git a/resources/src/mediawiki.action/mediawiki.action.view.categoryPage.less b/resources/src/mediawiki.action/mediawiki.action.view.categoryPage.less deleted file mode 100644 index 9a6fd31f99..0000000000 --- a/resources/src/mediawiki.action/mediawiki.action.view.categoryPage.less +++ /dev/null @@ -1,10 +0,0 @@ -@import "mediawiki.mixins"; - -.mw-category { - .column-count(1); -} -@media screen and ( min-width: 768px ) { - .mw-category { - .column-count(3); - } -} diff --git a/resources/src/mediawiki.less/mediawiki.mixins.less b/resources/src/mediawiki.less/mediawiki.mixins.less index e6e8a5a5d5..c84c884dd3 100644 --- a/resources/src/mediawiki.less/mediawiki.mixins.less +++ b/resources/src/mediawiki.less/mediawiki.mixins.less @@ -64,10 +64,3 @@ -webkit-box-shadow: @value; // Safari 3.1-5.0, iOS 3.2-4.3, Android 2.1-3.0 box-shadow: @value; // Chrome 10+, Firefox 4+, IE 9+, Safari 5.1+, Opera 11+, iOS 5+, Android 4+ } - -.column-count(@value) { - -webkit-column-count: @value; - -moz-column-count: @value; - -o-column-count: @value; - column-count: @value; -} \ No newline at end of file