r32930 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32929‎ | r32930 | r32931 >
Date:18:21, 7 April 2008
Author:aaron
Status:old
Tags:
Comment:
Style changes/cleanup
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/flaggedrevs.css (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -14,7 +14,7 @@
1515 $wgExtensionCredits['specialpage'][] = array(
1616 'name' => 'Flagged Revisions',
1717 'author' => array( 'Aaron Schulz', 'Joerg Baach' ),
18 - 'version' => '1.027',
 18+ 'version' => '1.0271',
1919 'url' => 'http://www.mediawiki.org/wiki/Extension:FlaggedRevs',
2020 'descriptionmsg' => 'flaggedrevs-desc',
2121 );
@@ -169,7 +169,7 @@
170170 #########
171171
172172 # Bump this number every time you change flaggedrevs.css/flaggedrevs.js
173 -$wgFlaggedRevStyleVersion = 8;
 173+$wgFlaggedRevStyleVersion = 9;
174174
175175 $wgExtensionFunctions[] = 'efLoadFlaggedRevs';
176176
@@ -223,6 +223,7 @@
224224 ######### Hook attachments #########
225225 $wgHooks['OutputPageParserOutput'][] = 'FlaggedRevs::InjectStyle';
226226 $wgHooks['EditPage::showEditForm:initial'][] = 'FlaggedRevs::InjectStyle';
 227+ $wgHooks['PageHistoryBeforeList'][] = 'FlaggedRevs::InjectStyle';
227228 # Main hooks, overrides pages content, adds tags, sets tabs and permalink
228229 $wgHooks['SkinTemplateTabs'][] = array( $wgFlaggedArticle, 'setActionTabs' );
229230 # Update older, incomplete, page caches (ones that lack template Ids/image timestamps)
Index: trunk/extensions/FlaggedRevs/flaggedrevs.css
@@ -107,30 +107,6 @@
108108 line-height: 16px;
109109 }
110110
111 -.fr-icon-current,
112 -.fr-icon-stable,
113 -.fr-icon-quality {
114 - padding: 0px;
115 - margin: 0px;
116 - width: 20px;
117 - height: 18px;
118 - position: relative;
119 - float: left;
120 - vertical-align: middle;
121 - background-repeat: no-repeat;
122 - background-position: 0px 0px;
123 -}
124 -
125 -.fr-icon-current {
126 - background-image: url(../FlaggedRevs/img/1.png);
127 -}
128 -.fr-icon-stable {
129 - background-image: url(../FlaggedRevs/img/2.png);
130 -}
131 -.fr-icon-quality {
132 - background-image: url(../FlaggedRevs/img/3.png);
133 -}
134 -
135111 .fr-text {
136112 height: 1em;
137113 line-height: 1em;
@@ -170,39 +146,39 @@
171147 background-image: url(../FlaggedRevs/img/fr-marker-100.png);
172148 }
173149
174 -.flaggedrevs_box0,
175 -.flaggedrevs_box1,
176 -.flaggedrevs_box2,
177 -.flaggedrevs_box3 {
 150+.flaggedrevs-box0,
 151+.flaggedrevs-box1,
 152+.flaggedrevs-box2,
 153+.flaggedrevs-box3 {
178154 border: 1px solid #aaa;
179155 text-align: center;
180156 font-size: 85%;
181157 clear: both;
182158 }
183159
184 -.flaggedrevs_box0 {
 160+.flaggedrevs-box0 {
185161 background-color: #f9f9f9;
186162 }
187 -.flaggedrevs_box1 {
 163+.flaggedrevs-box1 {
188164 background-color: #f0f8ff;
189165 }
190 -.flaggedrevs_box2 {
 166+.flaggedrevs-box2 {
191167 background-color: #f0fff0;
192168 }
193 -.flaggedrevs_box3 {
 169+.flaggedrevs-box3 {
194170 background-color: #fffff0;
195171 }
196172
197 -.flaggedrevs_box0a {
 173+.flaggedrevs-color-0 {
198174 background-color: #f9f9f9;
199175 }
200 -.flaggedrevs_box1a {
 176+.flaggedrevs-color-1 {
201177 background-color: #f0f8ff;
202178 }
203 -.flaggedrevs_box2a {
 179+.flaggedrevs-color-2 {
204180 background-color: #f0fff0;
205181 }
206 -.flaggedrevs_box3a {
 182+.flaggedrevs-color-3 {
207183 background-color: #fffff0;
208184 }
209185
@@ -211,6 +187,27 @@
212188 color: blue;
213189 }
214190
 191+.fr-icon-current,
 192+.fr-icon-stable,
 193+.fr-icon-quality {
 194+ padding: 0px;
 195+ margin: 0px;
 196+ width: 18px;
 197+ height: 18px;
 198+ float: left;
 199+ background-repeat: no-repeat;
 200+ background-position: center center;
 201+}
 202+.fr-icon-current {
 203+ background-image: url(../FlaggedRevs/img/1.png);
 204+}
 205+.fr-icon-stable {
 206+ background-image: url(../FlaggedRevs/img/2.png);
 207+}
 208+.fr-icon-quality {
 209+ background-image: url(../FlaggedRevs/img/3.png);
 210+}
 211+
215212 /* Review form */
216213 .flaggedrevs_reviewform {
217214 background-color: #f9f9f9;
Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -698,10 +698,22 @@
699699
700700 if( $quality !== false ) {
701701 $skin = $wgUser->getSkin();
702 -
 702+ $quality = intval($quality);
 703+ switch( $quality ) {
 704+ case 2:
 705+ $css = 'flaggedrevs-color-3';
 706+ break;
 707+ case 1:
 708+ $css = 'flaggedrevs-color-2';
 709+ break;
 710+ default:
 711+ $css = 'flaggedrevs-color-1';
 712+ break;
 713+ }
703714 $msg = ($quality >= 1) ? 'hist-quality' : 'hist-stable';
704 - $s .= ' <small><strong>[' . $skin->makeLinkObj( $wgTitle, wfMsgHtml( $msg ),
705 - 'stableid=' . $row->rev_id ) . ']</strong></small>';
 715+ $s = "<span class='$css'>{$s}</span> <small><strong>[" .
 716+ $skin->makeLinkObj( $wgTitle, wfMsgHtml( $msg ),'stableid=' . $row->rev_id ) .
 717+ "]</strong></small>";
706718 }
707719
708720 return true;
@@ -895,12 +907,16 @@
896908 $pristine = FlaggedRevs::isPristine( $flags );
897909 $time = $wgLang->date( $frev->getTimestamp(), true );
898910 # Some checks for which tag CSS to use
899 - if( $pristine )
900 - $tagClass = 'flaggedrevs_box3';
901 - else if( $quality )
902 - $tagClass = 'flaggedrevs_box2';
903 - else
904 - $tagClass = 'flaggedrevs_box1';
 911+ if( $pristine ) {
 912+ $tagClass = 'flaggedrevs-box3';
 913+ $color = 'flaggedrevs-color-3';
 914+ } else if( $quality ) {
 915+ $tagClass = 'flaggedrevs-box2';
 916+ $color = 'flaggedrevs-color-2';
 917+ } else {
 918+ $tagClass = 'flaggedrevs-box1';
 919+ $color = 'flaggedrevs-color-1';
 920+ }
905921 # Construct some tagging
906922 if( $synced ) {
907923 $msg = $quality ? 'revreview-quality-same' : 'revreview-basic-same';
@@ -920,7 +936,7 @@
921937 $box .= '<div id="mw-revisionratings" style="clear: both;">' . $html;
922938 # Add ratings if there are any...
923939 if( $stable && !empty($flags) ) {
924 - $box .= $this->addTagRatings( $flags, true, "{$tagClass}a" );
 940+ $box .= $this->addTagRatings( $flags, true, $color );
925941 }
926942 $box .= '</div>';
927943

Status & tagging log