//------------------------------------------------------------------------------- // get data path_data only output by full (p11)_data field from skin_function //------------------------------------------------------------------------------- function get_posdata( posdata ){ // eq. posArray[pathdata] = posdata ; map_pos.php에서 사용 var posArray = new Array() // var callpos_data = new Array() if( posdata && posdata.indexOf("|")!=-1 ){ callpos_data = posdata.split('|'); } // posArray['x'] = check_empty( callpos_data[0] ); posArray['y'] = check_empty( callpos_data[1] ); posArray['level'] = check_empty( callpos_data[2] ); posArray['km'] = check_empty( callpos_data[3] ); posArray['hour'] = check_empty( callpos_data[4] ); posArray['min'] = check_empty( callpos_data[5] ); posArray['pan'] = check_empty( callpos_data[6] ); posArray['tilt'] = check_empty( callpos_data[7] ); posArray['zoom'] = check_empty( callpos_data[8] ); posArray['panoId'] = check_empty( callpos_data[9] ); posArray['cctvid'] = check_empty( callpos_data[10] ); posArray['tvname'] = check_empty( callpos_data[11] ); posArray['tvcenter'] = check_empty( callpos_data[12] ); posArray['tvx'] = check_empty( callpos_data[13] ); posArray['tvy'] = check_empty( callpos_data[14] ); posArray['tvloc'] = check_empty( callpos_data[15] ); posArray['tvip'] = check_empty( callpos_data[16] ); posArray['tvport'] = check_empty( callpos_data[17] ); posArray['tvch'] = check_empty( callpos_data[18] ); posArray['tvid'] = check_empty( callpos_data[19] ); posArray['tvpass'] = check_empty( callpos_data[20] ); posArray['tvmovie'] = check_empty( callpos_data[21] ); posArray['tvkind'] = check_empty( callpos_data[22] ); // posArray['xy'] = ""; for(k=0;k<=1;k++){ posArray['xy'] += check_empty( callpos_data[k] ) + "|"; } posArray['xy'] += check_empty( callpos_data[2] ) posArray['rv'] = ""; for(k=6;k<=8;k++){ posArray['rv'] += check_empty( callpos_data[k] ) + "|"; } posArray['rv'] += check_empty( callpos_data[9] ); posArray['cctv'] = ""; for(k=10;k<=21;k++){ posArray['cctv'] += check_empty( callpos_data[k] ) + "|"; } posArray['cctv'] += check_empty( callpos_data[22] ); // return posArray; } //------------------------------------------------------------------------------- // get from full data of (p11)_data field from skin function //------------------------------------------------------------------------------- function get_pathdata( pathdata ){ // var posArray = new Array() //alert( pathdata ) if(pathdata && pathdata.indexOf('|')!=-1){ var datasrc = pathdata.split('|'); //console.log( datasrc ) // posArray['gno'] = datasrc[0]; posArray['name'] = datasrc[1]; posArray['icon'] = datasrc[2]; posArray['rosign'] = datasrc[3]; posArray['rono'] = datasrc[4]; posArray['roname'] = datasrc[5]; // posArray['x'] = datasrc[6]; //경도 posArray['y'] = datasrc[7]; //위도 // posArray['level'] = datasrc[8]; // map zoom // posArray['km'] = datasrc[9]; posArray['hour'] = datasrc[10]; posArray['min'] = datasrc[11]; // posArray['pan'] = datasrc[12]; posArray['tilt'] = datasrc[13]; posArray['zoom'] = datasrc[14]; // roadview zoom posArray['panoId'] = datasrc[15]; var re_data = ''; for(k=6;k<=28;k++){ re_data += datasrc[k] + "|"; } // var getpos = get_posdata( re_data ); // posArray['pathdata'] = re_data; posArray['xy'] = getpos['xy']; posArray['rv'] = getpos['rv']; posArray['cctv'] = getpos['cctv']; } return posArray; } function check_empty(val){ if(val=='undefined' || val==undefined || val=='null'){ val = ''; } return val; } function trans_gCctv(cctvpos){ //----------------------------------------- // db data string(utic) convert to utic map //----------------------------------------- var gCctv = []; if( cctvpos.indexOf('|')==-1){ return gCctv; } var callpos_data = cctvpos.split('|'); // if(callpos_data[1] == null){ return gCctv; } // 13 data gCctv.CCTVID = check_empty( callpos_data[0] ); gCctv.CCTVNAME = check_empty( callpos_data[1] ); gCctv.CENTERNAME = check_empty( callpos_data[2] ); gCctv.XCOORD = check_empty( callpos_data[3] ); gCctv.YCOORD = check_empty( callpos_data[4] ); gCctv.LOCATE = check_empty( callpos_data[5] ); gCctv.CCTVIP = check_empty( callpos_data[6] ); gCctv.PORT = check_empty( callpos_data[7] ); gCctv.CH = check_empty( callpos_data[8] ); gCctv.ID = check_empty( callpos_data[9] ); gCctv.PASSWD = check_empty( callpos_data[10] ); gCctv.MOVIE = check_empty( callpos_data[11] ); gCctv.KIND = check_empty( callpos_data[12] ); // return gCctv; } function convert_gCctv(itsraw){ //----------------------------------------- // its convert to utic map //----------------------------------------- var gCctv = []; gCctv.CENTERNAME = check_empty( itsraw.N_centername ); gCctv.CCTVID = check_empty( itsraw.N_cctvid ); gCctv.CCTVNAME = check_empty( itsraw.cctvname ); gCctv.CH = check_empty( itsraw.N_ch ); gCctv.MOVIE = check_empty( itsraw.N_movie ); gCctv.XCOORD = check_empty( itsraw.coordx ); gCctv.YCOORD = check_empty( itsraw.coordy ); gCctv.KIND = check_empty( itsraw.N_kind ); gCctv.ID = check_empty( itsraw.N_id ); gCctv.STRMID = check_empty( itsraw.N_strmid ); gCctv.PORT = check_empty( itsraw.N_port ); gCctv.PASSWD = check_empty( itsraw.N_passwd ); gCctv.CCTVIP = check_empty( itsraw.N_cctvip ); // return gCctv; } function get_cctvurl( streamInfo, stype ){ // if(stype=='live'){ var url = 'https://www.utic.go.kr:449/view/map/cctvStream.jsp?key=' + key+ '&cctvid=' + streamInfo.gCctvId + '&cctvName=' + encodeURI(encodeURIComponent(streamInfo.gCctvName)) + '&kind=' + streamInfo.gKind + '&cctvip=' + streamInfo.gCctvIp + '&cctvch=' + streamInfo.gCh + '&id=' + streamInfo.gId + '&cctvpasswd=' + streamInfo.gPasswd + '&cctvport=' + streamInfo.gPort; } else { var url = 'https://www.utic.go.kr:449/view/map/openDataCctvStream.jsp?key=' + key+ '&cctvid=' + streamInfo.gCctvId + '&cctvName=' + encodeURI(encodeURIComponent(streamInfo.gCctvName)) + '&kind=' + streamInfo.gKind + '&cctvip=' + streamInfo.gCctvIp + '&cctvch=' + streamInfo.gCh + '&id=' + streamInfo.gId + '&cctvpasswd=' + streamInfo.gPasswd + '&cctvport=' + streamInfo.gPort; } //2020-01-16 live base로 변경 var url = 'http://www.utic.go.kr/view/map/cctvStream.jsp?key=' + key+ '&cctvid=' + streamInfo.gCctvId + '&cctvName=' + encodeURI(encodeURIComponent(streamInfo.gCctvName)) + '&kind=' + streamInfo.gKind + '&cctvip=' + streamInfo.gCctvIp + '&cctvch=' + streamInfo.gCh + '&id=' + streamInfo.gId + '&cctvpasswd=' + streamInfo.gPasswd + '&cctvport=' + streamInfo.gPort; // return url; } function get_cctvinfo(cctvid){ // var ccthis = []; // id or gCctv of Json Set Data if(cctvid.CCTVID != null) { var gCctv = cctvid; } else { var gCctv = cctv.getCctv(cctvid); } // if(gCctv == null){ return ccthis; } // ccthis.gWidth = "320"; ccthis.gHeight = "245"; ccthis.gCctvId = gCctv.CCTVID; ccthis.gCctvName = gCctv.CCTVNAME; ccthis.gCenterName = gCctv.CENTERNAME; ccthis.gDx = gCctv.XCOORD; ccthis.gDy = gCctv.YCOORD; ccthis.gLocate = gCctv.LOCATE; ccthis.gCctvIp = gCctv.CCTVIP; ccthis.gPort = gCctv.PORT; ccthis.gCh = gCctv.CH; ccthis.gId = gCctv.ID; ccthis.gPasswd = gCctv.PASSWD; ccthis.gMovie = gCctv.MOVIE; // var CctvCode = ccthis.gCctvId.substring(0, 3); if(CctvCode == 'L01'){ ccthis.gKind = 'Seoul'; } else if(CctvCode == 'L02'){ ccthis.gKind = 'N'; } else if(CctvCode == 'L03'){ ccthis.gKind = 'O'; } else if(CctvCode == 'L04'){ ccthis.gKind = 'P'; } else if(CctvCode == 'L08'){ ccthis.gKind = 'd'; } else{ ccthis.gKind = gCctv.KIND; } // return ccthis; } // [방어용] mapcate 사전설정이 안된 경우 : 조건 변경시 코드 조정 function get_mapcate(rawcctv) { // var mapcate = ""; // if( rawcctv && rawcctv.cctvurl!=null ) { // ITS DATA if( rawcctv.cctvformat.toUpperCase()=="MP4" || rawcctv.cctvtype != 3 ) { if( rawcctv.cctvname.indexOf("국도")!=-1 ){ // cctvname : [국도 1호선] 논산 고정삼거리 mapcate = "glive_its"; } else { mapcate = "glive_ex"; } } else { if( rawcctv.cctvname.indexOf("국도")!=-1 ){ mapcate = "glive_its"; } else { mapcate = "glive_ex"; } } } else if( rawcctv && rawcctv.length>0 ){ mapcate = "gmap_utic"; } // return mapcate; } var timeoutID; function get_cctvstatus(){ $('iframe').attr('allowFullScreen', 1); /* var ifrm = document.getElementById('frame_cctv'); var iframeDoc = ifrm.contentDocument || ifrm.contentWindow.document; var scode = iframeDoc.readyState console.log( scode + ' : ' + ifrm.src ) if ( scode == 'complete' ) { window.clearTimeout(timeoutID); console.log( 'finish' ) } else { // timeoutID = window.setTimeout(get_cctvstatus, 1000); } */ } function get_cctvpop( streamInfo, cctv_url, popmode ){ var size_outbox = {w:'340px', h:'300px'} var size_framebox = {w:'330px', h:'245px', t:'35px', L:'15px'} var size_frame = {w:'330px', h:'245px', b:'0px', L:'0px'} var size_footer = {w:'340px', h:'30px', t:'290px'} // 사이즈 : 다음 CCTV BOX : 308x205 -> 영상 : 311x175, 카맵 : 320x165 if( streamInfo.gCenterName.indexOf('국가교통정보센터')!=-1 ){ /* size_outbox.h = '270px' size_framebox.h = '240px' size_frame.h = '280px' size_footer.t = '260px'; */ } var copyright = '경찰청 교통정보(UTIC)'; if( cctv_url.indexOf("utic.go.kr")!=-1 ){ //copyright += ' ' + streamInfo.gCenterName; size_framebox = {w:'330px', h:'245px', t:'35px', L:'15px'} size_frame = {w:'330px', h:'290px', b:'0px', L:'0px'} } else { copyright = streamInfo.gCenterName; } // var cctv_frame = '' if( streamInfo.gMovie=="Y" ){ var use_iframe = 1; if(use_iframe){ // cctv_frame = '' + '
' + ' ' + '
'; } else { // cctv_frame = '' + '
' + ' ' + '
'; } } else { size_frame.t = 0; cctv_frame = '' + '
' + ' ' + '
'; } // var cctv_button = '' if(popmode=='edit'){ cctv_button = '
지정
'; } else if(popmode=='del'){ cctv_button = '
해제
'; } // 커스텀 오버레이에 표시할 내용입니다 var content = ' ' + '
' + '
' + '
' + streamInfo.gCctvName + ' CCTV
' + '
' + '
' + '
' + '
제공 : ' + copyright + '
' + ' ' + cctv_button + '
' + ' ' + cctv_frame + '
'; // return content; } function get_cctvPlay(cctvid, gKind){ } //체크안됨 function chk_protectmap(strvalue){ var spc_pattern = /[|!\?@$%&\"\n\^=\r\']/gi if (spc_pattern.test(strvalue)){ // return false; } return true; } function get_protectmap(strvalue){ strvalue = strvalue.replace(/\|/gi,""); strvalue = strvalue.replace(/!/gi,""); strvalue = strvalue.replace(/\?/gi,""); strvalue = strvalue.replace(/@/gi,""); strvalue = strvalue.replace(/$/gi,""); strvalue = strvalue.replace(/%/gi,""); strvalue = strvalue.replace(/&/gi,""); strvalue = strvalue.replace(/\"/gi,""); strvalue = strvalue.replace(/\n/gi,""); strvalue = strvalue.replace(/\r/gi,""); strvalue = strvalue.replace(/\^/gi,""); strvalue = strvalue.replace(/=/gi,""); strvalue = strvalue.replace(/\'/gi,""); return strvalue } function get_transgps(tocrs, fromcrs, lon_x, lat_y){ //( 경도=longitude=X, 위도=latitude=Y ) try { fromcrs = fromcrs.toUpperCase(); // epsg:5181 : 중부원점(GRS80, 50만) tocrs = tocrs.toUpperCase(); // epsg:4326 : WGS84 경위도 // var lonlat = new OpenLayers.LonLat( lon_x, lat_y); var SCRS = new OpenLayers.Projection( fromcrs ); var TCRS = new OpenLayers.Projection( tocrs ); var point = lonlat.transform(SCRS, TCRS); // return point; }catch(e){} } function get_epsg4326(){ // var point = {lon : 0, lat : 0}; if( !EPSG_4326_X || !EPSG_4326_Y ){ if( EPSG_5181_X && EPSG_5181_Y ){ point = get_transgps("epsg:4326", "epsg:5181", EPSG_5181_X, EPSG_5181_Y); console.log( "중부원점(GRS80) EPSG:5181 : "+EPSG_5181_X+", "+ EPSG_5181_Y ) } else if( EPSG_900913_X && EPSG_900913_Y ){ point = get_transgps("epsg:4326", "epsg:900913", EPSG_900913_X, EPSG_900913_Y); console.log( "구글 EPSG:900913 : "+EPSG_900913_X+", "+ EPSG_900913_Y ) } else if( EPSG_5179_X && EPSG_5179_Y ){ point = get_transgps("epsg:4326", "epsg:5179", EPSG_5179_X, EPSG_5179_Y); console.log( "UTM-K 네이버 EPSG:5179 : "+EPSG_5179_X+", "+ EPSG_5179_Y ) } else if( EPSG_5174_X && EPSG_5174_Y ){ point = get_transgps("epsg:4326", "epsg:5174", EPSG_5174_X, EPSG_5174_Y); console.log( "중부원점TM EPSG:5174 : "+EPSG_5174_X+", "+ EPSG_5174_Y ) } if(point.lon && point.lat){ EPSG_4326_X = point.lon; EPSG_4326_Y = point.lat; console.log( "WGS84 경위도 EPSG:4326 전환값: "+EPSG_4326_X+", "+ EPSG_4326_Y ) } } return point; } // get_LonxLaty('4326', '5181,900913,5179') function get_LonxLaty(targetcrs, sortcrs){ //기본값 : sortcrs = 4326,5181,900913,5179 var LonxLaty = {lonx : 0, laty : 0, crs : 0 }; if(!sortcrs){ sortcrs = '4326,5181,900913,5179'; } sortcrs += ','; if(!targetcrs){ targetcrs = '4326'; } if( eval('EPSG_'+targetcrs+'_X') && eval('EPSG_'+targetcrs+'_Y') ){ LonxLaty = {lonx : eval('EPSG_'+targetcrs+'_X'), laty : eval('EPSG_'+targetcrs+'_Y'), crs : 'EPSG:'+targetcrs }; } else { // var crsList = sortcrs.split(','); for(var p=0;p Array object var data = JSON.parse( enjson ); //var data = jQuery.parseJSON(enjson); console.log( 'data = ' + data ) var frmsel = document.forms[frmname].elements[optname]; //var frmsel = document.getElementById(optname); //alert( Object.keys( data ).length ) frmsel.options.length = 0; // if( Object.keys( data ).length > 0 ){ // var k = 0; if(baseopt && baseopt.indexOf('optview')!=-1 ){ // 'optview' or 'optview_전체선택)_all' var basetxt = baseopt var baseval = ''; // if( baseopt.indexOf('_')!=-1 ){ var basesrc = baseopt.split('_'); basetxt = basesrc[1]; baseval = basesrc[2]; } baseopt = 'optview'; // frmsel.options[k] = new Option(basetxt, baseval); k++; } // for (key in data) { var keytext = data[key]; var keycode = key; if(baseopt=='optview' || baseopt=='optall'){ keytext = '[' + keycode + ']' + data[key]; } frmsel.options[k] = new Option(keytext, keycode); k++; } } }, error: function(e, ts, et) { //alert(ts.responseText) alert(e + '/' + ts + '/' + et) } }); } } // function get_bungulist(sidocode, guguncode,frmname, optname){ var PostingUrl = '/web/msys/mplus_ajax.php'; var theQuery = 'mode=bungu&sidocode='+sidocode+'&guguncode='+guguncode+'&output=json'; // if(sidocode){ // $.ajax({ type: 'POST', url: PostingUrl, data: theQuery, success: function( enjson ){ // //console.log( enjson ) // jason strong -> Array object var data = JSON.parse( enjson ); //console.log( data ) var frmsel = document.forms[frmname].elements[optname]; //var frmsel = document.getElementById(optname); //alert( Object.keys( data ).length ) frmsel.options.length = 0; // if( Object.keys( data ).length > 0 ){ // var k = 0 for (key in data) { frmsel.options[k] = new Option(data[key], key); k++; } } else { // frmsel.options[0] = new Option('없음', '0'); } }, error: function(e, ts, et) { //alert(ts.responseText) alert(e + '/' + ts + '/' + et) } }); } } function get_gugunlist(sidocode,frmname, optname){ var PostingUrl = '/web/msys/mplus_ajax.php'; var theQuery = 'mode=gugun&sidocode='+sidocode+'&output=json'; // if(sidocode){ // $.ajax({ type: 'POST', url: PostingUrl, data: theQuery, success: function( enjson ){ // //console.log( enjson ) // jason strong -> Array object var data = JSON.parse( enjson ); //console.log( data ) var frmsel = document.forms[frmname].elements[optname]; //var frmsel = document.getElementById(optname); //alert( Object.keys( data ).length ) frmsel.options.length = 0; // if( Object.keys( data ).length > 0 ){ // frmsel.options[0] = new Option('시군구(전체)', ''); // var k = 1 for (key in data) { frmsel.options[k] = new Option(data[key], key); k++; } } }, error: function(e, ts, et) { //alert(ts.responseText) alert(e + '/' + ts + '/' + et) } }); } } // 해당 함수 받기 : ajax_return( data ) function ajax_posting( PostingUrl, theQuery ){ // if (typeof window['ajax_return'] === "function"){ } else { alert('내부문서오류입니다.'); return false; } if( !PostingUrl || !theQuery ){ ajax_return( 'ERROR-01' ); } else { // $.ajax({ type: "POST", url: PostingUrl, data: theQuery, success: function(html){ ajax_return( html ); }, error: function(e, ts, et) { //alert(ts.responseText) ajax_return( 'ERROR-02-' + e + '-' + ts + '-' + et + '-' ); } }); } } // Actions checkbox Before function click_checkbox(obj, actdo, offtext, ontext, offclass, onclass, officon, onicon){ // var vh = document.getElementById(obj.id +'h'); var vi; var vt; // // if( document.getElementById(obj.id +'i')!=undefined ){ vi = document.getElementById(obj.id +'i'); } if( document.getElementById(obj.id +'t')!=undefined ){ vt = document.getElementById(obj.id +'t'); } //alert( offtext + '=' + ontext ) //alert( obj.className + '=' + vh.checked ) // process in call page process_checkbox(obj, actdo); // update_Checkbox(obj, vh, vi, vt, offtext, ontext, offclass, onclass, officon, onicon); } // Actions checkbox After function update_Checkbox(obj, vh, vi, vt, offtext, ontext, offclass, onclass, officon, onicon) { // var isChecked = vh.checked; if( vh.checked ){ if( !offclass && !onclass ){ // } else if( offclass ){ obj.className = offclass; } vh.checked = false; if( vt && offtext ){ vt.textContent = offtext; //$("#"+vt.id).text( offtext ); //obj.textContent = ""; } } else { if( !offclass && !onclass ){ // } else if( onclass ){ obj.className = onclass; } vh.checked = true; if( ontext ){ vt.textContent = ontext; } } if( vi!=undefined && officon && onicon ){ if(isChecked){ vi.className = officon; } else { vi.className = onicon; } } } function place_search(){ var frm = document.dataSetForm; var shopname = frm.shopname.value; // var codeId = frm.codeId.value; var detailCodeId = frm.detailCodeId.value; // if(codeId == "") { alert("해당 지역을 선택하세요."); return; } if(shopname == "") { alert("검색어를 입력해주세요."); return; } // 20161215 공백검색 못하게 막음 var blank_pattern = /^\s+|\s+$/g; if (shopname.replace(blank_pattern,'') == ""){ alert("공백은 사용할수 없습니다."); return; } var spc_pattern = /[~!@#$%<>^&*\()\-=+_\']/gi if (spc_pattern.test(shopname)){ alert("특수문자는 사용할 수 없습니다."); return; } // var upsoNm = encodeURIComponent( shopname ); // frm.action = "/web/splus/kmap/search.php" ; frm.method = "post"; frm.submit(); } //==============================================================CARMAP function KBS_PAGE(surl, targetname, gomsg){ if( surl ){ if(gomsg){ if( confirm(gomsg) ){ } else { return false; } } if(targetname=='blank'){ var winno = Math.floor((Math.random() * 1000) + 1); window.open(surl, 'blank_'+winno); } else if(targetname=='hidden'){ hiddenframe.window.location.href = surl; } else if(targetname){ //var pickframe = document.getElementById(targetname).name; //pickframe.window.location.href = surl; if(document.getElementById(targetname)!=undefined){ document.getElementById(targetname).src = surl; } else { alert('ifram이 보이지 않습니다.') } } else { window.location.href = surl; } } } function go_page(surl, targetname, gomsg){ KBS_PAGE(surl, targetname, gomsg) } function KBS_ALERT(inURL,inSel,intitle,inMsg,inCanBtn,inOkBtn, inOption){ var selmax = 0; var uselevel = '0' if(inOption && inOption.indexOf('|')==-1){ //inOption = intype|inbackground|incolor|inpadding| inOption = 'alert|666666|FFFFFF|10|0|'; } var inopt = inOption.split('|'); if(inopt[0]=='confirm'){ if(inCanBtn==''){ inCanBtn = "Cancel"; } } else { if(inCanBtn==''){ inCanBtn = "O.K"; } } // var modal_HTML = ""; // modal_HTML += ""; modal_HTML += "\n\n"; modal_HTML += "function triger_modal(setno){\n"; if(inURL){ inURL = inURL.replace(/@/gi,"'"); // modal_HTML += " var Selval = ''; \n"; modal_HTML += " for( k=0;k<"+selmax+";k++){ \n"; modal_HTML += " if( $('#inSel_'+k).is(':checked') ){ \n"; modal_HTML += " Selval = $('#inSel_'+k).val(); \n"; modal_HTML += " }\n"; modal_HTML += " }\n"; modal_HTML += " '" + inURL + "' + Selval; \n"; } modal_HTML += "}\n"; modal_HTML += "\n"; // var confirmModal = $(modal_HTML); // confirmModal.find('.modal-header').css('background-color', '#'+inopt[1]); confirmModal.find('.modal-header').css('color', '#'+inopt[2]); confirmModal.find('.modal-body').css('padding', inopt[3]); // var callclose = function() { $('.modal').remove(); $('.modal-backdrop').remove(); $('body').removeClass( "modal-open" ); $('body').css('padding', ''); $('#showalert').hide(); }; var callback = function() { /* var allowlevel = (inopt[4]*1); if(allowlevel>0){ if(uselevel'); function strip_tags(input, allowed) { allowed = (((allowed || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); // making sure the allowed arg is a string containing only tags in lowercase () var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi, commentsAndPhpTags = /|<\?(?:php)?[\s\S]*?\?>/gi; return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) { return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''; }); } //========================================== // LINK //========================================== function find_item(strtable, addId, strfield, strword ){ // sop => link if(addId){ addId = '|'+addId+'|' } if(strword){ strword = '|'+strword+'|' } window.location = '/ts/bbs/board.php?bo_table='+strtable+'&sca='+addId+'&sfl='+strfield+'&stx='+strword+'&sop=link&' } function find_roomno(sid){ // var roomno = Math.ceil(sid/1000); return roomno; } function tong_page(strpage){ // window.location = strpage; } //=========================== // 종합박스 열기 //=========================== function get_scrollpos(){ var offset = {x : 0, y : 0, w : 0, h : 0}; // scrollTop보다 pageYOffset값이 88 정도 크다 ?? var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant offset.y = window.pageYOffset; offset.x = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant offset.y = document.body.scrollTop; offset.x = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode offset.y = document.documentElement.scrollTop; offset.x = document.documentElement.scrollLeft; } offset.w = document.body.scrollWidth; offset.h = document.body.scrollHeight; return offset; } function centerWin(sUrl, sName, sWidth,sHeight, sOption){ var aY = 0; //Math.round((document.body.scrollTop) * 1) - Math.round(sHeight/2); // var sX = (screen.width-sWidth) / 2; var sY = Math.round((screen.height-sHeight)/2) - 35; //+ aY; //alert( sY ) // var sOption = "height="+sHeight+",width="+sWidth+",left="+sX+",top="+sY+","+sOption; // var callwin = window.open(sUrl, sName, sOption); callwin.focus(); return callwin; } function centerPop(oDivBox,sWidth,sHeight){ // var aW = document.body.clientWidth * 1; var aH = screen.availHeight * 1; sWidth = sWidth * 1; sHeight = sHeight * 1; // var sX = (aW - sWidth) / 2; var aY = Math.round( ( aH - sHeight ) / 2 ); // content located no scrolltop after bootstarp var offset = get_scrollpos(); var sY = offset.y + aY; var navi_high = $("#bs_topmenu").prop('offsetHeight'); sY = sY - navi_high; // OpenPopBox(oDivBox,sX,sY,sWidth,sHeight); } function OpenPopBox(oDivBox,sX,sY,sWidth,sHeight){ // document.getElementById(oDivBox).style.visibility = 'visible'; if(sX){ document.getElementById(oDivBox).style.left = sX + 'px'; } if(sY){ document.getElementById(oDivBox).style.top = sY + 'px'; } if(sWidth){ document.getElementById(oDivBox).style.width = sWidth + 'px'; } if(sHeight){ document.getElementById(oDivBox).style.height = sHeight + 'px'; } } function ShowHideDiv(oDivBox,vstatus){ if(vstatus){ document.getElementById(oDivBox).style.display = vstatus; } else { if(document.getElementById(oDivBox).style.display=='none'){ //document.getElementById(oDivBox).style.display = 'inline'; document.getElementById(oDivBox).style.display = 'inline-block'; } else { document.getElementById(oDivBox).style.display = 'none'; } } } function call_popup(inURL,intitle,wide,high,inbody,infoot){ // var setdata = new Array(); var inbody; var modal_HTML = ""; modal_HTML += " "; // if(inURL=='inhtml' || inURL=='intext' || inURL=='inform' || inURL=='incode' ){ confirmModal = $('#showmodalbox').html(modal_HTML); } else { modal_HTML = ""; confirmModal = $(modal_HTML); } // var fullwidth = $(window).width(); if(wide=='wide'){ var wide_px = fullwidth - 60; confirmModal.find('.modal-dialog').css({width: wide_px+'px'}); } else if(wide=='full'){ confirmModal.find('.modal-dialog').css({width: fullwidth + 'px', height:'100%',padding:'0px',margin:'0px',textAlign: 'center'}); } else if( wide && isNaN(wide)==false ){ if( wide > fullwidth ){ confirmModal.find('.modal-dialog').css({width: 'auto'}); } else { confirmModal.find('.modal-dialog').css({width: wide+'px'}); } } else { //alert( wide ) confirmModal.find('.modal-dialog').css({width: 'auto'}); } // confirmModal.find('.modal-header').css('background-color', '#3C96F3'); confirmModal.find('.modal-header').css('color', '#FFFFFF'); confirmModal.find('.modal-body').css('padding', '0'); // if(inURL=='inhtml' || inURL=='intext' || inURL=='inform' || inURL=='incode' ){ confirmModal.modal({keyboard: false}); } else { confirmModal.modal("show"); } }