1var UI = {},compareUI; 2 3//ìì´í° ë°±ë²í¼ ì¤ë¥ìì 4$(window).bind("pageshow", function(event) { 5 if (event.originalEvent.persisted) {window.location.reload();} 6}); 7 8/* ì ë ¥í¼ ì¤í¨ */ 9UI.inpSkin = function(){ 10 /* radio Skin */ 11 $(document).on('click','input[type=radio]',function(){ 12 if($(this).parent().is('.radio-skin')){ 13 $('input[name="'+this.name+'"]').each(function(){ 14 $(this).parent().removeClass('checked'); 15 $(this).attr('checked',false); 16 }) 17 $(this).parent().addClass('checked'); 18 $(this).attr('checked',true); 19 } 20 }) 21 /* checkBox skin */ 22 $(document).on('click','input[type=checkbox]',function(){ 23 var _label = $(this).parent(); 24 if(_label.is('.chk-skin')){ 25 if(_label.is('.checked')){ 26 _label.removeClass('checked') 27 $(this).attr('checked',false); 28 }else{ 29 _label.addClass('checked'); 30 $(this).attr('checked',true); 31 } 32 } 33 }) 34} 35/* ë¹êµí기 */ 36UI.compareChk = function(){ 37 var me = { 38 arrItem : [], 39 _init : function(){ 40 var viewport = $(".goods-compare > span"); 41 /* list hover */ 42 var _listItem = $('a.prd-wrap'); 43 _listItem.each(function(){ 44 $(this).parent().bind({ 45 'mouseenter':function(){ 46 $(this).addClass('hover') 47 }, 48 'mouseleave':function(){ 49 $(this).removeClass('hover') 50 } 51 }) 52 }) 53 54 //compare checkbox event 55 _listItem.parent().find('.chk-skin input').click(function(){ 56 var arrCopy = []; 57 var _listel = $(this).parents('li'); 58 var modelId = _listel.attr('id'); /* DBìì 모ë¸ì 구ë¶í ììë indexê° */ 59 var modelName = _listel.find('.model-name').text(); 60 61 /* ë°ì´í° ê°ì²´ ìì± */ 62 var tmpObj = {}; 63 var overlap = false; 64 tmpObj[modelId] = modelName; 65 66 /* ì¤ë³µë°ì´í° ê²ì¬ */ 67 for(var c=0; c<me.arrItem.length; c++){ 68 for(var key in me.arrItem[c]){ 69 if(key != modelId){ 70 arrCopy.push(me.arrItem[c]); 71 }else{ 72 overlap = true; 73 } 74 } 75 } 76 if(!overlap){ 77 if(me.arrItem.length > 2){ 78 alert('í´ëí°ì 3ê°ê¹ì§ë§ ë¹êµê° ê°ë¥í©ëë¤'); 79 return false; 80 } 81 arrCopy.push(tmpObj); 82 } 83 84 /* dom ê°ì²´ì ì ì© */ 85 var arrInnerHtml = []; 86 for(var i=0; i<arrCopy.length; i++){ 87 for(var key in arrCopy[i]){ 88 arrInnerHtml.push("<span data-id='"+key+"'>"+ arrCopy[i][key] +"<a href='#' class='compare-delect'>ìì </a></span>"); 89 } 90 } 91 viewport.html(arrInnerHtml.join('')) 92 me.arrItem = arrCopy; 93 }); 94 viewport.on('click','.compare-delect',function(){ 95 var testrset = $(this).parent().attr('data-id'); 96 97 $('#'+testrset).find('input[type=checkbox]').click(); 98 return false; 99 }); 100 } 101 } 102 return me; 103} 104 105/* layer popup */ 106UI.modal = function(target){ 107 var _this = $(target); 108 109 return { 110 open: function(options){ 111 $('#dimm').show(); 112 $('#popWrap1').show(); 113 _this.show(); 114 this.bind(options); 115 }, 116 close: function(){ 117 $('#dimm').hide(); 118 $('#popWrap1').hide(); 119 _this.hide(); 120 }, 121 bind: function(options){ 122 _this.find('.d_ok').unbind(); 123 _this.find('.d_close').unbind(); 124 125 _this.find('.d_ok').click(function(){ 126 options.OK.call(); 127 }) 128 _this.find('.d_close').click(function(){ 129 options.CANCEL.call(); 130 return false; 131 }) 132 } 133 } 134} 135 136/* basket popup */ 137UI.basketPopup = function(thisE) { 138 var _this = $(thisE); 139 140 if ($('.simple-menu .simple-join').hasClass('join-popup-open')){ 141 $('.simple-menu .simple-join').removeClass('join-popup-open'); 142 } 143 144 if (_this.parent().hasClass('active')){ 145 _this.parent().removeClass('active'); 146 } else { 147 _this.parent().addClass('active'); 148 $('.simple-join-popup').css('display', 'none'); 149 } 150} 151 152/* simple join popup */ 153UI.simpleJoinPopup = function(thisE) { 154 var _this = $(thisE); 155 156 if ($('.simple-menu .basket > li').eq(0).hasClass('active')){ 157 $('.simple-menu .basket > li').eq(0).removeClass('active'); 158 } 159 if (_this.parent().hasClass('join-popup-open')){ 160 _this.parent().removeClass('join-popup-open');
161 $('.simple-join-popup').slideUp(); 162 } else { 163 _this.parent().addClass('join-popup-open'); 164 $('.simple-join-popup').slideDown(); 165 } 166} 167 168/* phon detail img */ 169UI.detailImg = function() { 170 var me = { 171 _init : function(){ 172 var viewport = $(".thumb-view"), 173 viewCont = viewport.find('.img > ul'), 174 viewList = viewCont.find('> li'), 175 indexActive = viewport.find('.simg li'), 176 nextBtn = viewport.find('.bimg .next'), 177 prevBtn = viewport.find('.bimg .prev'), 178 index = 0; 179 180 nextBtn.click(function(){ 181 if (index < indexActive.length){ 182 index = index + 1; 183 } 184 indexActive.removeClass('active').eq(index).addClass('active'); 185 viewCont.css('margin-left', viewList.width() * -index); 186 if (index == (indexActive.length - 1)){ 187 nextBtn.css('display','none'); 188 } 189 prevBtn.css('display',''); 190 }); 191 192 prevBtn.click(function(){ 193 if (index > 0){ 194 index = index - 1; 195 } 196 indexActive.removeClass('active').eq(index).addClass('active'); 197 viewCont.css('margin-left', viewList.width() * -index); 198 if (index == 0){ 199 prevBtn.css('display','none'); 200 } 201 nextBtn.css('display',''); 202 }); 203 204 indexActive.click(function(){ 205 index = $(this).index(); 206 indexActive.removeClass('active'); 207 $(this).addClass('active'); 208 viewCont.css('margin-left', viewList.width() * -index); 209 if (index == (indexActive.length - 1)){ 210 nextBtn.css('display','none'); 211 prevBtn.css('display',''); 212 } else if (index == 0){ 213 nextBtn.css('display',''); 214 prevBtn.css('display','none'); 215 } else { 216 nextBtn.css('display',''); 217 prevBtn.css('display',''); 218 } 219 }); 220 } 221 } 222 return me; 223} 224 225UI.mainBanner = function() { 226 var me = { 227 _init : function(){ 228 var bodyW = $(window).width(); 229 if(bodyW < 1196){ 230 $('.quici_btn').css('display',''); 231 } else { 232 $('.quici_btn').css('display','none'); 233 }if(bodyW > 1196){ 234 $('.spread_type').css('display',''); 235 }else{ 236 $('.spread_type').css('display','none'); 237 }return false; 238 } 239 } 240 return me; 241} 242 243$(document).ready(function(){ 244 UI.inpSkin(); 245 compareUI = UI.compareChk(); 246 compareUI._init(); 247 $('.simple-menu .basket-icon').click(function(){ 248 UI.basketPopup(this); 249 }); 250 $('.simple-menu .simple-join-icon').click(function(){ 251 UI.simpleJoinPopup(this); 252 }); 253 254 if ($('.basket-list .basket-item > li').length > 0){ 255 var basketList = $('.basket-list .basket-item > li'); 256 basketList.each(function(index){ 257 if (((index+1)%3) == '0'){ 258 basketList.eq(index).addClass('list-three'); 259 } 260 }); 261 } 262 263 if ($('.top-banner')){ 264 $('.top-banner .top-banner-close').click(function() { 265 $('.top-banner').css('display','none'); 266 }); 267 } 268 269 if ($('.product-info .thumb-view')){ 270 UI.detailImg()._init(); 271 } 272 if ($('.main_wrap .spread_type')){ 273 UI.mainBanner()._init(); 274 $(window).resize(function(){ 275 UI.mainBanner()._init(); 276 }); 277 } 278 279/* $('#header .gnb > li').hover(function(){ 280 $(this).css('height','152px').find('.sub-gnb').css('display', 'block'); 281 }, function(){ 282 $(this).css('height','48px').find('.sub-gnb').css('display', ''); 283 }) 284*/ 285 286 // ë°°ì¡ì¡°í 287 $('#headership').click(function(event) { 288 event.preventDefault(); 289 // var url = location.href; 290 $.popupWindow_edited({ 291 windowURL : "/telink/inquiry", 292 windowName : "ShareDialog", 293 width : 626, 294 height : 436, 295 centerBrowser: 1 296 }); 297 }); 298 299 //ì«ìë§ ì ë ¥ê°ë¥íê²í기 300 $(".datepicker").siblings('input').keyup(function(){ 301 $(this).val($(this).val().replace(/[^0-9]/g,"")); 302 }) 303 304 $(".datepicker").siblings('input').blur(function(){ 305 var obj = $(this).val(); 306 var len = obj.length; 307 var tmp = ""; 308 309 if(len == 8){ 310 tmp += obj.substr(0,4); 311 tmp += "-"; 312 tmp += obj.substr(4,2); 313 tmp += "-"; 314 tmp += obj.substr(6,2); 315 316 if(fn_dateCheck(tmp)){ 317 $(this).val(tmp); 318 } 319 } 320 }) 321}); 322 323function fn_dateCheck(strValue){ 324 var chk1 = /^(19|20)\d{2}-([0][1-9]|1[012])-([0][1-9]|[12][0-9]|3[01])$/; 325 326 if (chk1.test(strValue) == false){ // ì í¨ì± ê²ì¬ì ì±ê³µíì§ ëª»íë¤ë©´ 327 return false; 328 } 329 330 //------------------------------------------------------------------------------- 331 // ì¡´ì¬íë ë ì(ì í¨í ë ì) ì¸ì§ ì²´í¬ 332 //------------------------------------------------------------------------------- 333 var bDateCheck = true; 334 var arrDate = strValue.split("-"); 335 var nYear = Number(arrDate[0]); 336 var nMonth = Number(arrDate[1]); 337 var nDay = Number(arrDate[2]); 338 339 // ì¬ì©ê°ë¥ íì§ ìì ë ë ì²´í¬ 340 if (nYear < 1900 || nYear > 2400){ 341 bDateCheck = false; 342 } 343 344 // ì¬ì©ê°ë¥ íì§ ìì ë¬ ì²´í¬ 345 if (nMonth < 1 || nMonth > 12){ 346 bDateCheck = false; 347 } 348 349 // í´ë¹ë¬ì ë§ì§ë§ ì¼ì 구í기 350 var nMaxDay = new Date(new Date(nYear, nMonth, 1) - 86400000).getDate(); 351 if (nDay < 1 || nDay > nMaxDay){ 352 bDateCheck = false; 353 } 354 355 if(bDateCheck == false) { 356 return false; 357 }else{ 358 return true; 359 } 360} 361 362/* 363function onlyNumber(event) { 364 var key = window.event ? event.keyCode : event.which; 365 if ((event.shiftKey == false) && ((key > 47 && key < 58) || (key > 95 && key < 106) 366 || key == 35 || key == 36 || key == 37 || key == 39 // ë°©í¥í¤ ì¢ì°,home,end
367 || key == 8 || key == 46 || key == 9) // del, back space, tab 368 ) { 369 return true; 370 } else if((event.shiftKey == true) && key == 9){ 371 return true; 372 } else { 373 return false; 374 } 375} 376*/ 377function onlyNumber(event) { 378 var key = window.event ? event.keyCode : event.which; 379 if( 380 event.shiftKey == false && ( 381 (48 <= key && key <= 57) ||/* í¤ë³´ë ì«ì í¤ */ 382 (96 <= key && key <= 105) ||/* ì«ìí¨ë ì«ì í¤ */ 383 (37 <= key && key <= 40) ||/* ì¢(37), ì(38), ì°(39), í(40) íì´í¬ */ 384 key == 8 ||/* back space í¤ */ 385 key == 46 ||/* delete í¤ */ 386 key == 9 /* tab í¤ */ 387 ) 388 ) { 389 return true; 390 } else if((event.shiftKey == true) && key == 9) { 391 return true; 392 } else { 393 return false; 394 } 395} 396 397//ìì í¤ì´ë²¤í¸ í¨ì를 ì¬ì©í ê²½ì° ìµì¤íë¡ë¬ìì íê¸ì´ ì ë ¥ê°ë¥íë¤. 398function onlyNumber2(obj) { 399 var str = obj.value; 400 var reg_patt = /[^0-9]*$/g; 401 obj.value = str.replace(reg_patt,""); 402} 403 404function onlyNumberInputEvent(obj, event) { 405 var data = event.data; 406 var pattern = /[^0-9]/g; 407 if(data && data.length == 1 && data.match(pattern)) { 408 obj.value = obj.value.replace(data, ""); 409 } 410} 411 412function onlyDateInputEvent(obj, event) { 413 var data = event.data; 414 var pattern = /[^0-9\-]/g; 415 if(data && data.length == 1 && data.match(pattern)) { 416 obj.value = obj.value.replace(data, ""); 417 } 418 419} 420 421function onlyNumberMobile(selector) { 422 var filter = "win16|win32|win64|mac|macintel"; 423 if(navigator.platform) { 424 if(filter.indexOf(navigator.platform.toLowerCase()) < 0) { // Mobileë¡ ì ìíì ê²½ì° 425 $(selector) 426 .attr("type", "number") 427 .attr("max", "9999") 428 .attr("pattern", "[0-9]*") 429 .attr("inputmode", "numeric") 430 .attr("oninput", "maxLengthCheck(this)") 431 ; 432 } else { // PCë¡ ì ìíì ê²½ì° 433 } 434 } 435} 436 437function onlyNumberMobileMask(selector) { 438 var filter = "win16|win32|win64|mac|macintel"; 439 if(navigator.platform) { 440 if(filter.indexOf(navigator.platform.toLowerCase()) < 0) { // Mobileë¡ ì ìíì ê²½ì° 441 $(selector).css("-webkit-text-security", "disc"); 442 } else { // PCë¡ ì ìíì ê²½ì° 443 } 444 } 445} 446 447function maxLengthCheck(object) { 448 if(object.value.length > object.maxLength){ 449 object.value = object.value.slice(0, object.maxLength); 450 } 451} 452 453function onlyEngNumber(event) { 454 var key = window.event ? event.keyCode : event.which; 455 if ((event.shiftKey == false) && ((key > 47 && key < 58) || (key > 95 && key < 106) 456 || key == 35 || key == 36 || key == 37 || key == 39 // ë°©í¥í¤ ì¢ì°,home,end 457 || key == 8 || key == 46 || key == 9) // del, back space, tab 458 && (key > 64 && key < 91) // alphabet 459 ) { 460 return true; 461 } else if((event.shiftKey == true) && key == 9){ 462 return true; 463 } else { 464 return false; 465 } 466} 467 468function onlyEngNumber2(obj) { 469 var str = obj.value; 470 var reg_patt = /[^A-Za-z0-9]/g; 471 obj.value = str.replace(reg_patt,""); 472} 473 474function onlyPhoneNumber(event) { 475 var key = window.event ? event.keyCode : event.which; 476 if ((event.shiftKey == false) && ((key > 47 && key < 58) || (key > 95 && key < 106) 477 || key == 35 || key == 36 || key == 37 || key == 39 // ë°©í¥í¤ ì¢ì°,home,end 478 || key == 8 || key == 46 || key == 9 || key == 109 || key == 189) // del, back space, tab 479 ) { 480 return true; 481 } else if((event.shiftKey == true) && key == 9){ 482 return true; 483 } else { 484 return false; 485 } 486} 487 488function fnLink(url) { 489 loadingModal(""); 490 window.location.href = url; 491} 492 493function fnAjaxGetJson({url, data, successCallback, failCallback, isFollowup}) { 494 fnAjaxJson({type: 'get', url, data, successCallback, failCallback, isFollowup}); 495} 496function fnAjaxPostJson({url, data, successCallback, failCallback, isFollowup=false}) { 497 fnAjaxJson({type: 'post', url, data, successCallback, failCallback, isFollowup}); 498} 499function fnAjaxJson({type, url, data, successCallback, failCallback, isFollowup=false}) { 500 data = JSON.stringify(data); 501 $.ajax({
502 type, 503 url, 504 data, 505 dataType: 'json', 506 contentType: 'application/json; charset=utf-8', 507 beforeSend(xhr) { 508 loadingModal(); 509 xhr.setRequestHeader('AJAX', true); 510 }, 511 success: function(result) { 512 if (typeof successCallback != 'function') return; 513 successCallback(result); 514 }, 515 error: function (xhr, status, error) { 516 unloadingModal(); 517 if (typeof failCallback != 'function') return; 518 failCallback(error); 519 }, 520 complete(xhr) { 521 if (!isFollowup) { 522 unloadingModal(); 523 } 524 } 525 }); 526} 527 528// ë¹ë기 ajax 529function fnAjaxSubmit(url, type, data, dataType, callbackFunction, loadingMessage, proc, isFollowup) { 530 if(!proc) { 531 setTimeout(function(){ 532 loadingModal(loadingMessage); 533 }, 1); 534 } 535 jQuery.ajax({ 536 url : url, 537 type : type, 538 data : data, 539 dataType: dataType, 540 async : true, 541 beforeSend : function(xhr) { 542 xhr.setRequestHeader("AJAX", true); 543 }, 544 success : callbackFunction, 545 error:function(xhr, status, error) { 546 unloadingModal(); 547 }, 548 complete:function(xhr) { 549 if(!proc && !isFollowup) { 550 unloadingModal(); 551 } 552 } 553 }); 554} 555 556//ë¹ë기 ajax 557function fnAjaxSubmitNoLoadingModal(url, type, data, dataType, callbackFunction, loadingMessage, proc) { 558 jQuery.ajax({ 559 url : url, 560 type : type, 561 data : data, 562 dataType: dataType, 563 async : true, 564 beforeSend : function(xhr) { 565 xhr.setRequestHeader("AJAX", true); 566 }, 567 success : callbackFunction, 568 error:function(xhr, status, error) { 569 }, 570 complete:function(xhr) { 571 } 572 }); 573} 574 575function loadingModal(loadingMessage) { 576 if(loadingMessage != undefined && $.trim(loadingMessage) != "") { 577 $("#area-modal-loading").find(".loading-alert").text(loadingMessage); 578 } 579 $("#area-modal-loading").modal("show"); 580} 581 582function unloadingModal() { 583 setTimeout(function(){ 584 $("#area-modal-loading").modal("hide"); 585 }, 500); 586} 587 588// ë기í ajax 589function fnAsyncAjaxSubmit(url, type, data, dataType, callbackFunction, viewLoading, proc) {
590 if( (navigator.appName == 'Netscape' && navigator.userAgent.search('Trident') != -1) || (navigator.userAgent.toLowerCase().indexOf("msie") != -1) ) { // IE ì¼ ê²½ì° 591 //loadingModal(viewLoading); 592 } else { 593 if(proc == undefined) { 594 loadingModal(viewLoading); 595 } 596 } 597 jQuery.ajax({ 598 url : url, 599 type : type, 600 data : data, 601 dataType: dataType, 602 async : false, 603 beforeSend : function(xhr) { 604 xhr.setRequestHeader("AJAX", true); 605 }, 606 success : callbackFunction, 607 error:function(xhr, status, error) { 608 unloadingModal(); 609 }, 610 complete:function(xhr) { 611 if(proc == undefined) { 612 unloadingModal(); 613 } 614 } 615 }); 616} 617 618// ë기í ajax 619function fnSyncAjax(option) { 620 url, type, data, dataType, callbackFunction, viewLoading, proc 621 if( (navigator.appName == 'Netscape' && navigator.userAgent.search('Trident') != -1) || (navigator.userAgent.toLowerCase().indexOf("msie") != -1) ) { // IE ì¼ ê²½ì° 622 //loadingModal(viewLoading); 623 } else { 624 if(proc == undefined) { 625 loadingModal(viewLoading); 626 } 627 } 628 jQuery.ajax({ 629 url : url, 630 type : type, 631 data : data, 632 dataType: dataType, 633 async : false, 634 beforeSend : function(xhr) { 635 xhr.setRequestHeader("AJAX", true); 636 }, 637 success : callbackFunction, 638 error:function(xhr, status, error) { 639 unloadingModal(); 640 }, 641 complete:function(xhr) { 642 if(proc == undefined) { 643 unloadingModal(); 644 } 645 } 646 }); 647} 648 649/** 650* @desc ë기ajaxìì² - ë기ë¼ì loadingModalì ì¬ì© ìí¨ 651* @desc return response 652* @param Object option 653* @param String url 654* @param String type 655* @param Object data 656* @param String dataType 657* @return Object 658*/ 659function fnSyncAjax(option) { 660 const url = option.url; 661 const type = option.type; 662 const data = option.data; 663 const dataType = option.dataType; 664 const isFollowup = !!option.isFollowup; // íì apiìì² ìëì§ ì¬ë¶ 665 666 let result; 667 668 jQuery.ajax({ 669 url : url, 670 type : type, 671 data : data, 672 dataType: dataType, 673 async : false, 674 beforeSend : function(xhr) { 675 xhr.setRequestHeader("AJAX", true); 676 loadingModal(); 677 }, 678 success : function (response, status, xhr) { 679 result = response; 680 }, 681 error:function(xhr, status, error) { 682 unloadingModal(); 683 result = error; 684 }, 685 complete:function(xhr) { 686 if (!isFollowup) { // íì apiìì² ìì¼ë©´ ëª¨ë¬ ë기 687 unloadingModal(); 688 } 689 } 690 }); 691 692 return result; 693} 694 695function fnSyncPostAjax(option) { 696 option.type = 'post'; 697 return fnSyncAjax(option); 698} 699 700function fnSyncGetAjax(option) { 701 option.type = 'get'; 702 return fnSyncAjax(option); 703} 704 705function fnFormSubmit(formobj, viewLoading) { 706 if(viewLoading == undefined || viewLoading) { 707 loadingModal(); 708 } 709 formobj.submit(); 710} 711 712$.dateInput = function(showId){ 713 $(showId).datepicker({ 714 inline: true, 715 dateFormat: "yy-MM-dd", /* ë ì§ í¬ë§· */ 716 prevText: 'ì´ì ë¬', 717 nextText: 'ë¤ì ë¬', 718 defaultDate:new Date(), 719 showButtonPanel: true, /* ë²í¼ í¨ë ì¬ì© */ 720 changeMonth: true, /* ì ì íë°ì¤ ì¬ì© */ 721 changeYear: true, /* ë ì íë°ì¤ ì¬ì© */ 722 showOtherMonths: true, /* ì´ì /ë¤ì ë¬ ì¼ì ë³´ì´ê¸° */ 723 selectOtherMonths: true, /* ì´ì /ë¤ì ë¬ ì¼ ì íí기 */ 724 yearRange:'2010:+5', 725 closeText: 'ë«ê¸°', 726 currentText: 'ì¤ë', 727 showMonthAfterYear: true, /* ë ê³¼ ë¬ì ìì¹ ë°ê¾¸ê¸° */ 728 minDate: '-20y', 729 /* íê¸í */ 730 monthNames : ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], 731 monthNamesShort : ['1ì', '2ì', '3ì', '4ì', '5ì', '6ì', '7ì', '8ì', '9ì', '10ì', '11ì', '12ì'], 732 dayNames : ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 733 dayNamesShort : ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 734 dayNamesMin : ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 735 /* ë ì§ ì í¨ì± ì²´í¬ */ 736 onClose: function(selectedDate) { 737 $(showId).val(selectedDate); 738 } 739 }); 740}; 741 742$.birthDateInput = function(showId){ 743 $(showId).datepicker({ 744 inline: true, 745 dateFormat: "yy-MM-dd", /* ë ì§ í¬ë§· */ 746 prevText: 'ì´ì ë¬', 747 nextText: 'ë¤ì ë¬', 748 defaultDate:new Date(), 749 showButtonPanel: true, /* ë²í¼ í¨ë ì¬ì© */ 750 changeMonth: true, /* ì ì íë°ì¤ ì¬ì© */ 751 changeYear: true, /* ë ì íë°ì¤ ì¬ì© */
752 showOtherMonths: true, /* ì´ì /ë¤ì ë¬ ì¼ì ë³´ì´ê¸° */ 753 selectOtherMonths: true, /* ì´ì /ë¤ì ë¬ ì¼ ì íí기 */ 754 yearRange:'-150:+0', 755 closeText: 'ë«ê¸°', 756 currentText: 'ì¤ë', 757 showMonthAfterYear: true, /* ë ê³¼ ë¬ì ìì¹ ë°ê¾¸ê¸° */ 758 minDate: '-150y', 759 /* íê¸í */ 760 monthNames : ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], 761 monthNamesShort : ['1ì', '2ì', '3ì', '4ì', '5ì', '6ì', '7ì', '8ì', '9ì', '10ì', '11ì', '12ì'], 762 dayNames : ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 763 dayNamesShort : ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 764 dayNamesMin : ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 765 /* ë ì§ ì í¨ì± ì²´í¬ */ 766 onClose: function(selectedDate) { 767 $(showId).val(selectedDate); 768 } 769 }); 770}; 771 772 773var holidays = { 774 "0101":{type:0, title:"ì ì "}, 775 "0301":{type:0, title:"ì¼ì¼ì "}, 776 "0505":{type:0, title:"ì´ë¦°ì´ë "}, 777 "0606":{type:0, title:"íì¶©ì¼"}, 778 "0815":{type:0, title:"ê´ë³µì "}, 779 "1003":{type:0, title:"ê°ì²ì "}, 780 "1225":{type:0, title:"í¬ë¦¬ì¤ë§ì¤"} 781}; 782 783$.dateInput2 = function(showId){ 784 785 $(showId).datepicker({ 786 dateFormat: "yymmdd", 787 changeYear: true, //ë ë ë³ê²½ ê°ë¥ 788 changeMonth: true, //ì ë³ê²½ ê°ë¥ 789 showOn: "button", //ë²í¼ í´ë¦ì ë¬ë ¤ íì 790 buttonImage: "/html/images/btn/btn_calendar.gif", //ë¬ë ¥ íì ë²í¼ ì´ë¯¸ì§ 791 buttonImageOnly: true, //ë²í¼ì í´ë¦í´ì¼ë§ ë¬ë ¥ íì 792 /* íê¸í */ 793 closeText : 'ë«ê¸°', 794 prevText : 'ì´ì ë¬', 795 nextText : 'ë¤ìë¬', 796 currentText : 'ì¤ë', 797 monthNames : ['1ì', '2ì', '3ì', '4ì', '5ì', '6ì', '7ì', '8ì', '9ì', '10ì', '11ì', '12ì'], 798 monthNamesShort : ['1ì', '2ì', '3ì', '4ì', '5ì', '6ì', '7ì', '8ì', '9ì', '10ì', '11ì', '12ì'], 799 dayNames : ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 800 dayNamesShort : ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 801 dayNamesMin : ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 802 maxDate : $.datepicker.formatDate('yymmdd', new Date()), //ì¤ë ì´í ë ì§ ì í 못í¨. 803 beforeShowDay: function(day) { 804 var result; 805 // í¬ë§·ì ëí´ì ë¤ì 참조(http://docs.jquery.com/UI/Datepicker/formatDate) 806 var holiday = holidays[$.datepicker.formatDate("mmdd",day )]; //íìë ì´ í´ì¼ì¸ì§ ì²´í¬ 807 808 if (holiday) { 809 result = [true, "date-holiday"+holiday.type, holiday.title]; 810 } else { 811 switch (day.getDay()) { 812 case 0: // ì¼ìì¼? 813 result = [true, "date-sunday"]; 814 break; 815 case 6: // í ìì¼? 816 result = [true, "date-saturday"]; 817 break; 818 default: 819 result = [true, ""]; 820 break; 821 } 822 } 823 return result; 824 }, 825 onSelect: function(date) { //ë¬ë ¥ìì ë ì§ë¥¼ ì íì í¸ì¶ëë ë©ìë 826 try{ 827 var dateArr = date; 828 $(showId).val(dateArr); //ì¼ 829 }catch (e) {return;} 830 } 831 }); 832 //ë¬ë ¥ UI를 íê¸ë¡ ë³ê²½ 833 $(showId).datepicker( "option", $.datepicker.regional[ "ko" ] ); 834 835} 836 837 838 839function phoneTabSession(tabGubun , successYn){ 840 $.ajax({ 841 type : "POST", 842 url : "/rate/tabSession", 843 dataType : "html", 844 data : { "sessionTabGubun":tabGubun }, 845 success : function(data) 846 { 847 if(successYn == "Y"){ 848 if(data == ""){ 849 TAB_GUBUN = "lte"; 850 }else{ 851 TAB_GUBUN = data; 852 } 853 tabPhoneChange(TAB_GUBUN); 854 } 855 }, 856 complete: function(){ 857 858 }, 859 error : function(data) 860 { 861 alert( "Ajax Error : Error ë¤ì ìëí´ ì£¼ì¸ì."); 862 } 863 }); 864 865} 866 867 868/***********************************************************************************/ 869/** Captcha start ******************************************************************/ 870/***********************************************************************************/ 871function fnPreventRefresh(el) {
872 //2025.01.21 24ë ì·¨ì½ì ì ê² code-ray [ëì]CWE-330 ë¶ì¶©ë¶í ëë¤ê° ì¬ì© ìì 873 let uint32Array = new Uint32Array(1); 874 window.crypto.getRandomValues(uint32Array); 875 const randomNumber = uint32Array[0] / (Math.pow(2, 32)); 876 //el.attr("src", "/cmmn/captcha.do?q="+el.attr("q")+"&r="+Math.random()); 877 el.attr("src", "/cmmn/captcha.do?q="+el.attr("q")+"&r="+randomNumber); 878} 879function playCaptcha(el) { 880 //2025.01.21 24ë ì·¨ì½ì ì ê² code-ray [ëì]CWE-330 ë¶ì¶©ë¶í ëë¤ê° ì¬ì© ìì 881 let uint32Array = new Uint32Array(1); 882 window.crypto.getRandomValues(uint32Array); 883 const randomNumber = uint32Array[0] / (Math.pow(2, 32)); 884 //var soundUrl = "/cmmn/audioCaptcha.do?q="+el.attr("q")+"&r="+Math.random(); 885 var soundUrl = "/cmmn/audioCaptcha.do?q="+el.attr("q")+"&r="+randomNumber; 886 var uAgent = navigator.userAgent; 887 if (uAgent.indexOf('Trident') > -1 || uAgent.indexOf('MSIE') > -1) { 888 winPlayer(soundUrl+'&agent=msie'); 889 } else if (!!document.createElement('audio').canPlayType) { 890 try { new Audio(soundUrl).play(); } catch(e) { winPlayer(soundUrl); } 891 } else { 892 //window.open(soundUrl, '', 'width=1,height=1'); 893 } 894} 895function winPlayer(objUrl) { 896 $('<div id="audiocaptcha" style="display:none;"></div>').appendTo('body'); 897 $('#audiocaptcha').html(' <bgsound src="' + objUrl + '">'); 898} 899 900function fnCaptchaLoading(el) { 901 //2025.01.21 24ë ì·¨ì½ì ì ê² code-ray [ëì]CWE-330 ë¶ì¶©ë¶í ëë¤ê° ì¬ì© ìì 902 var uint32Array = new Uint32Array(1); 903 window.crypto.getRandomValues(uint32Array); 904 var randomNumber = uint32Array[0] / (Math.pow(2, 32)); 905 //var q = Math.random(); 906 var q = randomNumber; 907 el.attr("q", q); 908 //2025.01.21 24ë ì·¨ì½ì ì ê² code-ray [ëì]CWE-330 ë¶ì¶©ë¶í ëë¤ê° ì¬ì© ìì 909 //el.attr("src", "/captcha.do?q="+el.attr("q")+"&r="+Math.random()); 910 window.crypto.getRandomValues(uint32Array); 911 randomNumber = uint32Array[0] / (Math.pow(2, 32)); 912 el.attr("src", "/captcha.do?q="+el.attr("q")+"&r="+randomNumber); 913 $("input[name='q']").val(el.attr("q")); 914} 915function fnCaptchaRefresh(el) { 916 //el.attr("src", "/captcha.do?q="+el.attr("q")+"&r="+Math.random()); 917 $("#captchaText").prop("readonly",false); 918 $('#captchaText').val(''); 919 fnCaptchaLoading(el); 920} 921function fnCaptchaAudio(el) { 922 //2025.01.21 24ë ì·¨ì½ì ì ê² code-ray [ëì]CWE-330 ë¶ì¶©ë¶í ëë¤ê° ì¬ì© ìì 923 let uint32Array = new Uint32Array(1); 924 window.crypto.getRandomValues(uint32Array); 925 const randomNumber = uint32Array[0] / (Math.pow(2, 32)); 926 //var soundUrl = "/captchaAudio.do?q="+el.attr("q")+"&r="+Math.random(); 927 var soundUrl = "/captchaAudio.do?q="+el.attr("q")+"&r="+randomNumber; 928 var uAgent = navigator.userAgent; 929 if (uAgent.indexOf('Trident') > -1 || uAgent.indexOf('MSIE') > -1) { 930 winPlayer(soundUrl+'&agent=msie'); 931 } else if (!!document.createElement('audio').canPlayType) { 932 try { new Audio(soundUrl).play(); } catch(e) { winPlayer(soundUrl); } 933 } else { 934 //window.open(soundUrl, '', 'width=1,height=1'); 935 } 936} 937 938function fnNewCaptchaLoading(containerId, imageId, qId, captchaTextId) { 939 //2025.01.21 24ë ì·¨ì½ì ì ê² code-ray [ëì]CWE-330 ë¶ì¶©ë¶í ëë¤ê° ì¬ì© ìì 940 var uint32Array = new Uint32Array(1); 941 window.crypto.getRandomValues(uint32Array); 942 var randomNumber = uint32Array[0] / (Math.pow(2, 32)); 943 //var q = Math.random(); 944 var q = randomNumber; 945 $("#"+containerId).find("#"+captchaTextId).val("").focus(); 946 $("#"+containerId).find("#"+imageId).attr("q", q); 947 //2025.01.21 24ë ì·¨ì½ì ì ê² code-ray [ëì]CWE-330 ë¶ì¶©ë¶í ëë¤ê° ì¬ì© ìì 948 //$("#"+containerId).find("#"+imageId).attr("src", "/captcha.do?q=" + q +"&r=" + Math.random()); 949 window.crypto.getRandomValues(uint32Array); 950 randomNumber = uint32Array[0] / (Math.pow(2, 32)); 951 $("#"+containerId).find("#"+imageId).attr("src", "/captcha.do?q=" + q +"&r=" + randomNumber); 952 $("#"+containerId).find("#"+qId).val(q); 953} 954/***********************************************************************************/ 955/** Captcha end ********************************************************************/ 956/***********************************************************************************/ 957 958 959function setComma(num){ 960 var pattern = /(^[+-]?\d+)(\d{3})/; 961 num += ''; 962 while (pattern.test(num)){ 963 num = num.replace(pattern, '$1' + ',' + '$2'); 964 } 965 return num == '0.0' ? '0' : num; 966} 967 968/** 969 * ì¶ì²ì¸ ì²´í¬ 970 * @param tp 971 */ 972function fnRcmdrCheck(tp, obj) { 973 switch(tp) { 974 case "Y01"://ì ë² ì´ì¤ì¸ ê²½ì° ì²ë¦¬ ë¡ì§ 975 var msg = "ì íí ì¶ì²ì¸ ì 보를 íì¸íì í ë¤ì ì ë ¥í´ ì£¼ì¸ì."; 976 if($.trim(obj.val()) == "") { 977 alert(msg); 978 obj.focus(); 979 return false; 980 } else {
981 var numberCheck = /^[0-9]*$/; 982 if($.trim(obj.val()).length == 8 && numberCheck.test(obj.val())) { 983 return true; 984 } else if($.trim(obj.val()).length == 9) { 985 if($.trim(obj.val()).substring(0,1).toUpperCase() == "U" && numberCheck.test($.trim(obj.val()).substring(1))) { 986 return true; 987 } 988 } 989 alert(msg); 990 obj.focus(); 991 return false; 992 } 993 break; 994 case "Y02"://1+1 ì½ì´ì´ë²¤í¸ ì¸ ê²½ì° ì²ë¦¬ ë¡ì§ 995 var msg = "ì íí ì¶ì²ì¸ ì 보를 íì¸íì í ë¤ì ì ë ¥í´ ì£¼ì¸ì."; 996 if($.trim(obj.val()) == "") { 997 alert(msg); 998 obj.focus(); 999 return false; 1000 } else { 1001 var spNext = obj.val().split("/"); 1002 var e_pattern = /[ã±-ã |ê°-í£]{2,}\/[0-9]{2,11}$/i; 1003 if(!e_pattern.test(obj.val())) { 1004 alert("ìì) í길ë/01012341234 íìê³¼ ê°ì´ ì ë ¥íì기 ë°ëëë¤."); 1005 obj.focus(); 1006 return false; 1007 } 1008 if(spNext[1].length < 10){ 1009 alert("í´ëí°ë²í¸ë ìµì 10ì리ì´ì ì ë ¥í´ì£¼ì기 ë°ëëë¤."); 1010 obj.focus(); 1011 return false; 1012 } 1013 if(spNext[1].length >= 12){ 1014 alert("í´ëí°ë²í¸ë 11ì리 ì´íë¡ ì ë ¥í´ì£¼ì기 ë°ëëë¤."); 1015 obj.focus(); 1016 return false; 1017 } 1018 return true; 1019 } 1020 break; 1021 } 1022} 1023 1024 1025 1026 1027 1028/************************************************************************************************ 1029 * ê¸°ë¥ : ëìë¦¬ë§ ë§ì¤í¹ ì²ë¦¬ 1030 ************************************************************************************************/ 1031function maskingName(val) { 1032 if(strName === undefined || strName === '') { 1033 return ''; 1034 } 1035 var pattern = /.$/; 1036 return strName.replace(pattern, "*"); 1037} 1038 1039/************************************************************************************************ 1040 * ê¸°ë¥ : ë¤ìì ë¶í° 3ê¸ì를 * ì²ë¦¬íë¤. (ex. 12ê°3456 â 12ê°3***) 1041 ************************************************************************************************/ 1042function maskingCar(val) { 1043 if (strCar == undefined || strCar === '') { 1044 return ''; 1045 } 1046 1047 var pattern = /.{3}$/; // ì ê·ì 1048 return strCar.replace(pattern, "***"); 1049} 1050 1051 1052/************************************************************************************************ 1053 * ê¸°ë¥ : html í¹ì문ì ìì° 1054 ************************************************************************************************/ 1055function strip_tag (str){ 1056 return str.replace(/(<([^>]+)>)/ig,""); 1057} 1058 1059/************************************************************************************************ 1060 * ê¸°ë¥ : ì´ë©ì¼ì²´í¬ 1061 ************************************************************************************************/ 1062function fnCheckEmail(emailValue) { 1063 var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 1064 if(filter.test(emailValue)) { 1065 return true; 1066 } else { 1067 return false; 1068 } 1069} 1070 1071function fnCheckEmail2(title, emailIdNm, emailDoNm) { 1072 //var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; 1073// var re1 = /^([\w-]+(?:\.[\w-]+)*)/i; 1074 var re1 = /^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*$/i; 1075 var re2 = /((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; 1076 //var email = fnNmVal(emailIdNm) +'@'+ fnNmVal(emailDoNm); 1077 1078 1079 if(re1.test(fnNmVal(emailIdNm)) === false) { 1080 alert(title + fnJosa.c(title,'ì/를') + " íì¸í´ 주ì¸ì."); 1081 $('#' + emailIdNm).focus(); 1082 return false; 1083 } 1084 1085 if(re2.test(fnNmVal(emailDoNm)) === false) { 1086 alert(title + fnJosa.c(title,'ì/를') + " íì¸í´ 주ì¸ì."); 1087 $('#' + emailDoNm).focus(); 1088 return false; 1089 } 1090 /* 1091 if(re.test(email) === false) { 1092 alert(title + fnJosa.c(title,'ì/를') + " íì¸í´ 주ì¸ì."); 1093 $('#' + emailIdNm).focus(); 1094 return false; 1095 } 1096 */ 1097 return true; 1098} 1099 1100function fnNmVal(nm) { 1101 return $.trim($('#' + nm).val())||''; 1102} 1103 1104;var fnJosa = (function(){ 1105 var _f = [ 1106 function(string) { //ì/를 êµ¬ë¶ 1107 return _hasJong(string) ? 'ì' : '를'; 1108 1109 }, 1110 function(string){ //ì/ë êµ¬ë¶ 1111 return _hasJong(string) ? 'ì' : 'ë'; 1112 }, 1113 function(string){ //ì´/ê° êµ¬ë¶ 1114 return _hasJong(string) ? 'ì´' : 'ê°'; 1115 } 1116 ], 1117 1118 _formats = { 1119 'ì/를' : _f[0], 1120 'ì' : _f[0], 1121 '를' : _f[0], 1122 'ì를' : _f[0], 1123 'ì/ë' : _f[1], 1124 'ì' : _f[1], 1125 'ë' : _f[1], 1126 'ìë' : _f[1], 1127 'ì´/ê°' : _f[2], 1128 'ì´' : _f[2], 1129 'ê°' : _f[2], 1130 'ì´ê°' : _f[2] 1131 }; 1132 1133 1134 function _hasJong(string){ //stringì ë§ì§ë§ ê¸ìê° ë°ì¹¨ì ê°ì§ëì§ íì¸ 1135 string = string.charCodeAt(string.length - 1); 1136 return (string - 0xac00) % 28 > 0; 1137 1138 } 1139 1140 return { 1141 c: function(word, format){ 1142 if (typeof _formats[format] === 'undefined') throw 'Invalid format!'; 1143 return _formats[format](word); 1144 1145 } 1146 }; 1147 1148})(); 1149 1150function fncfileChK(id,files,mbSize,fixType){ 1151 id = $("#"+id); 1152 var fixList = fixTypeList(fixType); 1153 if (navigator.userAgent.toLowerCase().indexOf("msie") == -1) { 1154 var f = files; 1155 if(f!=undefined){ 1156 if(f.size < mbSize){ 1157 flag2 = true; 1158 }else { 1159 customAlert("ì ë¡ëì í " + byteCalculation(mbSize) + " ì ëë¤."); 1160 $(id).val(''); 1161 $('.upload-name').val('ì´ë¯¸ì§ë¥¼ ë±ë¡í´ì£¼ì¸ì.'); 1162 } 1163 } 1164 } 1165 var pix = $(id).val().split(".")[1].toLowerCase(); 1166 if(pix != null){ 1167 if(fixList.indexOf(pix) == -1){ 1168 customAlert("íì©ë íì¥ì íì¼ì´ ìëëë¤. <br>(jpg, jpeg, gif, png, pdf, heic ë±ì ì´ë¯¸ì§ íì¼ë¡ ì ë¡ë í´ ì£¼ì¸ì)"); 1169 $(id).val(''); 1170 $('.upload-name').val('ì´ë¯¸ì§ë¥¼ ë±ë¡í´ì£¼ì¸ì.'); 1171 }else{ 1172 flag1 = true; 1173 } 1174 } 1175} 1176 1177function fixTypeList(type){ 1178 var result = ''; 1179 if(type == 1){ 1180 result = "jpg, gif, png, pdf, jpeg, heic"; 1181 }else if(type == 2){
1182 result = "pptx, hwp, doc, pdf, xlxs"; 1183 }else if(type == 3){ 1184 result = "jpg, gif, png, pdf, bmp, pptx, hwp, doc, pdf, xlxs"; 1185 }else{ 1186 result = type; 1187 } 1188 return result; 1189} 1190 1191function byteCalculation(bytes) { 1192 var bytes = parseInt(bytes); 1193 var s = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB']; 1194 var e = Math.floor(Math.log(bytes)/Math.log(1024)); 1195 1196 if(e == "-Infinity") return "0 "+s[0]; 1197 else 1198 return (bytes/Math.pow(1024, Math.floor(e))).toFixed(2)+" "+s[e]; 1199} 1200 1201/** 1202 * ë§¤ì¥ ì°¾ê¸° 1203 */ 1204function fnDispatcherHtml(url, obj, pType, pData) { 1205 var type = pType == undefined ? "post" : pType; 1206 var data = pData == undefined ? "{}" : pData; 1207 var dataType = "html"; 1208 fnAjaxSubmit(url, type, data, dataType, function(data) { 1209 $("#footerPop").html(data); 1210 $("#"+obj) 1211 .modal() 1212 .on('shown.bs.modal', function (e) { 1213 var $this = $(this); 1214 focusControl($this.find('.modal-content')); 1215 }) 1216 ; 1217 }); 1218} 1219 1220/** 1221 * Mobile Device ì²´í¬ 1222 */ 1223function isMobileDevice() { 1224 var pc_device = "win16|win32|win64|mac|macintel"; 1225 var this_device = navigator.platform; 1226 var isDevide; 1227 if(this_device) { 1228 if(pc_device.indexOf(navigator.platform.toLowerCase()) == -1) { 1229 isDevide = true;// MOBILE 1230 } else { 1231 isDevide = false;// PC 1232 } 1233 } 1234 return isDevide; 1235} 1236 1237/** 1238 * App function 1239 */ 1240function onBackPressed() { 1241 var cur_href = window.location.pathname; 1242 if(cur_href == "/cust/post/myServiceApp.do" || cur_href == "/mmbr/login/login.do" || cur_href == "/mmbr/login/appAutoLogin.do"){ 1243 customConfirm("ì±ì ì¢ ë£íìê² ìµëê¹?", "", function() {finishApp();}); 1244 return; 1245 } 1246 1247 window.history.back(); 1248 1249} 1250 1251function finishApp() { 1252 if (window.SK7App) { 1253 window.SK7App.finishApp(); 1254 } else if (window.webkit 1255 && window.webkit.messageHandlers 1256 && window.webkit.messageHandlers.SK7App) { 1257 var message = { 1258 command: 'finishApp' 1259 }; 1260 window.webkit.messageHandlers.SK7App.postMessage(message); 1261 } 1262// else { 1263// 24ë ì·¨ì½ì ì ê² CWE-489 íì± ëë²ê·¸ ì½ë ì ê±° 1264// console.log("No native APIs found."); 1265// } 1266} 1267// ê³µê¸°ê³ ê²°ì í기 í¨ì 1268function fnPhonePayment(prodCd, refer) { 1269 1270 var form = document.createElement("form"); 1271 form.setAttribute("charset", "UTF-8"); 1272 form.setAttribute("method", "Post"); //Post ë°©ì 1273 form.setAttribute("action", "/shop/mobile/phonePayment.do"); //ìì² ë³´ë¼ ì£¼ì 1274 form.setAttribute("id", "createForm"); //í¼ Id 1275 1276 var hiddenField = document.createElement("input"); 1277 hiddenField.setAttribute("type", "hidden"); 1278 hiddenField.setAttribute("name", "prodCd"); 1279 hiddenField.setAttribute("value", prodCd); 1280 1281 form.appendChild(hiddenField); 1282 1283 if(refer != undefined) { 1284 form.setAttribute("action", "/shop/mobile/phonePayment.do?refer="+refer); //ìì² ë³´ë¼ ì£¼ì 1285 } 1286 1287 document.body.appendChild(form); 1288 1289 fnFormSubmit($("#createForm")); 1290} 1291 1292// datepicker 1293function setDateOfDatepicker(el, date) { 1294 $(el).datepicker("setDate", date); 1295} 1296 1297function fnSelAuthTp(type){ 1298 $("[id^='dv_auth_']").hide(); 1299 $("#dv_auth_"+type).show(); 1300 1301 if(type.indexOf('Rep') >= 0){ 1302 if(type == "RepX"){ 1303 $(".certInputRep").show(); 1304 }else{ 1305 $(".certInputRep").hide(); 1306 } 1307 }else{ 1308 if(type == "X"){ 1309 $(".certInput").show(); 1310 }else{ 1311 $(".certInput").hide(); 1312 } 1313 } 1314} 1315 1316function authFail(errMsg){ 1317 1318 if(errMsg == "NOSESSION"){ 1319 1320 if( typeof(fnNoSeSSION) == 'function' ) { 1321 fnNoSeSSION(); 1322 } else { 1323 customAlert("ì¥ìê° ì§íì´ ìì´ ê°ì¸ì ë³´ë³´í¸ë¥¼ ìíì¬ ì¢ ë£íììµëë¤.<br> ë¤ì ìëíì기 ë°ëëë¤.", '', function() {location.reload();}); 1324 } 1325 1326 }else{ 1327 customAlert(errMsg); 1328 } 1329} 1330 1331function XSS_Check(str){ 1332 if(!str == "" || !str == undefined){ 1333 str = str.replace(/\</g, "<"); 1334 str = str.replace(/\</g, ">"); 1335 } 1336 return str; 1337} 1338 1339/** 1340 * 2023.08.22 ì± ì ê·¸ë ì´ë(ë¤ë¹ê²ì´ì ì¶ê°, íì , í¸ì) 1341 * */ 1342 1343//1. ë©ë´ í´ë¦ ì í¸ì¶ëë function 1344//* AOS ì onBackPressed() í¸ì¶ê³¼ ì ì¬í©ëë¤. 1345function onMenuClicked() { 1346 // ë©ë´ íë©´ íì±í ì¬ë¶ ìí를 ì±ì´ ê´ë¦¬í기 ì´ë ¤ì°ë¯ë¡ ì¹ì¼ë¡ ì ë¬íë ë°ì´í°ë ìì´ í¸ì¶ë©ëë¤. 1347 // ì´ function ì´ í¸ì¶ëë©´ ì¹ìì ìí를 íì¸í´ hide/show ì²ë¦¬ê° ëë©´ ë ë¯ í©ëë¤. 1348 if(!window.sk7mobile 1349 || window.sk7mobile.isOpenMenu == undefined){ 1350 window.sk7mobile = { 1351 isOpenMenu:false 1352 }; 1353 } 1354 if(!window.sk7mobile.isOpenMenu){ 1355 setGtag('모ë°ì¼GNB','íë²ê±°ë²í¼','ë©ì¸'); 1356 gnbFocus(); 1357 }else{ 1358 gnbClose(); 1359 } 1360}; 1361 1362function setCheckMenuItem(isChecked) { 1363var message = { 1364 command: 'setCheckMenuItem', 1365 isChecked: isChecked // true: ë©ë´ íë©´ ON, false: ë©ë´ íë©´ OFF 1366}; 1367if (window.SK7App) { 1368 window.SK7App.setCheckMenuItem(JSON.stringify(message)); 1369} else if (window.webkit 1370 && window.webkit.messageHandlers 1371 && window.webkit.messageHandlers.SK7App) { 1372 window.webkit.messageHandlers.SK7App.postMessage(message); 1373}
1374//else { 1375// 24ë ì·¨ì½ì ì ê² CWE-489 íì± ëë²ê·¸ ì½ë ì ê±° 1376// console.log("No native APIs found."); 1377//} 1378} 1379 1380 1381//2. ëë°ì´ì¤ ì ë³´ ê°ì ¸ì¤ê¸° 1382function getDeviceInfo() { 1383 var message = { 1384 command: 'getDeviceInfo', 1385 callback: onDeviceInfoReceived.name 1386 }; 1387 if (window.SK7App) { 1388 window.SK7App.getDeviceInfo(JSON.stringify(message)); 1389 } else if (window.webkit 1390 && window.webkit.messageHandlers 1391 && window.webkit.messageHandlers.SK7App) { 1392 window.webkit.messageHandlers.SK7App.postMessage(message); 1393 } 1394// else { 1395// 24ë ì·¨ì½ì ì ê² CWE-489 íì± ëë²ê·¸ ì½ë ì ê±° 1396// console.log("No native APIs found."); 1397// } 1398} 1399 1400//ëë°ì´ì¤ ì ë³´ Callback function 1401function onDeviceInfoReceived(deviceInfo) { 1402 /* ex: 1403 { 1404 "carrier": "T-Mobile", // íµì ì¬ ì ë³´ 1405 "deviceModel": "sdk_gphone64_arm64", // ë¨ë§ 모ë¸ëª 1406 "os": "android", 1407 "osVersion": 34, 1408 "pushToken": "d8SQmdFmRBKrj..." 1409 } 1410 */ 1411} 1412 1413//3. PUSH í í° ê°ì ¸ì¤ê¸° 1414function getPushToken() { 1415 var message = { 1416 command: 'getPushToken', 1417 callback: onPushTokenReceived.name 1418 }; 1419 if (window.SK7App) { 1420 window.SK7App.getPushToken(JSON.stringify(message)); 1421 } else if (window.webkit 1422 && window.webkit.messageHandlers 1423 && window.webkit.messageHandlers.SK7App) { 1424 window.webkit.messageHandlers.SK7App.postMessage(message); 1425 } 1426// else { 1427// 24ë ì·¨ì½ì ì ê² CWE-489 íì± ëë²ê·¸ ì½ë ì ê±° 1428// console.log("No native APIs found."); 1429// } 1430} 1431 1432//PUSH í í° callback function 1433function onPushTokenReceived(result) { 1434// 24ë ì·¨ì½ì ì ê² CWE-489 íì± ëë²ê·¸ ì½ë ì ê±° 1435// console.log(JSON.stringify(result)); 1436 /* ex: 1437 { 1438 "code": 0, // 0: SUCCESS, -1: FAULED 1439 "fcm_token": "d8SQmdFmRBKrjitBK..." 1440 } 1441 */ 1442} 1443 1444//PUSH data callback function 1445function onPushDataReceived(pushData) { 1446 var form = document.createElement('form'); 1447 form.setAttribute('method','POST'); 1448 form.setAttribute('action','/push/readPush.do'); 1449 1450 var pushDataInput = document.createElement('input'); 1451 pushDataInput.setAttribute('type','hidden'); 1452 pushDataInput.setAttribute('name','readSeq'); 1453 pushDataInput.setAttribute('value',pushData.readSeq); 1454 form.appendChild(pushDataInput); 1455 1456 document.body.appendChild(form); 1457 form.submit(); 1458 /* 1459 console.log("data payload: " + JSON.stringify(data)); 1460 ex: { 1461 "image": "https://www.sk7mobile.com/telink/upload/banner/1784/2307181823513393160.jpg", 1462 "message": "Body SK ì¸ë¸ëª¨ë°ì¼ ì í´ì², ì´ëì ê°ì í´ë ííì íì ìµëì¹!, SK ì¸ë¸ëª¨ë°ì¼ ì í´ì², ì´ëì ê°ì í´ë ííì íì ìµëì¹!", 1463 "readSeq": "ylD1R1w7/SkWiF6RaKRJnw==", 1464 "title": "Title SK ì¸ë¸ëª¨ë°ì¼ ì í´ì², ì´ëì ê°ì í´ë ííì íì ìµëì¹!", 1465 "view": "https://www-stg.sk7mobile.com:38889/bnef/event/eventIngView.do?cntId=001012fb780a258336607b7751ef04dc&refer=main" 1466 } 1467 */ 1468} 1469 1470/* 1471function formatInputDate(dateInput) { // ë ì§ íì key-in ê¸°ë¥ ê°ì 1472 1473 if(event && event.keyCode == 8) { // backspaceì¸ ê²½ì°ë ê·¸ëë¡ ì§í 1474 return true; 1475 } 1476 1477 if(!onlyNumber(event) && event.key != '-') { 1478 dateInput.value = dateInput.value.replace(/[^0-9\-]/g, ""); 1479 return false; 1480 } 1481 1482 var dateValue = dateInput.value.replace(/[^0-9]/g, ""); 1483 console.log('formatInputDate!! = ' + JSON.stringify(dateValue)); 1484 if(dateValue) { 1485 var formatted = ""; 1486 if(dateValue.length < 4) { 1487 return dateValue; 1488 } else if(dateValue.length < 6) { 1489 formatted = dateValue.substr(0, 4); 1490 formatted += "-"; 1491 formatted += dateValue.substr(4); 1492 } else { 1493 formatted = dateValue.substr(0, 4); 1494 formatted += "-"; 1495 formatted += dateValue.substr(4, 2); 1496 formatted += "-"; 1497 formatted += dateValue.substr(6); 1498 } 1499 dateInput.value = formatted; 1500 } 1501} 1502*/ 1503function formatDate(input) { 1504 var cursorPosition = input.selectionStart; 1505 var oldValue = input.value; 1506 var value = oldValue.replace(/[^0-9]/g, ''); 1507 1508 var formatted = ''; 1509 if (value.length > 0) { 1510 formatted = value.substring(0, 4); 1511 } 1512 if (value.length >= 5) { 1513 formatted += '-' + value.substring(4, 6); 1514 } 1515 if (value.length >= 7) { 1516 formatted += '-' + value.substring(6, 8); 1517 } 1518 1519 if (formatted !== oldValue) { 1520 input.value = formatted; 1521 1522 // 커ì ìì¹ ì¬ì¡°ì 1523 var dashesBeforeCursor = (oldValue.substring(0, cursorPosition).match(/-/g) || []).length; 1524 var dashesAfterFormat = (formatted.substring(0, cursorPosition).match(/-/g) || []).length; 1525 var newCursorPosition = cursorPosition + (dashesAfterFormat - dashesBeforeCursor); 1526 1527 input.setSelectionRange(newCursorPosition, newCursorPosition); 1528 } 1529}
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.