Index: trunk/extensions/ProofreadPage/proofread.js |
— | — | @@ -111,7 +111,7 @@ |
112 | 112 | //find the PageQuality template |
113 | 113 | //we do this separately from header detection, |
114 | 114 | //because the template might not be in the header |
115 | | - var reg = /\{\{PageQuality\|(0|1|2|3|4|25%|50%|75%|100%)(\|.*?|)\}\}/g; |
| 115 | + var reg = /\{\{PageQuality\|(0|1|2|3|4|25%|50%|75%|100%)(\|(.*?|))\}\}/g; |
116 | 116 | var m4 = reg.exec(pageHeader); |
117 | 117 | self.show4 = false; |
118 | 118 | if(m4) { |
— | — | @@ -128,12 +128,13 @@ |
129 | 129 | case "25%": self.proofreadpage_quality = 2; break; |
130 | 130 | default: self.proofreadpage_quality = 1; |
131 | 131 | } |
132 | | - |
133 | | - if((m4[3]!= "|"+wgUserName) && (m4[1]=="3")) self.show4 = true; |
134 | | - if(m4[1] =="4") self.show4 = true; |
| 132 | + self.proofreadpage_username = m4[3]; |
135 | 133 | pageHeader = pageHeader.replace(reg,''); |
136 | 134 | } |
137 | | - else self.proofreadpage_quality = 1; |
| 135 | + else { |
| 136 | + self.proofreadpage_quality = 1; |
| 137 | + self.proofreadpage_username = ""; |
| 138 | + } |
138 | 139 | |
139 | 140 | |
140 | 141 | //escape & character |
— | — | @@ -852,7 +853,11 @@ |
853 | 854 | +'<span class="quality2"> <input type="radio" name="quality" onclick="pr_add_quality(this.form,2)"> </span>' |
854 | 855 | +'<span class="quality1"> <input type="radio" name="quality" onclick="pr_add_quality(this.form,1)"> </span>' |
855 | 856 | +'<span class="quality3"> <input type="radio" name="quality" onclick="pr_add_quality(this.form,3)"> </span>'; |
856 | | - if(self.show4) f.innerHTML = f.innerHTML |
| 857 | + |
| 858 | + var show4 = false; |
| 859 | + if(self.proofreadpage_quality==4) show4 = true; |
| 860 | + if((self.proofreadpage_quality==3) && (self.proofreadpage_username != "|"+wgUserName)) show4 = true; |
| 861 | + if(show4) f.innerHTML = f.innerHTML |
857 | 862 | + '<span class="quality4"> <input type="radio" name="quality" onclick="pr_add_quality(this.form,4)"> </span>'; |
858 | 863 | f.innerHTML = f.innerHTML + ' '+proofreadPageMessageStatus; |
859 | 864 | ig.parentNode.insertBefore(f,ig.nextSibling.nextSibling.nextSibling); |