r112457 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112456‎ | r112457 | r112458 >
Date:00:03, 27 February 2012
Author:krinkle
Status:fixme (Comments)
Tags:
Comment:
[mediawik.special.changeslist] Remove ugly arrow swapping hack
* Use CSS and change the background image, instead of displaying 2 <img> tags and hiding one based on the parent element's class
* touches bug 17616 a bit, although it doesn't address the focus issue yet, but does improve the overal structure of this module
* Also speeds up by:
- Outputting less markup
- Having 1 embedded images in the CSS file instead of (N changes)*<img> tags
* jquery.makeCollapsible:
Modified paths:
  • /trunk/phase3/includes/ChangesList.php (modified) (history)
  • /trunk/phase3/resources/mediawiki.special/images (added) (history)
  • /trunk/phase3/resources/mediawiki.special/images/arrow-collapsed-ltr.png (added) (history)
  • /trunk/phase3/resources/mediawiki.special/images/arrow-collapsed-rtl.png (added) (history)
  • /trunk/phase3/resources/mediawiki.special/images/arrow-expanded.png (added) (history)
  • /trunk/phase3/resources/mediawiki.special/mediawiki.special.changeslist.css (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ChangesList.php
@@ -860,16 +860,7 @@
861861 $users = ' <span class="changedby">[' .
862862 implode( $this->message['semicolon-separator'], $users ) . ']</span>';
863863
864 - # Title for <a> tags
865 - $expandTitle = htmlspecialchars( wfMsg( 'rc-enhanced-expand' ) );
866 - $closeTitle = htmlspecialchars( wfMsg( 'rc-enhanced-hide' ) );
867 -
868 - $tl = "<span class='mw-collapsible-toggle'>"
869 - . "<span class='mw-rc-openarrow'>"
870 - . "<a href='#' title='$expandTitle'>{$this->sideArrow()}</a>"
871 - . "</span><span class='mw-rc-closearrow'>"
872 - . "<a href='#' title='$closeTitle'>{$this->downArrow()}</a>"
873 - . "</span></span>";
 864+ $tl = '<span class="mw-collapsible-toggle mw-enhancedchanges-arrow"></span>';
874865 $r .= "<td>$tl</td>";
875866
876867 # Main line
@@ -974,7 +965,6 @@
975966 $classes = array();
976967 $type = $rcObj->mAttribs['rc_type'];
977968
978 - #$r .= '<tr><td valign="top">'.$this->spacerArrow();
979969 $r .= '<tr><td></td><td class="mw-enhanced-rc">';
980970 $r .= $this->recentChangesFlags( array(
981971 'newpage' => $rcObj->mAttribs['rc_new'],
@@ -1119,7 +1109,7 @@
11201110 $r = Html::openElement( 'table', array( 'class' => $classes ) ) .
11211111 Html::openElement( 'tr' );
11221112
1123 - $r .= '<td class="mw-enhanced-rc">' . $this->spacerArrow();
 1113+ $r .= '<td class="mw-enhanced-rc"><span class="mw-enhancedchanges-arrow mw-enhancedchanges-arrow-space"></span>';
11241114 # Flag and Timestamp
11251115 if( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
11261116 $r .= '&#160;&#160;&#160;&#160;'; // 4 flags -> 4 spaces
Index: trunk/phase3/resources/mediawiki.special/images/arrow-collapsed-ltr.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/phase3/resources/mediawiki.special/images/arrow-collapsed-ltr.png
___________________________________________________________________
Added: svn:mime-type
11271117 + image/png
Index: trunk/phase3/resources/mediawiki.special/images/arrow-collapsed-rtl.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/phase3/resources/mediawiki.special/images/arrow-collapsed-rtl.png
___________________________________________________________________
Added: svn:mime-type
11281118 + image/png
Index: trunk/phase3/resources/mediawiki.special/images/arrow-expanded.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/phase3/resources/mediawiki.special/images/arrow-expanded.png
___________________________________________________________________
Added: svn:mime-type
11291119 + image/png
Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.changeslist.css
@@ -31,20 +31,29 @@
3232 float: none;
3333 }
3434
35 -/**
36 - * If JS is disabled, the arrow is still needed
37 - * for spacing, but ideally shouldn't be shown
38 - */
39 -.mw-enhanced-rc .mw-rc-openarrow {
40 - visibility: hidden;
 35+/* If JS is disabled, the arrow shouldn't be shown */
 36+.client-nojs .mw-enhancedchanges-arrow.mw-collapsible-toggle {
 37+ display: none;
4138 }
4239
43 -.mw-enhanced-rc.mw-made-collapsible .mw-rc-openarrow,
44 -.mw-enhanced-rc .mw-rc-closearrow {
45 - visibility: visible;
46 - display: none;
 40+.mw-enhancedchanges-arrow {
 41+ display: inline-block;
 42+ *display: inline; /* IE7 and below */
 43+ zoom: 1;
 44+ width: 15px;
 45+ height: 15px;
4746 }
48 -.mw-enhanced-rc.mw-made-collapsible .mw-collapsible-toggle-collapsed .mw-rc-openarrow,
49 -.mw-enhanced-rc.mw-made-collapsible .mw-collapsible-toggle-expanded .mw-rc-closearrow {
50 - display: inline;
 47+
 48+.mw-enhancedchanges-arrow.mw-enhancedchanges-arrow-space {
 49+ background: none;
5150 }
 51+
 52+.mw-enhancedchanges-arrow.mw-collapsible-toggle-collapsed {
 53+ /* @embed */
 54+ background: url(images/arrow-collapsed-ltr.png) no-repeat left center;
 55+}
 56+
 57+.mw-enhancedchanges-arrow.mw-collapsible-toggle-expanded {
 58+ /* @embed */
 59+ background: url(images/arrow-expanded.png) no-repeat left center;
 60+}

Comments

#Comment by Catrope (talk | contribs)   19:19, 14 March 2012

This removes the tooltips from the arrow icons

#Comment by Krinkle (talk | contribs)   05:31, 19 March 2012

I was expecting that the jQuery makeCollapsible plugin would take care of that (since it's not a custom-collapsible). Will checkout soon.

Status & tagging log