All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.adf.jsLibs.PopupDialog.js Maven / Gradle / Ivy

function TrPopupDialog()
{
var a0=TrPage.getInstance();
var a1=document.createElement("div");
a1.style.cssText="visibility:hidden; position: absolute;";
a1.className=a0.getStyleClass("af|dialog::container");
var a2=document.createElement("div");
a2.className=a0.getStyleClass("af|dialog::title-bar");
a1.appendChild(a2);
var a3=document.createElement("div");
a3.style.cssText="float:left;";
a3.className=a0.getStyleClass("af|dialog::title-text");
a2.appendChild(a3);
var a4=document.createElement("div");
a4.style.cssText="float:right;";
a4.className=a0.getStyleClass("af|dialog::close-icon");
_addEvent(a4,"click",TrPopupDialog._returnFromDialog);
a2.appendChild(a4);
var a5=document.createElement("div");
a5.style.cssText="float:right;";
a5.className=a0.getStyleClass("af|dialog::undisclose-icon");
_addEvent(a5,"click",TrPopupDialog._toggleDialog);
a2.appendChild(a5);
this._toggleDiv=a5;
var a6=document.createElement("div");
a6.style.cssText="clear:both;";
a2.appendChild(a6);
var a7=document.createElement("iframe");
a7.name="_blank";
a7.frameBorder="0";
a7.className=a0.getStyleClass("af|dialog::content");
a1.appendChild(a7);
this._iframe=a7;
this._outerDiv=a1;
this._titleTextDiv=a3;
document.body.appendChild(a1);
TrPanelPopup.call(this);
this.setModal(true);
this.setCentered(true);
this.setContent(a1);
this._fixedSize=false;
this._toggleHeight="0px";
}
TrPopupDialog.prototype=new TrPanelPopup();
TrPopupDialog.prototype.setTitle=function(a8)
{
if(a8)
{
this._titleTextDiv.innerHTML=a8;
}
else
{
this._titleTextDiv.innerHTML="";
}
}
TrPopupDialog.prototype.setDestination=function(a9)
{
this._iframe.src=a9;
}
TrPopupDialog.prototype.setSize=function(a10,a11)
{
this._resizeIFrame(a10,a11);
if(a10==null)
{
this._variableWidth=true;
}
else
{
this._variableWidth=false;
this._fixedSize=true;
}
if(a11==null)
{
this._variableHeight=true;
}
else
{
this._variableHeight=false;
this._fixedSize=true;
}
}
TrPopupDialog.getInstance=function()
{
return TrPopupDialog.DIALOG;
}
TrPopupDialog.prototype._destroy=function()
{
var a12=this._outerDiv;
if(a12)
{
delete this._outerDiv;
a12.parentNode.removeChild(a12);
}
if(this._iframe)
delete this._iframe;
if(this._titleTextDiv)
delete this._titleTextDiv;
}
TrPopupDialog.prototype._resizeIFrame=function(a13,a14)
{
if(a14!=null)
{
this._iframe.height=a14+"px";
}
if(a13!=null)
{
this._iframe.width="100%";
this._outerDiv.style.width=a13+"px";
}
this._calcPosition(false);
}
TrPopupDialog._initDialogPage=function()
{
var a15;
try
{
a15=parent.TrPopupDialog.DIALOG;
}
catch(err)
{
}
if(!a15)
return;
a15.setTitle(document.title);
if(a15.isVisible())
return;
if(!a15._fixedSize)
{
if(_agent.isIE)
{
a15._resizeIFrame(
a15._iframe.Document.body.scrollWidth+40,
a15._iframe.Document.body.scrollHeight+40);
}
else
{
a15._resizeIFrame(
a15._iframe.contentDocument.body.offsetWidth+40,
a15._iframe.contentDocument.body.offsetHeight+40);
}
}
else if(a15._variableWidth||a15._variableHeight)
{
if(a15._variableWidth)
{
if(_agent.isIE)
{
a15._resizeIFrame(a15._iframe.Document.body.scrollWidth+40,null);
}
else
{
a15._resizeIFrame(a15._iframe.contentDocument.body.offsetWidth+40,null);
}
}
if(a15._variableHeight)
{
if(_agent.isIE)
{
a15._resizeIFrame(null,a15._iframe.Document.body.scrollHeight+40);
}
else
{
a15._resizeIFrame(null,a15._iframe.contentDocument.body.offsetHeight+40);
}
}
}
a15.show();
}
TrPopupDialog._returnFromDialog=function()
{
var a16=TrPopupDialog.DIALOG;
if(a16)
{
a16.hide();
window.setTimeout(TrUIUtils.createCallback(
a16,TrPopupDialog.prototype._destroy),100);
TrPopupDialog.DIALOG=undefined;
}
else
{
alert("returnFromDialog(): Error - Current popup is not a dialog");
}
}
TrPopupDialog._toggleDialog=function()
{
var a17=TrPopupDialog.DIALOG;
if(a17)
{
var a18=TrPage.getInstance();
var a19=a17._iframe.height;
a17._iframe.height=a17._toggleHeight;
a17._toggleHeight=a19;
if(a17._iframe.height==="0px")
{
a17._toggleDiv.className=a18.getStyleClass("af|dialog::disclose-icon");
}
else
{
a17._toggleDiv.className=a18.getStyleClass("af|dialog::undisclose-icon");
}
}
else
{
alert("Error - Current popup is not a dialog");
}
}
TrPopupDialog._returnFromDialogAndSubmit=function(a20,a21)
{
if(a20)
{
var a22=a20['formName'];
var a23=a20['postback'];
_submitPartialChange(a22,0,{rtrn:a23});
}
}
TrPopupDialog._launchDialog=function(
a24,
a25,
a26,
a27)
{
var a28=TrPopupDialog.DIALOG;
if(!a28)
{
a28=TrPopupDialog.DIALOG=new TrPopupDialog();
}
a28.callback=a26;
a28.callbackProps=a27;
if(a25&&a25['width']&&a25['height'])
{
a28.setSize(a25['width'],a25['height']);
}
else if(a25&&a25['width'])
{
a28.setSize(a25['width'],null);
}
else if(a25&&a25['height'])
{
a28.setSize(null,a25['height']);
}
a28.setDestination(a24);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy