r60411 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60410‎ | r60411 | r60412 >
Date:12:02, 26 December 2009
Author:aaron
Status:ok
Tags:
Comment:
* Updated relative CSS urls
* Reworded messages with confusing link
* Line breaks and related style tweaks
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/client/flaggedrevs.css (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -92,9 +92,9 @@
9393 'revreview-draft-title' => 'This is a draft page',
9494 'revreview-draft-rev' => 'Draft revision',
9595 'revreview-edit' => 'Edit draft',
96 - 'revreview-editnotice' => '\'\'\'Your changes will go into the [[{{MediaWiki:Validationpage}}|stable version]] once an authorised user reviews them.\'\'\'',
 96+ 'revreview-editnotice' => '\'\'\'Your changes will be [[{{MediaWiki:Validationpage}}|published]] once an authorised user [[{{MediaWiki:Validationpage}}|reviews]] them.\'\'\'',
9797 'revreview-flag' => 'Review this revision',
98 - 'revreview-edited' => '\'\'\'Changes will go into the [[{{MediaWiki:Validationpage}}|stable version]] once an authorised user reviews them.\'\'\'
 98+ 'revreview-edited' => '\'\'\'Changes will be [[{{MediaWiki:Validationpage}}|published]] once an authorised user [[{{MediaWiki:Validationpage}}|reviews]] them.\'\'\'
9999 The \'\'draft\'\', shown below, contains [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $2 suggested {{PLURAL:$2|change|changes}}].',
100100 'revreview-flag' => 'Review this revision',
101101 'revreview-unflag' => 'Unreview this revision',
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.css
@@ -73,7 +73,7 @@
7474 right: 0px;
7575 background-repeat: no-repeat;
7676 background-position: 0px 0px;
77 - background-image: url(../FlaggedRevs/img/boxC.png);
 77+ background-image: url(../../FlaggedRevs/img/boxC.png);
7878 }
7979
8080 .fr-marker-20,
@@ -87,19 +87,19 @@
8888 }
8989
9090 .fr-marker-20 {
91 - background-image: url(../FlaggedRevs/img/bar_20.png);
 91+ background-image: url(../../FlaggedRevs/img/bar_20.png);
9292 }
9393 .fr-marker-40 {
94 - background-image: url(../FlaggedRevs/img/bar_40.png);
 94+ background-image: url(../../FlaggedRevs/img/bar_40.png);
9595 }
9696 .fr-marker-60 {
97 - background-image: url(../FlaggedRevs/img/bar_60.png);
 97+ background-image: url(../../FlaggedRevs/img/bar_60.png);
9898 }
9999 .fr-marker-80 {
100 - background-image: url(../FlaggedRevs/img/bar_80.png);
 100+ background-image: url(../../FlaggedRevs/img/bar_80.png);
101101 }
102102 .fr-marker-100 {
103 - background-image: url(../FlaggedRevs/img/bar_100.png);
 103+ background-image: url(../../FlaggedRevs/img/bar_100.png);
104104 }
105105
106106 /* Short User Interface */
@@ -145,19 +145,19 @@
146146 }
147147
148148 .fr-value20 {
149 - background-image: url(../FlaggedRevs/img/fr-marker-20.png);
 149+ background-image: url(../../FlaggedRevs/img/fr-marker-20.png);
150150 }
151151 .fr-value40 {
152 - background-image: url(../FlaggedRevs/img/fr-marker-40.png);
 152+ background-image: url(../../FlaggedRevs/img/fr-marker-40.png);
153153 }
154154 .fr-value60 {
155 - background-image: url(../FlaggedRevs/img/fr-marker-60.png);
 155+ background-image: url(../../FlaggedRevs/img/fr-marker-60.png);
156156 }
157157 .fr-value80 {
158 - background-image: url(../FlaggedRevs/img/fr-marker-80.png);
 158+ background-image: url(../../FlaggedRevs/img/fr-marker-80.png);
159159 }
160160 .fr-value100 {
161 - background-image: url(../FlaggedRevs/img/fr-marker-100.png);
 161+ background-image: url(../../FlaggedRevs/img/fr-marker-100.png);
162162 }
163163
164164 .flaggedrevs-box0,
@@ -225,20 +225,20 @@
226226 background-position: center center;
227227 }
228228 .fr-icon-current {
229 - background-image: url(../FlaggedRevs/img/1.png);
 229+ background-image: url(../../FlaggedRevs/img/1.png);
230230 }
231231 .fr-icon-stable {
232 - background-image: url(../FlaggedRevs/img/2.png);
 232+ background-image: url(../../FlaggedRevs/img/2.png);
233233 }
234234 .fr-icon-quality {
235 - background-image: url(../FlaggedRevs/img/3.png);
 235+ background-image: url(../../FlaggedRevs/img/3.png);
236236 }
237237 .fr-icon-locked {
238 - background-image: url(../FlaggedRevs/img/lock-closed.png);
 238+ background-image: url(../../FlaggedRevs/img/lock-closed.png);
239239 }
240240 .fr-icon-unlocked {
241241 width: 23px;
242 - background-image: url(../FlaggedRevs/img/lock-open.png);
 242+ background-image: url(../../FlaggedRevs/img/lock-open.png);
243243 }
244244
245245 .fr-diff-ratings {
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -155,7 +155,8 @@
156156 wfMsgHtml('revreview-oldrating') .
157157 FlaggedRevsXML::addTagRatings( $flags ) . '</span>';
158158 }
159 - $tag = "<div id='mw-revisiontag-old' class='flaggedrevs_notice plainlinks noprint'>$tag</div>";
 159+ $css = 'flaggedrevs_notice plainlinks noprint';
 160+ $tag = "<div id='mw-revisiontag-old' class='$css'>$tag</div>";
