r73063 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73062‎ | r73063 | r73064 >
Date:13:49, 15 September 2010
Author:adam
Status:resolved (Comments)
Tags:
Comment:
Setting the staleness threshold back where it was, and giving the labels some more room for expansion
Modified paths:
  • /trunk/extensions/ArticleAssessmentPilot/css/ArticleAssessment.css (modified) (history)
  • /trunk/extensions/ArticleAssessmentPilot/js/ArticleAssessment.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleAssessmentPilot/css/ArticleAssessment.css
@@ -78,7 +78,7 @@
7979 }
8080 .article-assessment-wrapper .field-wrapper {
8181 float: left;
82 - width: 250px;
 82+ width: 270px;
8383 padding-right: 28px;
8484 }
8585 .article-assessment-wrapper .rating-field {
@@ -125,7 +125,7 @@
126126 }
127127 .article-assessment-wrapper .article-assessment-rating-field-name {
128128 float: left;
129 - width: 90px;
 129+ width: 110px;
130130 font-weight: bold;
131131 font-size: 11px;
132132 }
@@ -137,13 +137,13 @@
138138 float: left;
139139 padding: 2px;
140140 text-indent: -9999px;
141 - margin-top: 2px;
 141+ margin-top: 4px;
142142 }
143143 .article-assessment-wrapper .article-assessment-rate-instructions,
144144 .article-assessment-wrapper .article-assessment-rate-feedback,
145145 .article-assessment-wrapper .article-assessment-show-ratings,
146146 .article-assessment-wrapper .article-assessment-hide-ratings {
147 - font-size: 10px;
 147+ font-size: 11px;
148148 font-style: italic;
149149 }
150150 .article-assessment-wrapper .article-assessment-rate-instructions {
Index: trunk/extensions/ArticleAssessmentPilot/js/ArticleAssessment.js
@@ -269,8 +269,8 @@
270270 $rateControl.stars( 'select', rating.userrating );
271271 }
272272 }
273 - // if the rating is stale, add the stale class
274 - if( data.query.articleassessment[0].revid < wgCurRevisionId ) {
 273+ // if the rating is more than 5 revisions old, mark it as stale
 274+ if( data.query.articleassessment[0].revid < wgCurRevisionId - 5 ) {
275275 // add the stale star class to each on star
276276 $( '.ui-stars-star-on' )
277277 .addClass( 'ui-stars-star-stale' );

Comments

#Comment by Catrope (talk | contribs)   15:07, 15 September 2010

This is broken for several reasons. First, the staleness threshold is configurable so it may not always be 5. Second, revids are global so you're really checking whether 5 revisions have been made to the entire wiki as opposed to whether 5 revisions have been made to this page. On enwiki. 5 revisions equals a few seconds, so practically every edit to a page would cause it to be considered stale.

#Comment by Catrope (talk | contribs)   12:46, 22 September 2010

Fixed in r73069 and r73138

Status & tagging log