r53103 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53102‎ | r53103 | r53104 >
Date:05:11, 11 July 2009
Author:aaron
Status:deferred
Tags:
Comment:
* Standardized CSS names
* Fixed pre-existing error with partial ratings
Modified paths:
  • /trunk/extensions/ReaderFeedback/ReaderFeedback.class.php (modified) (history)
  • /trunk/extensions/ReaderFeedback/readerfeedback.css (modified) (history)
  • /trunk/extensions/ReaderFeedback/specialpages/RatingHistory_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ReaderFeedback/specialpages/RatingHistory_body.php
@@ -77,7 +77,7 @@
7878 );
7979 if( $html ) {
8080 $wgOut->addHTML( '<h2>'.wfMsgHtml('ratinghistory-table')."</h2>\n".
81 - "<div class='fr_reader_feedback_ratings'>$html</div>" );
 81+ "<div class='rfb-reader_feedback_ratings'>$html</div>" );
8282 }
8383 }
8484
@@ -138,9 +138,9 @@
139139 case 'svg':
140140 if( $exists ) {
141141 $html .= "<h3>" . wfMsgHtml("readerfeedback-$tag") . "</h3>\n" .
142 - Xml::openElement( 'div', array('class' => 'fr_reader_feedback_graph') ) .
 142+ Xml::openElement( 'div', array('class' => 'rfb-reader_feedback_graph') ) .
143143 Xml::element( 'embed', array('src' => $url, 'type' => 'image/svg+xml',
144 - 'class' => 'fr_reader_feedback_plot', 'width' => '1000', 'height' => '410') ) .
 144+ 'class' => 'rfb-reader_feedback_plot', 'width' => '1000', 'height' => '410') ) .
145145 Xml::closeElement( 'div' ) . "\n";
146146 }
147147 break;
@@ -154,7 +154,7 @@
155155 wfMsgHtml("readerfeedback-svg")."</a>]</small>";
156156 }
157157 $html .= "<h3>" . wfMsgHtml("readerfeedback-$tag") . "$viewLink</h3>\n" .
158 - Xml::openElement( 'div', array('class' => 'fr_reader_feedback_graph') ) .
 158+ Xml::openElement( 'div', array('class' => 'rfb-reader_feedback_graph') ) .
159159 Xml::openElement( 'img', array('src' => $url,'alt' => $tag) ) .
160160 Xml::closeElement( 'img' ) .
161161 Xml::closeElement( 'div' ) . "\n";
@@ -186,7 +186,7 @@
187187 $userTable = $this->getUserList();
188188 if( $userTable ) {
189189 $html .= '<h2>' . wfMsgHtml('ratinghistory-users') . '</h2>' .
190 - Xml::openElement( 'div', array('class' => 'fr_reader_feedback_users') ) .
 190+ Xml::openElement( 'div', array('class' => 'rfb-reader_feedback_users') ) .
191191 $userTable . Xml::closeElement( 'div' ) . "\n";
192192 }
193193 } else {
@@ -624,7 +624,7 @@
625625 return ''; // don't give away votes that easily
626626 $columns = 4;
627627 $count = 0;
628 - $html = "<table class='fr_reader_feedback_users'><tr>";
 628+ $html = "<table class='rfb-reader_feedback_users'><tr>";
629629 while( $row = $res->fetchObject() ) {
630630 $title = Title::makeTitleSafe( NS_USER, $row->name );
631631 if( is_null($title) ) continue; // bad IP?
Index: trunk/extensions/ReaderFeedback/ReaderFeedback.class.php
@@ -86,7 +86,8 @@
8787 array( 'rfh_page_id' => $article->getId(), 'rfh_tag' => $tag,
8888 "rfh_date >= {$cutoff_unixtime}" ),
8989 __METHOD__ );
90 - $data = $row ? array($row->ave,$row->count) : array(0,0);
 90+ $data = $row && $row->count ?
 91+ array($row->ave,$row->count) : array(0,0);
9192 return $data;
9293 }
9394
@@ -201,7 +202,7 @@
202203 $wgMemc->set( $key, array( $votes, $now ), 24*3600 );
203204 }
204205 // Output multi-column list
205 - $html = "<table class='fr_reader_feedback_table' cellspacing='0'><tr>";
 206+ $html = "<table class='rfb-reader_feedback_table' cellspacing='0'><tr>";
206207 foreach( ReaderFeedback::getFeedbackTags() as $tag => $w ) {
207208 // Get tag average...
208209 $dist = isset($votes[$tag]) ? $votes[$tag] : array();
@@ -220,7 +221,7 @@
221222 $html .= '<td><table>';
222223 $html .= '<tr><th align="left">'.wfMsgHtml('ratinghistory-table-rating').'</th>';
223224 for( $i = 1; $i <= 5; $i++ ) {
224 - $html .= "<td align='center' class='fr-rating-option-".($i-1)."'>$i</td>";
 225+ $html .= "<td align='center' class='rfb-rating-option-".($i-1)."'>$i</td>";
225226 }
226227 $html .= '</tr><tr>';
227228 $html .= '<th align="left">'.wfMsgHtml("ratinghistory-table-votes").'</th>';
Index: trunk/extensions/ReaderFeedback/readerfeedback.css
@@ -24,24 +24,24 @@
2525 }
2626
2727 /* Reader feedback form */
28 -.fr_reader_feedback_plot {
 28+.rfb-reader_feedback_plot {
2929 background-color: #F8F8F8;
3030 }
3131
32 -.fr_reader_feedback_graph,
33 -.fr_reader_feedback_ratings,
34 -.fr_reader_feedback_users {
 32+.rfb-reader_feedback_graph,
 33+.rfb-reader_feedback_ratings,
 34+.rfb-reader_feedback_users {
3535 width: 100%;
3636 overflow: auto;
3737 }
3838
39 -.fr_reader_feedback_users {
 39+.rfb-reader_feedback_users {
4040 background-color: #F0F0F0;
4141 max-height:410px;
4242 font-size: 90%;
4343 }
4444
45 -.fr_reader_feedback_table {
 45+.rfb-reader_feedback_table {
4646 margin: .5em .5em .5em .5em;
4747 background: #f9f9f9;
4848 border: 1px #AAA solid;
@@ -49,7 +49,7 @@
5050 font-size: 85%;
5151 }
5252
53 -.fr_reader_feedback_table th, .fr_reader_feedback_table td {
 53+.rfb-reader_feedback_table th, .rfb-reader_feedback_table td {
5454 border: 1px #AAA solid;
5555 padding: 0.3em;
5656 }

Status & tagging log