160161 $wgOut->addHTML( $tag );
161162 }
162163 return true;
@@ -296,7 +297,8 @@
297298 $msg = 'revreview-quick-none';
298299 $tag .= "{$prot}<span class='fr-icon-current plainlinks'></span>" .
299300 wfMsgExt($msg,array('parseinline'));
300 - $tag = "<div id='mw-revisiontag' class='flaggedrevs_short{$rtl} plainlinks noprint'>$tag</div>";
 301+ $tag = "<div id='mw-revisiontag' class='flaggedrevs_short{$rtl} plainlinks noprint'>" .
 302+ "$tag</div>";
301303 $this->reviewNotice .= $tag;
302304 // Standard UI
303305 } else {
@@ -338,7 +340,8 @@
339341 $tooltip = wfMsgHtml('revreview-draft-title');
340342 $pending = "{$prot}<span class='fr-icon-current' title=\"{$tooltip}\"></span>" .
341343 wfMsgExt('revreview-edited',array('parseinline'),$srev->getRevId(),$revsSince);
342 - $pending = "<div id='mw-reviewnotice' class='flaggedrevs_preview plainlinks'>$pending</div>";
 344+ $pending = "<div id='mw-reviewnotice' class='flaggedrevs_preview plainlinks'>" .
 345+ "$pending</div>";
343346 # Notice should always use subtitle
344347 $this->reviewNotice = $pending;
345348 # Construct some tagging for non-printable outputs. Note that the pending
@@ -351,13 +354,23 @@
352355 // Simple icon-based UI
353356 if( FlaggedRevs::useSimpleUI() ) {
354357 if( $synced ) {
355 - $msg = $quality ? 'revreview-quick-quality-same' : 'revreview-quick-basic-same';
356 - $class = $quality ? 'fr-icon-quality' : 'fr-icon-stable';
357 - $tooltip = $quality ? 'revreview-quality-title' : 'revreview-stable-title';
358 - $msgHTML = wfMsgExt( $msg, array('parseinline'), $srev->getRevId(), $revsSince );
 358+ $msg = $quality
 359+ ? 'revreview-quick-quality-same'
 360+ : 'revreview-quick-basic-same';
 361+ $class = $quality
 362+ ? 'fr-icon-quality'
 363+ : 'fr-icon-stable';
 364+ $tooltip = $quality
 365+ ? 'revreview-quality-title'
 366+ : 'revreview-stable-title';
 367+ $msgHTML = wfMsgExt( $msg, array('parseinline'),
 368+ $srev->getRevId(), $revsSince );
359369 } else {
360 - $msg = $quality ? 'revreview-quick-see-quality' : 'revreview-quick-see-basic';
361 - $msgHTML = wfMsgExt( $msg, array('parseinline'), $srev->getRevId(), $revsSince );
 370+ $msg = $quality
 371+ ? 'revreview-quick-see-quality'
 372+ : 'revreview-quick-see-basic';
 373+ $msgHTML = wfMsgExt( $msg, array('parseinline'),
 374+ $srev->getRevId(), $revsSince );
362375 }
363376 $tooltip = wfMsgHtml($tooltip);
364377 $msgHTML = "{$prot}<span class='{$class}' title=\"{$tooltip}\"></span>$msgHTML";
@@ -383,7 +396,8 @@
384397 if( !empty($flags) ) {
385398 $tag .= " " . FlaggedRevsXML::ratingToggle();
386399 $tag .= "<span id='mw-revisionratings' style='display:block;'><br />" .
387 - wfMsgHtml('revreview-oldrating') . FlaggedRevsXML::addTagRatings( $flags ) . '</span>';
 400+ wfMsgHtml('revreview-oldrating') .
 401+ FlaggedRevsXML::addTagRatings( $flags ) . '</span>';
388402 }
389403 }
390404 }
@@ -664,7 +678,7 @@
665679 * Adds stable version tags to page when editing
666680 */
667681 public function addToEditView( $editPage ) {
668 - global $wgRequest, $wgOut;
 682+ global $wgRequest, $wgOut, $wgLang, $wgUser;
669683 $this->load();
670684 # Must be reviewable. UI may be limited to unobtrusive patrolling system.
671685 if( !$this->article->isReviewable() || $this->article->limitedUI() )
@@ -676,8 +690,7 @@
677691 $quality = 0;
678692 $frev = $this->article->getStableRev();
679693 if( $frev ) {
680 - global $wgLang, $wgUser;
681 - # Find out revision id
 694+ # Find out revision id of base version
682695 $latestId = $this->article->getLatest();
683696 $revId = $editPage->oldid ? $editPage->oldid : $latestId;
684697 $isOld = ($revId != $latestId); // not the current rev?
@@ -689,13 +702,16 @@
690703 # makes will be autoreviewed...
691704 $ofrev = FlaggedRevision::newFromTitle( $this->article->getTitle(), $revId );
692705 if( !is_null($ofrev) ) {
693 - $msg = ( $revId==$frev->getRevId() ) ? 'revreview-auto-w' : 'revreview-auto-w-old';
694 - $warning = "<div id='mw-autoreviewtag' class='flaggedrevs_warning plainlinks'>" .
 706+ $msg = ( $revId==$frev->getRevId() ) ?
 707+ 'revreview-auto-w' : 'revreview-auto-w-old';
 708+ $css = 'flaggedrevs_warning plainlinks';
 709+ $warning = "<div id='mw-autoreviewtag' class='$css'>" .
695710 wfMsgExt($msg,array('parseinline')) . "</div>";
696711 }
697712 # Let new users know about review procedure a tag
698713 } elseif( !$wgUser->getId() && $this->article->showStableByDefault() ) {
699 - $warning = "<div id='mw-editwarningtag' class='flaggedrevs_editnotice plainlinks'>" .
 714+ $css = 'flaggedrevs_editnotice plainlinks';
 715+ $warning = "<div id='mw-editwarningtag' class='$css'>" .
700716 wfMsgExt('revreview-editnotice',array('parseinline')) . "</div>";
701717 }
702718 # Add a notice if there are pending edits...
@@ -774,7 +790,7 @@
775791 $wgOut->addHTML( "<div class='mw-warning-with-logexcerpt'>" );
776792 $wgOut->addWikiMsg( 'revreview-unlocked' );
777793 LogEventsList::showLogExtract( $wgOut, 'stable',
778 - $this->article->getTitle()->getPrefixedText(), '', array('lim'=>1) );
 794+ $this->article->getTitle()->getPrefixedText(), '', array('lim' => 1) );
