r40041 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40040‎ | r40041 | r40042 >
Date:20:06, 26 August 2008
Author:raymond
Status:old
Tags:
Comment:
* Add tooltips to rollback and undo links
At least on de.wiki the users with the review right have the rollback right too. They are confused about the difference rollback/undo. Hope that helps a bit
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/PageHistory.php (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1947,6 +1947,8 @@
19481948 'tooltip-watch',
19491949 'tooltip-recreate',
19501950 'tooltip-upload',
 1951+ 'tooltip-rollback',
 1952+ 'tooltip-undo',
19511953 ),
19521954 'stylesheets' => array(
19531955 'common.css',
Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -816,8 +816,10 @@
817817 . " (<a href='$oldEdit'>" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . "</a>)";
818818 // Add an "undo" link
819819 $newUndo = $this->mNewPage->escapeLocalUrl( 'action=edit&undoafter=' . $this->mOldid . '&undo=' . $this->mNewid);
 820+ $htmlLink = htmlspecialchars( wfMsg( 'editundo' ) );
 821+ $htmlTitle = linker::tooltip( 'undo' );
820822 if( $editable && !$this->mOldRev->isDeleted( Revision::DELETED_TEXT ) && !$this->mNewRev->isDeleted( Revision::DELETED_TEXT ) ) {
821 - $this->mNewtitle .= " (<a href='$newUndo'>" . htmlspecialchars( wfMsg( 'editundo' ) ) . "</a>)";
 823+ $this->mNewtitle .= " (<a href='$newUndo' $htmlTitle>" . $htmlLink . "</a>)";
822824 }
823825
824826 if( !$this->mOldRev->userCan( Revision::DELETED_TEXT ) ) {
Index: trunk/phase3/includes/Linker.php
@@ -1552,7 +1552,8 @@
15531553 }
15541554 $query['token'] = $wgUser->editToken( array( $title->getPrefixedText(),
15551555 $rev->getUserText() ) );
1556 - return $this->link( $title, wfMsgHtml( 'rollbacklink' ), array(),
 1556+ return $this->link( $title, wfMsgHtml( 'rollbacklink' ),
 1557+ array( 'title' => wfMsg( 'tooltip-rollback' ) ),
15571558 $query, array( 'known', 'noclasses' ) );
15581559 }
15591560
Index: trunk/phase3/includes/PageHistory.php
@@ -362,10 +362,17 @@
363363 if( $this->mTitle->quickUserCan( 'edit' ) &&
364364 !$rev->isDeleted( Revision::DELETED_TEXT ) &&
365365 !$next->rev_deleted & Revision::DELETED_TEXT ) {
366 - $undolink = $this->mSkin->makeKnownLinkObj(
367 - $this->mTitle,
368 - wfMsgHtml( 'editundo' ),
369 - 'action=edit&undoafter=' . $next->rev_id . '&undo=' . $rev->getId()
 366+
 367+ # Create undo tooltip for the first (=latest) line only
 368+ $undoTooltip = $latest
 369+ ? array( 'title' => wfMsg( 'tooltip-undo' ) )
 370+ : array();
 371+ $undolink = $this->mSkin->link(
 372+ $this->mTitle,
 373+ wfMsgHtml( 'editundo' ),
 374+ $undoTooltip,
 375+ array( 'action' => 'edit', 'undoafter' => $next->rev_id, 'undo' => $rev->getId() ),
 376+ array( 'known', 'noclasses' )
370377 );
371378 $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
372379 }
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2784,6 +2784,8 @@
27852785 'tooltip-watch' => 'Add this page to your watchlist',
27862786 'tooltip-recreate' => 'Recreate the page despite it having been deleted',
27872787 'tooltip-upload' => 'Start upload',
 2788+'tooltip-rollback' => '"Rollback" reverts edit(s) to this page of the last contributor in one click.',
 2789+'tooltip-undo' => '"Undo" reverts this edit and opens the edit form in preview mode. Allows adding a reason in the summary.',
27882790
27892791 # Stylesheets
27902792 'common.css' => '/* CSS placed here will be applied to all skins */', # only translate this message to other languages if you have to change it
Index: trunk/phase3/RELEASE-NOTES
@@ -95,6 +95,7 @@
9696 * (bug 13815) In the comment for page moves, use the colon-separator message
9797 instead of a hardcoded colon.
9898 * Allow <gallery> to accept image names without an Image: prefix
 99+* Add tooltips to rollback and undo links
99100
100101 === Bug fixes in 1.14 ===
101102

Follow-up revisions

RevisionCommit summaryAuthorDate
r40045Fix for r40041. PHP strict notice. Thanks to Ialexraymond20:23, 26 August 2008

Status & tagging log