r51734 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51733‎ | r51734 | r51735 >
Date:10:24, 11 June 2009
Author:thomasv
Status:ok
Tags:
Comment:
adjusting textbox height
Modified paths:
  • /trunk/extensions/ProofreadPage/proofread.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/proofread.js
@@ -145,11 +145,16 @@
146146 pageFooter = pageFooter.split("&").join("&")
147147
148148 container.innerHTML = ''
149 - + '<div id="prp_header" style="display:none">' + escapeQuotesHTML(proofreadPageMessageHeader) + '<br/>'
150 - + '<textarea name="headerTextbox" rows="2" cols="80">' + pageHeader + '</textarea>'
151 - + '<br/>' + escapeQuotesHTML(proofreadPageMessagePageBody) + '<br/></div>'
152 - + '<textarea name="wpTextbox1" id="wpTextbox1" rows="40" cols="80">'+pageBody+'</textarea>'
153 - + '<div id="prp_footer" style="display:none">' + escapeQuotesHTML(proofreadPageMessageFooter) + '<br/>'
 149+ + '<div id="prp_header" style="display:none;">'
 150+ + '<span style="color:gray;font-size:80%;line-height:100%;">'
 151+ + escapeQuotesHTML(proofreadPageMessageHeader) + '</span>'
 152+ + '<textarea name="headerTextbox" rows="2" cols="80">' + pageHeader + '</textarea><br/>'
 153+ + '<span style="color:gray;font-size:80%;line-height:100%;">'
 154+ + escapeQuotesHTML(proofreadPageMessagePageBody) + '</span></div>'
 155+ + '<textarea name="wpTextbox1" id="wpTextbox1" style="height:' + ( self.DisplayHeight - 6 ) + 'px;">' + pageBody + '</textarea>'
 156+ + '<div id="prp_footer" style="display:none;">'
 157+ + '<span style="color:gray;font-size:80%;line-height:100%;">'
 158+ + escapeQuotesHTML(proofreadPageMessageFooter) + '</span><br/>'
154159 + '<textarea name="footerTextbox" rows="2" cols="80">'+pageFooter+'</textarea></div>';
155160
156161
@@ -168,6 +173,22 @@
169174 }
170175
171176
 177+function pr_reset_size() {
 178+
 179+ var box = document.getElementById("wpTextbox1");
 180+ var h = document.getElementById("prp_header");
 181+ var f = document.getElementById("prp_footer");
 182+ if( h.style.cssText == 'display:none;') {
 183+ box.style.cssText = "height:" + ( self.DisplayHeight - 6 ) + "px";
 184+ } else {
 185+ if( self.pr_horiz ) {
 186+ box.style.cssText = "height:" + ( self.DisplayHeight - 6 ) + "px";
 187+ } else {
 188+ box.style.cssText = "height:" + ( self.DisplayHeight - 6 - h.offsetHeight - f.offsetHeight) + "px";
 189+ }
 190+ }
 191+}
 192+
172193 function pr_toggle_visibility() {
173194
174195 var box = document.getElementById("wpTextbox1");
@@ -176,22 +197,21 @@
177198 if( h.style.cssText == ''){
178199 h.style.cssText = 'display:none';
179200 f.style.cssText = 'display:none';
180 - box.style.cssText = "height:"+(self.DisplayHeight-7)+"px";
181201 } else {
182202 h.style.cssText = '';
183203 f.style.cssText = '';
184 - if(!self.pr_horiz) box.style.cssText = "height:"+(self.DisplayHeight-169)+"px";
185 - else box.style.cssText = "height:"+(self.DisplayHeight-7)+"px";
186204 }
 205+ pr_reset_size();
187206 }
188207
189208 function pr_toggle_layout() {
190209
191 - if (!self.pr_horiz)
 210+ if ( self.pr_horiz ) {
 211+ pr_fill_table(false);
 212+ } else {
192213 pr_fill_table(true);
193 - else
194 - pr_fill_table(false);
195 -
 214+ }
 215+ pr_reset_size();
196216 }
197217
198218
@@ -594,7 +614,7 @@
595615 }
596616 else{
597617 if(!horizontal_layout){
598 - self.DisplayHeight = Math.ceil(height*0.9);
 618+ self.DisplayHeight = Math.ceil(height*0.85);
599619 self.DisplayWidth = parseInt(width/2-70);
600620 img_w = self.DisplayWidth;
601621 self.container_css = "background:#000000; overflow:hidden; width:"+self.DisplayWidth+"px; height:"+self.DisplayHeight+"px;";
@@ -610,7 +630,6 @@
611631 + "\" width=\""+img_w+"\" />";
612632
613633 image_container.style.cssText = self.container_css;
614 - document.getElementById("wpTextbox1").style.cssText = "height:"+(self.DisplayHeight-7)+"px";
615634 pr_zoom(0);
616635 }
617636

Status & tagging log