123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- /*
- var TYPE_NOTICE = 0;
- var TYPE_WARN = 1;
- var TYPE_ASK = 2;
- var TYPE_ASK = 3;
- var TYPE_ERROR = 4;
- */
- function WebMsgDialog(ctxPath) {
- /* public properties */
- this.TYPE_NOTICE = 0;
- this.TYPE_WARN = 1;
- this.TYPE_ASK = 2;
- this.TYPE_ERROR = 3;
- this.TYPE_CONFIRM = 4;
-
- /* private properties */
- this._ctxPath = ctxPath;
- }
- WebMsgDialog.prototype.showMessageBox = function(msgType,msgContents,detailContents,delayTime) {
- var msgURL = "/common/msgBox.do";
- var pObj = new Object();
- pObj.msgType = msgType;
- //pObj.msgTitle = msgTitle;
- pObj.msgContents = msgContents;
- pObj.detailContents = detailContents;
- pObj.delayTime = delayTime;
-
- if(this._ctxPath!= null && this._ctxPath != "")
- {
- msgURL = this._ctxPath + msgURL;
- }
- msgURL = msgURL +"?msgType="+msgType;
- //alert("msgURL="+msgURL);
- //alert("msgType="+pObj.msgType+",msgContents="+msgContents);
- var Obj = window.showModalDialog(msgURL,pObj,'dialogWidth:429px;DialogHeight=208px;help:no;status:no');
- return Obj;
- }
- WebMsgDialog.prototype.showMessageLessBox = function(msgType,msgContents,detailContents,delayTime) {
- var msgURL = "/common/msgBox.do";
- var pObj = new Object();
- pObj.msgType = msgType;
- //pObj.msgTitle = msgTitle;
- pObj.msgContents = msgContents;
- pObj.detailContents = detailContents;
- pObj.delayTime = delayTime;
-
- if(this._ctxPath!= null && this._ctxPath != "")
- {
- msgURL = this._ctxPath + msgURL;
- }
- msgURL = msgURL +"?msgType="+msgType;
- //alert("msgURL="+msgURL);
- //alert("msgType="+pObj.msgType+",msgContents="+msgContents);
- var Obj = window.showModelessDialog(msgURL,pObj,'dialogWidth:429px;DialogHeight=208px;help:no;status:no');
- return Obj;
- }
- WebMsgDialog.prototype.showIndexMessageBox = function(msgType,msgContents,detailContents,delayTime) {
- var msgURL = "/msgbox.jsp";
- var pObj = new Object();
- pObj.msgType = msgType;
- //pObj.msgTitle = msgTitle;
- pObj.msgContents = msgContents;
- pObj.detailContents = detailContents;
- pObj.delayTime = delayTime;
-
- if(this._ctxPath!= null && this._ctxPath != "")
- {
- msgURL = this._ctxPath + msgURL;
- }
- msgURL = msgURL +"?msgType="+msgType;
- //alert("msgURL="+msgURL);
- //alert("msgType="+pObj.msgType+",msgContents="+msgContents);
- var Obj = window.showModalDialog(msgURL,pObj,'dialogWidth:429px;DialogHeight=208px;help:no;status:no');
- return Obj;
- }
- WebMsgDialog.prototype.showIndexAskMessageBox = function(msgType,msgContents,detailContents,delayTime) {
- var msgURL = "/askMsgbox.jsp";
- var pObj = new Object();
- pObj.msgType = msgType;
- //pObj.msgTitle = msgTitle;
- pObj.msgContents = msgContents;
- pObj.detailContents = detailContents;
- pObj.delayTime = delayTime;
-
- if(this._ctxPath!= null && this._ctxPath != "")
- {
- msgURL = this._ctxPath + msgURL;
- }
- msgURL = msgURL +"?msgType="+msgType;
- //alert("msgURL="+msgURL);
- //alert("msgType="+pObj.msgType+",msgContents="+msgContents);
- var Obj = window.showModalDialog(msgURL,pObj,'dialogWidth:429px;DialogHeight=208px;help:no;status:no');
- return Obj;
- }
- function cmd_OK()
- {
- var obj = new Object();
- obj.id=1;
- window.returnValue = obj;
- window.close();
- }
- function cmd_NO()
- {
- var obj = new Object();
- obj.id=0;
- window.returnValue = obj;
- window.close();
- }
- function cmd_detail()
- {
- var display = document.all("detailID").style.display;
- var preHeight = document.all("detailTdID").clientHeight;
- if(display == "none"){
- document.all("detailID").style.display = "";
- }else{
- document.all("detailID").style.display = "none";
- }
- var curHeight = document.all("detailTdID").clientHeight;
-
- //alert("curHeight - preHeight="+curHeight - preHeight);
- //alert("preHeight="+preHeight+",curHeight="+curHeight);
- resetDialog(curHeight - preHeight);
- }
- function resetDialog(vl){
- var indexOfp = dialogHeight.indexOf("p");
- var dialogHeightInt = parseInt(dialogHeight.substring(0,indexOfp));
- //alert("vl="+vl);
- window.dialogHeight = dialogHeightInt + vl + "px";
- }
- function setMsgBoxData()
- {
- var argArray = new Array(window.dialogArguments);
- //alert(argArray.length);
- var valueObj = new Object();
- valueObj = argArray[0];
- //alert("msgType="+valueObj.msgType+",msgTitle="+valueObj.msgTitle+",msgContents="+valueObj.msgContents);
- var preCtHeight = document.all("windowHeight").clientHeight;
- var preDialogHeight = window.dialogHeight;
- var addHeight = document.body.scrollHeight - document.body.clientHeight
- //alert("preCtHeight="+preCtHeight+",preDialogHeight="+preDialogHeight);
-
- document.all("msgContentID").innerHTML = valueObj.msgContents;
- if(valueObj.detailContents != null && valueObj.detailContents != "")
- {
- document.all("detailCtID").value = valueObj.detailContents;
- }else{
- document.all("detailBtID").innerHTML="";
- }
-
- //alert( document.all("trID").clientHeight);
- var ctHeight = document.all("windowHeight").clientHeight;
- var increasedHeight = parseInt(ctHeight) - parseInt(preCtHeight);
- // alert("increasedHeight="+increasedHeight);
-
- var dialogHeight = window.dialogHeight;
-
- var indexOfp = dialogHeight.indexOf("p");
- var dialogHeightInt = parseInt(dialogHeight.substring(0,indexOfp));
- //alert("dialogHeightInt="+dialogHeightInt);
- window.dialogHeight = dialogHeightInt + increasedHeight + addHeight + "px";
- //alert("dialogHeight="+window.dialogHeight);
-
- if(valueObj.delayTime != null && valueObj.delayTime != "")
- {
- setTimeout("window.close()",valueObj.delayTime);
- }
- }
|