[2] | 1 | function __dlg_onclose() { |
---|
| 2 | if (!document.all) { |
---|
| 3 | opener.Dialog._return(null); |
---|
| 4 | } |
---|
| 5 | }; |
---|
| 6 | |
---|
| 7 | function __dlg_init() { |
---|
| 8 | |
---|
| 9 | if (!document.all) { |
---|
| 10 | // init dialogArguments, as IE gets it |
---|
| 11 | window.dialogArguments = opener.Dialog._arguments; |
---|
| 12 | window.sizeToContent(); |
---|
| 13 | window.sizeToContent(); // for reasons beyond understanding, |
---|
| 14 | // only if we call it twice we get the |
---|
| 15 | // correct size. |
---|
| 16 | window.addEventListener("unload", __dlg_onclose, true); |
---|
| 17 | /* |
---|
| 18 | // center on parent |
---|
| 19 | var px1 = opener.screenX; |
---|
| 20 | var px2 = opener.screenX + opener.outerWidth; |
---|
| 21 | var py1 = opener.screenY; |
---|
| 22 | var py2 = opener.screenY + opener.outerHeight; |
---|
| 23 | var x = (px2 - px1 - window.outerWidth) / 2; |
---|
| 24 | var y = (py2 - py1 - window.outerHeight) / 2; */ |
---|
| 25 | |
---|
| 26 | //centre on screen instead |
---|
| 27 | |
---|
| 28 | var x = (screen.width - window.outerWidth) / 2; |
---|
| 29 | var y = (screen.height - window.outerHeight) / 2; |
---|
| 30 | |
---|
| 31 | window.moveTo(x, y); |
---|
| 32 | var body = document.body; |
---|
| 33 | window.innerHeight = body.offsetHeight; |
---|
| 34 | window.innerWidth = body.offsetWidth; |
---|
| 35 | } else { |
---|
| 36 | var body = document.body; |
---|
| 37 | window.dialogHeight = body.offsetHeight + 50 + "px"; |
---|
| 38 | window.dialogWidth = body.offsetWidth + "px"; |
---|
| 39 | } |
---|
| 40 | }; |
---|
| 41 | |
---|
| 42 | // closes the dialog and passes the return info upper. |
---|
| 43 | function __dlg_close(val) { |
---|
| 44 | if (document.all) { // IE |
---|
| 45 | window.returnValue = val; |
---|
| 46 | } else { |
---|
| 47 | opener.Dialog._return(val); |
---|
| 48 | } |
---|
| 49 | window.close(); |
---|
| 50 | }; |
---|