1// js querystring ê°ì ¸ì¤ê¸° 2function scriptQuery() { 3 var script = document.getElementsByTagName('script'); 4 script = script[script.length-1].src 5 .replace(/^[^\?]+\?/, '') 6 .replace(/#.+$/, '') 7 .split('&'); 8 var queries = {} 9 , query; 10 while(script.length){ 11 query = script.shift().split('='); 12 queries[query[0]] = query[1]; 13 } 14 return queries; 15} 16// js url querystring ê°ì ¸ì¤ê¸° 17function getQueryStringObject() { 18 var a = window.location.search.substr(1).split('&'); 19 if (a == "") return {}; 20 var b = {}; 21 for (var i = 0; i < a.length; ++i) { 22 var p = a[i].split('=', 2); 23 if (p.length == 1) 24 b[p[0]] = ""; 25 else 26 b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); 27 } 28 return b; 29} 30 31// API ë²ì ê°ì ¸ì¤ê¸° 32var _SMC_API_VER = scriptQuery('smc_v').smc_v; 33 34$(document).ready(function(event){ 35 36 var param_np = getQueryStringObject().number_plate; 37 if(typeof param_np == "undefined"){ 38 param_np = ""; 39 }else{ 40 $(".float_reg_form .regcar_submit_btn").addClass("on"); 41 } 42 43 // ì´ê¸° íì´ì§ ì°¨ëë²í¸ì ë ¥ë focus 44 if($("input[name='number_plate']").length > 0){ 45 $("input[name='number_plate']").focus(); 46 $("input[type='text'][name='number_plate']").val(param_np); 47 } 48 49 50 51 52 var main_banner_swiper = new Swiper('.main_banner_slide', { 53 autoplay: { 54 delay: 5000, 55 }, 56 loop: true, 57 pagination: { 58 el: '.main_banner_slide .swiper-pagination', 59 }, 60 }); 61 62 63 // ê´ê³ ëª¨ë¬ ì¤í 64 ad_landing_modal(); 65}); 66 67 68// ë¤ë¡ê°ê¸°ì ëì°© íì´ì§ ìë 69window.onpageshow = function (event){ 70 if(event.persisted || (window.performance && window.performance.navigation.type == 2)){ 71 // ì´ê¸° íì´ì§ ì°¨ëë²í¸ì ë ¥ë focus 72 if($("input[name='number_plate']").length > 0){ 73 $("input[name='number_plate']").focus(); 74 var npchk = numberPlateValidation($("input[type='text'][name='number_plate']").val()); 75 if (npchk[0] === null && npchk[1] === null && npchk != "") { 76 $(this).addClass("error"); 77 $(".regcar_submit_btn").removeClass("on"); 78 }else{ 79 if($("input[type='text'][name='number_plate']").val() != ""){ 80 $(".regcar_submit_btn").addClass("on"); 81 } 82 $(this).removeClass("error"); 83 } 84 } 85 } 86} 87 88// ì¤í¬ë¡¤ì ìë¨ ìì ê³ ì ê¸°ë¥ 89$(window).scroll(function(e){ 90 if($(".main_header .login_btn").length > 0){ 91 if($(".main_header").outerHeight() < $(window).scrollTop()){ 92 $(".main_header").addClass("sticky"); 93 $(".reg_car_cont").addClass("sticky"); 94 }else{ 95 $(".main_header").removeClass("sticky"); 96 $(".reg_car_cont").removeClass("sticky"); 97 } 98 } 99}); 100 101// ì°¨ëë²í¸ ì ë ¥ì ì ìì¬ë¶ íì¸ 102$(document).on("keyup keypress",".float_reg_form input[name='number_plate']",function(e){ 103 var number_plate = $(this).val(); 104 var plate_vali = numberPlateValidation(number_plate); 105 106 if (plate_vali[0] === null && plate_vali[1] === null && number_plate != "") { 107 $(this).addClass("error"); 108 $(".regcar_submit_btn").removeClass("on"); 109 }else{ 110 if(number_plate != ""){ 111 $(".regcar_submit_btn").addClass("on"); 112 } 113 $(this).removeClass("error"); 114 } 115}); 116 117// ì°¨ëë²í¸ ì ë ¥ì ë기기 118$(document).on("submit",".float_reg_form form",function(e){ 119 if(!$(".regcar_submit_btn").hasClass("on")){ 120 regCarAlertModal('','ì¬ë°ë¥¸ ì°¨ëë²í¸ë¥¼ ì ë ¥í´ì£¼ì¸ì.'); 121 return false; 122 } 123}); 124 125/** ì°¨ë ë²í¸ submitì ì íì¸ í ì°¨ëë±ë¡ íì´ì§ë¡ ì´ë */ 126function beforeSubmitRegForm() { 127 if(!$(".regcar_submit_btn").hasClass("on")){ 128 regCarAlertModal('','ì¬ë°ë¥¸ ì°¨ëë²í¸ë¥¼ ì ë ¥í´ì£¼ì¸ì.'); 129 regCarFormGAEvent(false); // GA4 ì´ë²¤í¸ ì ì¡ 130 return false;
131 }else{ 132 var number_plate = $("input[name='number_plate']").val(); 133 $.ajax({ 134 async: false, 135 url: "/apiv"+_SMC_API_VER+"/Smc/checkNumberplate", 136 type: 'POST', 137 dataType: 'JSON', 138 data: {number_plate : number_plate}, 139 success: function (data) 140 { 141 if(data.code == 200){ 142 regCarFormGAEvent(true); // GA4 ì´ë²¤í¸ ì ì¡ 143 // $(".float_reg_form form").submit(); 144 location.href = "/regcar/renew_regcar?number_plate="+number_plate; 145 }else{ 146 regCarFormGAEvent(false); // GA4 ì´ë²¤í¸ ì ì¡ 147 regCarAlertModal('',data.msg); 148 return false; 149 } 150 } 151 }); 152 } 153} 154// 견ì ì ì² ë²í¼ í´ë¦ì - ì°¨ëë²í¸ íì¸ í submit 155$(document).on("click",".regcar_submit_btn", beforeSubmitRegForm); 156// ì°¨ëë²í¸ ì ë ¥ë ìí° ì´ë²¤í¸ ë°ìì - ì°¨ëë²í¸ íì¸ í submit 157$(document).on("keyup",".float_reg_form input[name='number_plate']", function(e) { 158 if(e.keyCode == 13) { 159 beforeSubmitRegForm(); 160 } 161}); 162 163 164// ë©ì¸ FAQ ì´ê³ ë«ê¸° 165$(document).on("click",".main_faq_dt",function(e){ 166 if($(this).parents("dt").hasClass('on')){ 167 $(".main_faq_cont dl dt").removeClass("on"); 168 $(".main_faq_cont dl dd").removeClass("on"); 169 }else{ 170 $(".main_faq_cont dl dt").removeClass("on"); 171 $(".main_faq_cont dl dd").removeClass("on"); 172 $(this).parents("dt").addClass("on"); 173 $(this).parents("dt").next().addClass("on"); 174 } 175}); 176 177// ë¡ê·¸ìì 178$(document).on("click",".logout_btn",function(){ 179 $('#confirm_modal .inner_wrap .modal_msg').text('ë¡ê·¸ìì íìê² ìµëê¹?'); //ëª¨ë¬ ë¬¸êµ¬ ë³ê²½ 180 $("#confirm_modal").modal({ // ëª¨ë¬ open 181 escapeClose: false, 182 clickClose: false, 183 showClose: false 184 }); 185 $('#confirm_modal .confirm_btn').addClass("logout"); 186 $('#confirm_modal .confirm_btn').attr("data-gotourl",$(this).attr("href")); 187 return false; 188}); 189 190// ëª¨ë¬ ì´ë¯¸ì§ ìì íì¸ ë²í¼ í´ë¦ ì 미리보기 ì´ë¯¸ì§ ìì 191$(document).on('click','#confirm_modal .confirm_btn.logout', function() { 192 console.log('logout button'); 193 194 // GA4 ì´ë²¤í¸ ì ì¡ 195 try { logoutGAEvent(); } catch(err) { console.warn('GA event function :: ', err); } 196 197 location.href = $(this).attr("data-gotourl"); 198}); 199 200// ëª¨ë¬ ì·¨ì ë²í¼ ë를 ë ëª¨ë¬ íì¸ ì°½ attribute ê° ìì 201$(document).on("click", "#confirm_modal .cancel_btn.logout", function() { 202 $('#confirm_modal .confirm_btn').removeClass("logout"); 203 $('#confirm_modal .confirm_btn').removeAttr("data-gotourl"); 204}); 205 206// ëª¨ë¬ ë«ê¸° 207$(document).on('click', '.cancel_btn', function(){ 208 $.modal.close(); 209}); 210 211// ajax를 íì©í ë´ì°¨í기 ë©ì¸ 견ì ë°ì´í° ìë¡ê³ 침 212var timeCall = ""; 213var reloadLimitDate = function() 214{ 215 var time_cnt = 0; 216 clearInterval(timeCall); 217 timeCall = setInterval(function(){ 218 var host = '/main/reloadCarData'; 219 var smcIds = $('input:hidden[name="smc_ids"]').val(); 220 221 $(".reg_car_list_wrap li.status_biding").each(function (i, v) { 222 var this_ele = $(this); 223 var smcId = $(this).data('smc_id'); 224 var reserveDate = this_ele.data("reserve_date"); 225 var plusHours = this_ele.data("plus_hours"); 226 var isEnd = this_ele.data("is_end"); 227 var smcStatus = this_ele.data("smc_status"); 228 var estnCnt = this_ele.data("estn_cnt"); 229 var deadLine = getTimeDeadLine(reserveDate, plusHours); 230 timeElementUpdate(smcId, deadLine, isEnd, smcStatus, estnCnt); 231 }); 232 233 if(time_cnt == 7){ 234 $.ajax({ 235 cache: false, 236 async: false, 237 url: host, 238 type: 'POST', 239 dataType: 'JSON', 240 data: {smcIds : smcIds}, 241 success: function (data) 242 { 243 if (data.success) { 244 245 if(data.totalCnt > 0) { 246 247 for(var i in data.return) 248 { 249 var r = data.return[i]; 250 var deadLine = getTimeDeadLine(r.reserveData, r.plusHours); 251 timeElementUpdate(r.smc_id, deadLine, r.is_end, r.smc_status, r.estn_cnt); 252 clearInterval(timeCall); 253 reloadLimitDate(); 254 } 255 } 256 return false;
257 } else if (data.error) { 258 clearInterval(timeCall); 259 return false; 260 } 261 } 262 }); 263 time_cnt = 0; 264 } 265 266 time_cnt++; 267 }, 1000); // 7ì´ë§ë¤ íë²ì© 268 269}; 270 271// ëª©ë¡ ê²¬ì ë°ì´í° ìë¡ê³ 침 272function timeElementUpdate(smcId, updateDate, isEnd, smc_status, estn_cnt) 273{ 274 if(!smcId || !smc_status || isEnd){ 275 return false; 276 } 277 var estn_cnt = (estn_cnt || 0); 278 279 var html = ""; 280 var statusStr_1 = ""; 281 var statusStr_2 = ""; 282 var statusTimeStr = ""; 283 var target = $("#smc_car_"+smcId); 284 target.find('.bid_indicator').empty(); 285 target.find('.status_indicator').empty(); 286 target.find('.remain_time').empty(); 287 if(smc_status == 1002 && !isEnd){ 288 if(estn_cnt <= 0){ 289 statusStr_1 = ('첫 견ì ë기 ì¤'); 290 statusStr_2 = "견ì ì§í ì¤"; 291 }else{ 292 statusStr_1 = ('<span>'+estn_cnt+'ê±´</span>ì 견ì ì´ ëì°©íìµëë¤.'); 293 statusStr_2 = "견ì ì§í ì¤"; 294 } 295 }else if(smc_status == 1003 || estn_cnt >= 20){ 296 statusStr_1 = ('견ì ì ì íí´ì£¼ì¸ì.'); 297 statusStr_2 = "견ì ì§í ìë£"; 298 }else if(smc_status == 1004){ 299 statusStr_1 = ('견ì ì í¨ê¸°ê° ë§ë£'); 300 statusStr_2 = "견ì ë§ë£"; 301 }else if(smc_status == 1005 || smc_status == 1006){ 302 statusStr_1 = ('ê±°ë ì§í ì¤'); 303 statusStr_2 = ('ê±°ë ì§í ì¤'); 304 }else if(smc_status == 1007 && (isEnd && smc_status != 2001)){ 305 statusStr_1 = ('ê±°ë ìµì¢ ìë£'); 306 statusStr_2 = "ê±°ëìë£"; 307 }else if(smc_status == 1008){ 308 statusStr_1 = ('ê±°ë ì·¨ì'); 309 statusStr_2 = "ê±°ëì·¨ì"; 310 }else if(smc_status == 2001){ 311 statusStr_1 = ("ì¹ì¸ë기 ì¤"); 312 statusStr_2 = "íì¬ ì¹ì¸ë기 ì¤"; 313 }else if(smc_status == 1001){ 314 statusStr_1 = "ë±ë¡ì ìë£í´ì£¼ì¸ì."; 315 statusStr_2 = ("ììì ì¥ ì¤"); 316 } 317 if(smc_status == 1002){ 318 statusTimeStr = "견ì "; 319 }else{ 320 statusTimeStr = "ì í"; 321 } 322 target.find('.status_indicator').html(statusStr_2); 323 target.find('.bid_indicator').html(statusStr_1); 324 325 if(smc_status == 1001){ 326 html += "<dt>ì°¨ëë±ë¡</dt>"; 327 html += "<dd>10% ìë£</dd>"; 328 }else if(smc_status == 2001){ 329 html += "<dt>ì°¨ëë±ë¡</dt>"; 330 html += "<dd>100% ìë£</dd>"; 331 }else{ 332 html += "<dt>" + statusTimeStr + "ë§ê° ìê°</dt>"; 333 if (!isEnd && $.inArray(smc_status, [1002, 1003, 1005, 1006]) > -1) { 334 html += '<dd>'; 335 html += ((updateDate.left_hours ? updateDate.left_hours : '00') + ":"); 336 html += ((updateDate.left_min ? updateDate.left_min : '00') + ":"); 337 html += ((updateDate.left_sec ? updateDate.left_sec : '00')); 338 html += '</dd>'; 339 } else { 340 html += "<dd>ì¢ ë£</dd>"; 341 } 342 } 343 target.find('.remain_time').html(html); 344 345 // smcId, updateDate, isEnd, smc_status, estn_cnt 346 $(".reg_car_list_wrap li.status_biding").each(function (i, v) { 347 var $this = $(this); 348 $this.data('smc_id', smcId); 349 $this.data("is_end", isEnd); 350 $this.data("smc_status", smc_status); 351 $this.data("estn_cnt", estn_cnt); 352 }); 353 return false; 354} 355 356// 견ì ë§ë£ìê° êµ¬í기 357var getTimeDeadLine = function(startDate, plusHour) 358{ 359 startDate_split = startDate.split(" "); 360 startDate_split[0] = startDate_split[0].split("-")[0]+"/"+startDate_split[0].split("-")[1]+"/"+startDate_split[0].split("-")[2] 361 startDate_split = startDate_split[0]+" "+startDate_split[1]; 362 363 var result = new Array(); 364 result['now_time'] = Math.floor(new Date().getTime()/1000); 365 result['start_time'] = Math.floor(new Date(startDate_split).getTime()/1000); 366 result['end_time'] = result['start_time'] + (plusHour * 3600); 367 result['end'] = false; 368 369 if(result['now_time'] < result['end_time']) 370 { 371 result['left_seconds'] = (result['end_time'] - result['now_time']); 372 373 result['left_days'] = Math.floor(result['left_seconds'] / (86400 * (plusHour / 24))); 374 result['left_hours'] = Math.floor((result['left_seconds'] / 3600) - (24*result['left_days'])); 375 result['diff'] = result['left_seconds'] - (result['left_hours'] * 3600) - (24 * result['left_days'] * 3600); 376 result['left_min'] = Math.floor(result['diff'] / 60); 377 result['left_sec'] = Math.floor(result['diff'] - (result['left_min'] * 60)); 378 379 result['left_hours'] = (result['left_hours'] < 10) ? '0' + result['left_hours'] : result['left_hours']; 380 result['left_min'] = (result['left_min'] < 10) ? '0' + result['left_min'] : result['left_min']; 381 result['left_sec'] = (result['left_sec'] < 10) ? '0' + result['left_sec'] : result['left_sec']; 382 383 result['limitDaySec'] = (result['end_time'] - result['start_time']); 384 result['per'] = Math.abs(Math.ceil(100 - ((result['limitDaySec'] - result['left_seconds']) / result['limitDaySec']) * 100)); 385 386 if(result['day'] < 0){ 387 result['left_days'] = 0; 388 result['left_hours'] = 0; 389 result['left_min'] = 0; 390 result['left_sec'] = 0; 391 result['limitDaySec'] = 0; 392 result['end'] = true; 393 } 394 } 395 396 $(".reg_car_list_wrap li.status_biding").each(function (i, v) { 397 var $this = $(this); 398 $this.data("reserve_date", startDate); 399 $this.data("plus_hours", plusHour); 400 }); 401 402 return result; 403}; 404 405// 첫차 ì± ë¤ì´ë¡ë 406var gotoDownloadLink = function() 407{ 408 var gotoUrl = ""; 409 var android_marketUrl = "https://app.adjust.com/jsr?url=https%3A%2F%2Fhc8a.adj.st%2f%3fadjust_t=tnsnf3q%26adjust_deeplink_js=1%26adjust_deeplink=chutcha%3a%2f%2fgoto%3Ftype%3dsmcmain%26adjust_campaign=smc%26adjust_adgroup=main_bottom%26adjust_creative=app%20icon"; 410 var ios_appstoreUrl = "https://app.adjust.com/jsr?url=https%3A%2F%2Fhc8a.adj.st%2f%3fadjust_t=tnsnf3q%26adjust_deeplink_js=1%26adjust_deeplink=chutcha%3a%2f%2fgoto%3Ftype%3dsmcmain%26adjust_campaign=smc%26adjust_adgroup=main_bottom%26adjust_creative=app%20icon"; 411 412 if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { 413 if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { 414 gotoUrl = ios_appstoreUrl; 415 } else if (navigator.userAgent.match(/Android/i)) { 416 gotoUrl = android_marketUrl; 417 } 418 }else{ 419 gotoUrl = android_marketUrl; 420 } 421 var win = window.open(gotoUrl, '_blank'); 422 win.focus(); 423}; 424 425// ì¬ì ì ì ë³´ ìì¸í보기
426$(document).on("click",".legal_cont_wrap .agreement_link button",function(){ 427 var flag = $(this).hasClass("on"); 428 if(flag){ 429 $(this).removeClass("on"); 430 $(".legal_cont_wrap .company_info").removeClass("on"); 431 }else{ 432 $(this).addClass("on"); 433 $(".legal_cont_wrap .company_info").addClass("on"); 434 } 435}); 436 437// ì°¨ëì´ ìì ë 견ì ì¡°í í´ë¦ì 438$(document).on("click",".reg_cnt_zero",function(){ 439 $('#basic_modal .inner_wrap .modal_title').text(''); //ëª¨ë¬ ë¬¸êµ¬ ë³ê²½ 440 $('#basic_modal .inner_wrap .modal_msg').html('ë±ë¡ë 견ì ìì²ì´ ììµëë¤.<br />견ì ìì² í ì¡°ííì¤ ì ììµëë¤.'); //ëª¨ë¬ ë¬¸êµ¬ ë³ê²½ 441 $("#basic_modal").modal({ // ëª¨ë¬ open 442 escapeClose: false, 443 clickClose: false, 444 showClose: false 445 }); 446 return false; 447}); 448 449 450// ì°¨ë ìì¸ë³´ê¸° ë²í¼ì ëë ì ë 451$(document).on("click",".smc_view_a",function(e){ 452 e.preventDefault(); 453 454 var smc_id = $(this).parents("li").data("smc_id"); 455 var href = $(this).attr("href"); 456 457 458 $.ajax({ 459 type : 'POST', 460 url : "/apiv"+_SMC_API_VER+"/smc/getCarViewUrl/"+smc_id, 461 dataType : 'json', 462 async: false, 463 success :function(data){ 464 if(data.code == "200"){ 465 herf = "/car?key="+data.keys; 466 location.href=href; 467 }else{ 468 alert("ì¤ë¥ê° ë°ìíìµëë¤. ë¤ì ìëí´ì£¼ì¸ì."); 469 location.reload(); 470 } 471 } 472 }); 473 return false; 474}); 475 476 477// ê´ê³ ëë© ëª¨ë¬ ëì°ê¸° 478function ad_landing_modal(){ 479 var flag = getParameterByName("ad_landing_flag"); 480 481 482 // ëª¨ë¬ ëì°ê¸° 483 var ad_landing_modal = $("#ad_landing_modal"); 484 485 // í¹ì íëê·¸ê° ìì ëë§ ëì°ê¸° 486 if(flag == 1){ 487 // 모ë°ì¼ìì ì ê·¼í ëë§ ëì°ê¸° 488 if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { 489 490 gtag('event', 'íì _ë·°', {'event_category': 'ë¶ê¸°'}); 491 492 ad_landing_modal.modal({ 493 showClose: false, 494 clickClose: false, 495 escapeClose: false, 496 blockerClass : 'ad_landing_modal_blocker' 497 }); 498 } 499 } 500} 501 502// ê´ê³ ëë© ëª¨ë¬ ì±ìì 보기 ë²í¼ í´ë¦ 503$(document).on("click","#ad_landing_modal .app_link",function(){ 504 gtag('event', 'íì _ì´ê¸°', {'event_category': 'ë¤ì´ë¡ë'}); 505 506 if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { 507 // 모ë°ì¼ì¼ ê²½ì° 508 if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { 509 // iOSì¼ë 510 parent.location.href='https://apps.apple.com/kr/app/id982096152'; 511 }else{ 512 // ìëë¡ì´ë ì¼ë 513 parent.location.href='https://play.google.com/store/apps/details?id=com.mrpic.chutcha&hl=ko'; 514 } 515 }else{ 516 // PCì¼ ê²½ì° 517 $.modal.close(); 518 } 519}); 520 521// ê´ê³ ëë© ëª¨ë¬ ì¹ìì 보기 ë²í¼ í´ë¦ 522$(document).on("click","#ad_landing_modal .close_btn",function(){ 523 gtag('event', 'íì _ì·¨ì', {'event_category': 'ì¹ëë©'}); 524 $.modal.close(); 525});
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.