Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -68,8 +68,8 @@ |
69 | 69 | */ |
70 | 70 | private function preCacheMessages() { |
71 | 71 | if( !isset( $this->message ) ) { |
72 | | - foreach( explode(' ', 'cur diff hist minoreditletter newpageletter last '. |
73 | | - 'blocklink history boteditletter semicolon-separator pipe-separator' ) as $msg ) { |
| 72 | + foreach ( explode( ' ', 'cur diff hist last blocklink history ' . |
| 73 | + 'semicolon-separator pipe-separator' ) as $msg ) { |
74 | 74 | $this->message[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) ); |
75 | 75 | } |
76 | 76 | } |
— | — | @@ -86,16 +86,44 @@ |
87 | 87 | * @return string |
88 | 88 | */ |
89 | 89 | protected function recentChangesFlags( $new, $minor, $patrolled, $nothing = ' ', $bot = false ) { |
90 | | - $f = $new ? |
91 | | - '<abbr class="newpage">' . $this->message['newpageletter'] . '</abbr>' : $nothing; |
92 | | - $f .= $minor ? |
93 | | - '<abbr class="minor">' . $this->message['minoreditletter'] . '</abbr>' : $nothing; |
94 | | - $f .= $bot ? '<abbr class="bot">' . $this->message['boteditletter'] . '</abbr>' : $nothing; |
95 | | - $f .= $patrolled ? '<span class="unpatrolled">!</span>' : $nothing; |
| 90 | + $f = $new ? self::flag( 'newpage' ) : $nothing; |
| 91 | + $f .= $minor ? self::flag( 'minor' ) : $nothing; |
| 92 | + $f .= $bot ? self::flag( 'bot' ) : $nothing; |
| 93 | + $f .= $patrolled ? self::flag( 'unpatrolled' ) : $nothing; |
96 | 94 | return $f; |
97 | 95 | } |
98 | 96 | |
99 | 97 | /** |
| 98 | + * Provide the <abbr> element appropriate to a given abbreviated flag, |
| 99 | + * namely the flag indicating a new page, a minor edit, a bot edit, or an |
| 100 | + * unpatrolled edit. By default in English it will contain "N", "m", "b", |
| 101 | + * "!" respectively, plus it will have an appropriate title and class. |
| 102 | + * |
| 103 | + * @param $key string 'newpage', 'unpatrolled', 'minor', or 'bot' |
| 104 | + * @return string Raw HTML |
| 105 | + */ |
| 106 | + public static function flag( $key ) { |
| 107 | + static $messages = null; |
| 108 | + if ( is_null( $messages ) ) { |
| 109 | + foreach ( explode( ' ', 'minoreditletter boteditletter newpageletter ' . |
| 110 | + 'unpatrolledletter recentchanges-label-minor recentchanges-label-bot ' . |
| 111 | + 'recentchanges-label-newpage recentchanges-label-unpatrolled' ) as $msg ) { |
| 112 | + $messages[$msg] = wfMsgExt( $msg, 'escapenoentities' ); |
| 113 | + } |
| 114 | + } |
| 115 | + # Inconsistent naming, bleh |
| 116 | + if ( $key == 'newpage' || $key == 'unpatrolled' ) { |
| 117 | + $key2 = $key; |
| 118 | + } else { |
| 119 | + $key2 = $key . 'edit'; |
| 120 | + } |
| 121 | + return "<abbr class=\"$key\" title=\"" |
| 122 | + . $messages["recentchanges-label-$key"] . "\">" |
| 123 | + . $messages["${key2}letter"] |
| 124 | + . '</abbr>'; |
| 125 | + } |
| 126 | + |
| 127 | + /** |
100 | 128 | * Returns text for the start of the tabular part of RC |
101 | 129 | * @return string |
102 | 130 | */ |
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php |
— | — | @@ -457,6 +457,13 @@ |
458 | 458 | Xml::fieldset( wfMsg( 'recentchanges-legend' ), $panelString, array( 'class' => 'rcoptions' ) ) |
459 | 459 | ); |
460 | 460 | |
| 461 | + # TODO: This is probably a bad format for the message. If anyone |
| 462 | + # customizes it and we add a new flag, it won't show up in the |
| 463 | + # customized message unless it's changed. |
| 464 | + $wgOut->addWikiMsg( 'recentchanges-label-legend', |
| 465 | + ChangesList::flag( 'newpage' ), ChangesList::flag( 'minor' ), |
| 466 | + ChangesList::flag( 'bot' ), ChangesList::flag( 'unpatrolled' ) ); |
| 467 | + |
461 | 468 | $this->setBottomText( $wgOut, $opts ); |
462 | 469 | } |
463 | 470 | |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1963,6 +1963,11 @@ |
1964 | 1964 | 'recentchanges-legend' => 'Recent changes options', |
1965 | 1965 | 'recentchangestext' => 'Track the most recent changes to the wiki on this page.', |
1966 | 1966 | 'recentchanges-feed-description' => 'Track the most recent changes to the wiki in this feed.', |
| 1967 | +'recentchanges-label-legend' => "Legend: $1 - new page, $2 - minor edit, $3 - bot edit, $4 - unpatrolled edit.", |
| 1968 | +'recentchanges-label-newpage' => 'This edit created a new page', |
| 1969 | +'recentchanges-label-minor' => 'This is a minor edit', |
| 1970 | +'recentchanges-label-bot' => 'This edit was performed by a bot', |
| 1971 | +'recentchanges-label-unpatrolled' => 'This edit has not yet been patrolled', |
1967 | 1972 | 'rcnote' => "Below {{PLURAL:$1|is '''1''' change|are the last '''$1''' changes}} in the last {{PLURAL:$2|day|'''$2''' days}}, as of $5, $4.", |
1968 | 1973 | 'rcnotefrom' => "Below are the changes since '''$2''' (up to '''$1''' shown).", |
1969 | 1974 | 'rclistfrom' => 'Show new changes starting from $1', |
— | — | @@ -1980,6 +1985,7 @@ |
1981 | 1986 | 'minoreditletter' => 'm', |
1982 | 1987 | 'newpageletter' => 'N', |
1983 | 1988 | 'boteditletter' => 'b', |
| 1989 | +'unpatrolledletter' => '!', # only translate this message to other languages if you have to change it |
1984 | 1990 | 'sectionlink' => '→', # only translate this message to other languages if you have to change it |
1985 | 1991 | 'number_of_watching_users_RCview' => '[$1]', # do not translate or duplicate this message to other languages |
1986 | 1992 | 'number_of_watching_users_pageview' => '[$1 watching {{PLURAL:$1|user|users}}]', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -180,6 +180,8 @@ |
181 | 181 | * (bug 16322) Allow maintenance scripts to accept DB user/pass over input or params |
182 | 182 | * (bug 18566) Maintenance script to un/protect pages |
183 | 183 | * (bug 671) The HTML <abbr> tag is now permitted. |
| 184 | +* RecentChanges now has a legend to explain what the Nmb! flags mean, and the |
| 185 | + flags have tooltips. |
184 | 186 | |
185 | 187 | === Bug fixes in 1.16 === |
186 | 188 | |
Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1149,6 +1149,11 @@ |
1150 | 1150 | 'recentchanges-legend', |
1151 | 1151 | 'recentchangestext', |
1152 | 1152 | 'recentchanges-feed-description', |
| 1153 | + 'recentchanges-label-legend', |
| 1154 | + 'recentchanges-label-newpage', |
| 1155 | + 'recentchanges-label-minor', |
| 1156 | + 'recentchanges-label-bot', |
| 1157 | + 'recentchanges-label-unpatrolled', |
1153 | 1158 | 'rcnote', |
1154 | 1159 | 'rcnotefrom', |
1155 | 1160 | 'rclistfrom', |
— | — | @@ -1166,6 +1171,7 @@ |
1167 | 1172 | 'minoreditletter', |
1168 | 1173 | 'newpageletter', |
1169 | 1174 | 'boteditletter', |
| 1175 | + 'unpatrolledletter', |
1170 | 1176 | 'sectionlink', |
1171 | 1177 | 'number_of_watching_users_RCview', |
1172 | 1178 | 'number_of_watching_users_pageview', |
Index: trunk/phase3/maintenance/language/messageTypes.inc |
— | — | @@ -341,6 +341,7 @@ |
342 | 342 | 'timezone-utc', |
343 | 343 | 'whatlinkshere-backlink', |
344 | 344 | 'recentchangeslinked-backlink', |
| 345 | + 'unpatrolledletter', |
345 | 346 | 'diff-with-additional', |
346 | 347 | 'pagetitle-view-mainpage', |
347 | 348 | 'trackback', |
Index: trunk/phase3/skins/common/shared.css |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | background-color: #ffa; |
70 | 70 | } |
71 | 71 | |
72 | | -span.unpatrolled { |
| 72 | +.unpatrolled { |
73 | 73 | font-weight: bold; |
74 | 74 | color: red; |
75 | 75 | } |
— | — | @@ -436,7 +436,7 @@ |
437 | 437 | } |
438 | 438 | |
439 | 439 | /** Generic minor/bot/newpage styling */ |
440 | | -abbr.newpage, abbr.minor, abbr.bot { |
| 440 | +.newpage, .minor, .bot { |
441 | 441 | font-weight: bold; |
442 | 442 | } |
443 | 443 | |
Index: trunk/phase3/CREDITS |
— | — | @@ -102,6 +102,7 @@ |
103 | 103 | * Simon Walker |
104 | 104 | * Stefano Codari |
105 | 105 | * Str4nd |
| 106 | +* svip |
106 | 107 | |
107 | 108 | == Translators == |
108 | 109 | * Anders Wegge Jakobsen |