From ecf1d0d0bbbe82645e80c1d3443bf13d5b094303 Mon Sep 17 00:00:00 2001 From: Alex Z Date: Sat, 25 Oct 2008 20:57:56 +0000 Subject: [PATCH] Fix for r42528 (enhanced RC JS/fallback fixes), use "visibility:hidden" rather than "display:none" to hide the arrow for non-JS for proper spacing. --- RELEASE-NOTES | 2 ++ includes/ChangesList.php | 47 ++++++++++++++++++++++--------- languages/messages/MessagesEn.php | 2 ++ maintenance/language/messages.inc | 2 ++ skins/common/enhancedchanges.js | 40 ++++++++++++++++++++++++++ skins/common/wikibits.js | 16 ----------- 6 files changed, 79 insertions(+), 30 deletions(-) create mode 100644 skins/common/enhancedchanges.js diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d5c2dcb9ce..476643de4e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -283,6 +283,8 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 14609) User's namespaces to be searched default not updated after adding new namespace * Purge form uses valid XHTML and (bug 8992) uses $wgRequest instead of $_SERVER * (bug 12764) Special:LonelyPages shows transcluded pages +* (bug 16073) Enhanced RecentChanges uses onclick handler with better fallback if + JavaScript is disabled. === API changes in 1.14 === diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 41d20398b2..febe9b1e88 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -388,6 +388,23 @@ class OldChangesList extends ChangesList { * Generate a list of changes using an Enhanced system (use javascript). */ class EnhancedChangesList extends ChangesList { + + /** + * Add the JavaScript file for enhanced changeslist + * @ return string + */ + public function beginRecentChangesList() { + global $wgStylePath, $wgStyleVersion; + $this->rc_cache = array(); + $this->rcMoveIndex = 0; + $this->rcCacheIndex = 0; + $this->lastdate = ''; + $this->rclistOpen = false; + $script = Xml::tags( 'script', array( + 'type' => 'text/javascript', + 'src' => $wgStylePath . "/common/enhancedchanges.js?$wgStyleVersion" ), '' ); + return $script; + } /** * Format a line for enhanced recentchange (aka with javascript and block of lines). */ @@ -596,13 +613,16 @@ class EnhancedChangesList extends ChangesList { $users = ' [' . implode( $this->message['semicolon-separator'], $users ) . ']'; - # Arrow - $rci = 'RCI'.$this->rcCacheIndex; - $rcl = 'RCL'.$this->rcCacheIndex; - $rcm = 'RCM'.$this->rcCacheIndex; - $toggleLink = "javascript:toggleVisibility('$rci','$rcm','$rcl')"; - $tl = '' . $this->sideArrow() . ''; - $tl .= ''; + # ID for JS visibility toggle + $jsid = $this->rcCacheIndex; + # onclick handler to toggle hidden/expanded + $toggleLink = "onclick='toggleVisibility($jsid); return false'"; + # Title for tags + $expandTitle = wfMsg('rc-enhanced-expand'); + $closeTitle = wfMsg('rc-enhanced-hide'); + + $tl = "" . $this->sideArrow() . ""; + $tl .= ""; $r .= ''.$tl.' '; # Main line @@ -680,7 +700,7 @@ class EnhancedChangesList extends ChangesList { $r .= "\n"; # Sub-entries - $r .= '