From eb62ec3e7086b3da23ff24c5c0c0867844e1a6f9 Mon Sep 17 00:00:00 2001 From: Alex Z Date: Thu, 20 Aug 2009 21:06:24 +0000 Subject: [PATCH] Update ChangesList output for enhanced changes to use CSS instead of obsolete attrbutes and elements (cellpadding, , etc.) The test page I was using successfully validated as HTML 5 :) Tested for signs of obvious regressions in FF 3.5, IE8, Opera 9.64 and Safari 4.0. Supposedly, the border-spacing property isn't supported by IE, but I didn't see any obvious issues when testing, so either the information I got was wrong/outdated, or its not actually necessary here. Needs testing in IE6/7 to verify. If I did everything right, there shouldn't be any visible changes, save maybe a couple trivial spacing quirks. --- includes/ChangesList.php | 31 +++++++++++++++---------------- includes/DefaultSettings.php | 2 +- skins/common/shared.css | 12 ++++++++++++ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 844f687427..1bfdc39bf5 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -776,7 +776,7 @@ class EnhancedChangesList extends ChangesList { wfProfileIn( __METHOD__ ); - $r = ''; + $r = '
'; # Collate list of users $userlinks = array(); @@ -846,13 +846,13 @@ class EnhancedChangesList extends ChangesList { $tl = ""; $tl .= ""; - $r .= '
'.$tl.' '; + $r .= ''.$tl.' '; # Main line $r .= $this->recentChangesFlags( $isnew, false, $unpatrolled, ' ', $bot ); # Timestamp - $r .= ' '.$block[0]->timestamp.' '; + $r .= ' '.$block[0]->timestamp.' '; # Article link if( $namehidden ) { @@ -944,7 +944,7 @@ class EnhancedChangesList extends ChangesList { # Sub-entries $r .= '
'; - $r .= ''; + $r .= '
'; foreach( $block as $rcObj ) { # Extract fields from DB into the function scope (rc_xxxx variables) // FIXME: Would be good to replace this extract() call with something @@ -954,10 +954,10 @@ class EnhancedChangesList extends ChangesList { extract( $rcObj->mAttribs ); #$r .= '
'.$this->spacerArrow(); - $r .= '
'; - $r .= ''.$this->spacerIndent() . $this->spacerIndent(); + $r .= '
'; + $r .= $this->spacerIndent() . $this->spacerIndent(); $r .= $this->recentChangesFlags( $rc_new, $rc_minor, $rcObj->unpatrolled, ' ', $rc_bot ); - $r .= ' '; + $r .= ' '; $params = $queryParams; @@ -967,27 +967,26 @@ class EnhancedChangesList extends ChangesList { # Log timestamp if( $rc_type == RC_LOG ) { - $link = ''.$rcObj->timestamp.' '; + $link = $rcObj->timestamp; # Revision link } else if( !ChangesList::userCan($rcObj,Revision::DELETED_TEXT) ) { - $link = ''.$rcObj->timestamp.' '; + $link = ''.$rcObj->timestamp.' '; } else { if ( $rcObj->unpatrolled && $rc_type == RC_NEW) { $params['rcid'] = $rcObj->mAttribs['rc_id']; } - $link = '' . - $this->skin->link( + $link = $this->skin->link( $rcObj->getTitle(), $rcObj->timestamp, array(), $params, array( 'known', 'noclasses' ) - ) . ''; + ); if( $this->isDeleted($rcObj,Revision::DELETED_TEXT) ) $link = ''.$link.' '; } - $r .= $link; + $r .= $link . ''; if ( !$rc_type == RC_LOG || $rc_type == RC_NEW ) { $r .= ' ('; @@ -1092,15 +1091,15 @@ class EnhancedChangesList extends ChangesList { extract( $rcObj->mAttribs ); $query['curid'] = $rc_cur_id; - $r = ''; - $r .= '
' . $this->spacerArrow() . ' '; + $r = ''; + $r .= '
' . $this->spacerArrow() . ' '; # Flag and Timestamp if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { $r .= '    '; // 4 flags -> 4 spaces } else { $r .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $rcObj->unpatrolled, ' ', $rc_bot ); } - $r .= ' '.$rcObj->timestamp.' '; + $r .= ' '.$rcObj->timestamp.' '; # Article or log link if( $rc_log_type ) { $logtitle = Title::newFromText( "Log/$rc_log_type", NS_SPECIAL ); diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 0ecf33bcd9..f468db0f0d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1580,7 +1580,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches do not keep obsolete copies of global * styles. */ -$wgStyleVersion = '238'; +$wgStyleVersion = '239'; # Server-side caching: diff --git a/skins/common/shared.css b/skins/common/shared.css index 780d49f9ce..9ed8661e7f 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -747,3 +747,15 @@ div.gallerytext { padding: 2px 4px; } +table.mw-enhanced-rc { + background: none; + padding:0; + border:0; + border-spacing:0; +} +td.mw-enhanced-rc { + white-space:nowrap; + vertical-align:top; + font-family:monospace +} + -- 2.20.1