r60759 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60758‎ | r60759 | r60760 >
Date:01:18, 7 January 2010
Author:aaron
Status:ok
Tags:
Comment:
* Demark pending edits in history (color/msg/margin)
* Darkened'flaggedrevs-unreviewed' color a bit
* Remove unused $tagClass var
* Removed unused CSS classes
* Other CSS cleanups
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsXML.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/client/flaggedrevs.css (modified) (history)
  • /trunk/extensions/FlaggedRevs/img/boxC.png (deleted) (history)
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -43,10 +43,11 @@
4444 'grouppage-autoreview' => '{{ns:project}}:Autoreviewer',
4545 'hist-draft' => 'draft revision',
4646 'hist-quality' => 'quality revision',
47 - 'hist-quality-user' => '[{{fullurl:$1|stableid=$2}} validated] by [[User:$3|$3]]',
 47+ 'hist-quality-user' => '[{{fullurl:$1|stableid=$2}} approved] by [[User:$3|$3]]',
4848 'hist-stable' => 'sighted revision',
4949 'hist-stable-user' => '[{{fullurl:$1|stableid=$2}} sighted] by [[User:$3|$3]]',
5050 'hist-autoreviewed' => '[{{fullurl:$1|stableid=$2}} automatically sighted]',
 51+ 'revreview-hist-pending' => '[pending review]',
