1/** 2 ---------------------------------------------------------- 3 * @íë¡ê·¸ë¨ëª : ê³µíµ javascript 4 * @íì¼ëª : common.js 5 * @ìì±ì¼ : 2021.10.04 6 ---------------------------------------------------------- 7 */ 8 9 10/* 11 * @method gfn_isNull 12 * @description check null 13 * @param {String} value 14 */ 15function gfn_isNull(value) { 16 if (value === "" || value === null || value === undefined || (value !== null && typeof value == "object" && !Object.keys(value).length)) { 17 return true; 18 } else { 19 return false; 20 } 21} 22 23 24/* 25 * @method gfn_isIe 26 * @description ie check 27 * @param null 28 */ 29function gfn_isIe() { 30 var _ua = navigator.userAgent; 31 var rv = -1; 32 33 //IE 11,10,9,8 34 var trident = _ua.match(/Trident\/(\d.\d)/i); 35 if( trident != null ) 36 { 37 if( trident[1] === "7.0" ) return true; 38 if( trident[1] === "6.0" ) return true; 39 if( trident[1] === "5.0" ) return true; 40 if( trident[1] === "4.0" ) return true; 41 } 42 43 //IE 7... 44 if( navigator.appName === 'Microsoft Internet Explorer' ) return true; 45 46 //other 47 var agt = _ua.toLowerCase(); 48 if (agt.indexOf("chrome") !== -1) return false; 49 if (agt.indexOf("opera") !== -1) return false; 50 if (agt.indexOf("staroffice") !== -1) return false; 51 if (agt.indexOf("webtv") !== -1) return false; 52 if (agt.indexOf("beonex") !== -1) return false; 53 if (agt.indexOf("chimera") !== -1) return false; 54 if (agt.indexOf("netpositive") !== -1) return false; 55 if (agt.indexOf("phoenix") !== -1) return false; 56 if (agt.indexOf("firefox") !== -1) return false; 57 if (agt.indexOf("safari") !== -1) return false; 58 if (agt.indexOf("skipstone") !== -1) return false; 59 if (agt.indexOf("netscape") !== -1) return false; 60 if (agt.indexOf("mozilla/5.0") !== -1) return false; 61} 62 63 64/* 65 * @method gfn_setCommCode 66 * @description ê³µíµì½ë call 67 * @param {array} codeparam 68 */ 69function gfn_setCommCode(codeparam) { 70 var list = []; 71 var bizCd = ""; 72 73 $.each(codeparam, function (idx, group) { 74 list.push(group.gCode); 75 76 if(group.bizCd) { 77 bizCd = group.bizCd; 78 } 79 80 }); 81 82 var obj = { 83 url : '/gh/cmn/selectCmnCdDtList.do', 84 param : 'code=' + list + (bizCd ? '&heBizCd=' + bizCd : ''), 85 callback : function (json) { 86 $.each(codeparam, function (idx, param) { 87 var prmCd = param.gCode; 88 gfn_setCommObject(param, json.list[prmCd]); 89 }); 90 gfn_afterOnLoad(); 91 } 92 }; 93 callAjax(obj.url, obj.param, obj.callback); 94} 95 96/* 97 * @method gfn_afterOnLoad 98 * @description ê³µíµì½ë í¸ì¶ í afterì²ë¦¬ 99 * @param {array} codeparam 100 */ 101function gfn_afterOnLoad() { 102 if (typeof fn_afterOnLoad !== 'undefined') { 103 fn_afterOnLoad(); 104 } 105} 106 107 108/* 109 * @method gfn_setCommObject 110 * @description ê³µíµì½ë component setting 111 * @param {array} prm, list 112 */ 113function gfn_setCommObject(prm, list) { 114 var obj = prm.objId, 115 type = prm.type, 116 selTy = prm.selectType; 117 118 if (list.length > 0) { 119 $(obj).empty(); 120 121 // Item íí°ë§ 122 if(prm.item1 !== undefined || prm.item2 !== undefined || prm.item3 !== undefined || prm.item4 !== undefined || prm.item5 !== undefined) { 123 for(var itemIdx = Object.keys(list).length-1 ; itemIdx >- 1 ; itemIdx--) { 124 var row = list[itemIdx]; 125 var isRemove = false; 126 127 if((list[itemIdx].item1Cn !== prm.item1 && prm.item1 !== undefined) 128 || (list[itemIdx].item2Cn !== prm.item2 && prm.item2 !== undefined) 129 || (list[itemIdx].item3Cn !== prm.item3 && prm.item3 !== undefined) 130 || (list[itemIdx].item4Cn !== prm.item4 && prm.item4 !== undefined) 131 || (list[itemIdx].item5Cn !== prm.item5 && prm.item5 !== undefined)) { 132 isRemove = true; 133 } 134 135 // 2. heBizCd íí°ë§ (ì½¤ë§ êµ¬ë¶ì ì²ë¦¬) 136 if(prm.bizCd !== undefined && row.item2Cn !== undefined) { 137 var bizArr = (row.item2Cn || "").split(","); 138 var hasMatch = false; 139 140 for(var i=0; i <bizArr.length; i++) {
141 var codeVal = bizArr[i].trim(); 142 143 if(codeVal === prm.bizCd || codeVal.indexOf(prm.bizCd + "-") === 0) { 144 hasMatch = true; 145 break; 146 } 147 } 148 149 // 매ì¹ëë ê²ì´ ìì¼ë©´ ìì 150 if(!hasMatch) { 151 isRemove = true; 152 } 153 } 154 155 if(isRemove) { 156 list.splice(itemIdx, 1); 157 } 158 } 159 } 160 161 switch (type) { 162 163 case 'combo' : 164 if (selTy === 'A') { 165 $(obj).append('<option value="">ì ì²´</option>'); 166 } else if (selTy === 'S' || selTy === 'V') { 167 $(obj).append('<option value="">ì í</option>'); 168 } 169 $.map(list, function (row) { 170 var option = ''; 171 if (typeof prm.value !== 'undefined' && row.cmnDtlCd === prm.value) { 172 option = 'selected'; 173 } 174 $(obj).append('<option value="'+ row.cmnDtlCd +'" '+ option +'>'+ row.cmnDtlCdNm +'</option>'); 175 }); 176 break; 177 178 case 'check' : 179 $.map(list, function(row) { 180 $(obj).append('<span><label><input type="checkbox" name="'+ row.cmnGrupCd +'" value="'+ row.cmnDtlCd +'"/> '+ row.cmnDtlCdNm +'</label></span> '); 181 }); 182 break; 183 184 case 'radio' : 185 $.map(list, function(row) { 186 var nm = '', option = ''; 187 if (typeof prm.name !== 'undefined') { 188 nm = prm.name; 189 } else { 190 nm = row.cmnGrupCd; 191 } 192 var id = row.cmnGrupCd + '_' + row.cmnDtlCd; 193 194 if (typeof prm.value !== 'undefined' && row.cmnDtlCd === prm.value) { 195 option = 'checked'; 196 } 197 198 $(obj).append('<span><input type="radio" id="'+ id +'" name="'+ nm +'" value="'+ row.cmnDtlCd +'" '+ option +'/>' 199 + '<label for="'+ id +'">'+ row.cmnDtlCdNm +'</label></span>'); 200 }); 201 202 if (selTy !== 'V') { 203 $(obj).find('input:first').prop('checked', true); 204 } 205 break; 206 207 default : 208 break; 209 } 210 } 211} 212 213/* 214* @method gfn_isFrgnRrno 215* @description 주민ë±ë¡ë²í¸(ì¸êµë±ë¡ë²í¸) ë·ì리 ì±ë³êµ¬ë¶ì¼ë¡ ì¸êµì¸ ì¬ë¶ íë³ 216* @return boolean 217*/ 218function gfn_isFrgnRrno(rrno2) { 219 var gen = String(rrno2).charAt(0); 220 return gen >= '5' && gen <= '8'; 221} 222 223 224/* 225* @method gfn_chkRrno 226* @description 주민ë±ë¡ë²í¸ ì í¨ì±ì²´í¬(ìì리6, ë·ì리7, ë©ì¸ì§opt[ê²ì¬ëìëª ì¹, ì¸êµì¸ ê²ì¬ì¬ë¶]) 227* @return boolean 228*/ 229function gfn_chkRrno(rrno1, rrno2, opt){ 230 var rrn = String(rrno1) + String(rrno2);//주민ë±ë¡ë²í¸ 13ì리 (ex. 1234567654321) 231 var msg = ""; 232 if(!gfn_isNull(opt)) msg += gfn_isNull(opt[0])? "":opt[0]+"ì ";//target 233 msg += 'ì¬ë°ë¥¸ 주민ë±ë¡ë²í¸ë¥¼ ì ë ¥íì¬ ì£¼ì¸ì.'; 234 235 //ì릿ì and ì«ì ì²´í¬ 236 if (rrn.length !== 13 || isNaN(rrn)) { 237 alert(msg); 238 return false; 239 } 240 241 var genda = rrno2.substr(0,1) // ì±ë³ 1~4 242 var formalYear = (genda < 3) ? '19' : '20' // ì°ë ê³ì° - 1 ëë 2: 1900ë ë, 3 ëë 4: 2000ë ë 243 var yyyy = formalYear + rrno1.substr(0,2); 244 var MM = rrno1.substr(2,2); 245 var dd = rrno1.substr(4,2); 246 247 //ë ì§ ì í¨ì± ê²ì¬ 248 //month ê²ì¬ 249 if( MM<1 || MM>12 ) { 250 alert(msg); 251 return false; 252 } 253 var maxDaysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; 254 var maxDay = maxDaysInMonth[MM-1]; 255 256 // ì¤ë ì²´í¬ 257 if( MM===2 && ( yyyy%4===0 && yyyy%100!==0 || yyyy%400===0 ) ) { 258 maxDay = 29; 259 } 260 //ë ì§ê²ì¬ 261 if( dd<=0 || dd>maxDay ) { 262 alert(msg); 263 return false; 264 } 265 //ì¸êµì¸ 주민ë±ë¡ë²í¸ ãì±ë³ï¼1900ë ë ë¨ì "5", ì¬ì "6"ë¡, 2000ë ë ë¨ì "7", ì¬ì "8"ë¡ ì£¼ë¯¼ë±ë¡ë²í¸ì 구ë¶íì¬ íì 266 if (genda >= 5 && genda <= 8) { 267 //ì¸êµì¸ íì¸ì¬ë¶ ì²´í¬(ë©ì¸ì§ ì²ë¦¬ ìµì ì´ ìê³ , íì¸í´ë¦ì) 268 if(!gfn_isNull(opt) && opt[1]) { 269 var cmsg = gfn_isNull(opt[0])? "":opt[0]+"ì "; 270 cmsg += "ì±ë³êµ¬ë¶ 주민ë²í¸ ["+genda+"]ë ì¸êµì¸ 주민ë±ë¡ë²í¸ì ëë¤.\nê·¸ëë ë±ë¡íìê² ìµëê¹?"; 271 if(confirm(cmsg)){ 272 return true; 273 } 274 }else{ 275 return true;//ì¸êµì¸ì í¨í´ ì í¨ì± ê²ì¬X 276 } 277 278 //ë´êµì¸ 주민ë±ë¡ë²í¸ ì í¨ì±// ì±ë³ 1 ~ 4 279 }else if (genda >= 1 && genda <= 4) { 280 281 var n = 2; 282 var sum = 0; 283 for (var i = 0; i < rrno1.length; i++){
284 sum += parseInt(rrno1.substr(i, 1)) * n++; 285 } 286 for (var i = 0; i < rrno2.length - 1; i++) { 287 sum += parseInt(rrno2.substr(i, 1)) * n++; 288 if (n === 10){ 289 n = 2; 290 } 291 } 292 var checkSum = 11 - sum % 11; 293 if (checkSum === 11) checkSum = 1; 294 if (checkSum === 10) checkSum = 0; 295 if (checkSum === parseInt(rrno2.substr(6, 1))){ 296 return true; 297 } 298 299 } 300 //ë´ì¸êµì¸ ìëì ë° ì¡°ê±´íµê³¼ 못íìì, 301 alert(msg); 302 return false; 303} 304 305 306/* 307 * @method gfn_calcRrnoToAge 308 * @description 주민ë±ë¡ë²í¸(ì6ì리, ë¤7ì리)ë¡ ë§ëì´ ê³ì° 309 * @return ë§ëì´ 310 */ 311function gfn_calcRrnoToAge(rrno1, rrno2, opt) { 312 var curDateObj = new Date(); // ë ì§ Object ìì± 313 var curDate = ""; // íì¬ë ìì¼ 314 var curYear = curDateObj.getFullYear(); // íì¬ë ë 315 var curMonth = curDateObj.getMonth() + 1; // íì¬ì 316 var curDay = curDateObj.getDate(); // íì¬ì¼ 317 318 var tmpYear = parseInt(rrno1.substring(0, 2)); // ììë ë(ìì¼ ë ë) 319 var tmpAge = 0; // ììëì´ 320 var tmpBirthday = rrno1.substring(2, 6); // 주민ë²í¸ 4ì리 ìì¼ë¬¸ì ì¶ì¶ 321 var genType = rrno2.substring(0, 1); // 주민ë²í¸ ë·ì리 ì±ë³êµ¬ë¶ 문ì ì¶ì¶ 322 323 if(curMonth < 10){ curMonth = "0" + curMonth; }// íì¬ ìì´ 10ë³´ë¤ ììê²½ì° '0' 문ì í©íë¤ 324 if(curDay < 10){ curDay = "0" + curDay; }// íì¬ ì¼ì´ 10ë³´ë¤ ììê²½ì° '0' 문ì í©íë¤ 325 curDate = curYear.toString() + curMonth.toString() + curDay.toString();//íì¬ë ìì¼ 326 327 //1900ë ë ì(5,6ì¸êµì¸) 328 if(genType === "1"|| genType === "2" || genType === "5" || genType === "6") { 329 tmpYear = 1900 + tmpYear; 330 //2000ë ë ì´í ì(7,8ì¸êµì¸) 331 } else if(genType === "3"|| genType === "4" || genType === "7" || genType === "8") { 332 tmpYear = 2000 + tmpYear; 333 //0,9-> 1800ë ë ì 334 }else{ 335 tmpYear = 1800 + tmpYear; 336 } 337 338 //ë¬ (ì)기ì¤ì¼ë¡ ë§ëì´ ê³ì°í기 339 if(opt){ 340 //ë¤ìë¬ ì²«ì§¸ë ì§ êµ¬í기 341 var tmpMonth = rrno1.substring(2, 4); // ììë¬(ìì¼ ë¬) 342 var tmpDay = rrno1.substring(4, 6); // ììë¬(ìì¼ ì¼ì) 343 var birthDate = new Date(tmpYear, tmpMonth-1, 1);//ë ì§ë 1ì¼ë¡ dateë§ë¤ê¸° 344 345 birthDate.setMonth(birthDate.getMonth() + 1);//+1ë¬ 346 tmpYear = birthDate.getFullYear(); //+1ë¬ ì²ë¦¬í ìì¼ì ë ë 347 tmpMonth = birthDate.getMonth()+1; // +1ë¬ ì²ë¦¬í ìì¼ì 348 tmpDay = birthDate.getDate(); //1ì¼ë¡ ì´ê¸°íë ë ì§ 349 350 if(tmpMonth < 10){ tmpMonth = "0" + tmpMonth; }// íì¬ ìì´ 10ë³´ë¤ ììê²½ì° '0' 문ì í©íë¤ 351 if(tmpDay < 10){ tmpDay = "0" + tmpDay; }// íì¬ ì¼ì´ 10ë³´ë¤ ììê²½ì° '0' 문ì í©íë¤ 352 tmpBirthday = tmpMonth.toString() + tmpDay.toString();//기존 ìì¼ì +1ë¬ ì 1ì¼ì 기ì¤ì¼ë¡ ê³ì°ë ìì¼ 353 } 354 355 tmpAge = curYear - tmpYear;//ë ëë¡ ëì´ê³ì° 356 357 //ìì¼ì´ ì§ëì§ ììì¼ë©´ -1ì´ ì²ë¦¬ 358 if(curDate < Number(curYear.toString() + tmpBirthday.toString()) ) { 359 tmpAge += -1; 360 } 361 return tmpAge; 362} 363 364 365 366/* 367 * @method gfn_retLocParam 368 * @description íë¼ë¯¸í° ì¤í¸ë§ ê° ìì± 369 * @return param 370 */ 371function gfn_retLocParam(param) { 372 if (String(param).length === 0 && typeof param === undefined) { 373 return ""; 374 } 375 376 var arrLocParam = param.replace(/(\s*)/g, "").split(","); 377 var strRetValue = ""; 378 379 arrLocParam.forEach(function (item, index) { 380 var prm = encodeURIComponent($("#"+item).val()) === 'null' ? '' : encodeURIComponent($("#"+item).val()); 381 if(index === 0){ 382 strRetValue += "?"+ item +"="+ prm; 383 }else{ 384 strRetValue += "&"+ item +"="+ prm; 385 } 386 }); 387 return strRetValue; 388} 389 390 391/* 392 * @method gfn_saveStfInfo 393 * @description ë§ì¡±ë íê° 394 * @param null 395 */ 396function gfn_saveStfInfo() { 397 if (!$('#stfFrm').find('input[name="stfchrtPnt"]').is(':checked')) { 398 alert('íì ì ì ííì¸ì.'); 399 return false; 400 } 401 if ($('#stfchrtOpinCn').val().getByte() > 3000) { 402 alert('기íì견ì 1000ì ì´ì ë±ë¡í ì ììµëë¤.'); 403 return false; 404 } 405 var obj = { 406 url : "/gh/cmn/savePgeStfInfo.do", 407 param : $('#stfFrm').serialize(), 408 callback : function (json) { 409 if (json.cnt > 0) { 410 alert('íê°ê° ì ì¡ëììµëë¤.'); 411 //ì´ê¸°í 412 $('#stfFrm').find('input[name="stfchrtPnt"]').prop('checked', false); 413 $('#stfFrm').find('input[name="stfchrtOpinCn"]').val(''); 414 } 415 } 416 } 417 if (typeof obj !== 'undefined') { 418 callAjax(obj.url, obj.param, obj.callback); 419 } 420} 421 422/* 423 * @method gfn_readCnt 424 * @description ì¡°íì ì¦ê° 425 * @param null 426 */ 427function gfn_readCnt(id, no) { 428 if (!no.isEmpty()) { 429 var obj = { 430 url : "/gh/cmn/saveBbsSrchCntInfo.do", 431 param : {bbsId : id, bbsNo : no}, 432 callback : function (json) {} 433 } 434 if (typeof obj !== 'undefined') { 435 callAjax(obj.url, obj.param, obj.callback); 436 } 437 } 438} 439 440/* 441 * @method keyUpTel 442 * @description ì íë²í¸ keyup 443 * @param null 444 */ 445$.fn.keyUpTel = function () { 446 $(this).attr("maxlength", "13"); 447 448 $(this).on('keyup', function(e) { 449 var v = gfn_addHypenPno($(this).val().korEx().engEx().trim()); 450 if (v.length > 14) v = v.substring(0,13);//15ì리 ì´ì ëìì substring 451 452 $(this).val(v); 453 // ìì¸ ì§ìë²í¸(02)ê° ë¤ì´ê°ë ê²½ì° 1ì ì½ì 454 if(v.substring(0, 2).indexOf('02') == 0) { 455 if($(this).attr("maxlength") != "12") 456 $(this).attr("maxlength", "12"); 457 }else{ 458 if($(this).attr("maxlength") != "13") 459 $(this).attr("maxlength", "13"); 460 } 461 });
462} 463 464/* 465 * @method gfn_addHypenPno 466 * @description ì íë²í¸ setting 467 * @param null 468 */ 469function gfn_addHypenPno(number){ 470 number = number.replace(/[^0-9]/gi, ''); 471 var tel = ""; 472 473 // ìì¸ì´ë¼ë ë³ì를 ì ì¸ 474 var seoul = 0; 475 476 // ìì¸ ì§ìë²í¸(02)ê° ë¤ì´ê°ë ê²½ì° 1ì ì½ì 477 if(number.substring(0, 2).indexOf('02') == 0) { 478 seoul = 1; 479 // if($(this).attr("maxlength") != "12") 480 // $(this).attr("maxlength", "12"); 481 }else{ 482 //if($(this).attr("maxlength") != "13") 483 // $(this).attr("maxlength", "13"); 484 } 485 486 // 문ìì´ì ì르ë 기ì¤ìì ìì¸ì ê°ì ëºì¤(-)íë¤. 487 // ê°ì´ 1ì¼ê²½ì° -1ì´ ë ê²ì´ê³ , ê°ì´ 0ì¼ê²½ì° ë³íê° ìë¤. 488 if(number.length < (4-seoul)) { 489 return number; 490 } else if(number.length < (7-seoul)) { 491 tel += number.substr(0, (3-seoul )); 492 tel += "-"; 493 tel += number.substr(3-seoul); 494 } else if(number.length < (11-seoul)) { 495 tel += number.substr(0, (3-seoul)); 496 tel += "-"; 497 tel += number.substr((3-seoul), 3); 498 tel += "-"; 499 tel += number.substr(6-seoul ); 500 } else { 501 tel += number.substr(0, (3-seoul)); 502 tel += "-"; 503 tel += number.substr((3-seoul), 4); 504 tel += "-"; 505 tel += number.substr(7-seoul ); 506 } 507 return tel; 508} 509 510 511/* 512 * @method gfn_openAddr 513 * @description open addrPop 514 */ 515function gfn_openAddr(obj, appFlg) { 516 tgObj = $(obj); 517 gfn_addrPopup(appFlg); 518} 519 520/* 521 * @method gfn_openAddrApi 522 * @description open addrLayerPop 523 * 주ìApi ê²ì ë ì´ì´ íì í¸ì¶ 524 */ 525function gfn_openAddrApi(obj, addrFlg) { 526 tgObj = $(obj); 527 var prm = {menuId : $('#menuId').val(), addrFlg : addrFlg} 528 gfn_openLyPop('700', '/gh/cmm/addrSrchApiP.do', obj, prm); 529} 530 531/* 532 * @method gfn_addrPopup 533 * @description popup return object 534 * 주ìì í ì fn_addrCallBack(zipRoad) í¸ì¶ 535 */ 536function gfn_addrPopup(appFlg) { 537 /* 538 zipRoad.roadFullAddr // ì ì²´ëë¡ëª 주ì 539 zipRoad.roadAddrPart1 // ëë¡ëª 주ì(ì°¸ê³ í목ì ì¸) 540 zipRoad.roadAddrPart2 // ëë¡ëª 주ìì°¸ê³ í목 541 zipRoad.jibunAddr // ì§ë²ì ë³´ 542 zipRoad.engAddr // ëë¡ëª 주ì(ì문) 543 zipRoad.zipNo // ì°í¸ë²í¸ 544 zipRoad.admCd // íì 구ìì½ë 545 zipRoad.rnMgtSn // ëë¡ëª ì½ë 546 zipRoad.bdMgtSn // 건물ê´ë¦¬ë²í¸ 547 zipRoad.addrDetail // ê³ ê°ì ë ¥ìì¸ì£¼ì 548 zipRoad.detBdNmList // ìì¸ê±´ë¬¼ëª 549 zipRoad.bdNm // ê±´ë¬¼ëª 550 zipRoad.bdKdcd // ê³µë주íì¬ë¶ (1:ê³µë주í, 0:ë¹ê³µë주í) 551 zipRoad.siNm // ìëëª 552 zipRoad.sggNm // ìêµ°êµ¬ëª 553 zipRoad.emdNm // ìë©´ëëª 554 zipRoad.liNm // ë²ì ë¦¬ëª 555 zipRoad.rn // ëë¡ëª 556 zipRoad.udrtYn // ì§íì¬ë¶ (0:ì§ì ,1:ì§í) 557 zipRoad.buldMnnm // ê±´ë¬¼ë³¸ë² 558 zipRoad.buldSlno // 건물ë¶ë² (ë¶ë²ì´ìëê²½ì°0) 559 zipRoad.mtYn // ì°ì¬ë¶ (0:ëì§, 1:ì°) 560 zipRoad.lnbrMnnm // ì§ë²ë³¸ë²(ë²ì§) 561 zipRoad.lnbrSlno // ì§ë²ë¶ë²(í¸ )(ë¶ë²ì´ìëê²½ì°0) 562 zipRoad.emdNo // ìë©´ëì¼ë ¨ë²í¸ 563 */ 564 //document.domain = "e-health.go.kr"; 565 //document.domain = "127.0.0.1"; 566 567 var flg = 'P'; 568 if (gfn_isMobile()) { 569 flg = 'M'; // 모ë°ì¼ 570 } 571 572 var width = 570; 573 var height = 420; 574 575 //Fixes dual-screen position Most Browsers Firefox 576 var dualLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left; 577 var dualTop = window.screenTop !== undefined ? window.screenTop : screen.top; 578 579 var _width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; 580 var _height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; 581 582 var left = ((_width / 2) - (width / 2)) + dualLeft; 583 var top = ((_height / 2) - (height / 2)) + dualTop; 584 585 var specs = "scrollbars=yes, resizable=yes, left=" + left; 586 specs += ", top=" + top;
587 specs += ", width=" + width; 588 specs += ", height=" + height; 589 590 if (flg === 'M') { 591 specs = 'scrollbars=yes, resizable=yes'; 592 } 593 window.open("/gh/cmm/addrSrchP.do?appFlg="+ appFlg +"&flg=" + flg,"addrPop", specs); 594} 595/* 596 * @method gfn_isMobile 597 * @description 모ë°ì¼ ì ìì¬ë¶ 598 */ 599function gfn_isMobile() { 600 var rslt = false; 601 if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ 602 rslt = true; 603 }else{ 604 if(navigator.maxTouchPoints == '5'){ //ìì´í¨ë ì¼ë 모ë°ì¼ë¡ ì¸ìíê²ë (ëìí°ì¹ì = 5) 605 rslt = true; 606 } 607 } 608 return rslt; 609} 610 611/* 612 * @method gfn_isIos 613 * @description ios ì ìì¬ë¶ 614 */ 615function gfn_isIos() { 616 return /iPad|iPhone|iPod/.test(navigator.userAgent) || 617 (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1); 618} 619 620/* 621 * @method gfn_isIos 622 * @description ios ì ìì¬ë¶ 623 */ 624function gfn_isIosChrome() { 625 return gfn_isIos() && /CriOS/i.test(navigator.userAgent); 626} 627 628 629var lyBeObj = {}; // layer íì í¸ì¶ ì ëì obj 630/* 631 * @method gfn_openLyPop 632 * @description layer íì í¸ì¶ 633 */ 634function gfn_openLyPop(width, url, obj, param) { 635 636 var wid = width == null ? '_600' : width == '000' ? '' : '_'+width; 637 var ly_in_cls = width == '000' ? 'ly_in_pos' : ''; 638 var prm = param ? param : {}; 639 640 if ($('body > div:last').is('#layerPop') === false) { 641 $('<div id="layerPop" class="dark active" tabindex="0" >' + 642 '<div class="ly_wrap wid'+ wid +'"><div class="ly_in '+ly_in_cls+'"><div class="ly_box">' + 643 '</div></div></div></div>').insertAfter('body > div:last'); 644 645 $('.ly_box').load(url, prm, function (json, status, xhr) { 646 // 민ììë¹ì¤ session TimeOut ì¤ì 647 if (xhr.responseText.indexOf("rsMsg") > -1) { 648 var data = JSON.parse(json); 649 if (data.rsMsg.statusCode === "E") { 650 if (typeof data.msg !== 'undefined') { 651 alert(data.msg); 652 $('.ly_box').remove(); 653 location.href = data.Referer; 654 } 655 } 656 } 657 }); 658 } 659 660 $('#layerPop').focus(); 661 lyBeObj = obj; 662} 663 664 665/* 666 * @method gfn_popClose 667 * @description layer íì ì¢ ë£ 668 */ 669function gfn_popClose() { 670 671 $('#layerPop').remove(); 672 673 if (typeof lyBeObj !== 'undefined') { 674 lyBeObj.focus(); 675 lyBeObj = {}; // layer obj ì´ê¸°í 676 } 677} 678 679//ë©ì¸ íì ì°½ ì¤í 680function fn_openImsiPopup(pLocation, pName, pWidth, pHeight) { 681 var minWidth = 1500; // ìµì íì ëì´ 682 var minHeight = 900; // ìµì íì ëì´ 683 684 var nWidth = pWidth; 685 var nHeight = pHeight; 686 687 if(nWidth === 'null' || nWidth === undefined || nWidth === '' || Number(nWidth) < minWidth) { 688 nWidth = minWidth; 689 } 690 if(nHeight === 'null' || nHeight === undefined || nHeight === '' || Number(nHeight) < minHeight) { 691 nHeight = minHeight; 692 } 693 694 // ëì¼ ëª¨ëí° ê³ ë ¤í ìëì° ëì°ê¸° 695 var curX = window.screenLeft; 696 var curY = window.screenTop; 697 var curWidth = document.body.clientWidth; 698 var curHeight = document.body.clientHeight; 699 700 //var nLeft = curX + (curWidth / 2) - (nWidth / 2); 701 //var nTop = curY + (curHeight / 2) - (nHeight / 2); 702 703 var nLeft = curX + (curWidth / 2) - (nWidth / 2); 704 var nTop = 50; 705 706 var strOption = ""; 707 strOption += "left=" + nLeft + "px,"; 708 strOption += "top=" + nTop + "px,"; 709 strOption += "width=" + nWidth + "px,"; 710 strOption += "height=" + nHeight + "px,"; 711 strOption += "toolbar=no,menubar=no,location=no,"; 712 strOption += "resizable=yes,status=no,scrollbars=yes"; 713 714 var winObj = window.open(pLocation, pName, strOption); 715 if (winObj == null) { 716 return true; 717 } 718} 719 720 721/* 722 * @method gfn_layerFocus 723 * @description layer 첫ë²ì§¸ ììë¡ focus ì´ë 724 */ 725function gfn_layerFocus() { 726 var lpObjTabable = $('#layerPop').find('button, input:not([type="hidden"]), select, iframe, textarea, [href], [tabindex]:not
726([tabindex="-1"])'); 727 lpObjTabable.first().focus(); 728} 729 730 731/* 732 * @method gfn_beforeForm 733 * @description ë³ê²½ì ê° setting 734 * @param {form} obj 735 */ 736function gfn_beforeForm(obj) { 737 return $(obj).serialize(); 738} 739 740/* 741 * @method gfn_setFileTxt 742 * @description file txt setting 743 * @param {form} obj 744 */ 745function gfn_setFileTxt(obj) { 746 var file = ''; 747 var thum = ''; 748 if ($(obj).find('#fileInfo_list').length > 0) { 749 file = $('#fileInfo_list').find('.MultiFile-title').text(); 750 } 751 return file + thum; 752} 753 754 755/* 756 * @method gfn_setRadio 757 * @description ì²´í¬ë°ì¤ íëë§ ì í 758 * @param {object} obj - chkeckbox 759 */ 760function gfn_setRadio(obj) { 761 $(obj).on('click',function() { 762 if($(this).prop('checked')) { 763 $(obj).prop('checked', false); 764 $(this).prop('checked', true); 765 } 766 }); 767} 768/* 769* @method gfn_setRadioT 770* @description ì 목í´ë¦íì¬ ì²´í¬ë°ì¤ ì í 771* @param {object} obj - chkeckbox 772*/ 773function gfn_setRadioT(obj) { 774 $(obj).closest('tbody').find('input[type="checkbox"]').prop("checked", false); 775 $(obj).closest('tr').find('input[type="checkbox"]').prop("checked", true); 776} 777 778 779/* 780 * @method gfn_chkAgree 781 * @description ì ë³´ ëì íì¸ 782 */ 783function gfn_chkAgree() { 784 var cnt = 0; 785 $.each($('input[class^="agrY"]'), function (i, obj) { 786 if (!$(obj).is(':checked')) { 787 alert($('.pageNm').text() + '를(ì) ìíì¬ ìë´ì¬íì ëìí´ ì£¼ì기 ë°ëëë¤.'); 788 $(obj).focus(); 789 cnt++; 790 return false; 791 } 792 }); 793 return cnt; 794} 795 796 797/* 798 * @method gfn_setFocus 799 * @description focus on 800 * @param obj 801 */ 802function gfn_setFocus(obj) { 803 setTimeout(function() { 804 $(obj).focus(); 805 }); 806} 807 808/* 809 * @method gfn_getPage 810 * @description jsonì¼ë¡ ì ë¬ë°ì íì´ì§ ì ë³´ htmlë¡ ë¦¬í´ 811 * @return paging 812 */ 813function gfn_getPage(obj, page, func, prm) { 814 $(obj).children().remove(); //paging ì´ê¸°í 815 816 var firstPageNo = page.firstPageNo; 817 var firstPageNoOnPageList = page.firstPageNoOnPageList; 818 var totalPageCount = page.totalPageCount; 819 var pageSize = page.pageSize; 820 var lastPageNoOnPageList = page.lastPageNoOnPageList; 821 var currentPageNo = page.currentPageNo; 822 var lastPageNo = page.lastPageNo;
823 var minusPageNo = page.currentPageNo - 1; 824 var plusPageNo = page.currentPageNo + 1; 825 826 var fnSrc = 'fn_search(' 827 if (typeof func !== 'undefined') { 828 fnSrc = func; 829 } 830 if (typeof prm !== 'undefined') { 831 fnSrc += '("' + prm.prm1 + '", '; 832 } 833 834 var strPage = ""; 835 if (firstPageNoOnPageList > pageSize) { 836 strPage += "<a href='#' class='fir' title='ì²ì' onclick='"+ fnSrc +"1); return false;'>ì²ì</a>"; 837 strPage += "<a href='#' class='prev mobile_none' title='ì´ì ' onclick='"+ fnSrc + (firstPageNoOnPageList-1) +"); return false;' >ì´ì </a>"; 838 strPage += "<a href='#' class='prev mobile_view' title='ì´ì ' onclick='"+ fnSrc + minusPageNo +"); return false;'>" + "ì´ì </a>"; 839 } else { 840 strPage += "<a href='#' class='fir' title='ì²ì' onclick='"+ fnSrc + firstPageNo +"); return false;'>ì²ì</a>"; 841 strPage += "<a href='#' class='prev mobile_none' title='ì´ì ' onclick='"+ fnSrc + firstPageNo +"); return false;'>ì´ì </a>"; 842 if (currentPageNo === 1){ 843 strPage += "<a href='#' class='prev mobile_view' title='ì´ì ' onclick='"+ fnSrc + firstPageNo +"); return false;'>" + "ì´ì </a>"; 844 }else{ 845 strPage += "<a href='#' class='prev mobile_view' title='ì´ì ' onclick='"+ fnSrc + minusPageNo +"); return false;'>" + "ì´ì </a>"; 846 } 847 } 848 849 for(var i=firstPageNoOnPageList; i<=lastPageNoOnPageList; i++) { 850 if (i === currentPageNo) { 851 strPage += "<span class='on' title='ì íë íì´ì§'>"+ currentPageNo +"</span>"; 852 } else { 853 strPage += "<a href='#' class='num' title='"+i+"ë²ì§¸ íì´ì§' onclick='"+ fnSrc + i +"); return false;'>"+ i +"</a>"; 854 } 855 } 856 857 if (lastPageNoOnPageList < totalPageCount) { 858 strPage += "<a href='#' class='next mobile_view' title='ë¤ì' onclick='"+ fnSrc + plusPageNo +"); return false;'>" + "ë¤ì</a>"; 859 strPage += "<a href='#' class='next mobile_none' title='ë¤ì' onclick='"+ fnSrc + plusPageNo +"); return false;'>ë¤ì</a>"; 860 strPage += "<a href='#' class='last' title='ë§ì§ë§' onclick='"+ fnSrc + lastPageNo +"); return false;'>ë§ì§ë§</a>"; 861 } else { 862 if (currentPageNo === lastPageNo){ 863 strPage += "<a href='#' class='next mobile_view' title='ë¤ì' onclick='"+ fnSrc + lastPageNo +"); return false;'>" + "ë¤ì</a>"; 864 } else { 865 strPage += "<a href='#' class='next mobile_view' title='ë¤ì' onclick='"+ fnSrc + plusPageNo +"); return false;'>" + "ë¤ì</a>"; 866 } 867 strPage += "<a href='#' class='next mobile_none' title='ë¤ì' onclick='"+ fnSrc + lastPageNo +"); return false;'>ë¤ì</a>"; 868 strPage += "<a href='#' class='last' title='ë§ì§ë§' onclick='"+ fnSrc + lastPageNo +"); return false;'>ë§ì§ë§</a>"; 869 } 870 $(obj).append(strPage); 871} 872 873 874/* 875 * @method gfn_setPage 876 * @description jsonì¼ë¡ ì ë¬ë°ì íì´ì§ ì ë³´ htmlë¡ ë¦¬í´ 877 * @return paging 878 */ 879function gfn_setPage(obj, page, func) { 880 $(obj).children().remove(); //paging ì´ê¸°í 881 882 var curPage = page.curPage; 883 var totalPages = page.totalPages; 884 885 var fnSrc = 'fn_search' 886 if (typeof func !== 'undefined') { 887 fnSrc = func; 888 } 889 890 var strPage = ''; 891 var pageLimit = 5; 892 var startPage = parseInt((curPage - 1) / pageLimit) * pageLimit + 1; 893 var endPage = startPage + pageLimit - 1; 894 895 if (totalPages < endPage) { 896 endPage = totalPages; 897 } 898 899 // ì²ì, ì´ì 900 strPage += "<a href='#' class='fir' title='ì²ì' onclick='"+ fnSrc +"(1); return false;'>ì²ì</a>"; 901 strPage += "<a href='#' class='prev mobile_none' title='ì´ì ' onclick='"+ fnSrc +"("+ (curPage-1 === 0 ? 1 : curPage-1) +"); return false;'>ì´ì </a>"; 902 if (curPage === 1){ 903 strPage += "<a href='#' class='prev mobile_view' title='ì´ì ' onclick='"+ fnSrc +"(1); return false;'>" + "ì´ì </a>"; 904 } else { 905 strPage += "<a href='#' class='prev mobile_view' title='ì´ì ' onclick='"+ fnSrc +"("+ (curPage-1) +"); return false;'>" + "ì´ì </a>"; 906 } 907 908 // pageLimit ë§ê² íì´ì§ ë ¸ì¶ 909 for(var i=startPage; i<=endPage; i++) { 910 if (i === curPage) { 911 strPage += "<span class='on' title='íì¬ íì´ì§'>"+ i +"</span>"; 912 } else { 913 strPage += "<a href='#' class='num' title='"+i+"ë²ì§¸ íì´ì§' onclick='"+ fnSrc +"("+ i +"); return false;'>"+ i +"</a>"; 914 } 915 } 916 917 // ë¤ì, ë§ì§ë§ 918 if (curPage === totalPages){ 919 strPage += "<a href='#' class='next mobile_view' title='ë¤ì' onclick='"+ fnSrc +"("+ totalPages +"); return false;'>" + "ë¤ì</a>"; 920 } else { 921 strPage += "<a href='#' class='next mobile_view' title='ë¤ì' onclick='"+ fnSrc +"("+ (curPage+1) +"); return false;'>" + "ë¤ì</a>"; 922 } 923 strPage += "<a href='#' class='next mobile_none' title='ë¤ì' onclick='"+ fnSrc +"("+ (curPage+1 < totalPages ? curPage+1 : totalPages) +"); return false;'>ë¤ì</a>"; 924 strPage += "<a href='#' class='last' title='ë§ì§ë§' onclick='"+ fnSrc +"("+ totalPages +"); return false;'>ë§ì§ë§</a>"; 925 926 $(obj).append(strPage); 927} 928 929/* 930* @method gfn_logout 931* @description ë¡ê·¸ìì(ì¸ì out) 932*/ 933function gfn_logout() { 934 var obj = { 935 url : '/gh/caSrvc/sessionOut.do', 936 param : {menuId : $('#menuId').val()}, 937 callback : function () { 938 sessionStorage.clear(); 939 } 940 } 941 if (typeof obj !== 'undefined') { 942 callAjax(obj.url, obj.param, obj.callback); 943 } 944} 945 946/* 947* @method gfn_connFileInfo 948* @description ì°ê³ë¥¼ íµí íì¼ ìì 949*/ 950function gfn_connFileInfo(docId, flSn) { 951 var obj = { 952 url : '/gh/caSrvc/selectConnFileInfo.do', 953 param : {docId : docId ,flSn : flSn}, 954 callback : function (json) { 955 if (json.result.docId !== '' && json.result.rtnMsg === '') { 956 gfn_connFileDown(json.result.docId); // 문ì ë¤ì´ 957 } else { 958 if (json.result.rtnMsg !== '') { 959 alert(json.result.rtnMsg); 960 } 961 } 962 } 963 } 964 if (typeof obj !== 'undefined') { 965 callAjax(obj.url, obj.param, obj.callback); 966 } 967} 968 969function gfn_openPdfFile(pdfObj, fNm){ 970 971 if(gfn_isIosChrome()){ 972 const pdfDataUri = pdfObj.output('datauristring'); 973 const link = document.createElement('a'); 974 975 link.href = pdfDataUri; 976 link.download = fNm; 977 978 document.body.appendChild(link); 979 link.click(); 980 document.body.removeChild(link); 981 982 }else { 983 const blobData = pdfObj.output('blob'); 984 const pdfUrl = URL.createObjectURL(blobData); 985 986 if(gfn_isIos()){ 987 window.location.href = pdfUrl; 988 }else{ 989 const link = document.createElement('a'); 990 link.href = pdfUrl; 991 link.download = fNm; 992 993 document.body.appendChild(link); 994 link.click(); 995 document.body.removeChild(link); 996 } 997 } 998}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.