* Add tooltips to rollback and undo links
authorRaimond Spekking <raymond@users.mediawiki.org>
Tue, 26 Aug 2008 20:06:57 +0000 (20:06 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Tue, 26 Aug 2008 20:06:57 +0000 (20:06 +0000)
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

RELEASE-NOTES
includes/Linker.php
includes/PageHistory.php
includes/diff/DifferenceEngine.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index d9508ef..20253a6 100644 (file)
@@ -95,6 +95,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 13815) In the comment for page moves, use the colon-separator message
   instead of a hardcoded colon.
 * Allow <gallery> to accept image names without an Image: prefix
+* Add tooltips to rollback and undo links
 
 === Bug fixes in 1.14 ===
 
index db912e3..e076801 100644 (file)
@@ -1552,7 +1552,8 @@ class Linker {
                }
                $query['token'] = $wgUser->editToken( array( $title->getPrefixedText(),
                        $rev->getUserText() ) );
-               return $this->link( $title, wfMsgHtml( 'rollbacklink' ), array(),
+               return $this->link( $title, wfMsgHtml( 'rollbacklink' ),
+                       array( 'title' => wfMsg( 'tooltip-rollback' ) ),
                        $query, array( 'known', 'noclasses' ) );
        }
 
index 35f08f3..4ba67a2 100644 (file)
@@ -362,10 +362,17 @@ class PageHistory {
                        if( $this->mTitle->quickUserCan( 'edit' ) &&
                        !$rev->isDeleted( Revision::DELETED_TEXT ) &&
                        !$next->rev_deleted & Revision::DELETED_TEXT ) {
-                               $undolink = $this->mSkin->makeKnownLinkObj(
-                               $this->mTitle,
-                               wfMsgHtml( 'editundo' ),
-                                       'action=edit&undoafter=' . $next->rev_id . '&undo=' . $rev->getId()
+
+                               # Create undo tooltip for the first (=latest) line only
+                               $undoTooltip = $latest
+                                       ? array( 'title' => wfMsg( 'tooltip-undo' ) )
+                                       : array();
+                               $undolink = $this->mSkin->link(
+                                       $this->mTitle,
+                                       wfMsgHtml( 'editundo' ),
+                                       $undoTooltip,
+                                       array( 'action' => 'edit', 'undoafter' => $next->rev_id, 'undo' => $rev->getId() ),
+                                       array( 'known', 'noclasses' )
                                );
                                $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
                        }
index 0f03058..58554fd 100644 (file)
@@ -816,8 +816,10 @@ CONTROL;
                        . " (<a href='$oldEdit'>" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . "</a>)";
                        // Add an "undo" link
                        $newUndo = $this->mNewPage->escapeLocalUrl( 'action=edit&undoafter=' . $this->mOldid . '&undo=' . $this->mNewid);
+                       $htmlLink = htmlspecialchars( wfMsg( 'editundo' ) );
+                       $htmlTitle = linker::tooltip( 'undo' );
                        if( $editable && !$this->mOldRev->isDeleted( Revision::DELETED_TEXT ) && !$this->mNewRev->isDeleted( Revision::DELETED_TEXT ) ) {
-                               $this->mNewtitle .= " (<a href='$newUndo'>" . htmlspecialchars( wfMsg( 'editundo' ) ) . "</a>)";
+                               $this->mNewtitle .= " (<a href='$newUndo' $htmlTitle>" . $htmlLink . "</a>)";
                        }
 
                        if( !$this->mOldRev->userCan( Revision::DELETED_TEXT ) ) {
index 2ff0ba4..ea9cf99 100644 (file)
@@ -2784,6 +2784,8 @@ You can view its source.',
 'tooltip-watch'                   => 'Add this page to your watchlist',
 'tooltip-recreate'                => 'Recreate the page despite it having been deleted',
 'tooltip-upload'                  => 'Start upload',
+'tooltip-rollback'                => '"Rollback" reverts edit(s) to this page of the last contributor in one click.',
+'tooltip-undo'                    => '"Undo" reverts this edit and opens the edit form in preview mode. Allows adding a reason in the summary.',
 
 # Stylesheets
 '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 ca105cf..2b5fe5c 100644 (file)
@@ -1947,6 +1947,8 @@ $wgMessageStructure = array(
                'tooltip-watch',
                'tooltip-recreate',
                'tooltip-upload',
+               'tooltip-rollback',
+               'tooltip-undo',
        ),
        'stylesheets' => array(
                'common.css',