5152 'review-edit-diff' => '\'\'\'NOTICE: Some pending changes to the published version are incorporated into the edit form below.\'\'\'',
5253 'revreview-diff-toggle-show' => '(show changes)',
5354 'revreview-diff-toggle-hide' => '(hide changes)',
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php
@@ -199,13 +199,10 @@
200200 $time = $wgLang->date( $frev->getTimestamp(), true );
201201 # Some checks for which tag CSS to use
202202 if( $pristine ) {
203 - $tagClass = 'flaggedrevs-box3';
204203 $color = 'flaggedrevs-color-3';
205204 } elseif( $quality ) {
206 - $tagClass = 'flaggedrevs-box2';
207205 $color = 'flaggedrevs-color-2';
208206 } else {
209 - $tagClass = 'flaggedrevs-box1';
210207 $color = 'flaggedrevs-color-1';
211208 }
212209 # Construct some tagging
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1676,14 +1676,35 @@
16771677 return true;
16781678 }
16791679
1680 - public static function addToHistLine( $history, $row, &$s ) {
1681 - if( $row->rev_deleted & Revision::DELETED_TEXT )
1682 - return true; // Don't bother showing notice for deleted revs
1683 - if( !isset($row->fr_quality) )
1684 - return true; // Unreviewed
1685 - # Add link to stable version of *this* rev, if any
1686 - list($link,$class) = FlaggedRevs::markHistoryRow(
1687 - $history->getArticle()->getTitle(), $row );
 1680+ public static function addToHistLine( $history, $row, &$s, &$liClasses ) {
 1681+ $title = $history->getArticle()->getTitle();
 1682+ if( !FlaggedRevs::isPageReviewable( $title ) ) {
 1683+ return false; // nothing to do here
 1684+ }
 1685+ # Fetch and process cache the stable revision
 1686+ if( !isset($history->fr_stableRevId) ) {
 1687+ $frev = FlaggedRevision::newFromStable( $title );
 1688+ $history->fr_stableRevId = $frev ? $frev->getRevId() : 0;
 1689+ }
 1690+ if( !$history->fr_stableRevId ) {
 1691+ return false; // nothing to do here
 1692+ }
 1693+ // Unreviewed revision: highlight if pending
 1694+ $link = $class = '';
 1695+ if( !isset($row->fr_quality) ) {
 1696+ if( $row->rev_id > $history->fr_stableRevId ) {
 1697+ $class = 'flaggedrevs-unreviewed';
 1698+ $link = '<strong>'.wfMsgHtml('revreview-hist-pending').'</strong>';
 1699+ }
 1700+ // Reviewed revision: highlight and add link
 1701+ } else if( !($row->rev_deleted & Revision::DELETED_TEXT) ) {
 1702+ # Add link to stable version of *this* rev, if any
 1703+ list($link,$class) = FlaggedRevs::markHistoryRow( $title, $row );
 1704+ # Space out and demark the stable revision
 1705+ if( $row->rev_id == $history->fr_stableRevId ) {
 1706+ $liClasses[] = 'flaggedrevs_hist_stable';
 1707+ }
 1708+ }
16881709 # Style the row as needed
16891710 if( $class ) $s = "<span class='$class'>$s</span>";
16901711 # Add stable old version link
Index: trunk/extensions/FlaggedRevs/img/boxC.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.css
@@ -1,14 +1,13 @@
22 /* Every time you change this CSS please bump $wgFlaggedRevStyleVersion in FlaggedRevs.php */
33
44 /* Standard User Interface */
5 -.flaggedrevs_basic,
6 -.flaggedrevs_quality,
7 -.flaggedrevs_pristine,
8 -.flaggedrevs_notice,
9 -.flaggedrevs_editnotice,
10 -.flaggedrevs_diffnotice,
11 -.flaggedrevs_warning,
12 -.flaggedrevs_preview {
 5+div.flaggedrevs_basic,
 6+div.flaggedrevs_quality,
 7+div.flaggedrevs_pristine,
 8+div.flaggedrevs_notice,
 9+div.flaggedrevs_diffnotice,
 10+div.flaggedrevs_preview,
 11+table.flaggedrevs_editnotice {
1312 border: 1px solid #aaa;
1413 padding: 5px;
1514 font-weight: normal;
@@ -18,40 +17,34 @@
1918 clear: both;
2019 }
2120
22 -.flaggedrevs_basic {
 21+div.flaggedrevs_basic {
2322 background-color: #f0f8ff;
2423 }
25 -.flaggedrevs_quality {
 24+div.flaggedrevs_quality {
2625 background-color: #f0fff0;
2726 }
28 -.flaggedrevs_pristine {
 27+div.flaggedrevs_pristine {
2928 background-color: #fffff0;
3029 }
31 -.flaggedrevs_notice {
 30+div.flaggedrevs_notice {
3231 background-color: #f9f9f9;
3332 }
34 -.flaggedrevs_preview {
 33+div.flaggedrevs_preview {
3534 background-color: #f9f9f9;
3635 color: #8b0000;
3736 }
38 -
39 -.flaggedrevs_warning {
40 - font-size: 85%;
41 - background-color: #fffff0;
42 - margin: 0em 1em 0em 0em;
43 -}
44 -.flaggedrevs_editnotice {
45 - font-size: 85%;
 37+table.flaggedrevs_editnotice {
 38+ font-size: 90%;
4639 background-color: #f9f9f9;
4740 text-align: left;
4841 width: 100%;
4942 }
50 -.flaggedrevs_diffnotice {
 43+div.flaggedrevs_diffnotice {
5144 font-size: 85%;
5245 background-color: #f9f9f9;
5346 }
5447
55 -.flaggedrevs_notes {
 48+div.flaggedrevs_notes {
5649 border: 1px solid #aaa;
5750 background-color: #f9f9f9;
5851 padding: 5px;
@@ -65,19 +58,6 @@
6659 width: 100px;
6760 }
6861
69 -.fr-checkbox {
70 - padding: 0px;
71 - width: 16px;
72 - height: 16px;
73 - position: relative;
74 - float: left;
75 - top: 0px;
76 - right: 0px;
77 - background-repeat: no-repeat;
78 - background-position: 0px 0px;
79 - background-image: url(../../FlaggedRevs/img/boxC.png);
80 -}
81 -
8262 .fr-marker-20,
8363 .fr-marker-40,
8464 .fr-marker-60,
@@ -105,7 +85,7 @@
10686 }
10787
10888 /* Short User Interface */
109 -.flaggedrevs_short {
 89+div.flaggedrevs_short {
11090 border: 0px;
11191 background-color: #f9f9f9;
11292 padding: 1px;
@@ -118,7 +98,7 @@
11999 line-height: 16px;
120100 }
121101
122 -.rtl .flaggedrevs_short {
 102+.rtl div.flaggedrevs_short {
123103 float: left;
124104 margin: 0 1em 0 0;
125105 }
@@ -162,29 +142,6 @@
163143 background-image: url(../../FlaggedRevs/img/fr-marker-100.png);
164144 }
165145
166 -.flaggedrevs-box0,
167 -.flaggedrevs-box1,
168 -.flaggedrevs-box2,
169 -.flaggedrevs-box3 {
170 - border: 1px solid #aaa;
171 - text-align: center;
172 - font-size: 85%;
173 - clear: both;
174 -}
175 -
176 -.flaggedrevs-box0 {
177 - background-color: #f9f9f9;
178 -}
179 -.flaggedrevs-box1 {
180 - background-color: #f0f8ff;
181 -}
182 -.flaggedrevs-box2 {
183 - background-color: #f0fff0;
184 -}
185 -.flaggedrevs-box3 {
186 - background-color: #fffff0;
187 -}
188 -
189146 /* Both User Interfaces */
190147 .flaggedrevs-color-0 {
191148 background-color: #f9f9f9;
@@ -200,19 +157,23 @@
201158 }
202159
203160 .flaggedrevs-unreviewed {
204 - background-color: #fffff0;
 161+ background-color: #ffeeaa;
205162 }
206163
207164 .flaggedrevs-unreviewed2 {
208165 background-color: #faebd7;
209166 }
210167
211 -.flaggedrevs_toggle {
 168+a.flaggedrevs_toggle {
212169 color: blue;
213170 white-space: nowrap;
214171 cursor:pointer;
215172 }
216173
 174+li.flaggedrevs_hist_stable {
 175+ margin-top: 2em;
 176+}
 177+
217178 .fr-icon-current,
218179 .fr-icon-stable,
219180 .fr-icon-quality,

Follow-up revisions

RevisionCommit summaryAuthorDate
r60760Follow up r60759: forgot to commit hook changeaaron01:21, 7 January 2010
r60883Cleanup/fixes for r60759aaron09:34, 10 January 2010

Status & tagging log