Index: branches/wmf/1.16wmf4/extensions/ProofreadPage/proofread_index.js |
— | — | @@ -26,21 +26,25 @@ |
27 | 27 | if(!m) return; |
28 | 28 | params = m[1]+'\n\|END='; |
29 | 29 | } |
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; |
34 | 35 | var container = document.createElement("div"); |
| 36 | + var wrapper = document.createElement("div"); |
| 37 | + wrapper.style.display = 'none'; |
| 38 | + container.appendChild(wrapper); |
| 39 | + wrapper.appendChild(textWrapper); |
35 | 40 | |
36 | 41 | 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>'; |
39 | 43 | for(i=0;i<index_attributes.length;i++){ |
40 | 44 | m = index_attributes[i].split('|'); |
41 | 45 | param_name = m[0]; |
42 | 46 | |
43 | 47 | 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>'; |
45 | 49 | |
46 | 50 | value = findparam(params,param_name); |
47 | 51 | value = value.replace(/\{\{!\}\}/g,'|'); |
— | — | @@ -50,14 +54,14 @@ |
51 | 55 | |
52 | 56 | if(m[2]) size=m[2]; else size="1"; |
53 | 57 | 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>'; |
55 | 59 | } |
56 | 60 | 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>'; |
58 | 62 | } |
59 | 63 | } |
60 | | - str = str +'</table>'; |
61 | | - container.innerHTML = str; |
| 64 | + str += '</table>'; |
| 65 | + container.innerHTML += str; |
62 | 66 | |
63 | 67 | var saveButton = document.getElementById("wpSave"); |
64 | 68 | var previewButton = document.getElementById("wpPreview"); |
Property changes on: branches/wmf/1.16wmf4/extensions/ProofreadPage |
___________________________________________________________________ |
Name: svn:mergeinfo |
65 | 69 | + /branches/wmf-deployment/extensions/ProofreadPage:60970 |
/trunk/extensions/ProofreadPage:64273 |
/trunk/phase3/extensions/ProofreadPage:63545-63546,63549,63643,63764,63897-63901 |