1var comApp = comApp || {}; 2 3// console.log('comApp in js : ', comApp); 4 5comApp.calender = (function($) { 6 var target, startInput, endInput, callBack; 7 var init = function(iTarget, cb) { 8 9 $.datepicker.setDefaults({ 10 closeText: 'ë«ê¸°', 11 currentText: 'ì¤ë', 12 prevText: 'ì´ì ë¬', 13 nextText: 'ë¤ì ë¬', 14 monthNames: ['1ì', '2ì', '3ì', '4ì', '5ì', '6ì', '7ì', '8ì', '9ì', '10ì', '11ì', '12ì'], 15 monthNamesShort: ['1ì', '2ì', '3ì', '4ì', '5ì', '6ì', '7ì', '8ì', '9ì', '10ì', '11ì', '12ì'], 16 dayNames: ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 17 dayNamesShort: ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 18 dayNamesMin: ['ì¼', 'ì', 'í', 'ì', '목', 'ê¸', 'í '], 19 weekHeader: '주', 20 yearSuffix: 'ë ', 21 dateFormat: 'yy-mm-dd', 22 showMonthAfterYear : true 23 }); 24 25 target = $(iTarget); 26 callBack = cb; 27 28 startInput = $("input[name=" + target.data("start") + "]"); 29 if (target.data("mobile") != true) { 30 startInput.datepicker(); 31 startInput.datepicker("option", "onSelect", function(dateText, inst) { 32 changeDate(); 33 }); 34 } 35 endInput = $("input[name=" + target.data("end") + "]"); 36 if (target.data("mobile") != true) { 37 endInput.datepicker(); 38 endInput.datepicker("option", "onSelect", function(dateText, inst) { 39 changeDate(); 40 }); 41 } 42 if (target.data("mobile") == true) { 43 target.on("change", monthEvent); 44 target.children().eq(0).prop("selected", true); 45 target.change(); 46 } else { 47 target.children().on("click", monthEvent); 48 target.children().eq(0).click(); 49 } 50 51 if (target.data("first") == "true") { 52 target.children().eq(0).click(); 53 } 54 if (target.data("mobile") != true) { 55 if (startInput.val() != "" || endInput.val() != "") { 56 changeDate(); 57 } 58 } 59 60 }, formatDate = function(year, month, day) { 61 var d = new Date(year, month, day), month = '' + (d.getMonth() + 1), day = '' + d.getDate(), year = d.getFullYear(); 62 63 if (month.length < 2) { 64 month = '0' + month; 65 } 66 if (day.length < 2) { 67 day = '0' + day; 68 } 69 return [ year, month, day ].join('-'); 70 }, changeDate = function() { 71 startInput.datepicker("option", "maxDate", endInput.val()); 72 endInput.datepicker("option", "minDate", startInput.val()) 73 }, monthEvent = function() { 74 var nowDate = new Date(); 75 target.children().removeClass("on"); 76 $(this).addClass("on"); 77 var index = 0; 78 if (target.data("mobile") == true) { 79 index = $(this).val(); 80 } else { 81 index = $(this).index(); 82 } 83 84 if (index == 0) { 85 endInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate())); 86 nowDate.setMonth(nowDate.getMonth() - 1); 87 startInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate())); 88 } else if (index == 1) { 89 endInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate())); 90 nowDate.setMonth(nowDate.getMonth() - 3); 91 startInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate())); 92 } else if (index == 2) { 93 endInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate())); 94 nowDate.setMonth(nowDate.getMonth() - 6); 95 startInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate())); 96 } else if (index == 3) { 97 endInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate())); 98 nowDate.setMonth(nowDate.getMonth() - 12); 99 startInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate())); 100 } 101 if (target.data("mobile") != true) { 102 changeDate(); 103 } 104 if (typeof callBack === "function") { 105 callBack(); 106 } 107 } 108 return { 109 init : init 110 } 111}(jQuery)); 112 113function bannerLink(seq, url, linkType) { 114 $.ajax({
115 data : { 116 seq : seq, 117 hitType : linkType 118 }, 119 type : 'post', 120 url : "/inc/hitUpdate.do", 121 dataType : 'json', 122 }).done(function(result) { 123 if (url != "" && typeof url != undefined) { 124 if (typeof linkType != undefined) { 125 if (linkType == "_self") { 126 location.href = url; 127 } else { 128 window.open(url); 129 } 130 } else { 131 location.href = url; 132 } 133 } 134 }); 135 136} 137function formatDate(dateTime, joinChar) { 138 var d = new Date(dateTime), month = '' + (d.getMonth() + 1), day = '' + d.getDate(), year = d.getFullYear(); 139 140 if (month.length < 2) { 141 month = '0' + month; 142 } 143 if (day.length < 2) { 144 day = '0' + day; 145 } 146 if (joinChar != null && joinChar != undefined) { 147 return [ year, month, day ].join(joinChar); 148 } else { 149 return [ year, month, day ].join('.'); 150 } 151} 152function prdtViewLink(seq, type, useYn, mSeq, src) { 153 var returnUrl = ''; 154 if (location.href.indexOf('/m/') >= 0) { 155 returnUrl = '/m'; 156 } 157 158 var targetBlank = false; 159 if (location.href.indexOf('/shopping/') >= 0 || location.href.indexOf('/order/') >= 0 || location.href.indexOf('/cart/') >= 0) { 160 targetBlank = true; 161 } 162 163 if ('PT' == type) { 164 if (useYn != 'Y') { 165 alert('í매íì§ ìì ì íì ëë¤.'); 166 return; 167 } else { 168 returnUrl = returnUrl + '/product/view/' + seq + '.do'; 169 if (mSeq != null) { 170 var position = Number(mSeq); 171 triggerProductClickGtm(seq, returnUrl, targetBlank, position, src); 172 } else { 173 if (targetBlank) { 174 window.open(returnUrl); 175 } else { 176 location.href = returnUrl; 177 } 178 } 179 } 180 } else if ('BT' == type) { 181 if (useYn != 'Y') { 182 alert('í매íì§ ìì ì íì ëë¤.'); 183 return; 184 } else { 185 returnUrl = returnUrl + '/product/view/' + seq + '.do'; 186 187 console.log(targetBlank); 188 console.log(returnUrl); 189 190 if (mSeq != null) { 191 var position = Number(mSeq); 192 triggerProductClickGtm(seq, returnUrl, targetBlank, position, src); 193 } else { 194 if (targetBlank) { 195 window.open(returnUrl); 196 } else { 197 location.href = returnUrl; 198 } 199 } 200 } 201 } else { 202 if (type == 'GT') { 203 returnUrl = '#gift'; 204 } else if (type == 'MT') { 205 if (mSeq == undefined || mSeq == '') { 206 alert('ê´ë ¨ ìì¸ ì ë³´ê° ììµëë¤.'); 207 return; 208 } else { 209 returnUrl = returnUrl + '/product/view/' + mSeq + '.do?mile=' + seq; 210 } 211 } 212 213 if (targetBlank) { 214 window.open(returnUrl); 215 } else { 216 location.href = returnUrl; 217 } 218 } 219} 220 221function triggerProductClickGtm(prdtSeq, returnUrl, targetBlank, position, src) { 222 $.ajax({
223 type : 'post', 224 url : '/ajax/product/view/' + prdtSeq + '.do', 225 dataType : 'json', 226 success : function (xhr) { 227 if (xhr.result == 'OK') { 228 var prdtType = xhr.data.prdtType; 229 if (prdtType == 'PT' || prdtType == 'BT') { 230 console.log('@@@@') 231 var name = (xhr.data.lineNmEn + ' ' + xhr.data.prdtNmEn); 232 var prdtPrice = Number(xhr.data.prdtPrice); 233 var brand = xhr.data.lineNmEn; 234 var category = (xhr.data.fullCateNm ? (xhr.data.fullCateNm).replace(/>/gi, '/') : undefined); 235 var cate1 = $('#productView').find('input[name="cateNm1"]').val(); 236 var cate2 = $('#productView').find('input[name="cateNm2"]').val(); 237 var cate3 = $('#productView').find('input[name="cateNm3"]').val(); 238 var list = (cate1 + '/' + cate2 + '/' + cate3); 239 240 var hotItemDealTitle = 'ê³µì몰 ë¨ë íí/ì ê·íì첫íí'; 241 var tmpStartDate = new Date('2021/07/22 15:00:01'); 242 var tmpEndDate = new Date('2021/08/08 23:59:59'); 243 var today = Date.now(); 244 if (today >= tmpStartDate && today <= tmpEndDate) { 245 hotItemDealTitle = 'ê³µì몰 ë¨ë íí/í´ë¦¬ì´ë°ì¤ ì¸ì¼'; 246 } 247 248 if ($('#contents').hasClass('dev_main')) { 249 list = 'ë©ì¸/BEST SELLER'; 250 } else if ($('#contents').hasClass('dev_best')) { 251 list = 'ê³µì몰 ë¨ë íí/ë² ì¤í¸'; 252 } else if ($('#contents').hasClass('dev_single')) { 253 list = 'ê³µì몰 ë¨ë íí/ë¨ë 구ì±'; 254 } else if ($('#contents').hasClass('dev_new')) { 255 list = hotItemDealTitle; 256 } 257 258 if (src) { 259 list = src; 260 } 261 262 var product = { 263 list : list, 264 id : (prdtSeq + ''), 265 brand : brand, 266 name : name, 267 price : prdtPrice, 268 category : category, 269 position : position 270 }; 271 272 LARO.TagManager.productClick(product); 273 console.log(product); 274 LARO.GA4TagManager.productClick(product); 275 276 if (targetBlank) { 277 window.open(returnUrl); 278 } else { 279 location.href = returnUrl; 280 } 281 } 282 } 283 }, 284 error : function(result, status, error) { 285 console.log(error); 286 } 287 }); 288} 289 290function hashSearch(word) { 291 if (word.trim() != "") { 292 var returnUrl = ""; 293 if (location.href.indexOf("/m/") >= 0) { 294 returnUrl = "/m/product/search.do"; 295 } else { 296 returnUrl = "/product/search.do"; 297 } 298 $("body").append("<form id='hashForm' method='POST' action='" + returnUrl + "' ><input type='hidden' value='" + word + "' name='topSearchKeyword'/></form>"); 299 $("#hashForm").submit(); 300 } 301} 302function reviewWrite(ordDetSeq, prdtSeq, brdCate, prdtNm) { 303 304 var returnUrl = ''; 305 if (location.href.indexOf('/m/') >= 0) { 306 returnUrl = '/m/review/write.do'; 307 } else { 308 returnUrl = '/review/write.do'; 309 } 310 311 if (arguments[0] && arguments[1] && arguments[2]) { 312 313 LARO.GA4TagManager.writeReview(prdtNm, prdtSeq,"mypage"); 314 315 $('body').append( 316 "<form id='hashForm' method='POST' action='" + returnUrl + "' ><input type='hidden' value='" + ordDetSeq + "' name='ordNum'/><input type='hidden' value='" + prdtSeq 317 + "' name='prdtSeq'/><input type='hidden' value='" + brdCate + "' name='brdCate'></form>"); 318 $('#hashForm').submit(); 319 } else { 320 location.href = '/myPage/myPrdtReviewList.do'; 321 } 322} 323function oneDayFunction(cookieId) {
324 setCookie(cookieId, "Y", 1); 325} 326 327function setCookie(c_name, value, exdays) { 328 var exdate = new Date(); 329 exdate.setDate(exdate.getDate() + exdays); 330 var c_value = escape(value) + "; path=/" + ((exdays == null) ? "" : "; expires=" + exdate.toGMTString()); 331 document.cookie = c_name + "=" + c_value + "; SameSite=None; Secure"; 332} 333 334function setCookieExpireByTime(c_name, value, times) { 335 var now = new Date(); 336 var time = now.getTime(); 337 time += times; 338 now.setTime(time); 339 var c_value = escape(value) + "; path=/; expires=" + now.toGMTString() + "; SameSite=None; Secure"; 340 document.cookie = c_name + "=" + c_value; 341} 342 343function getCookie(c_name) { 344 var i, x, y, ARRcookies = document.cookie.split(";"); 345 for (i = 0; i < ARRcookies.length; i++) { 346 x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); 347 y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1); 348 x = x.replace(/^\s+|\s+$/g, ""); 349 if (x == c_name) { 350 return unescape(y); 351 } 352 } 353} 354 355function getPageTypeForInsider() { 356 var pageType = 'Content'; 357 358 var pathname = window.location.pathname; 359 if (pathname == '/main.do' || pathname == '/m/main.do') { 360 pageType = 'Home'; 361 } else if (pathname == '/cart/cart.do' || pathname == '/m/cart/cart.do') { 362 pageType = 'Basket'; 363 } else if (pathname == '/order/orderFin.do' || pathname == '/m/order/orderFin.do') { 364 pageType = 'Confirmation'; 365 } else if (pathname.indexOf('/product/list') > -1) { 366 pageType = 'Category'; 367 } else if (pathname.indexOf('/product/view') > -1) { 368 pageType = 'Product'; 369 } else if (pathname.indexOf('/product/search') > -1) { 370 pageType = 'Search'; 371 } 372 373 return pageType; 374} 375 376var LARO_CAPTCHA = { 377 RANDOM_NO : null, 378 changeCaptcha : function(captchaName, reload) { 379 this.RANDOM_NO = Math.random(); 380 var reqKey = ''; 381 var reqType = ''; 382 if (captchaName == 'LOGCAPLRPINCHA') { 383 reqKey = $('#j_username').val(); 384 reqType = '1'; 385 } else if (captchaName == 'EDIMEMCAPINFOCHA') { 386 reqKey = '_SESS_MBR_ID_'; 387 reqType = '2'; 388 } else if (captchaName == 'CNCAPMOCHANEW') { 389 reqKey = btoa($('#newMobile').val()); 390 reqType = '3'; 391 } else if (captchaName == 'CACONPTCHSULTA') { 392 reqKey = '_SESS_MBR_ID_'; 393 reqType = '4'; 394 } 395 $('#catpcha').html('<img src="/new/captcha/' + reqType + '/' + reqKey + '.do"/>'); 396 $('.catpcha_wrap').show(); 397 sessionStorage.setItem(captchaName, 'true'); 398 }, 399 audioCaptcha : function(type, captchName) { 400 var kor = (type > 0) ? "lan=kor&" : ""; 401 $.ajax({
402 url : '/captcha/audio.do', 403 type : 'POST', 404 dataType : 'text', 405 data : 'rand=' + Math.random() + '&ans=y&captchaName=' + captchName, 406 async : false, 407 success : function(resp) { 408 var uAgent = navigator.userAgent; 409 var soundUrl = '/captcha/audio.do?' + kor + 'rand=' + Math.random() + '&ans=' + resp + '&captchaName=' + captchName; 410 if (uAgent.indexOf('Trident') > -1 || uAgent.indexOf('MSIE') > -1) { 411 this.capchaPlayer(soundUrl + '&agent=msie'); 412 } else if (!!document.createElement('audio').canPlayType) { 413 try { 414 new Audio(soundUrl).play(); 415 } catch (e) { 416 this.capchaPlayer(soundUrl); 417 } 418 } else 419 window.open(soundUrl, '', 'width=1,height=1'); 420 } 421 }); 422 }, 423 capchaPlayer : function(src) { 424 $('#audiocatpch').html(' <bgsound src="' + src + '">'); 425 }, 426 validate : function(captchaName) { 427 var result = false; 428 if (sessionStorage.getItem(captchaName) != 'true') { 429 result = true; 430 return result; 431 } 432 433 if (!$('#answer').val()) { 434 alert('ì´ë¯¸ì§ì ë³´ì´ë ì«ì ëë ì¤í¼ì»¤ë¥¼ íµí´ ë¤ë¦¬ë ì«ì를 ì ë ¥í´ ì£¼ì¸ì.'); 435 result = false; 436 return result; 437 } 438 439 $.ajax({
440 url : '/captcha/captchaSubmit.jsp', 441 type : 'POST', 442 dataType : 'text', 443 data : 'answer=' + $('#answer').val(), 444 async : false, 445 success : function(resp) { 446 if (resp == 1) { 447 result = true; 448 return true; 449 } else { 450 alert('ìë ë±ë¡ ë°©ì§ë¥¼ ìí 문ì를 ì못 ì ë ¥íìµëë¤.'); 451 LARO_CAPTCHA.changeCaptcha(captchaName, false); 452 $('#answer').val(''); 453 result = false; 454 return false; 455 } 456 }, 457 error : function(response, status, error) { 458 return false; 459 } 460 }); 461 462 return result; 463 }, 464 cleanCaptcha : function() { 465 $('#answer').val(''); 466 sessionStorage.clear(); 467 $('.catpcha_wrap').hide(); 468 } 469}; 470 471function decodeUriComponentWithSpace(component) { 472 return decodeURIComponent(component.replace(/\+/g, '%20')) 473}
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.