r65857 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65856‎ | r65857 | r65858 >
Date:15:09, 3 May 2010
Author:catrope
Status:deferred
Tags:
Comment:
1.16wmf4: MFT r64273 (ProofreadPage incompat with UsabilityInitiative)
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/ProofreadPage (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/ProofreadPage/proofread_index.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/ProofreadPage/proofread_index.js
@@ -26,21 +26,25 @@
2727 if(!m) return;
2828 params = m[1]+'\n\|END=';
2929 }
30 -
31 - var f = text.parentNode;
32 - var new_text = f.removeChild(text);
33 -
 30+
 31+ // Certain extensions, like UsabilityInitiative, wrap the textarea
 32+ var textWrapper = text;
 33+ while(textWrapper.parentNode.nodeName != 'FORM') textWrapper = textWrapper.parentNode;
 34+ var f = textWrapper.parentNode;
3435 var container = document.createElement("div");
 36+ var wrapper = document.createElement("div");
 37+ wrapper.style.display = 'none';
 38+ container.appendChild(wrapper);
 39+ wrapper.appendChild(textWrapper);
3540
3641 var index_attributes = self.prp_index_attributes.split('\n');
37 - var str = '<div style="display:none;"><textarea id="wpTextbox1" name="wpTextbox1">'+new_text.value+'</textarea></div>';
38 - str = str + '<table>';
 42+ var str = '<table>';
3943 for(i=0;i<index_attributes.length;i++){
4044 m = index_attributes[i].split('|');
4145 param_name = m[0];
4246
4347 if(m[1]) param_label=m[1]; else param_label=param_name;
44 - str = str + '<tr><td>'+param_label+': </td>';
 48+ str += '<tr><td>'+param_label+': </td>';
4549
4650 value = findparam(params,param_name);
4751 value = value.replace(/\{\{!\}\}/g,'|');
@@ -50,14 +54,14 @@
5155
5256 if(m[2]) size=m[2]; else size="1";
5357 if(size=="1") {
54 - str = str + '<td><input name="'+param_name+'" size=60 value="'+value+'"/></td></tr>';
 58+ str += '<td><input name="'+param_name+'" size=60 value="'+value+'"/></td></tr>';
5559 }
5660 else{
57 - str = str +'<td><textarea name="'+param_name+'" cols=60 rows='+size+'>'+value+'</textarea></td></tr>';
 61+ str += '<td><textarea name="'+param_name+'" cols=60 rows='+size+'>'+value+'</textarea></td></tr>';
5862 }
5963 }
60 - str = str +'</table>';
61 - container.innerHTML = str;
 64+ str += '</table>';
 65+ container.innerHTML += str;
6266
6367 var saveButton = document.getElementById("wpSave");
6468 var previewButton = document.getElementById("wpPreview");
Property changes on: branches/wmf/1.16wmf4/extensions/ProofreadPage
___________________________________________________________________
Name: svn:mergeinfo
6569 + /branches/wmf-deployment/extensions/ProofreadPage:60970
/trunk/extensions/ProofreadPage:64273
/trunk/phase3/extensions/ProofreadPage:63545-63546,63549,63643,63764,63897-63901

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64273ProofreadPage: Fix incompatibility with UsabilityInitiative...catrope21:01, 27 March 2010

Status & tagging log