|
html layer로 개발한 popup window 연재1 - overview
web application 개발과정에서 popup window를 생성해야 할 때가 있습니다.
하지만 어떤 경우는 popup window를 보안정책상 막아놓기를 원하는 경우도 있습니다.
개발자는 이렇게 말할 수 있습니다. 그거 풀어야 합니다. 하지만 고객을 이기지는 못합니다.
필자도 동일한 상황을 격어 봤습니다.
그래서 개발한 기능이 popup window를 open하지 않고, layer로 popup window와 동일한 모양과 기능입니다.
필자는 WCLayerWindow 이라는 xxjavascript를 개발하였고 이를 소개하겠습니다.
1. window에 Layer 구조로 popup iframe이 뜨고 그 iframe에 원하는 url이 submit되는 기능
2. layer 구조의 window는 title이 있고, icon이 있고, close button이 있는 구조
3. layer 구조의 window는 title을 mouse로 drag하여 위치를 이동할 수 있는 기능
4. layer 구조의 window의 border를 mouse로 drag하여 resize 할 수 있는 기능
아래의 소개하는 JSP 프로그램은 html layer 구조를 사용한 popup window 를 생성하는 sample code입니다.
-- LayerWindow1.jsp 시작
<%@ page language="java" import="wdl.*,wdl.board.*,wdl.board.*,java.util.*,java.sql.*,java.lang.*,
java.io.*,java.io.File " contentType="text/html; charset=EUC-KR"%>
<%
WCPage oPage = new WCPage();
if (oPage.initCtrl(pageContext) > 0)
{
return;
}
oPage.printCtrl();
%>
<form name=elParam>
</form>
<script>
function openPopup()
{
try
{
// WCPage.js가 load가 완료되었는지를 점검합니다.
if (window.WCPage_isInit == false)
{
setTimeout("openPopup()",20);
return;
}
// WCPage.js가 초기화 되었는지를 점검합니다.
if (WCPage_isInit() == false)
{
setTimeout("openPopup()",20);
return;
}
// WCLayerWindow.js가 load되었는지를 검검합니다.
if (window.WCLayerWindow_create == null)
{
setTimeout("openPopup()",20);
return;
}
var action = "http://www.webdevlib.net/wdl/doc/main/notice.jsp";
var form = document.elParam;
form.method = "post";
form.action = action;
var oCtrl = WCLayerWindow_create(window,"HelloWDL",window);
WCLayerWindow_setCtrlProperty(window,oCtrl,"form",form);
WCLayerWindow_setCtrlProperty(window,oCtrl,"title","Hello WDL");
WCLayerWindow_setCtrlProperty(window,oCtrl,"icon","http://www.webdevlib.net/wdl/doc/img/icon/icon_popup.gif");
WCLayerWindow_setCtrlProperty(window,oCtrl,"left",205);
WCLayerWindow_setCtrlProperty(window,oCtrl,"top",100);
WCLayerWindow_setCtrlProperty(window,oCtrl,"width",385);
WCLayerWindow_setCtrlProperty(window,oCtrl,"height",355);
WCLayerWindow_setCtrlProperty(window,oCtrl,"border",2);
WCLayerWindow_setCtrlProperty(window,oCtrl,"resizable","true");
WCLayerWindow_open(window,oCtrl);
}
catch (e)
{
}
}
setTimeout("openPopup()",10);
</script>
-- LayerWindow1.jsp 끝
위의 프로그램에서 WCPage는 JSP pageContext 관련된 request,response,out등의 object등을
저장하고 있고 post,get으로 전달받은 parameter를 저장하는 object입니다.
WCPage source code는 여기서는 간략하게 설명하였습니다. 기존에 올린 글들에서
WCPage 기능에 대해서 간단히 설명을 하였습니다. WCPage.java source code를 download받으시려면
http://www.webdevlib.net 에서 download 받으실 수 있습니다.
LayerWindow1.jsp 는 제가 www.webdevlib.net 에 있는 소스중에서
개발자가 최대한 이해하기 쉽게 중요한 부분을 추출하여 재구성한 sample입니다.
물론 모든 소스코드는 다운로드 받으실 수 있습니다.
제가 글을 쓰면서 layer window를 구현하는 기법에 대해서
하나의 방법을 제시하면서 또한 layer window의 xxjavascript 코드 중에서
개발자 분들이 일부 참조할 만한 사항들이 있으실 것입니다.
WCPage.initCtrl 에서 pageContext를 넘김으로 WCPage에서 JSP 관련 context를 모두 저장하고
또한 page로 전달된 parameter를 WCPage가 모두 저장하고 있습니다.
WCPage oPage = new WCPage();
if (oPage.initCtrl(pageContext) > 0)
{
return;
}
oPage.printCtrl();
WCPage 관련된 위의 코드는 HTML Layer popup window를 실행하기 위해서는 반드시
필요한 구조입니다. WCPage.printCtrl() 은 WCLayerWindow이 필요한 xxjavascript를 출력합니다.
// WCPage.printCtrl이 출력한 html의 일부분 시작
<script language="xxjavascript" src="/wdl/js/WCProperties.js"></script>
<script language="xxjavascript" src="/wdl/js/WCObj.js"></script>
<script language="xxjavascript" src="/wdl/js/WCCtrl.js"></script>
<script language="xxjavascript" src="/wdl/js/WCPage.js"></script>
<script id=_wdl_js_WCLayerWindow_js language="xxjavascript">setTimeout("WCPage_loadScript('_wdl_js_WCLayerWindow_js','/wdl/js/WCLayerWindow.js')",50);</script>
<script language="xxjavascript">
...
// WCPage.printCtrl이 출력한 html의 일부분 끝
이와 같은 xxjavascript를 WCPage.printCtrl()이 출력합니다.
이제 HTML Layer popup window 기능인 WCLayerWindow 기능에 대해서 설명하겠습니다.
function WCLayerWindow_create(wSrcWnd,sName,wScreen)
: WCLayerWindow_create는 layer popup window에 대한 정보를 저장하는 xxjavascript object를 생성합니다.
function WCLayerWindow_setCtrlProperty(wSrcWnd,oCtrl,sProp,sValue)
: control(layer popup window)의 property를 지정합니다.
function WCLayerWindow_open(wSrcWnd,oCtrl)
: layer 구조의 html을 생성하고 popup window를 생성합니다.
WCLayerWindow_open
-> WCLayerWindow_open2
-> WCLayerWindow_open3
-> WCLayerWindow_getFrameHtml
WCLayerWindow_getFrameHtml : layer popup window의 HTML을 생성합니다.
layer popup window html의 구조는 다음과 같습니다.
- header html : mouse로 dragging하면 window가 이동할 수 있도록 하는 기능
- header text html
- icon html
- close box html
- body iframe html : popup window의 body는 iframe으로 구성되며 iframe에 form을 submit하거나 url을 설정할 수 있습니다.
- border html
- resizable border : mouse로 border를 클릭하여 drag하면 window의 size를 조절할 수 있는 기능
실제 실행되는 예를 보려면 아래의 URL을 방문하면 popup window가 하나 뜹니다. layer popup window의 sample입니다.
resize와 title drag 기능이 되는 sample 화면을 보실 수 있습니다.
-- WCLayerWindow.js 소스 시작
function WCLayerWindow_focusFrame(wSrcWnd)
{
try
{
var sName = wSrcWnd.name;
var oCtrl = WCObj_getObj(wSrcWnd,sName);
if (oCtrl == null)
return;
WCLayerWindow_focus(wSrcWnd,oCtrl);
}
catch (ex)
{
}
}
function WCLayerWindow_closeAll(wSrcWnd)
{
try
{
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
for (var i=0;i<=wScreen.g_oPage.layerWindow.topIdx;i++)
{
var oCtrl = wScreen.g_oPage.layerWindow.frameStack[wScreen.g_oPage.layerWindow.topIdx];
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
WCLayerWindow_hide(wSrcWnd,oCtrl);
WCCtrl_deleteObjByName(wScreen,oCtrl.name);
}
wScreen.g_oPage.layerWindow.curCtrl = null;
wScreen.g_oPage.layerWindow.topIdx = -1;
wScreen.g_oPage.layerWindow.bottomIdx = -1;
wScreen.g_oPage.layerWindow.frameStack = new Array();
}
catch (ex)
{
}
}
function WCLayerWindow_close(wSrcWnd)
{
WCLayerWindow_closeFrame(wSrcWnd,null);
}
function WCLayerWindow_closeFrame(wSrcWnd,oCtrl)
{
try
{
if (oCtrl == null)
{
var sName = wSrcWnd.name;
oCtrl = WCObj_getObj(wSrcWnd,sName);
}
var wCaller = WCLayerWindow_getCallerWindow(wSrcWnd,oCtrl);
WCLayerWindow_doClose(wCaller,oCtrl);
}
catch (ex)
{
}
}
function WCLayerWindow_doClose(wSrcWnd,oCtrl)
{
try
{
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if (oCtrl == null)
{
if (wScreen.g_oPage.layerWindow.curCtrl != null)
{
oCtrl = wScreen.g_oPage.layerWindow.curCtrl;
sName = wScreen.g_oPage.layerWindow.curCtrl.name;
wSrcWnd = wScreen.g_oPage.layerWindow.curCtrl.wSrcWnd;
}
}
else
{
sName = oCtrl.name;
}
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var wClient = WCLayerWindow_getClientWindow(wSrcWnd,oCtrl);
if (wClient != null)
{
elClientFrame = WCLayerWindow_getClientFrame(wSrcWnd,oCtrl);
elClientFrame.style.pixelTop = -10000;
elClientFrame.style.pixelLeft = -10000;
elClientFrame.style.pixelWidth = 0;
elClientFrame.style.pixelHeight = 0;
if (oCtrl.clientWindow.WCLayerWindow_onClose != null)
{
oCtrl.clientWindow.WCLayerWindow_onClose(wSrcWnd,oCtrl);
}
}
if (oCtrl.callerWindow != null)
{
if (oCtrl.callerWindow.WCLayerWindow_onCloseFrame != null)
{
oCtrl.callerWindow.WCLayerWindow_onCloseFrame(wSrcWnd,oCtrl);
}
}
else
{
var nCatch = 1;
}
wScreen.g_oPage.layerWindow.frameStack[oCtrl.windowStackIdx] = null;
if (wScreen.g_oPage.layerWindow.topIdx == oCtrl.windowStackIdx)
{
var oTop = WCLayerWindow_getNextFrame(wSrcWnd,oCtrl);
WCLayerWindow_focusEx(wSrcWnd,oTop);
}
if (wScreen.g_oPage.layerWindow.topIdx < 0)
{
wScreen.g_oPage.layerWindow.topIdx = -1;
}
oCtrl.callerWindow = null;
WCLayerWindow_hide(wSrcWnd,oCtrl);
WCCtrl_deleteObjByName(wScreen,sName);
}
catch(myexception)
{
}
}
function WCLayerWindow_getNextFrame(wSrcWnd,oCtrl)
{
try
{
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
while (true)
{
wScreen.g_oPage.layerWindow.topIdx --;
if (wScreen.g_oPage.layerWindow.topIdx < 0)
return null;
var oTop = wScreen.g_oPage.layerWindow.frameStack[wScreen.g_oPage.layerWindow.topIdx];
if (oTop != null)
return oTop;
}
}
catch (ex)
{
}
}
function WCLayerWindow_hide(wSrcWnd,oCtrl)
{
try
{
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var elPopupDiv = wScreen.document.getElementById("elPopupDiv_"+oCtrl.name+"");
if (elPopupDiv != null)
{
elPopupDiv.style.pixelTop = -20000;
elPopupDiv.style.pixelLeft = -20000;
}
}
catch (ex)
{
}
}
function WCLayerWindow_getCallerWindow(wSrcWnd,oCtrl)
{
if (oCtrl == null)
{
var sName = wSrcWnd.name;
oCtrl = WCObj_getObj(wSrcWnd,sName);
}
return oCtrl.callerWindow;
}
function WCLayerWindow_isPopup(wSrcWnd)
{
var sName = wSrcWnd.name;
var oCtrl = WCObj_getObj(wSrcWnd,sName);
if (oCtrl != null)
{
return true;
}
return false;
}
function WCLayerWindow_showMessage(wSrcWnd,oCtrl,sHtmlMsg,nWidth,nHeight)
{
var sName = "";
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if (wScreen.g_oPage.layerWindow.curCtrl != null)
{
sName = wScreen.g_oPage.layerWindow.curCtrl.name;
}
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var elPopupMsgDiv = wScreen.document.getElementById("elPopupMsgDiv_"+sName+"");
if (elPopupMsgDiv == null)
return;
elPopupMsgDiv.style.pixelTop = oCtrl.headerHeight + oCtrl.border;
elPopupMsgDiv.style.pixelLeft = 0 + oCtrl.border;
elPopupMsgDiv.style.pixelWidth = nWidth;
elPopupMsgDiv.style.pixelHeight = nHeight;
var elMsg = wScreen.document.getElementById("elMsgCell_"+sName+"");
if (elMsg == null)
return;
elMsg.width = nWidth;
elMsg.height = nHeight;
elMsg.innerHTML = sHtmlMsg;
}
function WCLayerWindow_showClient(wSrcWnd,oCtrl)
{
var sName = "";
var nType = 0;
var wSrcWnd = null;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if (wScreen.g_oPage.layerWindow.curCtrl != null)
{
oCtrl = wScreen.g_oPage.layerWindow.curCtrl;
sName = wScreen.g_oPage.layerWindow.curCtrl.name;
wSrcWnd = wScreen.g_oPage.layerWindow.curCtrl.wSrcWnd;
nType = Number(wScreen.g_oPage.layerWindow.curCtrl.type);
}
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var elPopupMsgDiv = wScreen.document.getElementById("elPopupMsgDiv_"+sName+"");
if (elPopupMsgDiv == null)
return;
elPopupMsgDiv.style.pixelTop = oCtrl.headerHeight-10000;
elPopupMsgDiv.style.pixelLeft = 2-10000;
if (nType == 1)
{
var elPopupHtmlDiv = wScreen.document.getElementById("elPopupHtmlDiv_"+sName+"");
if (elPopupHtmlDiv == null)
return;
elPopupHtmlDiv.style.pixelTop = oCtrl.headerHeight + oCtrl.border;
elPopupHtmlDiv.style.pixelLeft = 0 + oCtrl.border;
elPopupHtmlDiv.style.pixelWidth = 100;
elPopupHtmlDiv.style.pixelHeight = 100;
}
else
{
var elLayerWindowDiv = wScreen.document.getElementById("elLayerWindowDiv_"+sName+"");
if (elLayerWindowDiv == null)
return;
elLayerWindowDiv.style.pixelTop = oCtrl.headerHeight + oCtrl.border;
elLayerWindowDiv.style.pixelLeft = 0 + oCtrl.border;
}
}
function WCLayerWindow_setSize(wSrcWnd,oCtrl,nWidth,nHeight)
{
var sName = "";
var nType = 0;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if (wScreen.g_oPage.layerWindow.curCtrl != null)
{
sName = wScreen.g_oPage.layerWindow.curCtrl.name;
nType = Number(wScreen.g_oPage.layerWindow.curCtrl.type);
}
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if (nType == 1)
{
var elPopupHtmlDiv = wScreen.document.getElementById("elPopupHtmlDiv_"+sName+"");
if (elPopupHtmlDiv == null)
return;
elPopupHtmlDiv.style.pixelTop = oCtrl.headerHeight + oCtrl.border;
elPopupHtmlDiv.style.pixelLeft = 0 + oCtrl.border;
elPopupHtmlDiv.style.pixelWidth = nWidth;
elPopupHtmlDiv.style.pixelHeight = nHeight-10;
}
else
{
var elLayerWindowDiv = wScreen.document.getElementById("elLayerWindowDiv_"+sName+"");
if (elLayerWindowDiv == null)
return;
elLayerWindowDiv.style.pixelTop = oCtrl.headerHeight + oCtrl.border;
elLayerWindowDiv.style.pixelLeft = 0 + oCtrl.border;
elLayerWindowDiv.style.pixelHeight = nHeight;
var elFrame = wScreen.document.getElementById(""+""+""+sName+"");
if (elFrame != null)
{
elFrame.style.pixelWidth = nWidth;
elFrame.style.pixelHeight = nHeight;
}
var elPopupBgDiv = wScreen.document.getElementById("elPopupBgFrameDiv_"+sName+"");
if (elPopupBgDiv != null)
{
elPopupBgDiv.style.pixelTop = 0;
elPopupBgDiv.style.pixelLeft = 0;
elPopupBgDiv.style.pixelWidth = nWidth+oCtrl.border*2;
if (oCtrl.headerHeight > 0)
elPopupBgDiv.style.pixelHeight = nHeight+oCtrl.border*2+oCtrl.headerHeight;
else
elPopupBgDiv.style.pixelHeight = nHeight+oCtrl.border*2;
}
var elPopupBgFrame = wScreen.document.getElementById("elPopupBgFrame_"+sName+"");
if (elPopupBgFrame != null)
{
elPopupBgFrame.style.pixelTop = 0;
elPopupBgFrame.style.pixelLeft = 0;
elPopupBgFrame.style.pixelWidth = nWidth+oCtrl.border*2;
if (oCtrl.headerHeight > 0)
elPopupBgFrame.style.pixelHeight = nHeight+oCtrl.border*2+oCtrl.headerHeight;
else
elPopupBgFrame.style.pixelHeight = nHeight+oCtrl.border*2;
}
}
var elSizeImg = wScreen.document.getElementById("elSizeImg_"+sName+"");
if (elSizeImg != null)
{
elSizeImg.height = nHeight;
elSizeImg.width = nWidth;
}
}
function WCLayerWindow_getClientWindow(wSrcWnd,oCtrl)
{
if (oCtrl.clientWindow != null)
return oCtrl.clientWindow;
var sName = "";
sName = oCtrl.name;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl)
oCtrl.clientWindow = eval("wScreen."+sName);
return oCtrl.clientWindow;
}
function WCLayerWindow_getClientFrame(wSrcWnd,oCtrl)
{
if (oCtrl.clientFrame != null)
return oCtrl.clientFrame;
var sName = "";
sName = oCtrl.name;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl)
oCtrl.clientFrame = wScreen.window.document.getElementById(sName);
return oCtrl.clientFrame;
}
function WCLayerWindow_getScreen(wSrcWnd,oCtrl)
{
return oCtrl.screenWindow;
}
function WCLayerWindow_initScreen(wSrcWnd,oCtrl)
{
try
{
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if (wScreen.g_oPage.layerWindow == null)
{
wScreen.g_oPage.layerWindow = WCCtrl_newIdx(window,0);
wScreen.g_oPage.layerWindow.curCtrl = null;
wScreen.g_oPage.layerWindow.topIdx = -1;
wScreen.g_oPage.layerWindow.bottomIdx = -1;
wScreen.g_oPage.layerWindow.frameStack = new Array();
}
}
catch (ex)
{
}
}
function WCLayerWindow_create(wSrcWnd,sName,wScreen)
{
try
{
if (wScreen == null)
{
wScreen = wSrcWnd;
}
var oCtrl = null;
while (true)
{
if (WCObj_getObj(wScreen,sName) == null)
break;
WCCtrl_deleteObjByName(wScreen,sName);
}
var nObjIdx = 0;
if (nObjIdx > 0)
oCtrl = WCCtrl_newIdx(wScreen,nObjIdx);
else
oCtrl = WCCtrl_new(wScreen);
oCtrl.screenWindow = wScreen;
WCLayerWindow_initScreen(wSrcWnd,oCtrl);
wScreen.g_oPage.layerWindow.topIdx ++;
var nIdx = wScreen.g_oPage.layerWindow.topIdx;
wScreen.g_oPage.layerWindow.frameStack[nIdx] = oCtrl;
oCtrl.windowStackIdx = nIdx;
if (wScreen.g_oPage.layerWindow.bottomIdx < 0)
{
wScreen.g_oPage.layerWindow.bottomIdx = nIdx;
}
oCtrl.containerWindow = wSrcWnd;
oCtrl.name = sName;
oCtrl.dragElmt = null
oCtrl.callerWindow = null;
oCtrl.popupClientWidth = 0;
oCtrl.popupClientHeight = 0;
oCtrl.border = 1;
oCtrl.moveImgDivTop = Number(oCtrl.border);
oCtrl.moveImgDivLeft = Number(oCtrl.border) + Number(16);
oCtrl.resizable = false;
oCtrl.edgeBorderWidth = 20;
oCtrl.headerBgColor = "#2f5596";
oCtrl.headerBlurBgColor = "#888888";
oCtrl.headerHeight = 20;
oCtrl.borderColor = "#2f5596";
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var sImgPath = wSrcWnd.WCPage_getImgPathServer(wSrcWnd);
oCtrl.iconImg = sImgPath+"/button16.gif";
oCtrl.useIframe = true;
return oCtrl;
}
catch (e)
{
}
}
function WCLayerWindow_createDiv(wSrcWnd,sName,wScreen)
{
var oCtrl = WCLayerWindow_create(wSrcWnd,sName,wScreen);
oCtrl.useIframe = false;
}
function WCLayerWindow_setHeaderHeight(wSrcWnd,oCtrl,nHeight)
{
oCtrl.headerHeight = nHeight;
}
function WCLayerWindow_setHeaderBgColor(wSrcWnd,oCtrl,sColor)
{
oCtrl.headerBgColor = sColor;
}
function WCLayerWindow_setResizable(wSrcWnd,oCtrl,bResizable)
{
oCtrl.resizable= bResizable;
}
function WCLayerWindow_setBorder(wSrcWnd,oCtrl,nBorder)
{
oCtrl.border = nBorder;
oCtrl.edgeBorderWidth = nBorder + 20;
oCtrl.moveImgDivTop = Number(oCtrl.border);
oCtrl.moveImgDivLeft = Number(oCtrl.border) + Number(16);
}
function WCLayerWindow_setBorderColor(wSrcWnd,oCtrl,sColor)
{
oCtrl.borderColor = sColor;
}
function WCLayerWindow_blur(wSrcWnd,oCtrl)
{
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if (oCtrl != null)
{
var elHeader = wScreen.document.getElementById("elLayerWindowHeader_"+oCtrl.name);
if (elHeader != null)
{
elHeader.bgColor = oCtrl.headerBlurBgColor;
}
var elBorder = wScreen.document.getElementById("elPopupBorderTd_"+oCtrl.name);
if (elBorder != null)
{
elBorder.style.borderColor = oCtrl.headerBlurBgColor;
}
}
}
function WCLayerWindow_focus(wSrcWnd,oCtrl)
{
try
{
if (oCtrl == null)
return;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var nIdx = wScreen.g_oPage.layerWindow.topIdx;
var oTop = wScreen.g_oPage.layerWindow.frameStack[nIdx];
if (oCtrl == oTop)
return;
WCLayerWindow_focusEx(wSrcWnd,oCtrl);
}
catch (ex)
{
}
}
function WCLayerWindow_focusEx(wSrcWnd,oCtrl)
{
try
{
if (oCtrl == null)
return;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var nIdx = wScreen.g_oPage.layerWindow.topIdx;
var oTop = wScreen.g_oPage.layerWindow.frameStack[nIdx];
if (oTop != oCtrl)
{
WCLayerWindow_blur(wSrcWnd,oTop);
wScreen.g_oPage.layerWindow.frameStack[oCtrl.windowStackIdx] = oTop;
WCLayerWindow_setStackIdx(wSrcWnd,oTop,oCtrl.windowStackIdx)
wScreen.g_oPage.layerWindow.frameStack[nIdx] = oCtrl;
WCLayerWindow_setStackIdx(wSrcWnd,oCtrl,nIdx)
}
wScreen.g_oPage.layerWindow.curCtrl = oCtrl;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var elBorder = wScreen.document.getElementById("elPopupBorderTd_"+oCtrl.name);
if (elBorder != null)
{
elBorder.style.borderColor = oCtrl.borderColor;
}
var elHeader = wScreen.document.getElementById("elLayerWindowHeader_"+oCtrl.name);
if (elHeader != null)
{
elHeader.bgColor = oCtrl.headerBgColor;
}
}
catch (ex)
{
}
}
function WCLayerWindow_setStackIdx(wSrcWnd,oCtrl,nStackIdx)
{
oCtrl.windowStackIdx = nStackIdx;
var layerIndex = Number(oCtrl.windowStackIdx)+0;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var sName = oCtrl.name;
var elPopupDiv = wScreen.document.getElementById("elPopupDiv_"+sName);
if (elPopupDiv != null)
{
elPopupDiv.style.zIndex = (layerIndex*10 +0);
for (var i=0;i<12;i++)
{
elDiv = document.getElementById("elResizableDiv_"+sName+"_"+i);
if (elDiv != null)
{
elDiv.style.zIndex = (layerIndex*10 +3);
}
}
}
var elPopupBgFrameDiv = wScreen.document.getElementById("elPopupBgFrameDiv_"+sName);
if (elPopupBgFrameDiv != null)
elPopupBgFrameDiv.style.zIndex = (layerIndex*10 +0);
var elPopupDummyDiv = wScreen.document.getElementById("elPopupDummyDiv_"+sName);
if (elPopupDummyDiv != null)
elPopupDummyDiv.style.zIndex = (layerIndex*10 +0);
var elLayerWindowDiv = wScreen.document.getElementById("elLayerWindowDiv_"+sName);
if (elLayerWindowDiv != null)
elLayerWindowDiv.style.zIndex = (layerIndex*10 +0);
var elPopupMsgDiv = wScreen.document.getElementById("elPopupMsgDiv_"+sName);
if (elPopupMsgDiv != null)
elPopupMsgDiv.style.zIndex = (layerIndex*10 +0);
var elPopupHtmlDiv = wScreen.document.getElementById("elPopupHtmlDiv_"+sName);
if (elPopupHtmlDiv != null)
elPopupHtmlDiv.style.zIndex = (layerIndex*10 +0);
var elMoveDiv = wScreen.document.getElementById("elMoveDiv_"+sName);
if (elMoveDiv != null)
elMoveDiv.style.zIndex = (layerIndex*10 +2);
}
function WCLayerWindow_getFrameHtml(wSrcWnd,oCtrl,sIcon)
{
var layerIndex = Number(oCtrl.windowStackIdx)+0;
oCtrl.iconImg = sIcon;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var sImgPath = wSrcWnd.WCPage_getImgPathServer(wSrcWnd);
if (sImgPath == null)
return null;
var sName = oCtrl.name;
var sHtml = "";
sHtml += "<div id='elPopupDiv_"+sName+"' style='POSITION: absolute; z-index:"+(layerIndex*10 +0)+"; top:-4000px;left:-2000px; width:0; height:0; ' >";
sHtml += "<div id='elPopupBgFrameDiv_"+sName+"' style='POSITION: absolute; z-index:"+(0)+"; top:0px;left:0px' >";
if (oCtrl.useIframe == true)
{
sHtml += "<iframe id='elPopupBgFrame_"+sName+"' name='elPopupBgFrame_"+sName+"' frameborder='0' src='' style='z-index:"+(0)+";' border=0 scrolling=no STYLE='VISIBILITY: visible'></IFRAME>";
}
else
{
}
sHtml += "</div><!-- elPopupBgFrame_"+sName+" -->";
sHtml += "<div id='elPopupDummyDiv_"+sName+"' style='POSITION: absolute; z-index:"+(layerIndex*10 +0)+"; ' >";
sHtml += "<table border='0' cellpadding='0' cellspacing='0'>";
sHtml += "<tr>";
sHtml += "<td id=elPopupBorderTd_"+sName+" align=left valign=top style='border:"+oCtrl.borderColor+" "+oCtrl.border+"px solid;'>";
sHtml += "<table border='0' cellpadding='0' cellspacing='0'>";
if (oCtrl.headerHeight > 0)
{
sHtml += "<tr>";
sHtml += "<td id=elPopupBodyTbl_"+sName+" width=10 align=left valign=top>";
sHtml += "<table id=elLayerWindowHeader_"+oCtrl.name+" border='0' bgcolor='"+oCtrl.headerBgColor+"' cellpadding='0' cellspacing='0' ";
sHtml += "<tr>";
sHtml += "<td align=left valign=top height="+oCtrl.headerHeight+" width=16 style=\"padding:2,0,0,1;\" [안내]태그제한으로등록되지않습니다-ondblclick=\"xxjavascript:try{WCS.WCLayerWindow_doIc[안내]태그제한으로등록되지않습니다-onDblClick(window,'"+oCtrl.name+"');}catch(ex){}\" >";
sHtml += "<img alt border=0 src='"+oCtrl.iconImg+"' width=16></td>";
sHtml += "<td align=left valign=top width=4>";
sHtml += "<img alt border=0 height=2 src='"+sImgPath+"/trans.gif' width=4><br>";
sHtml += "</td>";
sHtml += "<td id=elHeaderWidthTd_"+sName+" align=left valign=top width=10>";
sHtml += "<div id=elTitle_"+sName+" style='POSITION:absolute; top:1; left:"+(16+4+oCtrl.border)+"; overflow:hidden; height:16px;'>";
sHtml += "</div>";
sHtml += "</td><td align=left width=17 valign=top style=\"padding:1,0,0,1;\" [안내]태그제한으로등록되지않습니다-xxonclick=\"xxjavascript:try{WCS.WCLayerWindow_doClose(window,WCS.WCObj_getObj(window,'"+oCtrl.name+"'));}catch(ex){}\">";
sHtml += "<img alt border=0 src='"+sImgPath+"/layerwindow/icon_close.gif'>";
sHtml += "</td></tr></table><!--header end-->";
sHtml += "</td>";
sHtml += "</tr>";
}
sHtml += "<tr>";
sHtml += "<td align=left valign=top id=elPopupClientTd_"+sName+">";
sHtml += "<div id='elLayerWindowDiv_"+sName+"' style='POSITION: absolute; z-index:"+(layerIndex*10 +0)+"; top:0px;left:0px; overflow:hidden;' >";
if (oCtrl.useIframe == true)
{
sHtml += "<iframe id='"+sName+"' name='"+sName+"' frameborder='0' src='' style='z-index:"+(layerIndex*10 +0)+";' border=0 scrolling=no STYLE='VISIBILITY: visible'></iframe>";
}
else
{
}
sHtml += "</div>";
sHtml += "<div id='elPopupMsgDiv_"+sName+"' style='POSITION: absolute; z-index:"+(layerIndex*10 +0)+";' >";
sHtml += "<table border='0' cellpadding='0' bgcolor='#ffffff' cellspacing='0'>\n";
sHtml += "<tr><td align=center id=elMsgCell_"+sName+" style=\"line-height: 13px; font-size: 11px; font-family: tahoma, Arial, Helvetica, sans-serif, 굴림; line-break:strict; word-break:break-all; \"></td></tr></table> \n";
sHtml += "</div>";
sHtml += "<div id='elPopupHtmlDiv_"+sName+"' style='POSITION: absolute; z-index:"+(layerIndex*10 +0)+"; left:-10000px;top:-10000px;width:0px;height:0px;overflow:hidden;'>";
sHtml += "</div>";
sHtml += "<img id=elSizeImg_"+sName+" alt border=0 src='"+sImgPath+"/trans.gif' height=1 width=1>";
sHtml += "</td>\n";
sHtml += "</tr>\n";
sHtml += "</table>";
sHtml += "</td>\n";
sHtml += "</tr>\n";
sHtml += "</table>\n";
sHtml += "</div>";
var nLeft = oCtrl.moveImgDivLeft;
var nTop = oCtrl.moveImgDivTop;
sHtml += "<div id=elMoveDiv_"+sName+" style='z-index:"+(layerIndex*10 +2)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:"+nTop+"; left:"+nLeft+";' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseup=\"xxjavascript:WCS.WCLayerWindow_doMouseUp(wSrcWnd,'"+sName+"');\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousemove=\"xxjavascript:WCS.WCLayerWindow_doMouseMove(wSrcWnd,'"+sName+"');\" ";
sHtml += " >\n";
var sBackgroundImg = ""+sImgPath+"/back.gif";
sHtml += "<img id=elMoveImg_"+sName+" alt border=0 width=0 height=0 src='"+sBackgroundImg+"'>";
sHtml += "</div><!-- elMoveDiv -->";
if (oCtrl.resizable == true || oCtrl.resizable == "true")
{
var nResizableBorderWeight = oCtrl.border;
var nEdgeBorderWidth = oCtrl.edgeBorderWidth;
var nCtrlWidth = oCtrl.popupClientWidth + (2*oCtrl.border);
var nCtrlHeight = oCtrl.popupClientHeight + (2*oCtrl.border) + oCtrl.headerHeight;
sHtml += "<div id=elResizableDiv_"+sName+"_0 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:0; left:0;' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='nw-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_0 alt border=0 width="+nResizableBorderWeight+" height="+nEdgeBorderWidth+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
sHtml += "<div id=elResizableDiv_"+sName+"_1 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:0; left:"+nResizableBorderWeight+";' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='nw-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_1 alt border=0 width="+(nEdgeBorderWidth-nResizableBorderWeight)+" height="+nResizableBorderWeight+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
sHtml += "<div id=elResizableDiv_"+sName+"_2 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:0; left:"+nEdgeBorderWidth+";' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='n-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_2 alt border=0 width="+(nCtrlWidth-(nEdgeBorderWidth)*2)+" height="+nResizableBorderWeight+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
sHtml += "<div id=elResizableDiv_"+sName+"_3 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:0; left:"+(nCtrlWidth-(nEdgeBorderWidth))+";' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='ne-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_3 alt border=0 width="+(nEdgeBorderWidth-nResizableBorderWeight)+" height="+nResizableBorderWeight+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
sHtml += "<div id=elResizableDiv_"+sName+"_4 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:0; left:"+(nCtrlWidth-nResizableBorderWeight)+";' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='ne-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_4 alt border=0 width="+nResizableBorderWeight+" height="+nEdgeBorderWidth+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
sHtml += "<div id=elResizableDiv_"+sName+"_5 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:"+nEdgeBorderWidth+"; left:"+(nCtrlWidth-nResizableBorderWeight)+";' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='e-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_5 alt border=0 width="+nResizableBorderWeight+" height="+(nCtrlHeight-nEdgeBorderWidth*2)+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
sHtml += "<div id=elResizableDiv_"+sName+"_6 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:"+(nCtrlHeight-nEdgeBorderWidth)+"; left:"+(nCtrlWidth-nResizableBorderWeight)+";' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='se-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_6 alt border=0 width="+nResizableBorderWeight+" height="+nEdgeBorderWidth+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
sHtml += "<div id=elResizableDiv_"+sName+"_7 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:"+(nCtrlHeight-nResizableBorderWeight)+"; left:"+(nCtrlWidth-nEdgeBorderWidth)+";' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='se-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_7 alt border=0 width="+(nEdgeBorderWidth-nResizableBorderWeight)+" height="+nResizableBorderWeight+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
sHtml += "<div id=elResizableDiv_"+sName+"_8 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:"+(nCtrlHeight-nResizableBorderWeight)+"; left:"+nEdgeBorderWidth+";' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='s-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_8 alt border=0 width="+(nCtrlWidth-(nEdgeBorderWidth)*2)+" height="+nResizableBorderWeight+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
sHtml += "<div id=elResizableDiv_"+sName+"_9 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:"+(nCtrlHeight-nResizableBorderWeight)+"; left:"+nResizableBorderWeight+";' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='sw-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_9 alt border=0 width="+(nEdgeBorderWidth-nResizableBorderWeight)+" height="+nResizableBorderWeight+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
sHtml += "<div id=elResizableDiv_"+sName+"_10 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:"+(nCtrlHeight-nEdgeBorderWidth)+"; left:0;' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='sw-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_10 alt border=0 width="+nResizableBorderWeight+" height="+nEdgeBorderWidth+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
sHtml += "<div id=elResizableDiv_"+sName+"_11 style='z-index:"+(layerIndex*10 +3)+"; FILTER: alpha(opacity=0); POSITION: absolute; top:"+nEdgeBorderWidth+"; left:0;' dragenabled ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmouseover=\"xxjavascript:this.style.cursor='w-resize'\" ";
sHtml += " [안내]태그제한으로등록되지않습니다-xxonmousedown=\"xxjavascript:WCS.WCLayerWindow_doResizableDivMouseDown(wSrcWnd,'"+sName+"');\" ";
sHtml += " > \n";
sHtml += "<img id=elResizableImg_"+sName+"_11 alt border=0 width="+nResizableBorderWeight+" height="+(nCtrlHeight-nEdgeBorderWidth*2)+" src='"+sBackgroundImg+"'>";
sHtml += "</div>\n";
}
sHtml += "</div><!-- elPopupDiv -->";
return sHtml;
}
function WCLayerWindow_doResizableDivMouseDown(wSrcWnd,sName)
{
try
{
var oCtrl = WCObj_getObj(wSrcWnd,sName);
for (var i=0;i<12;i++)
{
elDiv = document.getElementById("elResizableDiv_"+sName+"_"+i);
if (elDiv != null)
{
elDiv.style.filter = "alpha(opacity=25)";
}
}
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var elCurrent = WCLayerWindow_checkDrag(wSrcWnd,oCtrl,wScreen.event.srcElement);
if (null!=elCurrent)
{
var elPopupDiv = document.getElementById("elPopupDiv_"+sName);
var nCtrlTop = elPopupDiv.offsetTop;
var nCtrlLeft = elPopupDiv.offsetLeft;
var nMouseY = wSrcWnd.event.clientY;
var nMouseX = wSrcWnd.event.clientX;
var sResizableDivId = elCurrent.id;
var sResizableDivIdExp = "elResizableDiv_"+sName+"_";
var nCurrIdx = Number(sResizableDivId.substring(sResizableDivIdExp.length,sResizableDivId.length));
var nVerIdx = 0;
var nHorIdx = 0;
if (nCurrIdx < 5)
{
nVerIdx = 2;
}
else
{
nVerIdx = 8;
}
if (nCurrIdx < 2 || nCurrIdx > 8)
{
nHorIdx = 11;
}
else
{
nHorIdx = 5;
}
var elResizableVerDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nVerIdx);
var elResizableHorDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nHorIdx);
var nMousePositionInBorderY = nMouseY - (nCtrlTop + Number(elResizableVerDiv.style.top.substring(0,elResizableVerDiv.style.top.indexOf("px"))));
var nMousePositionInBorderX = nMouseX - (nCtrlLeft + Number(elResizableHorDiv.style.left.substring(0,elResizableHorDiv.style.left.indexOf("px"))));
oCtrl.resizeStartY = nMousePositionInBorderY;
oCtrl.resizeStartX = nMousePositionInBorderX;
oCtrl.resizeStart = true;
wScreen.document.documentElement.[안내]태그제한으로등록되지않습니다-xxonmousemove = function()
{
WCLayerWindow_doResizableDivMouseMove(wSrcWnd,sName,elCurrent);
}
wScreen.document.documentElement.[안내]태그제한으로등록되지않습니다-xxonmouseup = function()
{
WCLayerWindow_doResizableDivMouseUp(wSrcWnd,sName);
}
wScreen.document.documentElement.[안내]태그제한으로등록되지않습니다-[안내]태그제한으로등록되지않습니다-xxonselectstart = function()
{
return false;
}
wScreen.document.documentElement.[안내]태그제한으로등록되지않습니다-[안내]태그제한으로등록되지않습니다-ondragstart = function()
{
return false;
}
}
}
catch (ex)
{
}
}
function WCLayerWindow_doResizableDivMouseUp(wSrcWnd,sName)
{
try
{
var oCtrl = WCObj_getObj(wSrcWnd,sName);
oCtrl.resizeStart = false;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
wScreen.document.documentElement.[안내]태그제한으로등록되지않습니다-xxonmouseup = null;
wScreen.document.documentElement.[안내]태그제한으로등록되지않습니다-xxonmousemove = null;
wScreen.document.documentElement.[안내]태그제한으로등록되지않습니다-[안내]태그제한으로등록되지않습니다-xxonselectstart = null;
wScreen.document.documentElement.[안내]태그제한으로등록되지않습니다-[안내]태그제한으로등록되지않습니다-ondragstart = null;
for (var i=0;i<12;i++)
{
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,i);
if (elResizableDiv != null)
{
elResizableDiv.style.filter = "alpha(opacity=0)";
elResizableDiv.style.zindex = oCtrl.windowStackIdx*10 +3;
}
}
var elPopupDiv = wScreen.document.getElementById("elPopupDiv_"+sName+"");
var elResizableDivTop = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,2);
var elResizableDivLeft = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,11);
var nResizableImgTop = WCLayerWindow_getResizableImgElmt(wSrcWnd,sName,2).width;
var nResizableImgLeft = WCLayerWindow_getResizableImgElmt(wSrcWnd,sName,11).height;
var nCtrlTop = Number(elPopupDiv.style.top.substring(0,elPopupDiv.style.top.indexOf("px"))) + Number(elResizableDivTop.style.top.substring(0,elResizableDivTop.style.top.indexOf("px")));
var nCtrlLeft = Number(elPopupDiv.style.left.substring(0,elPopupDiv.style.left.indexOf("px"))) + Number(elResizableDivLeft.style.left.substring(0,elResizableDivLeft.style.left.indexOf("px")));
var nCtrlWidth = nResizableImgTop + oCtrl.edgeBorderWidth*2;
var nCtrlHeight = nResizableImgLeft + oCtrl.edgeBorderWidth*2;
oCtrl.popupClientWidth = nCtrlWidth - oCtrl.border*2;
oCtrl.popupClientHeight = nCtrlHeight - oCtrl.border*2 - oCtrl.headerHeight;
var nDiffY = elPopupDiv.style.pixelTop - nCtrlTop;
var nDiffX = elPopupDiv.style.pixelLeft - nCtrlLeft;
elPopupDiv.style.pixelTop = nCtrlTop;
elPopupDiv.style.pixelLeft = nCtrlLeft;
var elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,0);
elResizableDiv.style.top = 0;
elResizableDiv.style.left = 0;
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,1);
elResizableDiv.style.top = 0;
elResizableDiv.style.left = oCtrl.border;
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,2);
elResizableDiv.style.top = 0;
elResizableDiv.style.left = oCtrl.edgeBorderWidth;
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,3);
elResizableDiv.style.top = 0;
elResizableDiv.style.left = nCtrlWidth - oCtrl.edgeBorderWidth;
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,4);
elResizableDiv.style.top = 0;
elResizableDiv.style.left = nCtrlWidth - oCtrl.border;
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,5);
elResizableDiv.style.top = oCtrl.edgeBorderWidth;
elResizableDiv.style.left = nCtrlWidth - oCtrl.border;
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,6);
elResizableDiv.style.top = nCtrlHeight - oCtrl.edgeBorderWidth;
elResizableDiv.style.left = nCtrlWidth - oCtrl.border;
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,7);
elResizableDiv.style.top = nCtrlHeight - oCtrl.border;
elResizableDiv.style.left = nCtrlWidth - oCtrl.edgeBorderWidth;
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,8);
elResizableDiv.style.top = nCtrlHeight - oCtrl.border;
elResizableDiv.style.left = oCtrl.edgeBorderWidth;
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,9);
elResizableDiv.style.top = nCtrlHeight - oCtrl.border;
elResizableDiv.style.left = oCtrl.border;
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,10);
elResizableDiv.style.top = nCtrlHeight - oCtrl.edgeBorderWidth;
elResizableDiv.style.left = 0;
elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,11);
elResizableDiv.style.top = oCtrl.edgeBorderWidth;
elResizableDiv.style.left = 0;
var elLayerWindowDiv = wScreen.document.getElementById("elLayerWindowDiv_"+sName+"");
if (elLayerWindowDiv == null)
return;
elLayerWindowDiv.style.pixelTop = oCtrl.headerHeight + oCtrl.border;
elLayerWindowDiv.style.pixelLeft = 0 + oCtrl.border;
elLayerWindowDiv.style.pixelHeight = oCtrl.popupClientHeight;
var elFrame = wScreen.document.getElementById(""+""+""+sName+"");
if (elFrame != null)
{
elFrame.style.pixelWidth = oCtrl.popupClientWidth;
elFrame.style.pixelHeight = oCtrl.popupClientHeight;
}
var elPopupBgDiv = wScreen.document.getElementById("elPopupBgFrameDiv_"+sName+"");
if (elPopupBgDiv != null)
{
elPopupBgDiv.style.pixelTop = 0;
elPopupBgDiv.style.pixelLeft = 0;
elPopupBgDiv.style.pixelWidth = oCtrl.popupClientWidth+oCtrl.border*2;
if (oCtrl.headerHeight > 0)
elPopupBgDiv.style.pixelHeight = oCtrl.popupClientHeight+oCtrl.border*2+oCtrl.headerHeight;
else
elPopupBgDiv.style.pixelHeight = oCtrl.popupClientHeight+oCtrl.border*2;
}
var elPopupBgFrame = wScreen.document.getElementById("elPopupBgFrame_"+sName+"");
if (elPopupBgFrame != null)
{
elPopupBgFrame.style.pixelTop = 0;
elPopupBgFrame.style.pixelLeft = 0;
elPopupBgFrame.style.pixelWidth = oCtrl.popupClientWidth+oCtrl.border*2;
if (oCtrl.headerHeight > 0)
elPopupBgFrame.style.pixelHeight = oCtrl.popupClientHeight+oCtrl.border*2+oCtrl.headerHeight;
else
elPopupBgFrame.style.pixelHeight = oCtrl.popupClientHeight+oCtrl.border*2;
}
var elSizeImg = wScreen.document.getElementById("elSizeImg_"+sName+"");
if (elSizeImg != null)
{
elSizeImg.height = oCtrl.headerHeight;
elSizeImg.width = oCtrl.headerWidth;
}
var elHeaderWidth = wScreen.document.getElementById("elHeaderWidth_"+sName+"");
if (elHeaderWidth != null)
{
var nTextWidth = Number(oCtrl.popupClientWidth) - 16*2;
if (nTextWidth < 0)
{
nTextWidth = 0;
}
elHeaderWidth.width = nTextWidth;
}
var elHeaderWidthTd = wScreen.document.getElementById("elHeaderWidthTd_"+sName+"");
if (elHeaderWidthTd != null)
{
var nTextWidth = Number(oCtrl.popupClientWidth) - 16*2;
if (nTextWidth < 0)
{
nTextWidth = 0;
}
elHeaderWidthTd.width = nTextWidth;
}
var elPopupBodyTbl = wScreen.document.getElementById("elPopupBodyTbl_"+sName+"");
if (elPopupBodyTbl != null)
{
elPopupBodyTbl.width = oCtrl.popupClientWidth;
}
var elPopupClientTd = wScreen.document.getElementById("elPopupClientTd_"+sName+"");
if (elPopupClientTd != null)
{
elPopupClientTd.width = oCtrl.popupClientWidth;
elPopupClientTd.height = oCtrl.popupClientHeight;
}
var elTitle = wScreen.document.getElementById("elTitle_"+sName+"");
elTitle.style.pixelWidth = Number(oCtrl.popupClientWidth) - 10 - (2+16+4);;
var elMoveImg = wScreen.document.getElementById("elMoveImg_"+sName+"");
if (elMoveImg != null)
{
elMoveImg.width = nCtrlWidth-(oCtrl.border*2)-(16+16) + nDiffX;
}
}
catch (ex)
{
}
}
function WCLayerWindow_doResizableDivMouseMove(wSrcWnd,sName,elCurrent)
{
try
{
var oCtrl = WCObj_getObj(wSrcWnd,sName);
if (!oCtrl.resizeStart)
{
return;
}
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var nMouseY = wScreen.event.clientY + wScreen.document.body.scrollTop;
var nMouseX = wScreen.event.clientX + wScreen.document.body.scrollLeft;
var sResizableDivId = elCurrent.id;
var sResizableDivIdExp = "elResizableDiv_"+sName+"_";
var nCurrIdx = Number(sResizableDivId.substring(sResizableDivIdExp.length,sResizableDivId.length));
var elPopupDiv = document.getElementById("elPopupDiv_"+sName);
var nCtrlTop = elPopupDiv.offsetTop;
var nCtrlLeft = elPopupDiv.offsetLeft;
var nEdgeBorderWidth = oCtrl.edgeBorderWidth;
if (nCurrIdx != 5 && nCurrIdx != 11)
{
var nIdx = 0;
if (nCurrIdx < 5)
{
nIdx = 2;
}
else
{
nIdx = 8;
}
var elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx);
var nDivTop = parseInt(elResizableDiv.style.top.substring(0,elResizableDiv.style.top.indexOf("px")),0);
var nDiffY = (nMouseY - nCtrlTop) - nDivTop - oCtrl.resizeStartY;
var elResizableDivTop = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,2);
var elResizableDivBottom = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,8);
var nDiff = Number(elResizableDivBottom.style.top.substring(0,elResizableDivBottom.style.top.indexOf("px"))) - Number(elResizableDivTop.style.top.substring(0,elResizableDivTop.style.top.indexOf("px")));
var wClient = WCLayerWindow_getClientWindow(wSrcWnd,oCtrl);
if (!(nDiff < oCtrl.headerHeight + oCtrl.border*2 + oCtrl.edgeBorderWidth && ((nDiffY < 0 && nIdx == 8) || (nDiffY > 0 && nIdx == 2))))
{
var elResizableImgLeft3 = WCLayerWindow_getResizableImgElmt(wSrcWnd,sName,nIdx-3);
var elResizableDivLeft3 = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx-3);
var elResizableDivLeft2 = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx-2);
var elResizableDivLeft = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx-1);
var elResizableDivRight = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx+1);
var elResizableDivRight2 = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx+2);
var elResizableDivRight3 = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx+3);
var elResizableImgRight3 = WCLayerWindow_getResizableImgElmt(wSrcWnd,sName,nIdx+3);
elResizableDivLeft.style.top = Number(elResizableDivLeft.style.top.substring(0,elResizableDivLeft.style.top.indexOf("px"))) + nDiffY;
elResizableDiv.style.top = Number(elResizableDiv.style.top.substring(0,elResizableDiv.style.top.indexOf("px"))) + nDiffY;
elResizableDivRight.style.top = Number(elResizableDivRight.style.top.substring(0,elResizableDivRight.style.top.indexOf("px"))) + nDiffY;
elResizableDivLeft2.style.top = Number(elResizableDivLeft2.style.top.substring(0,elResizableDivLeft2.style.top.indexOf("px"))) + nDiffY;
elResizableDivRight2.style.top = Number(elResizableDivRight2.style.top.substring(0,elResizableDivRight2.style.top.indexOf("px"))) + nDiffY;
if (nIdx < 5)
{
elResizableDivLeft3.style.top = Number(elResizableDivLeft3.style.top.substring(0,elResizableDivLeft3.style.top.indexOf("px"))) + nDiffY;
elResizableDivRight3.style.top = Number(elResizableDivRight3.style.top.substring(0,elResizableDivRight3.style.top.indexOf("px"))) + nDiffY;
}
if (nIdx > 5)
{
nDiffY *= -1;
}
elResizableImgLeft3.height -= nDiffY;
elResizableImgRight3.height -= nDiffY;
}
}
if (nCurrIdx != 2 && nCurrIdx != 8)
{
var nIdx = 0;
if (nCurrIdx < 2 || nCurrIdx > 8)
{
nIdx = 11;
}
else
{
nIdx = 5;
}
var elResizableDiv = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx);
var nDivLeft = parseInt(elResizableDiv.style.left.substring(0,elResizableDiv.style.left.indexOf("px")),0);
var nDiffX = (nMouseX - nCtrlLeft) - nDivLeft - oCtrl.resizeStartX;
var elResizableDivLeft = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,11);
var elResizableDivRight = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,5);
var nDiff = Number(elResizableDivRight.style.left.substring(0,elResizableDivRight.style.left.indexOf("px"))) - Number(elResizableDivLeft.style.left.substring(0,elResizableDivLeft.style.left.indexOf("px")));
var wClient = WCLayerWindow_getClientWindow(wSrcWnd,oCtrl);
if (!(nDiff < 100 && ((nDiffX < 0 && nIdx == 5) || (nDiffX > 0 && nIdx == 11))))
{
var elResizableImgLeft3 = WCLayerWindow_getResizableImgElmt(wSrcWnd,sName,nIdx-3);
var elResizableDivLeft3 = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx-3);
var elResizableDivLeft2 = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx-2);
var elResizableDivLeft = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx-1);
var elResizableDivRight = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx+1);
var elResizableDivRight2 = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx+2);
var elResizableDivRight3 = WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx+3);
var elResizableImgRight3 = WCLayerWindow_getResizableImgElmt(wSrcWnd,sName,nIdx+3);
elResizableDivLeft.style.left = Number(elResizableDivLeft.style.left.substring(0,elResizableDivLeft.style.left.indexOf("px"))) + nDiffX;
elResizableDiv.style.left = Number(elResizableDiv.style.left.substring(0,elResizableDiv.style.left.indexOf("px"))) + nDiffX;
elResizableDivRight.style.left = Number(elResizableDivRight.style.left.substring(0,elResizableDivRight.style.left.indexOf("px"))) + nDiffX;
elResizableDivLeft2.style.left = Number(elResizableDivLeft2.style.left.substring(0,elResizableDivLeft2.style.left.indexOf("px"))) + nDiffX;
elResizableDivRight2.style.left = Number(elResizableDivRight2.style.left.substring(0,elResizableDivRight2.style.left.indexOf("px"))) + nDiffX;
if (nIdx < 2 || nIdx > 8)
{
elResizableDivLeft3.style.left = Number(elResizableDivLeft3.style.left.substring(0,elResizableDivLeft3.style.left.indexOf("px"))) + nDiffX;
elResizableDivRight3.style.left = Number(elResizableDivRight3.style.left.substring(0,elResizableDivRight3.style.left.indexOf("px"))) + nDiffX;
}
else
{
nDiffX *= -1;
}
elResizableImgLeft3.width -= nDiffX;
elResizableImgRight3.width -= nDiffX;
}
}
}
catch (ex)
{
}
}
function WCLayerWindow_getResizableDivElmt(wSrcWnd,sName,nIdx)
{
try
{
if (nIdx < 0)
{
nIdx = nIdx + 12;
}
else if (nIdx >= 12)
{
nIdx = nIdx - 12;
}
var elRet = document.getElementById("elResizableDiv_"+sName+"_"+nIdx);
return elRet;
}
catch (ex)
{
}
}
function WCLayerWindow_getResizableImgElmt(wSrcWnd,sName,nIdx)
{
try
{
if (nIdx < 0)
{
nIdx = nIdx + 12;
}
else if (nIdx >= 12)
{
nIdx = nIdx - 12;
}
var elRet = document.getElementById("elResizableImg_"+sName+"_"+nIdx);
return elRet;
}
catch (ex)
{
}
}
function WCLayerWindow_getHeaderHtml(wSrcWnd,oCtrl,sTitle)
{
try
{
if (wSrcWnd.WCLayerWindow_getHeaderHtmlEx != null)
{
var sHtml = wSrcWnd.WCLayerWindow_getHeaderHtmlEx(wSrcWnd,oCtrl,sTitle);
return sHtml;
}
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var sImgPath = wSrcWnd.WCPage_getImgPathServer(wSrcWnd);
var sHtml = "";
var sText = "" + sTitle+"";
sHtml += "<table border='0' cellpadding='0' cellspacing='0'><tr>";
sHtml += "<td style=\"color:'#ffffff'; line-height: 13px;font-size: 11px;font-family: tahoma, Arial, Helvetica, sans-serif, 굴림;line-break:strict; word-break:break-all;\" align=left valign=top><img alt border=0 height=3 src='"+sImgPath+"/trans.gif' width=4><br>"+sText+"</td>";
sHtml += "</tr></table>";
return sHtml;
}
catch (e)
{
}
}
function WCLayerWindow_setSizeFixedFrame(wSrcWnd,oCtrl,nWidth,nHeight)
{
var wClient = WCLayerWindow_getClientWindow(wSrcWnd,oCtrl);
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var sName = "";
var nType = 0;
{
sName = oCtrl.name;
}
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if (nType == 1)
{
var elPopupHtmlDiv = wClient.document.getElementById("elPopupHtmlDiv_"+sName+"");
if (elPopupHtmlDiv == null)
return;
elPopupHtmlDiv.style.pixelTop = oCtrl.headerHeight + oCtrl.border;
elPopupHtmlDiv.style.pixelLeft = 0 + oCtrl.border;
}
else
{
var elLayerWindowDiv = wClient.document.getElementById("elLayerWindowDiv_"+sName+"");
if (elLayerWindowDiv == null)
return;
elLayerWindowDiv.style.pixelTop = 0;
elLayerWindowDiv.style.pixelLeft = 0;
var elFrame = wClient.document.getElementById(sName);
if (elFrame == null)
return;
elFrame.style.pixelWidth = nWidth;
elFrame.style.pixelHeight = nHeight-115;
}
var elSizeImg = wClient.document.getElementById("elSizeImg_"+sName+"");
if (elSizeImg != null)
{
}
}
function WCLayerWindow_open(wSrcWnd,oCtrl)
{
var sTitle = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"title");
var sIcon = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"icon");
var nLeft = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"left");
var nTop = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"top");
var nWidth = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"width");
var nHeight = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"height");
var elForm = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"form");
var nBorder = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"border");
if (nBorder != null)
{
WCLayerWindow_setBorder(window,oCtrl,nBorder);
}
var bResizable = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"resizable");
if (bResizable != null)
{
WCLayerWindow_setResizable(window,oCtrl,bResizable);
}
var sBorderColor = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"borderColor");
if (sBorderColor != null)
{
WCLayerWindow_setBorderColor(window,oCtrl,sBorderColor);
}
var sHeaderBgColor = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"headerBgColor");
if (sHeaderBgColor != null)
{
WCLayerWindow_setHeaderBgColor(window,oCtrl,sHeaderBgColor);
}
WCLayerWindow_open2(wSrcWnd,oCtrl,elForm,sTitle,sIcon,nLeft,nTop,nWidth,nHeight,null,null,null);
}
function WCLayerWindow_open2(wSrcWnd,oCtrl,elForm,sTitle,sIcon,nLeft,nTop,nWidth,nHeight,sHtml,bShowMsg,sMsgHtml)
{
try
{
var bRet = WCLayerWindow_open3(wSrcWnd,oCtrl,elForm,sTitle,sIcon,nLeft,nTop,nWidth,nHeight,sHtml,bShowMsg,sMsgHtml);
if (bRet == false)
{
return false;
}
var sName = oCtrl.name;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if (elForm != null)
{
elForm.target = ""+""+""+sName;
if (oCtrl.debugType == 1)
{
elForm.target = "_blank";
}
wScreen.WCPage_submitForm(wSrcWnd,oCtrl,elForm);
}
WCLayerWindow_openEx(wSrcWnd,oCtrl,sTitle,nLeft,nTop,nWidth,nHeight,bShowMsg);
var elPopupDiv = wScreen.document.getElementById("elPopupDiv_"+sName+"");
if (elPopupDiv != null)
{
WCLayerWindow_focusEx(wSrcWnd,oCtrl);
}
return true;
}
catch (e)
{
}
}
function WCLayerWindow_openByUrl(wSrcWnd,oCtrl,sUrl)
{
try
{
var sTitle = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"title");
var sIcon = WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"icon");
var nLeft = WCString_parseInt(WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"left"));
var nTop = WCString_parseInt(WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"top"));
var nWidth = WCString_parseInt(WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"width"));
var nHeight = WCString_parseInt(WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,"height"));
var bShowMsg = true;
var sMsgHtml = null;
var sHtml = null;
WCLayerWindow_open3(wSrcWnd,oCtrl,null,sTitle,sIcon,nLeft,nTop,nWidth,nHeight,sHtml,bShowMsg,sMsgHtml);
var sName = oCtrl.name;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var wIframeElmt = wScreen.document.getElementById(sName);
if (wIframeElmt != null)
{
wIframeElmt.src = sUrl;
}
WCLayerWindow_openEx(wSrcWnd,oCtrl,sTitle,nLeft,nTop,nWidth,nHeight,bShowMsg);
var elPopupDiv = wScreen.document.getElementById("elPopupDiv_"+sName+"");
if (elPopupDiv != null)
{
WCLayerWindow_focusEx(wSrcWnd,oCtrl);
}
return true;
}
catch (e)
{
}
}
function WCLayerWindow_open3(wSrcWnd,oCtrl,elForm,sTitle,sIcon,nLeft,nTop,nWidth,nHeight,sHtml,bShowMsg,sMsgHtml)
{
try
{
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
oCtrl.screenWindow = wScreen;
oCtrl.popupClientWidth = nWidth;
oCtrl.popupClientHeight = nHeight;
var sName = oCtrl.name;
if (wScreen.g_oPage.layerWindow.curCtrl != null)
{
WCLayerWindow_blur(wSrcWnd,wScreen.g_oPage.layerWindow.curCtrl);
}
var elPopup = wScreen.document.getElementById("wdl_layerwindow");
if (elPopup == null)
{
return false;
}
var elPopupDiv = wScreen.document.getElementById("elPopupDiv_"+sName+"");
if (elPopupDiv == null)
{
var sFrameHtml = WCLayerWindow_getFrameHtml(wSrcWnd,oCtrl,sIcon);
if (sFrameHtml == null)
return false;
elPopup.insertAdjacentHTML("afterBegin",sFrameHtml);
}
else
{
WCLayerWindow_resetSize(wSrcWnd,oCtrl);
}
wScreen.g_oPage.layerWindow.curCtrl = oCtrl;
if (wScreen.g_oPage.layerWindow.curCtrl != null)
{
sName = wScreen.g_oPage.layerWindow.curCtrl.name;
wScreen.g_oPage.layerWindow.curCtrl.wSrcWnd = wSrcWnd;
}
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var elLayerWindowDiv = wScreen.document.getElementById("elLayerWindowDiv_"+sName+"");
if (elLayerWindowDiv != null && sHtml != null && elForm == null)
{
var wClient = WCLayerWindow_getClientWindow(wSrcWnd,oCtrl);
var elBody = wClient.window.document.getElementById("elBody");
if (elBody == null)
{
var sBuf = "";
var sHome = wSrcWnd.WCPage_getWebHome();
if (sHome == null)
{
return null;
}
sBuf += "<body id=elBody scroll=auto bgcolor=\"#ffffff\" text=\"#000000\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">";
sBuf += sHtml;
sBuf += "</body>";
wClient.window.document.write(sBuf);
}
else
{
elBody.innerHTML = sHtml;
}
}
}
catch (e)
{
}
}
function WCLayerWindow_insertHtml(wSrcWnd,oCtrl,sHtml)
{
try
{
var wClient = WCLayerWindow_getClientWindow(wSrcWnd,oCtrl);
var oBody = wClient.document.body;
oBody.insertAdjacentHTML("beforeEnd",sHtml);
oBody.scrollTop = 100000;
}
catch (ex)
{
}
}
function WCLayerWindow_openEx(wSrcWnd,oCtrl,sTitle,nLeft,nTop,nWidth,nHeight,bShowMsg)
{
try
{
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var sName = oCtrl.name;
if (wScreen != null)
{
}
var nType = 0;
if (wScreen.g_oPage.layerWindow.curCtrl != null)
{
sName = wScreen.g_oPage.layerWindow.curCtrl.name;
nType = Number(wScreen.g_oPage.layerWindow.curCtrl.type);
}
oCtrl.popupClientWidth = nWidth;
oCtrl.popupClientHeight = nHeight;
oCtrl.callerWindow = wSrcWnd;
var elPopupDiv = wScreen.document.getElementById("elPopupDiv_"+sName+"");
if (elPopupDiv == null)
return;
if (elPopupDiv.style.pixelTop < 0)
elPopupDiv.style.pixelTop = nTop;
if (elPopupDiv.style.pixelLeft < 0)
elPopupDiv.style.pixelLeft = nLeft;
if (elPopupDiv.style.pixelTop != nTop)
elPopupDiv.style.pixelTop = nTop;
if (elPopupDiv.style.pixelLeft != nLeft)
elPopupDiv.style.pixelLeft = nLeft;
if (nType == 1)
{
}
else
{
if (bShowMsg == true)
{
var sMsg = "Please, Wait";
if (wSrcWnd.WCLayerWindow_getWaitMessage != null)
{
sMsg = wSrcWnd.WCLayerWindow_getWaitMessage(wSrcWnd,oCtrl);
WCLayerWindow_showMessage(wSrcWnd,oCtrl,sMsg,nWidth,nHeight);
}
}
}
WCLayerWindow_setSize(wSrcWnd,oCtrl,nWidth,nHeight);
var elTitle = wScreen.document.getElementById("elTitle_"+sName+"");
if (elTitle != null)
{
var sHtml = WCLayerWindow_getHeaderHtml(wSrcWnd,oCtrl,sTitle);
elTitle.innerHTML = sHtml;
var nTextWidth = Number(nWidth) - 10 - (2+16+4);
if (nTextWidth < 0)
{
nTextWidth = 0;
}
elTitle.style.pixelWidth = nTextWidth;
elTitle.style.pixelTop = 1+oCtrl.border;
}
var elMoveDiv = wScreen.document.getElementById("elMoveDiv_"+sName+"");
if (elMoveDiv != null)
{
var nLeft = elMoveDiv.style.left;
}
var elMoveImg = wScreen.document.getElementById("elMoveImg_"+sName+"");
if (elMoveImg != null)
{
if (oCtrl.headerHeight > 0)
{
var nHeight = Number(oCtrl.headerHeight);
elMoveImg.width = nWidth-(oCtrl.border*2)-(16+16);
elMoveImg.height = nHeight;
}
else if (oCtrl.headerHeight < 0)
{
elMoveImg.width = nWidth-(oCtrl.border*2);
elMoveImg.height = Number(nHeight) + Number(oCtrl.border)*2;
}
}
var elHeaderWidth = wScreen.document.getElementById("elHeaderWidth_"+sName+"");
if (elHeaderWidth != null)
{
var nTextWidth = Number(nWidth) - 16*2;
if (nTextWidth < 0)
{
nTextWidth = 0;
}
elHeaderWidth.width = nTextWidth;
}
var elHeaderWidthTd = wScreen.document.getElementById("elHeaderWidthTd_"+sName+"");
if (elHeaderWidthTd != null)
{
var nTextWidth = Number(nWidth) - 16*2;
if (nTextWidth < 0)
{
nTextWidth = 0;
}
elHeaderWidthTd.width = nTextWidth;
}
var elPopupBodyTbl = wScreen.document.getElementById("elPopupBodyTbl_"+sName+"");
if (elPopupBodyTbl != null)
{
elPopupBodyTbl.width = nWidth;
}
var elPopupClientTd = wScreen.document.getElementById("elPopupClientTd_"+sName+"");
if (elPopupClientTd != null)
{
elPopupClientTd.width = nWidth;
elPopupClientTd.height = nHeight;
}
oCtrl.clientWindow = eval("wScreen."+sName);
}
catch (e)
{
}
}
function WCLayerWindow_doMouseMove(wSrcWnd,sName)
{
try
{
var oCtrl = WCObj_getObj(wSrcWnd,sName);
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var sWndName = wSrcWnd.name;
if ((1 == wScreen.event.button) && (oCtrl.dragElmt != null))
{
var intTop = wScreen.event.clientY + wScreen.document.body.scrollTop;
var intLeft = wScreen.event.clientX + wScreen.document.body.scrollLeft;
var intLessTop = 0;
var intLessLeft = 0;
var elCurrent = oCtrl.dragElmt.offsetParent;
while (elCurrent.offsetParent!=null)
{
intLessTop += elCurrent.offsetTop;
intLessLeft += elCurrent.offsetLeft;
elCurrent = elCurrent.offsetParent;
}
if (intTop >= 0 && intLeft >= 0 && intLeft <= wScreen.document.body.offsetWidth && intTop <= wScreen.document.body.offsetHeight)
{
oCtrl.intLeft = intLeft;
oCtrl.intTop = intTop;
oCtrl.dragElmt.style.pixelTop = Number(intTop) - Number(intLessTop) - Number(oCtrl.dragElmt.y);
oCtrl.dragElmt.style.pixelLeft = Number(intLeft) - Number(intLessLeft) - Number(oCtrl.dragElmt.x);
oCtrl.dragElmt.style.pixelTop -= oCtrl.moveImgDivTop;
oCtrl.dragElmt.style.pixelLeft -= oCtrl.moveImgDivLeft;
}
wScreen.event.returnValue = false;
};
}
catch (e)
{
}
};
function WCLayerWindow_checkDrag(wSrcWnd,oCtrl,elCheck)
{
while (elCheck!=null)
{
if (null!=elCheck.getAttribute("dragEnabled"))
return elCheck;
elCheck = elCheck.parentElement;
}
return null
}
function WCLayerWindow_doHeaderMouseDown(wSrcWnd,sName)
{
try
{
var oCtrl = WCObj_getObj(wSrcWnd,sName);
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
WCLayerWindow_doMouseDown(wSrcWnd,sName);
}
catch (ex)
{
}
}
function WCLayerWindow_doMouseDown(wSrcWnd,sName)
{
try
{
var oCtrl = WCObj_getObj(wSrcWnd,sName);
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if (sName != null)
{
var oCtrl = WCObj_getObj(wScreen,sName);
if (wScreen.g_oPage.layerWindow.curCtrl != oCtrl)
{
WCLayerWindow_blur(wScreen,wScreen.g_oPage.layerWindow.curCtrl);
WCLayerWindow_focus(wScreen,oCtrl);
}
}
var oCtrl = null;
if (wScreen.g_oPage.layerWindow.curCtrl != null)
{
sName = wScreen.g_oPage.layerWindow.curCtrl.name;
wSrcWnd = wScreen.g_oPage.layerWindow.curCtrl.wSrcWnd;
oCtrl = wScreen.g_oPage.layerWindow.curCtrl;
}
else
{
return;
}
var elCurrent = WCLayerWindow_checkDrag(wSrcWnd,oCtrl,wScreen.event.srcElement);
if (null!=elCurrent)
{
oCtrl.dragElmt = elCurrent;
oCtrl.dragElmt.x = wScreen.event.offsetX;
oCtrl.dragElmt.y = wScreen.event.offsetY;
var op = wScreen.event.srcElement;
if ((oCtrl.dragElmt!=op.offsetParent) && (oCtrl.dragElmt!=wScreen.event.srcElement))
{
while (op!=oCtrl.dragElmt)
{
oCtrl.dragElmt.x += op.offsetLeft;
oCtrl.dragElmt.y += op.offsetTop;
op=op.offsetParent;
}
}
var elMoveDiv = wScreen.document.getElementById("elMoveDiv_"+sName+"");
if (elMoveDiv != null)
{
elMoveDiv.style.pixelTop = 0;
elMoveDiv.style.pixelLeft = 0;
elMoveDiv.style.filter = "alpha(opacity=25)";
}
var elMoveImg = wScreen.document.getElementById("elMoveImg_"+sName+"");
if (elMoveImg != null)
{
elMoveImg.width = oCtrl.popupClientWidth+oCtrl.border*2;
elMoveImg.height = oCtrl.popupClientHeight+oCtrl.border*2+oCtrl.headerHeight;
}
oCtrl.dragStart = true;
oCtrl.dragStop = false;
}
}
catch (e)
{
}
}
function WCLayerWindow_doMouseUp(wSrcWnd,sName)
{
try
{
var oCtrl = WCObj_getObj(wSrcWnd,sName);
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if ((1 == wScreen.event.button) && (oCtrl.dragElmt != null))
{
var intTop = wScreen.event.clientY + wScreen.document.body.scrollTop - wScreen.document.body.clientTop;
var intLeft = wScreen.event.clientX + wScreen.document.body.scrollLeft - wScreen.document.body.clientLeft;
var intLessTop = 0;
var intLessLeft = 0;
var elCurrent = oCtrl.dragElmt.offsetParent;
var elPopupDiv = wScreen.document.getElementById("elPopupDiv_"+sName+"");
if (elPopupDiv != null)
{
if (intTop >= 0 && intLeft >= 0 && intLeft <= wScreen.document.body.offsetWidth && intTop <= wScreen.document.body.offsetHeight)
{
oCtrl.intLeft = intLeft;
oCtrl.intTop = intTop;
}
elPopupDiv.style.pixelTop = oCtrl.intTop - (oCtrl.moveImgDivTop+oCtrl.dragElmt.y);
elPopupDiv.style.pixelLeft = oCtrl.intLeft - (Number(oCtrl.moveImgDivLeft)+oCtrl.dragElmt.x);
var elMoveDiv = wScreen.document.getElementById("elMoveDiv_"+sName+"");
if (elMoveDiv != null)
{
elMoveDiv.style.pixelTop = oCtrl.moveImgDivTop;
elMoveDiv.style.pixelLeft = oCtrl.moveImgDivLeft;
elMoveDiv.style.filter = "alpha(opacity=0)";
}
var elMoveImg = wScreen.document.getElementById("elMoveImg_"+sName+"");
if (elMoveImg != null)
{
if (oCtrl.headerHeight > 0)
{
elMoveImg.width = oCtrl.popupClientWidth-(oCtrl.border*2)-(16+16);
elMoveImg.height = oCtrl.headerHeight;
}
else
{
}
}
}
}
oCtrl.dragElmt=null;
}
catch (e)
{
}
}
function WCLayerWindow_doSelectStart(wSrcWnd,sName)
{
try
{
var nType = 0;
var oCtrl = WCObj_getObj(wSrcWnd,sName);
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
if (wScreen.g_oPage.layerWindow.curCtrl != null)
{
nType = Number(wScreen.g_oPage.layerWindow.curCtrl.type);
}
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
return (null==WCLayerWindow_checkDrag(wSrcWnd,oCtrl,wScreen.event.srcElement) && (oCtrl.dragElmt!=null))
}
catch (e)
{
}
}
function WCLayerWindow_getPopupAncestor(wSrcWnd,wnd)
{
if (this == parent)
return this;
var oPopupWnd = null;
var oWnd = wnd;
while (true)
{
if (oWnd == null)
break;
if (oWnd.WCLayerWindow_open != null)
oPopupWnd = oWnd;
if (oWnd.parent == null)
break;
if (oWnd == oWnd.parent)
break;
oWnd = oWnd.parent;
}
return oPopupWnd;
}
function WCLayerWindow_doIc[안내]태그제한으로등록되지않습니다-onDblClick(wSrcWnd,sCtrlName)
{
try
{
var oCtrl = WCObj_getObj(wSrcWnd,sCtrlName);
var wCaller = WCLayerWindow_getCallerWindow(wSrcWnd,oCtrl);
WCLayerWindow_doClose(wCaller,oCtrl);
}
catch (ex)
{
}
}
function WCLayerWindow_setCtrlProperty(wSrcWnd,oCtrl,sProp,sValue)
{
if (oCtrl.ctrlProperty == null)
{
oCtrl.ctrlProperty = WCProperties_new();
}
WCProperties_setValue(oCtrl.ctrlProperty,sProp,sValue);
}
function WCLayerWindow_getCtrlProperty(wSrcWnd,oCtrl,sProp)
{
var sValue = WCProperties_getStrValue(oCtrl.ctrlProperty,sProp);
return sValue;
}
function WCLayerWindow_resetSize(wSrcWnd,oCtrl)
{
var sName = oCtrl.name;
var wScreen = WCLayerWindow_getScreen(wSrcWnd,oCtrl);
var nResizableBorderWeight = oCtrl.border;
var nEdgeBorderWidth = oCtrl.edgeBorderWidth;
var nCtrlWidth = oCtrl.popupClientWidth + (2*oCtrl.border);
var nCtrlHeight = oCtrl.popupClientHeight + (2*oCtrl.border) + oCtrl.headerHeight;
if (oCtrl.resizable == true || oCtrl.resizable == "true")
{
var elResizableDiv0 = wScreen.document.getElementById("elResizableDiv_"+sName+"_0");
if (elResizableDiv0 != null)
{
elResizableDiv0.style.top = 0;
elResizableDiv0.style.left = 0;
}
var elResizableImg0 = wScreen.document.getElementById("elResizableImg_"+sName+"_0");
if (elResizableImg0 != null)
{
elResizableImg0.width = nResizableBorderWeight;
elResizableImg0.height = nEdgeBorderWidth;
}
var elResizableDiv1 = wScreen.document.getElementById("elResizableDiv_"+sName+"_1");
if (elResizableDiv1 != null)
{
elResizableDiv1.style.top = 0;
elResizableDiv1.style.left = nResizableBorderWeight;
}
var elResizableImg1 = wScreen.document.getElementById("elResizableImg_"+sName+"_1");
if (elResizableImg1 != null)
{
elResizableImg1.width = nEdgeBorderWidth-nResizableBorderWeight;
elResizableImg1.height = nResizableBorderWeight;
}
var elResizableDiv2 = wScreen.document.getElementById("elResizableDiv_"+sName+"_2");
if (elResizableDiv2 != null)
{
elResizableDiv2.style.top = 0;
elResizableDiv2.style.left = nEdgeBorderWidth;
}
var elResizableImg2 = wScreen.document.getElementById("elResizableImg_"+sName+"_2");
if (elResizableImg2 != null)
{
elResizableImg2.width = nCtrlWidth-(nEdgeBorderWidth)*2;
elResizableImg2.height = nResizableBorderWeight;
}
var elResizableDiv3 = wScreen.document.getElementById("elResizableDiv_"+sName+"_3");
if (elResizableDiv3 != null)
{
elResizableDiv3.style.top = 0;
elResizableDiv3.style.left = nCtrlWidth-(nEdgeBorderWidth);
}
var elResizableImg3 = wScreen.document.getElementById("elResizableImg_"+sName+"_3");
if (elResizableImg3 != null)
{
elResizableImg3.width = nEdgeBorderWidth-nResizableBorderWeight;
elResizableImg3.height = nResizableBorderWeight;
}
var elResizableDiv4 = wScreen.document.getElementById("elResizableDiv_"+sName+"_4");
if (elResizableDiv4 != null)
{
elResizableDiv4.style.top = 0;
elResizableDiv4.style.left = nCtrlWidth-nResizableBorderWeight;
}
var elResizableImg4 = wScreen.document.getElementById("elResizableImg_"+sName+"_4");
if (elResizableImg4 != null)
{
elResizableImg4.width = nResizableBorderWeight;
elResizableImg4.height = nEdgeBorderWidth;
}
var elResizableDiv5 = wScreen.document.getElementById("elResizableDiv_"+sName+"_5");
if (elResizableDiv5 != null)
{
elResizableDiv5.style.top = nEdgeBorderWidth;
elResizableDiv5.style.left = nCtrlWidth-nResizableBorderWeight;
}
var elResizableImg5 = wScreen.document.getElementById("elResizableImg_"+sName+"_5");
if (elResizableImg5 != null)
{
elResizableImg5.width = nResizableBorderWeight;
elResizableImg5.height = nCtrlHeight-nEdgeBorderWidth*2;
}
var elResizableDiv6 = wScreen.document.getElementById("elResizableDiv_"+sName+"_6");
if (elResizableDiv6 != null)
{
elResizableDiv6.style.top = nCtrlHeight-nEdgeBorderWidth;
elResizableDiv6.style.left = nCtrlWidth-nResizableBorderWeight;
}
var elResizableImg6 = wScreen.document.getElementById("elResizableImg_"+sName+"_6");
if (elResizableImg6 != null)
{
elResizableImg6.width = nResizableBorderWeight;
elResizableImg6.height = nEdgeBorderWidth;
}
var elResizableDiv7 = wScreen.document.getElementById("elResizableDiv_"+sName+"_7");
if (elResizableDiv7 != null)
{
elResizableDiv7.style.top = nCtrlHeight-nResizableBorderWeight;
elResizableDiv7.style.left = nCtrlWidth-nEdgeBorderWidth;
}
var elResizableImg7 = wScreen.document.getElementById("elResizableImg_"+sName+"_7");
if (elResizableImg7 != null)
{
elResizableImg7.width = nEdgeBorderWidth-nResizableBorderWeight;
elResizableImg7.height = nResizableBorderWeight;
}
var elResizableDiv8 = wScreen.document.getElementById("elResizableDiv_"+sName+"_8");
if (elResizableDiv8 != null)
{
elResizableDiv8.style.top = nCtrlHeight-nResizableBorderWeight;
elResizableDiv8.style.left = nEdgeBorderWidth;
}
var elResizableImg8 = wScreen.document.getElementById("elResizableImg_"+sName+"_8");
if (elResizableImg8 != null)
{
elResizableImg8.width = nCtrlWidth-(nEdgeBorderWidth)*2;
elResizableImg8.height = nResizableBorderWeight;
}
var elResizableDiv9 = wScreen.document.getElementById("elResizableDiv_"+sName+"_9");
if (elResizableDiv9 != null)
{
elResizableDiv9.style.top = nCtrlHeight-nResizableBorderWeight;
elResizableDiv9.style.left = nResizableBorderWeight;
}
var elResizableImg9 = wScreen.document.getElementById("elResizableImg_"+sName+"_9");
if (elResizableImg9 != null)
{
elResizableImg9.width = nEdgeBorderWidth-nResizableBorderWeight;
elResizableImg9.height = nResizableBorderWeight;
}
var elResizableDiv10 = wScreen.document.getElementById("elResizableDiv_"+sName+"_10");
if (elResizableDiv10 != null)
{
elResizableDiv10.style.top = nCtrlHeight-nEdgeBorderWidth;
elResizableDiv10.style.left = 0;
}
var elResizableImg10 = wScreen.document.getElementById("elResizableImg_"+sName+"_10");
if (elResizableImg10 != null)
{
elResizableImg10.width = nResizableBorderWeight;
elResizableImg10.height = nEdgeBorderWidth;
}
var elResizableDiv11 = wScreen.document.getElementById("elResizableDiv_"+sName+"_11");
if (elResizableDiv11 != null)
{
elResizableDiv11.style.top = nEdgeBorderWidth;
elResizableDiv11.style.left = 0;
}
var elResizableImg11 = wScreen.document.getElementById("elResizableImg_"+sName+"_11");
if (elResizableImg11 != null)
{
elResizableImg11.width = nResizableBorderWeight;
elResizableImg11.height = nCtrlHeight-nEdgeBorderWidth*2;
}
var elMoveImg = wScreen.document.getElementById("elMoveImg_"+sName+"");
if (elMoveImg != null)
{
elMoveImg.width = oCtrl.popupClientWidth+oCtrl.border*2;
}
}
}
-- WCLayerWindow.js 소스 끝
아래의 소스가 완벽히 실행하기 위해서는 WCPage,WCProperties,WCVector,WCLog,WCSystem 등의 source코드가 필요합니다.
이러한 java source는 Web Development Library(http://www.webdevlib.net )에서 download 받아 사용하실 수 있습니다.
물론 www.webdevlib.net에서 소스코드를 받지 않고, 아래의 소스 코드를 수정하여 사용하실 수도 있습니다.
의도적으로 소스코드의 일부만 글로 쓰는 것은 아닙니다. 모든 소스에 대한 설명은 차차 하겠습니다.
첨부파일 : layerwindow1.zip
layerwindow1.jsp
WCLayerWindow.js
WCPage.js
출처 : 고급 웹 UI 개발 라이브러리 Web Development Library 소스공개 : http://www.webdevlib.net