From: Aryeh Gregor Date: Sun, 2 Aug 2009 22:15:55 +0000 (+0000) Subject: Add legend and tooltips to explain RC flags X-Git-Tag: 1.31.0-rc.0~40557 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=2ea241d23feb6834e5032f1e27cc198a152ed4e0;p=lhc%2Fweb%2Fwiklou.git Add legend and tooltips to explain RC flags Based on a patch submitted by svip on IRC. I also changed the for unpatrolled into an , and created a new message in case anyone wants to localize !, for the sake of uniformity. --- diff --git a/CREDITS b/CREDITS index df88b0bfc9..6aa650b829 100644 --- a/CREDITS +++ b/CREDITS @@ -102,6 +102,7 @@ following names for their contribution to the product. * Simon Walker * Stefano Codari * Str4nd +* svip == Translators == * Anders Wegge Jakobsen diff --git a/RELEASE-NOTES b/RELEASE-NOTES index dee4461896..de2d514b09 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -180,6 +180,8 @@ this. Was used when mwEmbed was going to be an extension. * (bug 16322) Allow maintenance scripts to accept DB user/pass over input or params * (bug 18566) Maintenance script to un/protect pages * (bug 671) The HTML tag is now permitted. +* RecentChanges now has a legend to explain what the Nmb! flags mean, and the + flags have tooltips. === Bug fixes in 1.16 === diff --git a/includes/ChangesList.php b/includes/ChangesList.php index b51b166f3c..2691dd461e 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -68,8 +68,8 @@ class ChangesList { */ private function preCacheMessages() { if( !isset( $this->message ) ) { - foreach( explode(' ', 'cur diff hist minoreditletter newpageletter last '. - 'blocklink history boteditletter semicolon-separator pipe-separator' ) as $msg ) { + foreach ( explode( ' ', 'cur diff hist last blocklink history ' . + 'semicolon-separator pipe-separator' ) as $msg ) { $this->message[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) ); } } @@ -86,15 +86,43 @@ class ChangesList { * @return string */ protected function recentChangesFlags( $new, $minor, $patrolled, $nothing = ' ', $bot = false ) { - $f = $new ? - '' . $this->message['newpageletter'] . '' : $nothing; - $f .= $minor ? - '' . $this->message['minoreditletter'] . '' : $nothing; - $f .= $bot ? '' . $this->message['boteditletter'] . '' : $nothing; - $f .= $patrolled ? '!' : $nothing; + $f = $new ? self::flag( 'newpage' ) : $nothing; + $f .= $minor ? self::flag( 'minor' ) : $nothing; + $f .= $bot ? self::flag( 'bot' ) : $nothing; + $f .= $patrolled ? self::flag( 'unpatrolled' ) : $nothing; return $f; } + /** + * Provide the element appropriate to a given abbreviated flag, + * namely the flag indicating a new page, a minor edit, a bot edit, or an + * unpatrolled edit. By default in English it will contain "N", "m", "b", + * "!" respectively, plus it will have an appropriate title and class. + * + * @param $key string 'newpage', 'unpatrolled', 'minor', or 'bot' + * @return string Raw HTML + */ + public static function flag( $key ) { + static $messages = null; + if ( is_null( $messages ) ) { + foreach ( explode( ' ', 'minoreditletter boteditletter newpageletter ' . + 'unpatrolledletter recentchanges-label-minor recentchanges-label-bot ' . + 'recentchanges-label-newpage recentchanges-label-unpatrolled' ) as $msg ) { + $messages[$msg] = wfMsgExt( $msg, 'escapenoentities' ); + } + } + # Inconsistent naming, bleh + if ( $key == 'newpage' || $key == 'unpatrolled' ) { + $key2 = $key; + } else { + $key2 = $key . 'edit'; + } + return "" + . $messages["${key2}letter"] + . ''; + } + /** * Returns text for the start of the tabular part of RC * @return string diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index caeda530e6..04dfb40b47 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -457,6 +457,13 @@ class SpecialRecentChanges extends SpecialPage { Xml::fieldset( wfMsg( 'recentchanges-legend' ), $panelString, array( 'class' => 'rcoptions' ) ) ); + # TODO: This is probably a bad format for the message. If anyone + # customizes it and we add a new flag, it won't show up in the + # customized message unless it's changed. + $wgOut->addWikiMsg( 'recentchanges-label-legend', + ChangesList::flag( 'newpage' ), ChangesList::flag( 'minor' ), + ChangesList::flag( 'bot' ), ChangesList::flag( 'unpatrolled' ) ); + $this->setBottomText( $wgOut, $opts ); } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 5b4f06f301..24068e44e2 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1963,6 +1963,11 @@ You can also choose to let others contact you through your user or talk page wit 'recentchanges-legend' => 'Recent changes options', 'recentchangestext' => 'Track the most recent changes to the wiki on this page.', 'recentchanges-feed-description' => 'Track the most recent changes to the wiki in this feed.', +'recentchanges-label-legend' => "Legend: $1 - new page, $2 - minor edit, $3 - bot edit, $4 - unpatrolled edit.", +'recentchanges-label-newpage' => 'This edit created a new page', +'recentchanges-label-minor' => 'This is a minor edit', +'recentchanges-label-bot' => 'This edit was performed by a bot', +'recentchanges-label-unpatrolled' => 'This edit has not yet been patrolled', 'rcnote' => "Below {{PLURAL:$1|is '''1''' change|are the last '''$1''' changes}} in the last {{PLURAL:$2|day|'''$2''' days}}, as of $5, $4.", 'rcnotefrom' => "Below are the changes since '''$2''' (up to '''$1''' shown).", 'rclistfrom' => 'Show new changes starting from $1', @@ -1980,6 +1985,7 @@ You can also choose to let others contact you through your user or talk page wit 'minoreditletter' => 'm', 'newpageletter' => 'N', 'boteditletter' => 'b', +'unpatrolledletter' => '!', # only translate this message to other languages if you have to change it 'sectionlink' => '→', # only translate this message to other languages if you have to change it 'number_of_watching_users_RCview' => '[$1]', # do not translate or duplicate this message to other languages 'number_of_watching_users_pageview' => '[$1 watching {{PLURAL:$1|user|users}}]', diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc index b6af4b26fd..35cb1bf19e 100644 --- a/maintenance/language/messageTypes.inc +++ b/maintenance/language/messageTypes.inc @@ -341,6 +341,7 @@ $wgOptionalMessages = array( 'timezone-utc', 'whatlinkshere-backlink', 'recentchangeslinked-backlink', + 'unpatrolledletter', 'diff-with-additional', 'pagetitle-view-mainpage', 'trackback', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 2061faf3ad..d7bc8f6f88 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1149,6 +1149,11 @@ $wgMessageStructure = array( 'recentchanges-legend', 'recentchangestext', 'recentchanges-feed-description', + 'recentchanges-label-legend', + 'recentchanges-label-newpage', + 'recentchanges-label-minor', + 'recentchanges-label-bot', + 'recentchanges-label-unpatrolled', 'rcnote', 'rcnotefrom', 'rclistfrom', @@ -1166,6 +1171,7 @@ $wgMessageStructure = array( 'minoreditletter', 'newpageletter', 'boteditletter', + 'unpatrolledletter', 'sectionlink', 'number_of_watching_users_RCview', 'number_of_watching_users_pageview', diff --git a/skins/common/shared.css b/skins/common/shared.css index 1287c9d5ad..626094f4f4 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -68,7 +68,7 @@ li span.deleted, span.history-deleted { background-color: #ffa; } -span.unpatrolled { +.unpatrolled { font-weight: bold; color: red; } @@ -436,7 +436,7 @@ td.os-suggest-result-hl { } /** Generic minor/bot/newpage styling */ -abbr.newpage, abbr.minor, abbr.bot { +.newpage, .minor, .bot { font-weight: bold; }