779795 $wgOut->addHTML( "</div>" );
780796 }
781797 return true;
@@ -799,8 +815,9 @@
800816 $oldreviewedLink = $wgUser->getSkin()->makeKnownLinkObj( $oldreviewed,
801817 wfMsgHtml('oldreviewedpages'), 'category=' . urlencode($category) );
802818
803 - $wgOut->appendSubtitle("<span id='mw-category-oldreviewed'>$unreviewedLink / $oldreviewedLink</span>");
804 -
 819+ $wgOut->appendSubtitle(
 820+ "<span id='mw-category-oldreviewed'>$unreviewedLink / $oldreviewedLink</span>"
 821+ );
805822 return true;
806823 }
807824
@@ -811,7 +828,9 @@
812829 global $wgRequest, $wgUser, $wgOut;
813830 $this->load();
814831 # User must have review rights and page must be reviewable
815 - if( !$wgUser->isAllowed('review') || !$this->article->exists() || !$this->article->isReviewable() ) {
 832+ if( !$wgUser->isAllowed('review') || !$this->article->exists()
 833+ || !$this->article->isReviewable() )
 834+ {
816835 return true;
817836 }
818837 # Unobtrusive patrolling UI only shows forms if requested
@@ -1005,8 +1024,10 @@
10061025 $this->load();
10071026 if( FlaggedRevs::allowComments() && $frev && $frev->getComment() ) {
10081027 $notes = "<br /><div class='flaggedrevs_notes plainlinks'>";
1009 - $notes .= wfMsgExt('revreview-note', array('parseinline'), User::whoIs( $frev->getUser() ) );
1010 - $notes .= '<br /><i>' . $wgUser->getSkin()->formatComment( $frev->getComment() ) . '</i></div>';
 1028+ $notes .= wfMsgExt('revreview-note', array('parseinline'),
 1029+ User::whoIs( $frev->getUser() ) );
 1030+ $notes .= '<br /><i>' . $wgUser->getSkin()->formatComment( $frev->getComment() ) .
 1031+ '</i></div>';
10111032 $this->reviewNotes = $notes;
10121033 }
10131034 }
@@ -1115,9 +1136,11 @@
11161137 // compare to current
11171138 $file = wfFindFile( $title );
11181139 if( $file && $file->getTimestamp() > $timestamp )
1119 - $imgChanges[] = $skin->makeKnownLinkObj( $title, $title->getPrefixedText() );
 1140+ $imgChanges[] = $skin->makeKnownLinkObj( $title,
 1141+ $title->getPrefixedText() );
