r25625 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25624‎ | r25625 | r25626 >
Date:10:25, 7 September 2007
Author:aaron
Status:old
Tags:
Comment:
*Remove unused images/css
*Streamline duplicated css code
*Add toggle to simple UI
*Remove unused variable cruft
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/flaggedrevs.css (modified) (history)
  • /trunk/extensions/FlaggedRevs/img/1-small.png (deleted) (history)
  • /trunk/extensions/FlaggedRevs/img/2-small.png (deleted) (history)
  • /trunk/extensions/FlaggedRevs/img/3-small.png (deleted) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -484,7 +484,7 @@
485485 $levelmarker = $level * 20 + 20; //XXX do this better
486486 if( $prettyBox ) {
487487 $tag .= "<tr><td><span class='fr-group'><span class='fr-text'>" . wfMsgHtml("revreview-$quality") .
488 - "</span></tr><tr><td><span class='fr-marker fr_value$levelmarker'>$valuetext</span></span></td></tr>\n";
 488+ "</span></td><td><span class='fr-marker fr_value$levelmarker'>$valuetext</span></span></td></tr>\n";
489489 } else {
490490 $tag .= "&nbsp;<span class='fr-marker-$levelmarker'><strong>" .
491491 wfMsgHtml("revreview-$quality") .
@@ -502,35 +502,32 @@
503503 * @param Row $trev, flagged revision row
504504 * @param array $flags
505505 * @param int $rev_since, revisions since review
 506+ * @param bool $cur, are we referring to the visible revision?
506507 * @returns string
507508 * Generates a review box using a table using addTagRatings()
508509 */
509 - public function prettyRatingBox( $tfrev, $flags, $revs_since, $simpleTag=false ) {
510 - global $wgLang, $wgUser;
511 -
512 - $box = '';
 510+ public function prettyRatingBox( $tfrev, $flags, $revs_since, $cur=true ) {
 511+ global $wgLang;
513512 # Get quality level
514513 $quality = self::isQuality( $flags );
515514 $pristine = self::isPristine( $flags );
516515 $time = $wgLang->date( wfTimestamp(TS_MW, $tfrev->fr_timestamp), true );
517 -
518 - $skin = $wgUser->getSkin();
519516 // Some checks for which tag CSS to use
520 - if( $simpleTag )
521 - $tagClass = 'flaggedrevs_box0';
522 - else if( $pristine )
 517+ if( $pristine )
523518 $tagClass = 'flaggedrevs_box3';
524519 else if( $quality )
525520 $tagClass = 'flaggedrevs_box2';
526521 else
527522 $tagClass = 'flaggedrevs_box1';
528523 // Construct some tagging
529 - $msg = $quality ? 'revreview-quality' : 'revreview-basic';
530 - $box = self::addTagRatings( $flags, true, "{$tagClass}a" );
531 - $box .= '<p><a id="mw-revisiontoggle" style="display:none;" href="javascript:toggleRevRatings()">' .
532 - wfMsg('revreview-toggle') . '</a></p>';
 524+ $msg = $cur ? 'revreview-' : 'revreview-newest-';
 525+ $msg .= $quality ? 'quality' : 'basic';
 526+
 527+ $box = ' <a id="mw-revisiontoggle" style="display:none;" href="javascript:toggleRevRatings()">' .
 528+ wfMsg('revreview-toggle') . '</a>';
533529 $box .= '<span id="mw-revisionratings">' .
534530 wfMsgExt($msg, array('parseinline'), $tfrev->fr_rev_id, $time, $revs_since) .
 531+ self::addTagRatings( $flags, true, "{$tagClass}a" ) .
535532 '</span>';
536533
537534 return $box;
@@ -1326,6 +1323,7 @@
13271324 if( $this->useSimpleUI() ) {
13281325 $msg = $quality ? 'revreview-quick-see-quality' : 'revreview-quick-see-basic';
13291326 $tag .= "<span class='fr_tab_current plainlinks'></span>" . wfMsgExt($msg,array('parseinline'));
 1327+ $tag .= parent::prettyRatingBox( $tfrev, $flags, $revs_since, false );
13301328 } else {
13311329 $msg = $quality ? 'revreview-newest-quality' : 'revreview-newest-basic';
13321330 $tag .= wfMsgExt($msg, array('parseinline'), $tfrev->fr_rev_id, $time, $revs_since);
@@ -1348,6 +1346,7 @@
13491347 $css = $quality ? 'fr_tab_quality' : 'fr_tab_stable';
13501348 $tag .= "<span class='$css plainlinks'></span>" .
13511349 wfMsgExt($msg,array('parseinline'),$tfrev->fr_rev_id,$revs_since);
 1350+ $tag .= parent::prettyRatingBox( $tfrev, $flags, $revs_since );
13521351 } else {
13531352 $msg = $quality ? 'revreview-quality' : 'revreview-basic';
13541353 $tag = wfMsgExt($msg, array('parseinline'), $vis_id, $time, $revs_since);
Index: trunk/extensions/FlaggedRevs/flaggedrevs.css
@@ -1,6 +1,9 @@
2 -.flaggedrevs_tag1 {
 2+/* Standard UI */
 3+.flaggedrevs_tag1,
 4+.flaggedrevs_tag2,
 5+.flaggedrevs_tag3,
 6+.flaggedrevs_notice {
37 border: 1px solid #aaa;
4 - background-color: #f0f8ff;
58 padding: 3px;
69 font-size: 80%;
710 margin-left: 0px;
@@ -9,33 +12,16 @@
1013 }
1114
1215 .flaggedrevs_tag2 {
13 - border: 1px solid #aaa;
 16+ background-color: #f0f8ff;
 17+}
 18+.flaggedrevs_tag2 {
1419 background-color: #f0fff0;
15 - padding: 5px;
16 - font-size: 80%;
17 - margin-left: 0px;
18 - margin-right: 0px;
19 - text-align: center;
2020 }
21 -
2221 .flaggedrevs_tag3 {
23 - border: 1px solid #aaa;
2422 background-color: #fffff0;
25 - padding: 3px;
26 - font-size: 80%;
27 - margin-left: 0px;
28 - margin-right: 0px;
29 - text-align: center;
3023 }
31 -
3224 .flaggedrevs_notice {
33 - border: 1px solid #aaa;
3425 background-color: #f9f9f9;
35 - padding: 3px;
36 - font-size: 80%;
37 - margin-left: 0px;
38 - margin-right: 0px;
39 - text-align: center;
4026 }
4127
4228 .flaggedrevs_notes {
@@ -48,29 +34,6 @@
4935 text-align: center;
5036 }
5137
52 -.flaggedrevs_short {
53 - border: 1px solid #aaa;
54 - background-color: #f9f9f9;
55 - padding: 4px;
56 - position: relative;
57 - float: right;
58 - font-size: 80%;
59 - margin-left: 25px;
60 - margin-right: 25px;
61 - text-align: left;
62 -}
63 -
64 -/*.fr-marker-1 span {display: none};*/
65 -.fr-marker-1 {
66 - background-image: url(../FlaggedRevs/img/boxY.png);
67 - background-repeat: no-repeat;
68 - min-width: 16px;
69 - width: 16px;
70 - height: 16px;
71 - min-height: 16px;
72 - padding: 3px 16px 0px 20px;
73 -}
74 -
7538 .fr-text-value {
7639 min-width:100px;
7740 width: 100px;
@@ -108,13 +71,22 @@
10972 padding-bottom: 3px;
11073 }
11174
112 -.fr-marker-1 {
113 - background-image: url(../FlaggedRevs/img/boxC.png);
114 - background-repeat: no-repeat;
115 - padding: 3px 16px 0px 0px;
 75+/* Short UI */
 76+.flaggedrevs_short {
 77+ border: 1px solid #aaa;
 78+ background-color: #f9f9f9;
 79+ padding: 4px;
 80+ font-size: 80%;
 81+ margin-left: 0px;
 82+ margin-right: 0px;
 83+ text-align: left;
 84+ float: right;
 85+ width: 320px;
11686 }
11787
118 -.fr_tab_current {
 88+.fr_tab_current,
 89+.fr_tab_stable,
 90+.fr_tab_quality {
11991 padding: 0px;
12092 margin: 0px;
12193 width: 27px;
@@ -123,35 +95,18 @@
12496 float: left;
12597 top: -1px;
12698 right: 0px;
127 - background-image: url(../FlaggedRevs/img/1.png);
12899 background-repeat: no-repeat;
129100 background-position: 0px 0px;
130101 }
 102+
 103+.fr_tab_current {
 104+ background-image: url(../FlaggedRevs/img/1.png);
 105+}
131106 .fr_tab_stable {
132 - padding: 0px;
133 - margin: 0px;
134 - width: 27px;
135 - height: 27px;
136 - position: relative;
137 - float: left;
138 - top: -1px;
139 - right: 0px;
140107 background-image: url(../FlaggedRevs/img/2.png);
141 - background-repeat: no-repeat;
142 - background-position: 0px 0px;
143108 }
144109 .fr_tab_quality {
145 - padding: 0px;
146 - margin: 0px;
147 - width: 27px;
148 - height: 27px;
149 - position: relative;
150 - float: left;
151 - top: -1px;
152 - right: 0px;
153110 background-image: url(../FlaggedRevs/img/3.png);
154 - background-repeat: no-repeat;
155 - background-position: 0px 0px;
156111 }
157112
158113 .fr-text {
@@ -197,33 +152,26 @@
198153 margin-top: 5px;
199154 }
200155
201 -.flaggedrevs_box0 {
 156+.flaggedrevs_box0,
 157+.flaggedrevs_box1,
 158+.flaggedrevs_box2,
 159+.flaggedrevs_box3 {
202160 border: 1px solid #aaa;
203 - background-color: #f9f9f9;
204 - position: relative;
205161 text-align: center;
206162 font-size: 85%;
207163 }
 164+
 165+.flaggedrevs_box0 {
 166+ background-color: #f9f9f9;
 167+}
208168 .flaggedrevs_box1 {
209 - border: 1px solid #aaa;
210169 background-color: #f0f8ff;
211 - position: relative;
212 - text-align: center;
213 - font-size: 85%;
214170 }
215171 .flaggedrevs_box2 {
216 - border: 1px solid #aaa;
217172 background-color: #f0fff0;
218 - position: relative;
219 - text-align: center;
220 - font-size: 85%;
221173 }
222174 .flaggedrevs_box3 {
223 - border: 1px solid #aaa;
224175 background-color: #fffff0;
225 - position: relative;
226 - text-align: center;
227 - font-size: 85%;
228176 }
229177
230178 /* Hack to avoid extra borders */
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php
@@ -22,13 +22,13 @@
2323 'revreview-noflagged' => 'There are no reviewed revisions of this page, so it may \'\'\'not\'\'\' have been
2424 [[Help:Article validation|checked]] for quality.',
2525
 26+ 'revreview-quick-none' => '\'\'\'Current\'\'\'. No reviewed revisions.',
2627 'revreview-quick-see-quality' => '\'\'\'Current\'\'\'. [[{{fullurl:{{FULLPAGENAMEE}}|stable=1}} See latest quality revision]]',
2728 'revreview-quick-see-basic' => '\'\'\'Current\'\'\'. [[{{fullurl:{{FULLPAGENAMEE}}|stable=1}} See latest sighted revision]]',
2829 'revreview-quick-basic' => '\'\'\'[[Help:Article validation|Sighted]]\'\'\'. [[{{fullurl:{{FULLPAGENAMEE}}|stable=0}} See current revision]]
2930 ($2 [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&editreview=1}} {{plural:$2|change|changes}}])',
3031 'revreview-quick-quality' => '\'\'\'[[Help:Article validation|Quality]]\'\'\'. [[{{fullurl:{{FULLPAGENAMEE}}|stable=0}} See current revision]]
3132 ($2 [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&editreview=1}} {{plural:$2|change|changes}}])',
32 - 'revreview-quick-none' => '\'\'\'Current\'\'\'. No reviewed revisions.',
3333 'revreview-newest-basic' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} latest sighted revision]
3434 ([{{fullurl:Special:Stableversions|page={{FULLPAGENAMEE}}}} list all]) was [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved]
3535 on <i>$2</i>. [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&editreview=1}} $3 {{plural:$3|change|changes}}] {{plural:$3|needs|need}} review.',
Index: trunk/extensions/FlaggedRevs/img/1-small.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: trunk/extensions/FlaggedRevs/img/2-small.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: trunk/extensions/FlaggedRevs/img/3-small.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png

Status & tagging log