r60817 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60816‎ | r60817 | r60818 >
Date:00:51, 8 January 2010
Author:aaron
Status:ok
Tags:
Comment:
* Fixed review.js to reference new ID names
* Use dimensionsEmpty()
Modified paths:
  • /trunk/extensions/FlaggedRevs/client/review.js (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -389,7 +389,7 @@
390390
391391 public function isApproval() {
392392 # If all values are set to zero, this has been unapproved
393 - if( !count( FlaggedRevs::getDimensions() ) && $this->approve ) {
 393+ if( FlaggedRevs::dimensionsEmpty() && $this->approve ) {
394394 return true; // no tags & approve param given
395395 }
396396 foreach( $this->dims as $quality => $value ) {
Index: trunk/extensions/FlaggedRevs/client/review.js
@@ -8,7 +8,7 @@
99 * c) Also remove comment box clutter in case of invalid input.
1010 */
1111 FlaggedRevs.updateRatingForm = function() {
12 - var ratingform = document.getElementById('mw-ratingselects');
 12+ var ratingform = document.getElementById('mw-fr-ratingselects');
1313 if( !ratingform ) return;
1414 var disabled = document.getElementById('fr-rating-controls-disabled');
1515 if( disabled ) return;
@@ -57,12 +57,12 @@
5858 }
5959 }
6060 // Show note box only for quality revs
61 - var notebox = document.getElementById('mw-notebox');
 61+ var notebox = document.getElementById('mw-fr-notebox');
6262 if( notebox ) {
6363 notebox.style.display = quality ? 'inline' : 'none';
6464 }
6565 // If only a few levels are zero, don't show submit link
66 - var submit = document.getElementById('mw-submitreview');
 66+ var submit = document.getElementById('mw-fr-submitreview');
6767 if( submit ) {
6868 submit.disabled = ( somezero && !allzero ) ? 'disabled' : '';
6969 }
@@ -102,7 +102,7 @@
103103 wgAjaxReview.supported = false;
104104 return true;
105105 }
106 - var form = document.getElementById("mw-reviewform");
 106+ var form = document.getElementById("mw-fr-reviewform");
107107 var notes = document.getElementById("wpNotes");
108108 var reason = document.getElementById("wpReason");
109109 if( !form ) {
@@ -115,13 +115,17 @@
116116 for( var i=0; i < inputs.length; i++) {
117117 // Different input types may occur depending on tags...
118118 if( inputs[i].name == "title" || inputs[i].name == "action" ) {
119 - // No need to send these...
 119+ continue; // No need to send these...
120120 } else if( inputs[i].type == "submit" ) {
121121 inputs[i].value = wgAjaxReview.sendingMsg;
122122 } else if( inputs[i].type == "checkbox" ) {
123123 args.push( inputs[i].name + "|" + (inputs[i].checked ? inputs[i].value : 0) );
124 - } else if( inputs[i].type != "radio" || inputs[i].checked ) {
125 - args.push( inputs[i].name + "|" + inputs[i].value );
 124+ } else if( inputs[i].type == "radio" ) {
 125+ if( inputs[i].checked ) { // must be checked
 126+ args.push( inputs[i].name + "|" + inputs[i].value );
 127+ }
 128+ } else {
 129+ args.push( inputs[i].name + "|" + inputs[i].value ); // Includes text/hiddens...
126130 }
127131 inputs[i].disabled = "disabled";
128132 }
@@ -152,8 +156,8 @@
153157 };
154158
155159 wgAjaxReview.unlockForm = function() {
156 - var form = document.getElementById("mw-reviewform");
157 - var submit = document.getElementById("mw-submitreview");
 160+ var form = document.getElementById("mw-fr-reviewform");
 161+ var submit = document.getElementById("mw-fr-submitreview");
158162 var notes = document.getElementById("wpNotes");
159163 var reason = document.getElementById("wpReason");
160164 if( !form || !submit ) {
@@ -185,17 +189,17 @@
186190 if( (msg = response.substr(6)) ) {
187191 jsMsg( msg, 'review' ); // success notice
188192 window.scroll(0,0); // scroll up to notice
189 - tagBox = document.getElementById('mw-revisiontag');
 193+ tagBox = document.getElementById('mw-fr-revisiontag');
190194 if( tagBox ) tagBox.style.display = 'none'; // remove tag from draft
191195 }
192196 wgAjaxReview.inprogress = false;
193197 if( wgAjaxReview.timeoutID ) {
194198 window.clearTimeout(wgAjaxReview.timeoutID);
195199 }
196 - var submit = document.getElementById("mw-submitreview");
197 - var binaryState = document.getElementById("mw-reviewstate");
198 - var legend = document.getElementById("mw-reviewformlegend");
199 - var diffNotice = document.getElementById("mw-difftostable");
 200+ var submit = document.getElementById("mw-fr-submitreview");
 201+ var binaryState = document.getElementById("mw-fr-reviewstate");
 202+ var legend = document.getElementById("mw-fr-reviewformlegend");
 203+ var diffNotice = document.getElementById("mw-fr-difftostable");
200204 // On success...
201205 if( response.indexOf('<suc#>') == 0 ) {
202206 document.title = wgAjaxReview.actioncomplete;
@@ -234,7 +238,7 @@
235239 };
236240
237241 wgAjaxReview.onLoad = function() {
238 - var submit = document.getElementById("mw-submitreview");
 242+ var submit = document.getElementById("mw-fr-submitreview");
239243 if( submit ) {
240244 submit.onclick = wgAjaxReview.ajaxCall;
241245 }

Status & tagging log