Index: trunk/extensions/ProofreadPage/proofread.js |
— | — | @@ -82,19 +82,19 @@ |
83 | 83 | pageFooter = ''; |
84 | 84 | } |
85 | 85 | else { |
86 | | - pageHeader = ''; |
| 86 | + pageHeader = '<div class="pagetext">'; |
87 | 87 | pageBody = text; |
88 | | - pageFooter = ''; |
| 88 | + pageFooter = '</div>'; |
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | 92 | container.innerHTML = '' |
93 | | - +'Header (noinclude):<br/>' |
| 93 | + +'<div id="prp_header" style="display:none">Header (noinclude):<br/>' |
94 | 94 | +'<textarea name="headerTextbox" rows="4" cols="80">'+pageHeader+'</textarea>' |
95 | | - +'<br/>Page body (to be transcluded):<br/>' |
| 95 | + +'<br/>Page body (to be transcluded):<br/></div>' |
96 | 96 | +'<textarea name="wpTextbox1" id="wpTextbox1" rows="40" cols="80">'+pageBody+'</textarea>' |
97 | | - +'<br/>Footer (noinclude):<br/>' |
98 | | - +'<textarea name="footerTextbox" rows="4" cols="80">'+pageFooter+'</textarea>'; |
| 97 | + +'<div id="prp_footer" style="display:none"><br/>Footer (noinclude):<br/>' |
| 98 | + +'<textarea name="footerTextbox" rows="4" cols="80">'+pageFooter+'</textarea></div>'; |
99 | 99 | |
100 | 100 | saveButton = document.getElementById("wpSave"); |
101 | 101 | saveButton.setAttribute("onclick","proofreadPageFillForm(this.form);"); |
— | — | @@ -106,8 +106,21 @@ |
107 | 107 | } |
108 | 108 | |
109 | 109 | |
| 110 | +function proofreadpage_toggle_visibility() { |
110 | 111 | |
| 112 | + h = document.getElementById("prp_header"); |
| 113 | + f = document.getElementById("prp_footer"); |
| 114 | + s = h.getAttribute("style"); |
| 115 | + if( s == ""){ |
| 116 | + h.setAttribute("style", "display:none;"); |
| 117 | + f.setAttribute("style", "display:none;"); |
| 118 | + } else { |
| 119 | + h.setAttribute("style", ""); |
| 120 | + f.setAttribute("style", ""); |
| 121 | + } |
| 122 | +} |
111 | 123 | |
| 124 | + |
112 | 125 | function proofreadpage_default_setup() { |
113 | 126 | |
114 | 127 | var displayWidth = 400; //default value |
— | — | @@ -167,6 +180,21 @@ |
168 | 181 | |
169 | 182 | if(proofreadPageIsEdit) { |
170 | 183 | proofreadpage_make_edit_area(cell_left,new_text.value); |
| 184 | + toolbar = document.getElementById("toolbar"); |
| 185 | + if(toolbar){ |
| 186 | + var image = document.createElement("img"); |
| 187 | + image.width = 23; |
| 188 | + image.height = 22; |
| 189 | + image.className = "mw-toolbar-editbutton"; |
| 190 | + image.src = "http://upload.wikimedia.org/wikipedia/commons/2/2a/Button_category_plus.png"; |
| 191 | + image.border = 0; |
| 192 | + image.alt = "headers"; |
| 193 | + image.title = "toggle headers visibility"; |
| 194 | + image.style.cursor = "pointer"; |
| 195 | + image.onclick = proofreadpage_toggle_visibility; |
| 196 | + toolbar.appendChild(image); |
| 197 | + } |
| 198 | + |
171 | 199 | } else { |
172 | 200 | cell_left.appendChild(new_text); |
173 | 201 | } |