From 657831a2f5ef8f2ece9447ae2ed7007680d71d16 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Tue, 26 Aug 2008 20:06:57 +0000 Subject: [PATCH] * 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 --- RELEASE-NOTES | 1 + includes/Linker.php | 3 ++- includes/PageHistory.php | 15 +++++++++++---- includes/diff/DifferenceEngine.php | 4 +++- languages/messages/MessagesEn.php | 2 ++ maintenance/language/messages.inc | 2 ++ 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d9508efd42..20253a67b2 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 to accept image names without an Image: prefix +* Add tooltips to rollback and undo links === Bug fixes in 1.14 === diff --git a/includes/Linker.php b/includes/Linker.php index db912e3866..e076801881 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -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' ) ); } diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 35f08f38f7..4ba67a289b 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -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[] = "{$undolink}"; } diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 0f030581f6..58554fd074 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -816,8 +816,10 @@ CONTROL; . " (" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . ")"; // 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 .= " (" . htmlspecialchars( wfMsg( 'editundo' ) ) . ")"; + $this->mNewtitle .= " (" . $htmlLink . ")"; } if( !$this->mOldRev->userCan( Revision::DELETED_TEXT ) ) { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 2ff0ba4794..ea9cf9985d 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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 diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index ca105cff93..2b5fe5cffc 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1947,6 +1947,8 @@ $wgMessageStructure = array( 'tooltip-watch', 'tooltip-recreate', 'tooltip-upload', + 'tooltip-rollback', + 'tooltip-undo', ), 'stylesheets' => array( 'common.css', -- 2.20.1