11201142 }
1121 - $wgMemc->set( $key, FlaggedRevs::makeMemcObj($imgChanges), $wgParserCacheExpireTime );
 1143+ $wgMemc->set( $key, FlaggedRevs::makeMemcObj($imgChanges),
 1144+ $wgParserCacheExpireTime );
11221145 }
11231146 if( $imgChanges )
11241147 $changeList += $imgChanges;
@@ -1131,17 +1154,18 @@
11321155 }
11331156
11341157 # If the user is allowed to review, prompt them!
 1158+ $css = 'flaggedrevs_diffnotice plainlinks';
11351159 if( empty($changeList) && $wgUser->isAllowed('review') ) {
1136 - $wgOut->addHTML( "<div id='mw-difftostable' class='flaggedrevs_diffnotice plainlinks'>" .
 1160+ $wgOut->addHTML( "<div id='mw-difftostable' class='$css'>" .
11371161 wfMsgExt('revreview-update-none', array('parseinline')).$notice.'</div>' );
11381162 } elseif( !empty($changeList) && $wgUser->isAllowed('review') ) {
11391163 $changeList = implode(', ',$changeList);
1140 - $wgOut->addHTML( "<div id='mw-difftostable' class='flaggedrevs_diffnotice plainlinks'>" .
 1164+ $wgOut->addHTML( "<div id='mw-difftostable' class='$css'>" .
11411165 wfMsgExt('revreview-update', array('parseinline')).'&nbsp;'.
11421166 $changeList.$notice.'</div>' );
11431167 } elseif( !empty($changeList) ) {
11441168 $changeList = implode(', ',$changeList);
1145 - $wgOut->addHTML( "<div id='mw-difftostable' class='flaggedrevs_diffnotice plainlinks'>" .
 1169+ $wgOut->addHTML( "<div id='mw-difftostable' class='$css'>" .
11461170 wfMsgExt('revreview-update-includes', array('parseinline')).'&nbsp;'.
11471171 $changeList.$notice.'</div>' );
11481172 }
@@ -1153,13 +1177,16 @@
11541178
11551179 # Set a key to note that someone is viewing this
11561180 if( $wgUser->isAllowed('review') ) {
1157 - $key = wfMemcKey( 'stableDiffs', 'underReview', $oldRev->getID(), $newRev->getID() );
 1181+ $key = wfMemcKey( 'stableDiffs', 'underReview',
 1182+ $oldRev->getID(), $newRev->getID() );
11581183 $wgMemc->set( $key, '1', 10*60 ); // 10 min
11591184 }
11601185 }
11611186 }
11621187 $newRevQ = FlaggedRevs::getRevQuality( $newRev->getPage(), $newRev->getId() );
1163 - $oldRevQ = $oldRev ? FlaggedRevs::getRevQuality( $newRev->getPage(), $oldRev->getId() ) : false;
 1188+ $oldRevQ = $oldRev
 1189+ ? FlaggedRevs::getRevQuality( $newRev->getPage(), $oldRev->getId() )
 1190+ : false;
11641191 # Diff between two revisions
11651192 if( $oldRev ) {
11661193 $wgOut->addHTML( "<table class='fr-diff-ratings'><tr>" );
@@ -1190,9 +1217,12 @@
11911218 } else {
11921219 $msg = 'hist-draft';
11931220 }
1194 - $wgOut->addHTML( "<table class='fr-diff-ratings'><tr><td class='fr-$msg' align='center'>" );
1195 - $wgOut->addHTML( "<b>[" . wfMsgHtml( $msg ) . "]</b>" );
1196 - $wgOut->addHTML( '</td></tr></table>' );
 1221+ $wgOut->addHTML(
 1222+ "<table class='fr-diff-ratings'>" .
 1223+ "<tr><td class='fr-$msg' align='center'>" .
 1224+ '<b>[' . wfMsgHtml( $msg ) . ']</b>' .
 1225+ '</td></tr></table>'
 1226+ );
11971227 }
11981228 return true;
11991229 }
@@ -1257,7 +1287,8 @@
12581288 if( !$this->article->isReviewable() || $this->article->getTitle()->isTalkPage() )
12591289 return true;
12601290 # We may want to skip some UI elements
1261 - if( $this->article->limitedUI() ) return true;
 1291+ if( $this->article->limitedUI() )
 1292+ return true;
12621293 # Get the stable version, from master
12631294 $frev = $this->article->getStableRev( FR_MASTER );
12641295 if( !$frev )
@@ -1327,9 +1358,8 @@
13281359 /**
13291360 * Adds a brief review form to a page.
13301361 * @param string $data
1331 - * @param bool $top
1332 - * @param bool hide
13331362 * @param bool $top, should this form always go on top?
 1363+ * @param bool $hide
13341364 */
13351365 public function addQuickReview( &$data, $top = false, $hide = false ) {
13361366 global $wgOut, $wgUser, $wgRequest;
@@ -1538,8 +1568,11 @@
15391569 if( $parserOut ) {
15401570 # Clear older, incomplete, cached versions
15411571 # We need the IDs of templates and timestamps of images used
1542 - if( !isset($parserOut->fr_newestTemplateID) || !isset($parserOut->fr_newestImageTime) )
 1572+ if( !isset($parserOut->fr_newestTemplateID)
 1573+ || !isset($parserOut->fr_newestImageTime) )
 1574+ {
15431575 $this->article->getTitle()->invalidateCache();
 1576+ }
15441577 }
15451578 return true;
15461579 }

Status & tagging log