r51499 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51498‎ | r51499 | r51500 >
Date:11:33, 5 June 2009
Author:thomasv
Status:ok
Tags:
Comment:
do not allow to validate empty pages
Modified paths:
  • /trunk/extensions/ProofreadPage/proofread.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/proofread.js
@@ -1,9 +1,6 @@
22 // Author : ThomasV - License : GPL
33
4 -//todo :
5 -//empty pages : detect if textbox is empty
64
7 -
85 function pr_init_tabs(){
96
107 var a = document.getElementById("p-cactions");
@@ -834,7 +831,8 @@
835832
836833 function pr_add_quality(form,value){
837834
838 - if( ( value == 0 ) && ( form.elements["wpTextbox1"].value != "" ) ) {
 835+ var tbv = form.elements["wpTextbox1"].value;
 836+ if( ( ( value == 0 ) && ( tbv != "" ) ) || ( ( value >= 3 ) && ( tbv == "" ) ) ) {
839837 switch( self.proofreadpage_quality ) {
840838 case 4: document.editform.quality[4].checked = true; break;
841839 case 3: document.editform.quality[3].checked = true; break;
@@ -877,14 +875,12 @@
878876 if( ! ( ( self.proofreadpage_quality == 4 ) || ( ( self.proofreadpage_quality == 3 ) && ( self.proofreadpage_username != wgUserName ) ) ) ) {
879877 document.editform.quality[4].parentNode.style.cssText = 'display:none';
880878 }
881 - if( self.proofreadpage_quality ) {
882 - switch( self.proofreadpage_quality ) {
883 - case 4: document.editform.quality[4].checked = true; break;
884 - case 3: document.editform.quality[3].checked = true; break;
885 - case 1: document.editform.quality[2].checked = true; break;
886 - case 2: document.editform.quality[1].checked = true; break;
887 - case 0: document.editform.quality[0].checked = true; break;
888 - }
 879+ switch( self.proofreadpage_quality ) {
 880+ case 4: document.editform.quality[4].checked = true; break;
 881+ case 3: document.editform.quality[3].checked = true; break;
 882+ case 1: document.editform.quality[2].checked = true; break;
 883+ case 2: document.editform.quality[1].checked = true; break;
 884+ case 0: document.editform.quality[0].checked = true; break;
889885 }
890886 }
891887

Status & tagging log