You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
281 lines
11 KiB
281 lines
11 KiB
/********************* frame.jsp *********************************************************************************************************************************/ |
|
function checkloading(){ |
|
try{ |
|
if(document.frames.main){ |
|
//$(document.frames.main.document.head).append('<meta http-equiv="X-UA-Compatible content="IE=8"'); |
|
var $mainbody = $(document.frames.main.document.body); |
|
var isloading = document.frames.main.document.readyState!='complete' && document.frames.main.document.readyState!= 'interactive'; |
|
if(!isloading){ |
|
for(var i=0; i<document.frames.main.document.frames.length; i++){ |
|
if(document.frames.main.document.frames[i].document.readyState!='complete' && document.frames.main.document.frames[i].document.readyState!= 'interactive'){ |
|
isloading=true; |
|
} |
|
} |
|
} |
|
if(isloading){ |
|
if($mainbody.find('.frameblock').length==0){ |
|
$mainbody.find('#custom_indicator').remove(); |
|
$mainbody.append('<div class="frameblock" style="text-align: center; color: #000; background-color: #fff; font-family: dotum; font-size: 13px; font-weight: bold;position: absolute;top:0;left:0;width:100%;height:'+$mainbody.prop('scrollHeight')+'px; z-index: 1001; opacity: 0.5;-ms-filter:\'progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\';filter:alpha(opacity=50);"><div style="margin-top:'+($mainbody.height()/2-25)+'px;opacity: 1;-ms-filter:\'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)\';filter:alpha(opacity=100);"><img src="/totsys/common/js/img/ajax-loader1.gif"> 처리중입니다...</div></div>'); |
|
} |
|
}else{ |
|
$mainbody.find('.frameblock').remove(); |
|
} |
|
} |
|
}catch(e){ |
|
try{ |
|
//console.log(e); |
|
}catch(e){} |
|
} |
|
setTimeout(checkloading,300); |
|
} |
|
|
|
var hasCloseBtn = false; |
|
var frameset1rows, frameset2cols; |
|
function overrideOpen(win){ |
|
//팝업 레이어 사용안함 |
|
if(true)return; |
|
frameset1rows = document.getElementsByTagName('frameset')[0].rows; |
|
frameset2cols = document.getElementsByTagName('frameset')[1].cols; |
|
win.originalOpen = win.open; |
|
win.open = function(url,winname,param){ |
|
if(url.indexOf('displayXUI') > -1){ |
|
win.originalOpen(url,winname,param); |
|
return; |
|
} |
|
var $mainbody = $(document.frames.main.document.body); |
|
if(param)param = param.toLowerCase(); |
|
var width = param.split('width=')[1].split(',')[0]; |
|
var height = param.split('height=')[1].split(',')[0]; |
|
var x = $mainbody.width()/2-width/2; |
|
x = parseInt(x); |
|
var y = $mainbody.height()/2-height/2; |
|
y = parseInt(y); |
|
if(x<0)x = 0; |
|
if(y<0)y = 0; |
|
try{ |
|
var zidx = 1000+$mainbody.find('.popframeblock').length; |
|
var html='<div class="popframeblock popframeblock'+winname+'" style="text-align: center; color: #000; background-color: #fff; font-family: dotum; font-size: 13px; font-weight: bold;position: absolute;top:0;left:0;width:100%;height:'+$mainbody.prop('scrollHeight')+'px; z-index: '+zidx+'; opacity: 0.5;-ms-filter:\'progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\';filter:alpha(opacity=50);">' |
|
+' ' |
|
+'</div>' |
|
+'<iframe class="popifr popifr'+winname+'" style="position:absolute;left:'+x+'px;top:'+y+'px;z-index:'+(zidx+1)+';border:1px solid #ccc;" onload="poploadbind(this);" name="'+winname+'" src="'+url+'" frameborder="0" width="'+width+'" height="'+height+'"></iframe>'; |
|
$mainbody.find('.popframeblock'+winname+',iframe[name="'+winname+'"]').remove(); |
|
$mainbody.append(html); |
|
return $mainbody.find('iframe[name="'+winname+'"]')[0].contentWindow; |
|
}catch(e){ |
|
alert('브라우저 오류입니다. 페이지를 새로 고칩니다.'); |
|
location.href=location.href; |
|
} |
|
|
|
}; |
|
} |
|
|
|
function bindload(mainifr){ |
|
//팝업 레이어 사용안함 |
|
if(true)return; |
|
try{ |
|
try{ |
|
if(getPopCookie() == 'no' || document.documentMode < 10) |
|
return; |
|
}catch(e){return;} |
|
overrideOpen(mainifr.contentWindow); |
|
mainifr.contentWindow.poploadbind=function(popifr){ |
|
if(popifr.contentWindow.location.href.indexOf('reuse_copy_form.jsp') > -1){ |
|
closepop(); |
|
} |
|
overrideOpen(popifr.contentWindow); |
|
popifr.contentWindow.close=function(){ |
|
popifr.contentWindow.parent.$('.popframeblock,.popifr').remove(); |
|
}; |
|
popifr.contentWindow.focus=null; |
|
try{ |
|
Object.keys(popifr.contentWindow).filter(function(m){ |
|
for(var m in popifr.contentWindow){ |
|
try{ |
|
var con = popifr.contentWindow[m].toString(); |
|
if(con.substr(0,9) == 'function ' && con.indexOf('[native code]')==-1){ |
|
if(con.indexOf('window.close()') > -1||con.indexOf('self.close()') > -1){ |
|
con=con.replace('window.close()','parent.parent.closepop(window.name)'); |
|
con=con.replace('self.close()','parent.parent.closepop(window.name)'); |
|
popifr.contentWindow.eval(m+'='+con); |
|
hasCloseBtn=true; |
|
} |
|
} |
|
}catch(e){ |
|
console.log(e); |
|
} |
|
} |
|
}); |
|
}catch(e){} |
|
$(popifr.contentWindow.document.body).find('*').each(function(){ |
|
try{ |
|
var oncl = $(this).attr('onclick').toString(); |
|
if(oncl){ |
|
if(oncl.indexOf('window.close()')>-1||oncl.indexOf('self.close()')>-1){ |
|
oncl = oncl.replace('window.close()','parent.parent.closepop(window.name)'); |
|
oncl = oncl.replace('self.close()','parent.parent.closepop(window.name)'); |
|
$(this).attr('onclick',oncl); |
|
hasCloseBtn=true; |
|
} |
|
} |
|
}catch(e){} |
|
try{ |
|
var href = $(this).attr('href'); |
|
if(href){ |
|
if(href.indexOf('window.close()')>-1||href.indexOf('self.close()')>-1){ |
|
href = href.replace('window.close()','parent.parent.closepop(window.name)'); |
|
href = href.replace('self.close()','parent.parent.closepop(window.name)'); |
|
$(this).attr('href',href); |
|
hasCloseBtn=true; |
|
} |
|
} |
|
}catch(e){} |
|
}); |
|
if(!hasCloseBtn){ |
|
if(popifr.contentWindow.document.body.innerHTML == ''){ |
|
closepop(window.name); |
|
}else{ |
|
$(popifr.contentWindow.document.body).append('<div style="text-align:right;"><img style="cursor:pointer;" onclick="parent.parent.closepop(window.name);" alt="닫기" src="/totsys/common/inc/board/doc/images/bt_close.gif"></div>'); |
|
} |
|
} |
|
hasCloseBtn=false; |
|
$(popifr.contentWindow.document.body).css({'background-color':'#fff','overflow':'hidden'}); |
|
var ch = popifr.contentWindow.document.body.clientHeight; |
|
var sh = popifr.contentWindow.document.body.scrollHeight; |
|
var oh = $(popifr).height(); |
|
var arr = [ch,sh,oh].sort(function(a,b){return b-a;}); |
|
$(popifr).height(arr[0]); |
|
var cw = popifr.contentWindow.document.body.clientWidth; |
|
var sw = popifr.contentWindow.document.body.scrollWidth; |
|
var ow = $(popifr).width(); |
|
arr = [cw,sw,ow].sort(function(a,b){return b-a;}); |
|
$(popifr).width(arr[0]); |
|
var $mainbody = $(document.frames.main.document.body); |
|
var x = $mainbody.width()/2-sw/2; |
|
x = parseInt(x); |
|
var y = $mainbody.height()/2-sh/2; |
|
y = parseInt(y); |
|
if(x<0)x=0; |
|
if(y<0)y=0; |
|
$(popifr).css({top:y+'px',left:x+'px'}); |
|
}; |
|
var html='<div style="position:absolute;top:0;right:0;text-align:right;width:150px;height:20px;">' |
|
+'<input type="button" value="'+(togglemax?'원래대로':'최대화')+'" onclick="parent.parent.toggleMaximum(this);"/>' |
|
+'<input type="button" value="+" onclick="if(document.body.style.zoom==\'\'){document.body.style.zoom=1;}document.body.style.zoom=parseFloat(document.body.style.zoom)+0.1;"/>' |
|
+'<input type="button" value="-" onclick="if(document.body.style.zoom==\'\'){document.body.style.zoom=1;}document.body.style.zoom=parseFloat(document.body.style.zoom)-0.1;"/>' |
|
+'<input type="button" value="x1" onclick="document.body.style.zoom=1;"/>' |
|
+'<div>'; |
|
$(mainifr.contentWindow.document.body).append(html); |
|
$(mainifr.contentWindow.document.body).find('#formDiv').prepend('<div style="text-align:right;"><input onclick="parent.parent.toggleForm(this);" type="button" value="전체화면보기"/></div>') |
|
$(mainifr.contentWindow.document.head).append('<style>input[type="button"]{border-width: 1px; line-height: 20px; font-family: 돋움;background-color: aliceblue;}</style>'); |
|
}catch(e){} |
|
} |
|
|
|
function closepop(name){ |
|
if(!name){ |
|
$(document.frames.main.document.body).find('.popframeblock,.popifr').remove(); |
|
}else{ |
|
$(document.frames.main.document.body).find('.popframeblock'+name+',.popifr'+name).remove(); |
|
} |
|
} |
|
|
|
function setCookie( name, value, expiredays ) |
|
{ |
|
var todayDate = new Date(); |
|
todayDate.setDate( todayDate.getDate() + expiredays ); |
|
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" |
|
} |
|
|
|
function setpop(idx){ |
|
if(idx == 0){ |
|
setCookie('usepop','yes',999); |
|
}else{ |
|
setCookie('usepop','no',999); |
|
} |
|
if(confirm('다음페이지부터 적용됩니다\n\n지금 새로고침하고 적용하시겠습니까?\n\n새로고침시 현재 페이지의 입력내용이 사라집니다.')){ |
|
document.frames.main.location.reload(); |
|
} |
|
} |
|
function getPopCookie(){ |
|
var coo=document.cookie; |
|
var popcoo; |
|
try{ |
|
popcoo = coo.split('usepop=')[1].split(';')[0]; |
|
}catch(e){} |
|
if(!popcoo)popcoo='no'; |
|
return popcoo; |
|
} |
|
|
|
function bindtopload(topwin){ |
|
//팝업 레이어 사용안함 |
|
if(true)return; |
|
try{ |
|
if(document.documentMode<10) |
|
return; |
|
}catch(e){ |
|
return; |
|
} |
|
var dv=$(topwin.document.getElementById('top_other_menu')); |
|
dv.append('<select onchange="parent.setpop(this.selectedIndex);"><option>레이어사용</option><option>팝업사용</option></select>'); |
|
var popcoo = getPopCookie(); |
|
idx = popcoo == 'yes' ? 0 : 1; |
|
dv.find('select')[0].selectedIndex=idx; |
|
|
|
} |
|
|
|
var tf=false; |
|
function toggleForm(obj){ |
|
tf = !tf; |
|
if(tf){ |
|
obj.value = '원래대로'; |
|
$(document.frames.main.document.body).find('#formDiv').css({ |
|
'position':'absolute', |
|
'top':'0', |
|
'left':'0', |
|
'width':'100%', |
|
'height':$(document.frames.main.document.body).height()+'px', |
|
'background-color':'#fff', |
|
'z-index':'2000', |
|
'overflow':'scroll' |
|
}); |
|
}else{ |
|
obj.value = '전체화면보기'; |
|
$(document.frames.main.document.body).find('#formDiv').css({ |
|
'position':'', |
|
'width':'', |
|
'height':'', |
|
'overflow':'' |
|
}); |
|
} |
|
} |
|
|
|
var togglemax=false; |
|
function toggleMaximum(obj){ |
|
togglemax = !togglemax; |
|
if(obj)obj.value = togglemax?'원래대로':'최대화'; |
|
alert("frame.jsp 297 프레임 호출"); |
|
var row = parseInt(document.getElementsByTagName('frameset')[0].rows.split(',')[0]); |
|
var col = parseInt(document.getElementsByTagName('frameset')[1].cols.split(',')[0]); |
|
toggleMaxAct(row,col); |
|
} |
|
function toggleMaxAct(row,col){ |
|
var orow = parseInt(frameset1rows.split(',')[0]); |
|
var ocol = parseInt(frameset2cols.split(',')[0]); |
|
if(togglemax){ |
|
row-=3; |
|
col-=5; |
|
}else{ |
|
row+=3; |
|
col+=5; |
|
} |
|
|
|
if(row<0)row = 0; |
|
if(row>orow)row = orow; |
|
if(col<0)col = 0; |
|
if(col>ocol)col = ocol; |
|
document.getElementsByTagName('frameset')[0].rows=row+',*'; |
|
document.getElementsByTagName('frameset')[1].cols=col+',*'; |
|
if((togglemax&&row<orow&&col<ocol)||(!togglemax&&row>0&&col>0)){ |
|
setTimeout(function(){toggleMaxAct(row,col);},0); |
|
} |
|
} |
|
setTimeout(checkloading,100); |