Xinha.prototype.sizeEditor=function()

in blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/xinha/XinhaCore.js [1099:1215]


Xinha.prototype.sizeEditor=function(_a5,_a6,_a7,_a8){
if(this._risizing){
return;
}
this._risizing=true;
this.notifyOf("before_resize",{width:_a5,height:_a6});
this._iframe.style.height="100%";
this._textArea.style.height="100%";
this._iframe.style.width="";
this._textArea.style.width="";
if(_a7!==null){
this._htmlArea.sizeIncludesToolbars=_a7;
}
if(_a8!==null){
this._htmlArea.sizeIncludesPanels=_a8;
}
if(_a5){
this._htmlArea.style.width=_a5;
if(!this._htmlArea.sizeIncludesPanels){
var _a9=this._panels.right;
if(_a9.on&&_a9.panels.length&&Xinha.hasDisplayedChildren(_a9.div)){
this._htmlArea.style.width=(this._htmlArea.offsetWidth+parseInt(this.config.panel_dimensions.right,10))+"px";
}
var _aa=this._panels.left;
if(_aa.on&&_aa.panels.length&&Xinha.hasDisplayedChildren(_aa.div)){
this._htmlArea.style.width=(this._htmlArea.offsetWidth+parseInt(this.config.panel_dimensions.left,10))+"px";
}
}
}
if(_a6){
this._htmlArea.style.height=_a6;
if(!this._htmlArea.sizeIncludesToolbars){
this._htmlArea.style.height=(this._htmlArea.offsetHeight+this._toolbar.offsetHeight+this._statusBar.offsetHeight)+"px";
}
if(!this._htmlArea.sizeIncludesPanels){
var _ab=this._panels.top;
if(_ab.on&&_ab.panels.length&&Xinha.hasDisplayedChildren(_ab.div)){
this._htmlArea.style.height=(this._htmlArea.offsetHeight+parseInt(this.config.panel_dimensions.top,10))+"px";
}
var _ac=this._panels.bottom;
if(_ac.on&&_ac.panels.length&&Xinha.hasDisplayedChildren(_ac.div)){
this._htmlArea.style.height=(this._htmlArea.offsetHeight+parseInt(this.config.panel_dimensions.bottom,10))+"px";
}
}
}
_a5=this._htmlArea.offsetWidth;
_a6=this._htmlArea.offsetHeight;
var _ad=this._panels;
var _ae=this;
var _af=1;
function panel_is_alive(pan){
if(_ad[pan].on&&_ad[pan].panels.length&&Xinha.hasDisplayedChildren(_ad[pan].container)){
_ad[pan].container.style.display="";
return true;
}else{
_ad[pan].container.style.display="none";
return false;
}
}
if(panel_is_alive("left")){
_af+=1;
}
if(panel_is_alive("right")){
_af+=1;
}
this._framework.tb_cell.colSpan=_af;
this._framework.tp_cell.colSpan=_af;
this._framework.bp_cell.colSpan=_af;
this._framework.sb_cell.colSpan=_af;
if(!this._framework.tp_row.childNodes.length){
Xinha.removeFromParent(this._framework.tp_row);
}else{
if(!Xinha.hasParentNode(this._framework.tp_row)){
this._framework.tbody.insertBefore(this._framework.tp_row,this._framework.ler_row);
}
}
if(!this._framework.bp_row.childNodes.length){
Xinha.removeFromParent(this._framework.bp_row);
}else{
if(!Xinha.hasParentNode(this._framework.bp_row)){
this._framework.tbody.insertBefore(this._framework.bp_row,this._framework.ler_row.nextSibling);
}
}
if(!this.config.statusBar){
Xinha.removeFromParent(this._framework.sb_row);
}else{
if(!Xinha.hasParentNode(this._framework.sb_row)){
this._framework.table.appendChild(this._framework.sb_row);
}
}
this._framework.lp_cell.style.width=this.config.panel_dimensions.left;
this._framework.rp_cell.style.width=this.config.panel_dimensions.right;
this._framework.tp_cell.style.height=this.config.panel_dimensions.top;
this._framework.bp_cell.style.height=this.config.panel_dimensions.bottom;
this._framework.tb_cell.style.height=this._toolBar.offsetHeight+"px";
this._framework.sb_cell.style.height=this._statusBar.offsetHeight+"px";
var _b1=_a6-this._toolBar.offsetHeight-this._statusBar.offsetHeight;
if(panel_is_alive("top")){
_b1-=parseInt(this.config.panel_dimensions.top,10);
}
if(panel_is_alive("bottom")){
_b1-=parseInt(this.config.panel_dimensions.bottom,10);
}
this._iframe.style.height=_b1+"px";
var _b2=_a5;
if(panel_is_alive("left")){
_b2-=parseInt(this.config.panel_dimensions.left,10);
}
if(panel_is_alive("right")){
_b2-=parseInt(this.config.panel_dimensions.right,10);
}
this._iframe.style.width=_b2+"px";
this._textArea.style.height=this._iframe.style.height;
this._textArea.style.width=this._iframe.style.width;
this.notifyOf("resize",{width:this._htmlArea.offsetWidth,height:this._htmlArea.offsetHeight});
this._risizing=false;
};