1var chat_name; 2var chat_style; 3var chat_cnt = 0; 4var chat_color; 5var chat_img; 6let urlPath = location.pathname; 7 8var device; 9$(document).ready(function () { 10 /* ====================================================================== 11 * 12 * COMMON 13 * 14 ====================================================================== */ 15 // ëë°ì´ì¤ êµ¬ë¶ 16 const isMobile = 17 /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( 18 navigator.userAgent 19 ) 20 ? true 21 : false; 22 23 if (!isMobile) { 24 //모ë°ì¼ì´ ìë ê²½ì° ì¤í¬ë¦½í¸ 25 device = "pc"; 26 } else { 27 //모ë°ì¼ì¸ ê²½ì° ì¤í¬ë¦½í¸ 28 device = "mo"; 29 } 30 31 // Get today's date 32 function getDate() { 33 const today = new Date(); 34 const year = today.getFullYear(); 35 const month = ("0" + (1 + today.getMonth())).slice(-2); 36 const day = ("0" + today.getDate()).slice(-2); 37 const hours = today.getHours() % 12 ? today.getHours() % 12 : 12; 38 const minutes = 39 today.getMinutes() < 10 ? "0" + today.getMinutes() : today.getMinutes(); 40 const ampm = today.getHours() >= 12 ? "PM" : "AM"; 41 const date = `${year}.${month}.${day} ${hours}:${minutes} ${ampm}`; 42 43 return date; 44 } 45 46 setTimeout(function () { 47 $(".notice_yn").fadeOut(); 48 }, 3000); 49 50 //ì±ë´ì¤ì 51 function chat_master() { 52 $(".mchat_hard").addClass("dn"); 53 $(".goBack").addClass("dn"); 54 55 $.ajax({ 56 url: "/getChatMaster", 57 type: "get", 58 success: function (data) { 59 if (!(urlPath.indexOf("/en") > -1)) { 60 chat_name = data.name; //ì±ë´ëª êµë¬¸ 61 } else { 62 chat_name = data.name_en; //ì±ë´ëª ì문 63 } 64 chat_style = data.style; //ì±ë´íì 65 chat_color = data.point_color; //í¬ì¸í¸ì»¬ë¬ 66 text = data.text; 67 chat_img = data.floating_btn; 68 $("#mChat .tit").text(chat_name); //ì±ë´ëª 69 chat_contents(chat_style); 70 //ì±ë´ ìë´ë©ì¸ì§ 71 if (data.notice_yn == "Y") { 72 if (!(urlPath.indexOf("/en") > -1)) { 73 $(".quick_message").text(data.notice_content); //ìë´ë©ì¸ì§ êµë¬¸ 74 } else { 75 $(".quick_message").text(data.notice_content_en); //ìë´ë§¤ì¸ì§ ì문 76 } 77 } else { 78 $(".notice_yn").css("display", "none"); 79 } 80 81 //ë ¸ì¶ì¬ë¶ 82 if (device == "mo" && data.mo_yn1 == "N") { 83 $(".quick_btn").css("display", "none"); 84 $(".notice_yn").css("display", "none"); 85 } 86 if (device == "pc" && data.pc_yn1 == "N") { 87 $(".quick_btn").css("display", "none"); 88 $(".notice_yn").css("display", "none"); 89 } 90 91 let floating_btn = data.floating_btn; 92 if (floating_btn == "") { 93 floating_btn = "/img/front/mChat/chat_icon.png"; 94 chat_img = "/img/front/mChat/chat_icon.png"; 95 } 96 97 $("#quick_btn").attr("src", floating_btn); 98 $("#quick_btn_head").attr("src", floating_btn); 99 $(".mchat_inner").css("background", "#f2f8ff"); //ë°°ê²½ ê·¸ë¼ë°ì´ì 100 // $(".mchat_inner").css('background', 'linear-gradient(to bottom right,' + data.bg_color1 + "E6" + ',' + data.bg_color2 + "E6" + ')');//ë°°ê²½ ê·¸ë¼ë°ì´ì 101 if (data.style == "banner") { 102 //ë°°ëíì 103 $(".mChat").addClass("banner"); //ë°°ëíì ì¶ê° 104 $(".greeting").text(repWord(data.text)); //ì¸ì¬ë§ 105 $(".mchat_skin--standard").remove(); 106 } else { 107 //기본íì 108 $("#master_text").text(repWord(data.text)); //ì¸ì¬ë§ 109 $("#master_name").text(chat_name); //ì±ë´ëª 110 $(".mchat_skin--banner, .banner_menu, .mchat_skin--sub").remove(); 111 } 112 }, 113 }); 114 } 115 116 //ìµìì í¤ìë 117 function chat_contents(chat_style) { 118 var lang = ""; 119 if (!(urlPath.indexOf("/en") > -1)) { 120 lang = "kor"; 121 } else { 122 lang = "eng"; 123 } 124 125 $.ajax({ 126 url: "/getChatContents", 127 data: { 128 par: 0, 129 banner: chat_style, 130 lang: lang, 131 }, 132 type: "get", 133 success: function (data) { 134 if (chat_style == "basic") { 135 //기본íìì¼ë 136 data.forEach(function (e) { 137 let link_arrow = ""; 138 if ( 139 e.link.replace("|", "") != "" && 140 e.link.replace("|", "") != null && 141 e.link.replace("|", "") != "undefined" && 142 e.link.indexOf("|") == -1 143 ) { 144 link_arrow = 145 '<img src="/img/front/mChat/link_arrow.png" alt="ë§í¬ë²í¼">'; 146 } else { 147 link_arrow = ""; 148 } 149 150 $(".select_list").append( 151 '<li class="select_item select_item' + 152 e.idx + 153 '"> ' + 154 '<button type="button" class="select_btn" name="select_btn"' + 155 'onclick="contScrollDown(' + 156 chat_cnt + 157 "); getCate(" + 158 e.idx + 159 ",'" + 160 e.nm.replace(/'/g, "`") + 161 "','" + 162 e.view_type + 163 "','" + 164 e.guide_text.replace(/'/g, "`") + 165 "','" + 166 e.content.replace(/'/g, "`") + 167 "'," + 168 e.cnt + 169 ",'" + 170 e.link + 171 "','" + 172 e.attach_file + 173 "','" + 174 e.attach_file_ori + 175 "','" + 176 e.page_type + 177 "', '" + 178 e.view_type_sub + 179 "')\">" + 180 e.nm.replace(/'/g, "`") + 181 link_arrow + 182 "</button> </li>" 183 ); 184 }); 185 } else { 186 //ë°°ëíìì¼ë 187 var cnt = 1; 188 data.forEach(function (e) { 189 $(".banner_box").append( 190 '<div id="banner' + 191 cnt + 192 '" onclick="getBanner(\'' + 193 e.nm.replace(/'/g, "`") + 194 "','" + 195 e.content.replace(/'/g, "`") + 196 "'," + 197 e.idx + 198 ",'" + 199 e.guide_text.replace(/'/g, "`") + 200 "','" + 201 cnt + 202 "','" + 203 e.attach_file + 204 "','" + 205 e.link + 206 "','" + 207 e.page_type + 208 '\')" class="banner_item">' + 209 ' <div class="item_inner">' + 210 ' <div class="item_info">' + 211 ' <div class="item_name">' + 212 // e.nm.replace(/'/g, "`") + 213 "</div>" + 214 ' <div class="item_desc">' + 215 e.content.replace(/'/g, "`") + 216 "</div>" + 217 " </div>" + 218 " </div>" + 219 " </div>" 220 ); 221 if ( 222 e.attach_file != "" && 223 e.attach_file != null && 224 e.attach_file != "undefined" 225 ) { 226 // 기ë¥ê°ë° ì ìì ìì 227 // $("#banner" + cnt).css("background-image", `url(/img/front/mChat/banner_img0${cnt}.svg)`); 228 $("#banner" + cnt).css( 229 "background-image", 230 "url(" + repWord(e.attach_file) + ")" 231 ); 232 } 233 234 $(".banner_menu_wrap").append( 235 '<li class="link_item">' + 236 "<a onclick=\"getBanner('" + 237 e.nm.replace(/'/g, "`") + 238 "','" + 239 e.content.replace(/'/g, "`") + 240 "'," + 241 e.idx + 242 ",'" + 243 e.guide_text.replace(/'/g, "`") + 244 "','" + 245 cnt + 246 "','" + 247 e.attach_file + 248 "','" + 249 e.link + 250 "','" + 251 e.page_type + 252 "')\">" + 253 e.nm.replace(/'/g, "`") + 254 "</a>" + 255 "</li>" 256 ); 257 258 cnt++; 259 }); 260 } 261 // console.log("load end") 262 // select btn active 263 //select_list(); 264 }, 265 }).then(() => { 266 $(".mchat_hard").removeClass("dn"); 267 }); 268 } 269 chat_master(); 270 271 // When the chatbot button is clicked 272 $(".quick_btn").click(function () { 273 $(".now").text(getDate()); 274 if ($(".mchat_cont").hasClass("on")) { 275 $(".mchat_cont").removeClass("on"); 276 } else { 277 $(".mchat_cont").addClass("on"); 278 } 279 }); 280 281 // back to home 282 $(".home").click(function () { 283 $(".hard_chat").removeClass("active"); 284 if (chat_style == "basic") { 285 $(".mChat").removeClass("banner sub"); 286 $(".select_list").empty(); 287 } else { 288 $(".mChat").removeClass("sub"); 289 $(".banner_target").empty(); 290 $(".banner_box").empty(); 291 $(".banner_menu_wrap").empty(); 292 } 293 $(".basic_target").empty(); 294 chat_master(); 295 // 문ì ìì íëì½ë© 리ì 296 resetHardChat(); 297 }); 298 299 // ë¤ë¡ê°ê¸° 300 document.addEventListener("click", (e) => { 301 const goHomeBtn = e.target.closest(".goHome"); 302 if (goHomeBtn) { 303 e.stopPropagation(); 304 document.querySelector(".home")?.click(); 305 } 306 }); 307 // select btn active 308 function select_list() { 309 $(".select_list").each(function () { 310 const _this = $(this); 311 const item = $(this).find(".select_item"); 312 313 item.click(function () { 314 _this.find(".select_btn").removeClass("selected"); 315 $(this).find(".select_btn").addClass("selected"); 316 }); 317 }); 318 $(".banner_item").click(function () { 319 $(".mChat").addClass("sub"); 320 }); 321 } 322 323 // banner_menu function 324 $(".banner_menu_button").click(function () { 325 const bannerMn = $(".banner_menu"); 326 const bannerWrap = $(".banner_menu_wrap").height(); 327 const bn_H = 34 + bannerWrap; 328 329 if ($(".banner_menu").hasClass("on")) { 330 $(".banner_menu").removeClass("on"); 331 bannerMn.height(0); 332 } else { 333 $(".banner_menu").addClass("on"); 334 bannerMn.height(bn_H); 335 } 336 }); 337 338 /* ====================================================================== 339 * 340 * FRONT 341 * 342 ====================================================================== */ 343 344 if ($(".front").length > 0) { 345 // Close when clicking other areas 346 $(document).mouseup(function (e) { 347 var LayerPopup = $(".mchat_cont"); 348 if (LayerPopup.has(e.target).length === 0) { 349 LayerPopup.removeClass("on"); 350 } 351 352 var bannerMenu = $(".banner_menu"); 353 if (bannerMenu.has(e.target).length === 0) { 354 bannerMenu.removeClass("on"); 355 } 356 }); 357 358 // When the close button is clicked 359 $(".quit").click(function () { 360 $(".mchat_cont").removeClass("on"); 361 }); 362 } 363 364 /* ====================================================================== 365 * 366 * ADMIN 367 * 368 ====================================================================== */ 369 370 if ($(".admin_layout").length > 0) { 371 // guide popup 372 $(".guide_wrap button").click(function () { 373 $(this).siblings(".guide_popup").addClass("on"); 374 }); 375 376 // Close when clicking other areas 377 $(document).mouseup(function (e) { 378 const guidePopup = $(".guide_popup"); 379 if (guidePopup.has(e.target).length === 0) { 380 guidePopup.removeClass("on"); 381 } 382 }); 383 384 // drag & drop 385 $("#sortable") 386 .sortable({ 387 cursor: "move", 388 items: $(".dep1_list"), 389 handle: ".sort_handle", 390 }) 391 .disableSelection(); 392 393 // when depth1 arrow clicked 394 $(".open_sub_btn").click(function () { 395 if ($(this).parents(".dep1_tit").hasClass("on")) { 396 $(this) 397 .parents(".dep1_tit") 398 .removeClass("on") 399 .siblings(".dep2_wrap") 400 .slideUp(); 401 } else { 402 $(this) 403 .parents(".dep1_tit") 404 .addClass("on") 405 .siblings(".dep2_wrap") 406 .slideDown(); 407 } 408 }); 409 410 // checkbox all check 411 $(".chkbox").click(function () {}); 412 413 const $chkAll = $("#chkAll"); 414 $chkAll.change(function () { 415 const $this = $(this); 416 const checked = $this.prop("checked"); 417 418 $('.tab_cont_bx input[name="chk_keyword"]').prop("checked", checked); 419 }); 420 421 $(".tab_cont_bx").each(function () { 422 const boxes = $('.tab_cont_bx input[name="chk_keyword"]'); 423 boxes.change(function () { 424 const boxLength = boxes.length; 425 const checkedLength = $( 426 '.tab_cont_bx input[name="chk_keyword"]:checked' 427 ).length; 428 const selectAll = boxLength == checkedLength; 429 430 $chkAll.prop("checked", selectAll); 431 432 const AllChecked = $(".tab_cont_bx input[name=chk_keyword]").length; 433 let checkedCnt = $( 434 ".tab_cont_bx input[name=chk_keyword]:checked" 435 ).length; 436 437 if (AllChecked == checkedCnt) { 438 $("#chkAll").prop("checked", true); 439 } 440 }); 441 }); 442 } 443}); 444/* ====================================================================== 445* 446* basic 447* 448====================================================================== */ 449 450// í¤ìë í´ë¦ ì ì¤í¬ë¡¤ ì´ë 451function contScrollDown(num) { 452 var target = "bubble_customer"; 453 454 setTimeout(function () { 455 $("." + target) 456 .last() 457 .get(0) 458 .scrollIntoView({ block: "start", behavior: "smooth" }); 459 }, 300); 460} 461 462// ë°ë¡ëµë³ ì´ë¯¸ì§ 463function linkItem() { 464 $(".link_item").each(function () { 465 const _this = $(this); 466 467 if ($(this).find(".item_info").length > 0) { 468 $(this).find(".item_img").addClass("bdrs_on"); 469 } 470 }); 471} 472 473//ì±ë´í¤ìë 474function getCate( 475 par, 476 nm, 477 view_type, 478 guide_text, 479 content, 480 cnt, 481 link,
482 attach_file, 483 attach_file_ori, 484 page_type, 485 view_type_sub 486) { 487 //ì±ë´íµê³ ë ë/ì/ì¼ë¡ êµ¬ë¶ 488 $.ajax({ 489 url: "/chatStat", 490 data: { 491 idx: par, 492 device: device, 493 }, 494 type: "get", 495 success: function (data) {}, 496 }); 497 498 if (view_type == "Y_coment") { 499 var content_arr = nullChk(content).split("|"); 500 var link_arr = nullChk(link).split("|"); 501 var attach_file_arr = nullChk(attach_file).split("|"); 502 var page_arr = nullChk(page_type).split("|"); 503 var currentPage = isEnPage() ? "en" : "ko"; 504 505 if (link_arr != "" && link_arr != null && link_arr != "undefined") { 506 YComent_Ncnt( 507 nm, 508 guide_text, 509 content, 510 cnt, 511 link, 512 attach_file, 513 page_type, 514 currentPage 515 ); 516 } else { 517 YComent_Ycnt(par, nm, view_type, guide_text); 518 } 519 } else { 520 if (view_type_sub == "link") { 521 NComent_Ncnt(content, link, page_type); 522 } else { 523 NComent_Ycnt(par, nm, view_type, guide_text); 524 } 525 } 526 527 fontColor(chat_color); 528} 529 530function select_list() { 531 $(".select_list").each(function () { 532 const _this = $(this); 533 const item = $(this).find(".select_item"); 534 535 item.click(function () { 536 _this.find(".select_btn").removeClass("selected"); 537 $(this).find(".select_btn").addClass("selected"); 538 }); 539 }); 540} 541 542const bubbleSwiper = undefined; 543const swiperOptions = { 544 slidesPerView: "auto", 545 loop: false, 546 draggable: true, 547 allowTouchMove: true, 548}; 549 550function YComent_Ncnt( 551 nm, 552 guide_text, 553 content, 554 cnt, 555 link, 556 attach_file, 557 page_type, 558 currentPage 559) { 560 //íìdepê° ìê³ ë°ë¡ëµë³ì¼ë 561 var content_arr = nullChk(content).split("|"); 562 var link_arr = nullChk(link).split("|"); 563 var attach_file_arr = nullChk(attach_file).split("&&&"); 564 var page_arr = nullChk(page_type).split("|"); 565 566 html = '<div id="ddd" class="bubble bubble_customer">'; 567 html += '<div class="bubble_box">' + nm + "</div>"; 568 html += "</div>"; 569 570 html += '<div class="bubble bubble_admin">'; 571 html += '<div class="bubble_top_box">'; 572 html += '<div class="bubble_status_icon">'; 573 html += "<img src=" + chat_img + ">"; 574 html += "</div>"; 575 html += '<div class="bubble_status_box">'; 576 html += '<span class="status">' + chat_name + "</span>"; 577 html += '<span class="status_now en_font">' + getNow() + "</span>"; 578 579 html += "</div>"; 580 html += "</div>"; 581 582 html += 583 ' <div class="bubble_box bubble_box--link bubble_slider swiper-container home_button_box">'; 584 html += ' <div class="swiper-wrapper">'; 585 for (var i = 0; i < content_arr.length - 1; i++) { 586 html += ' <div class="link_item carousel_item swiper-slide">'; 587 html += '<div class="link_answer">' + content_arr[i] + "</div>"; 588 html += 589 ' <a href="' + 590 link_arr[i] + 591 '" target="' + 592 page_arr[i] + 593 '" class="item_inner">'; 594 if (attach_file_arr[i] != "") { 595 html += 596 ' <div class="item_img"><img src="' + 597 attach_file_arr[i] + 598 '" alt="íë¡ì í¸ ì´ë¯¸ì§"> </div>'; 599 } 600 if (link_arr[i] != "") { 601 html += ' <div class="item_info">'; 602 if (currentPage == "ko") { 603 html += ' <div class="item_name">ë°ë¡ê°ê¸°</div>'; 604 } else { 605 html += ' <div class="item_name">Visit Now</div>'; 606 } 607 html += ' <div class="item_arrow"></div>'; 608 html += " </div>"; 609 } 610 html += " </a>"; 611 html += " </div>"; 612 } 613 html += " </div>"; 614 615 html += '<a href="javascript:void(0);" class="goHome">'; 616 if (currentPage == "ko") { 617 html += 618 '<svg width="12.25" height="12.25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.99 2.638a2.344 2.344 0 0 1 3.02 0l7.032 5.93c.528.445.833 1.1.833 1.791v9.698a1.823 1.823 0 0 1-1.823 1.823h-3.646a1.823 1.823 0 0 1-1.823-1.823V14.84a.26.26 0 0 0-.26-.26h-3.646a.26.26 0 0 0-.26.26v5.216a1.823 1.823 0 0 1-1.823 1.823H4.948a1.823 1.823 0 0 1-1.823-1.823v-9.698c0-.69.305-1.346.833-1.792l7.031-5.93zm2.014 1.194a.781.781 0 0 0-1.008 0l-7.03 5.93a.781.781 0 0 0-.279.597v9.698c0 .144.117.26.26.26h3.647a.26.26 0 0 0 .26-.26V14.84c0-1.007.816-1.823 1.823-1.823h3.646c1.007 0 1.823.816 1.823 1.823v5.216c0 .144.116.26.26.26h3.646a.26.26 0 0 0 .26-.26v-9.698a.781.781 0 0 0-.277-.597l-7.031-5.93z" fill="#0063EF"/></svg> 첫 íë©´ì¼ë¡ ëìê°ê¸°'; 619 } else { 620 html +=
621 '<svg width="12.25" height="12.25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.99 2.638a2.344 2.344 0 0 1 3.02 0l7.032 5.93c.528.445.833 1.1.833 1.791v9.698a1.823 1.823 0 0 1-1.823 1.823h-3.646a1.823 1.823 0 0 1-1.823-1.823V14.84a.26.26 0 0 0-.26-.26h-3.646a.26.26 0 0 0-.26.26v5.216a1.823 1.823 0 0 1-1.823 1.823H4.948a1.823 1.823 0 0 1-1.823-1.823v-9.698c0-.69.305-1.346.833-1.792l7.031-5.93zm2.014 1.194a.781.781 0 0 0-1.008 0l-7.03 5.93a.781.781 0 0 0-.279.597v9.698c0 .144.117.26.26.26h3.647a.26.26 0 0 0 .26-.26V14.84c0-1.007.816-1.823 1.823-1.823h3.646c1.007 0 1.823.816 1.823 1.823v5.216c0 .144.116.26.26.26h3.646a.26.26 0 0 0 .26-.26v-9.698a.781.781 0 0 0-.277-.597l-7.031-5.93z" fill="#0063EF"/></svg> Back To Home'; 622 } 623 html += " </a>"; 624 html += " </div>"; 625 html += "</div>"; 626 627 if (chat_style == "basic") { 628 $(".basic_target").append(html); 629 html = ""; 630 } else { 631 $(".banner_box").append(html); 632 html = ""; 633 } 634 635 linkItem(); 636 bubbleSlider(); 637} 638 639function bubbleSlider() { 640 const bubbleSwiper = new Swiper(".bubble_slider", swiperOptions); 641} 642 643function NComent_Ncnt(content, link, page_type) { 644 //íìdepê° ìê³ ë´ì©ììì¼ë 645 if (link != null && link != "") { 646 //ë§í¬ ëìì£¼ê³ ë 647 window.open(link, page_type); 648 } 649} 650 651function YComent_Ycnt(par, nm, view_type, guide_text) { 652 //íìdepê° ìê³ ë°ë¡ëµë³ì¼ë 653 html = '<div id="ddd" class="bubble bubble_customer">'; 654 html += '<div class="bubble_box chat_move_' + chat_cnt + '">' + nm + "</div>"; 655 html += "</div>"; 656 657 html += '<div class="bubble bubble_admin">'; 658 659 html += '<div class="bubble_top_box">'; 660 html += '<div class="bubble_status_icon">'; 661 html += "<img src=" + chat_img + ">"; 662 html += "</div>"; 663 html += '<div class="bubble_status_box">'; 664 html += '<span class="status">' + chat_name + "</span>"; 665 html += '<span class="status_now en_font">' + getNow() + "</span>"; 666 667 html += "</div>"; 668 html += "</div>"; 669 670 if (chat_style == "basic") { 671 $(".basic_target").append(html); 672 html = ""; 673 } else { 674 $(".banner_box").append(html); 675 html = ""; 676 } 677 678 var chat_move = "chat_move_" + chat_cnt; 679 setTimeout(function () {}, 300); 680 chat_cnt++; 681 682 var lang = ""; 683 if (!(urlPath.indexOf("/en") > -1)) { 684 lang = "kor"; 685 } else { 686 lang = "eng"; 687 } 688 689 $.ajax({ 690 url: "/getChatContents", 691 data: { 692 par: par, 693 banner: "basic", 694 lang: lang, 695 }, 696 type: "get", 697 success: function (data) { 698 html2 = '<div class="bubble bubble_select">'; 699 html2 += '<ul class="select_list">'; 700 701 data.forEach(function (e) { 702 let link_arrow = ""; 703 if ( 704 e.link.replace("|", "") != "" && 705 e.link.replace("|", "") != null && 706 e.link.replace("|", "") != "undefined" && 707 e.link.indexOf("|") == -1 708 ) { 709 link_arrow = 710 '<img src="/img/front/mChat/link_arrow.png" alt="ë§í¬ë²í¼">'; 711 } else { 712 link_arrow = ""; 713 } 714 715 html2 += '<li class="select_item select_item' + e.idx + '">'; 716 html2 += '<button type="button" class="select_btn"'; 717 html2 += 718 'onclick="contScrollDown(' + 719 chat_cnt + 720 "); getCate(" + 721 e.idx + 722 ",'" + 723 e.nm.replace(/'/g, "`") + 724 "','" + 725 e.view_type + 726 "','" + 727 e.guide_text.replace(/'/g, "`") + 728 "','" + 729 e.content.replace(/'/g, "`") + 730 "'," + 731 e.cnt + 732 ",'" + 733 e.link + 734 "','" + 735 e.attach_file + 736 "','" + 737 e.attach_file_ori + 738 "','" + 739 e.page_type + 740 "', '" + 741 e.view_type_sub + 742 "')\" >" + 743 e.nm.replace(/'/g, "`") + 744 link_arrow + 745 "</button> </li>"; 746 }); 747 html2 += "</ul>"; 748 749 if (chat_style == "basic") { 750 $(".basic_target").append(html2); 751 html2 = ""; 752 } else { 753 $(".banner_box").append(html2); 754 html2 = ""; 755 } 756 linkItem(); 757 // select btn active 758 select_list(); 759 }, 760 }); 761} 762 763function NComent_Ycnt(par, nm, view_type, guide_text) { 764 //íìdepê° ìê³ ë´ì©ììì¼ë 765 html = '<div id="ddd" class="bubble bubble_customer">'; 766 html += '<span class="status_now en_font">' + getNow() + "</span>"; 767 html += '<div class="bubble_box chat_move_' + chat_cnt + '">' + nm + "</div>"; 768 html += "</div>"; 769 770 html += '<div class="bubble bubble_admin">'; 771 772 html += '<div class="bubble_top_box">'; 773 html += '<div class="bubble_status_icon">'; 774 html += "<img src=" + chat_img + ">"; 775 html += "</div>"; 776 html += '<div class="bubble_status_box">'; 777 html += '<span class="status">' + chat_name + "</span>"; 778 html += '<span class="status_now en_font">' + getNow() + "</span>"; 779 780 html += "</div>"; 781 html += "</div>"; 782 783 html += '<div class="bubble_box bubble_box--admin 1">' + guide_text; 784 html += "</div></div>"; 785 786 if (chat_style == "basic") { 787 $(".basic_target").append(html); 788 html = ""; 789 } else { 790 $(".banner_box").append(html); 791 html = ""; 792 } 793 794 var chat_move = "chat_move_" + chat_cnt; 795 setTimeout(function () {}, 300); 796 chat_cnt++; 797 798 var lang = ""; 799 if (!(urlPath.indexOf("/en") > -1)) { 800 lang = "kor"; 801 } else { 802 lang = "eng"; 803 } 804 805 $.ajax({ 806 url: "/getChatContents", 807 data: { 808 par: par, 809 banner: "basic", 810 lang: lang, 811 }, 812 type: "get", 813 success: function (data) { 814 html2 = '<div class="bubble bubble_select">'; 815 html2 += '<ul class="select_list">'; 816 817 data.forEach(function (e) { 818 let link_arrow = ""; 819 if ( 820 e.link.replace("|", "") != "" && 821 e.link.replace("|", "") != null && 822 e.link.replace("|", "") != "undefined" && 823 e.link.indexOf("|") == -1 824 ) { 825 } else { 826 link_arrow = ""; 827 } 828 829 html2 += '<li class="select_item select_item' + e.idx + '">'; 830 html2 += '<button type="button" class="select_btn"'; 831 html2 += 832 'onclick="contScrollDown(' + 833 chat_cnt + 834 "); getCate(" + 835 e.idx + 836 ",'" + 837 e.nm.replace(/'/g, "`") + 838 "','" + 839 e.view_type + 840 "','" + 841 e.guide_text.replace(/'/g, "`") + 842 "','" + 843 e.content.replace(/'/g, "`") + 844 "'," + 845 e.cnt + 846 ",'" + 847 e.link + 848 "','" + 849 e.attach_file + 850 "','" + 851 e.attach_file_ori + 852 "','" + 853 e.page_type + 854 "', '" + 855 e.view_type_sub + 856 "')\" >" + 857 e.nm.replace(/'/g, "`") + 858 link_arrow + 859 "</button> </li>"; 860 }); 861 html2 += "</ul>"; 862 if (chat_style == "basic") { 863 $(".basic_target").append(html2); 864 html2 = ""; 865 } else { 866 $(".banner_box").append(html2); 867 868 html2 = ""; 869 } 870 select_list(); 871 }, 872 }); 873} 874function isDark(color) { 875 var match = /rgb\((\d+).*?(\d+).*?(\d+)\)/.exec(color); 876 return (match[1] & 255) + (match[2] & 255) + (match[3] & 255) < (3 * 256) / 2; 877} 878function fontColor(chat_color) { 879 $(".bubble_customer .bubble_box").each(function () { 880 $(this).css("background-color", chat_color); 881 const bgc = $(this).css("background-color"); 882 883 $(this).css("color", isDark(bgc) ? "white" : "black"); 884 }); 885} 886 887/* ====================================================================== 888* 889* banner 890* 891====================================================================== */ 892// Get today's date 893function getDate() { 894 const weeks = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; 895 const today = new Date(); 896 const year = today.getFullYear();
897 const month = ("0" + (1 + today.getMonth())).slice(-2); 898 const day = ("0" + today.getDate()).slice(-2); 899 const hours = today.getHours() % 12 ? today.getHours() % 12 : 12; 900 const minutes = 901 today.getMinutes() < 10 ? "0" + today.getMinutes() : today.getMinutes(); 902 const ampm = today.getHours() >= 12 ? "PM" : "AM"; 903 const date = `${year}.${month}.${day} ${hours}:${minutes} ${ampm}`; 904 const dayOfWeeks = today.getDay(); 905 906 return date; 907} 908function getNow() { 909 const weeks = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; 910 const today = new Date(); 911 const dayOfWeeks = today.getDay(); 912 const hours = today.getHours() % 12 ? today.getHours() % 12 : 12; 913 const minutes = 914 today.getMinutes() < 10 ? "0" + today.getMinutes() : today.getMinutes(); 915 const ampm = today.getHours() >= 12 ? "PM" : "AM"; 916 const now = `${weeks[dayOfWeeks]} ${hours}:${minutes} ${ampm}`; 917 918 return now; 919} 920 921function getBanner( 922 nm, 923 content, 924 par, 925 guide_text, 926 cnt, 927 attach_file, 928 link, 929 page_type 930) { 931 if (link != "" && link != null && link != "undefined") { 932 window.open(link, page_type); 933 } else { 934 //banner_box 935 $(".goBack").removeClass("dn"); 936 $(".mchat_hard").addClass("dn"); 937 $(".banner_box").empty().addClass("open_bn"); 938 $(".greeting").hide(); 939 $(".banner_box").append( 940 '<div id="banner_sub' + 941 cnt + 942 '" class="banner_item">' + 943 ' <div class="item_inner">' + 944 ' <div class="item_info">' + 945 ' <div class="item_name">' + 946 // nm + 947 "</div>" + 948 ' <div class="item_desc">' + 949 content + 950 "</div>" + 951 " </div>" + 952 " </div>" + 953 " </div>" + 954 '<div class="now"></div>' 955 ); 956 957 html = '<div class="bubble bubble_admin">'; 958 html += '<div class="bubble_top_box">'; 959 html += '<div class="bubble_status_icon">'; 960 html += "<img src=" + chat_img + ">"; 961 html += "</div>"; 962 html += '<div class="bubble_status_box">'; 963 html += '<span class="status">' + chat_name + "</span>"; 964 html += '<span class="status_now en_font">' + getNow() + "</span>"; 965 966 html += "</div>"; 967 html += "</div>"; 968 html += '<div class="bubble_box bubble_box--admin">'; 969 html += guide_text; 970 html += "</div>"; 971 html += "</div>"; 972 973 $(".banner_box").append(html); 974 $(".now").text(getDate()); 975 if ( 976 attach_file != "" && 977 attach_file != null && 978 attach_file != "undefined" 979 ) { 980 // 기ë¥ê°ë° ì ìììì 981 $("#banner_sub" + cnt).css( 982 "background-image", 983 `url(/img/front/mChat/banner_img0${cnt}.svg)` 984 ); 985 $("#banner_sub" + cnt).css("background-image", `url(${attach_file})`); 986 } 987 html = ""; 988 989 var lang = ""; 990 if (!(urlPath.indexOf("/en") > -1)) { 991 lang = "kor"; 992 } else { 993 lang = "eng"; 994 } 995 996 $.ajax({ 997 url: "/getChatContents", 998 data: { 999 par: par, 1000 banner: "basic", 1001 lang: lang, 1002 }, 1003 type: "get", 1004 success: function (data) { 1005 html2 = '<div class="bubble bubble_select">'; 1006 html2 += '<ul class="select_list">'; 1007 1008 data.forEach(function (e) { 1009 let link_arrow = ""; 1010 if ( 1011 e.link.replace("|", "") != "" && 1012 e.link.replace("|", "") != null && 1013 e.link.replace("|", "") != "undefined" && 1014 e.link.indexOf("|") == -1 1015 ) { 1016 link_arrow = 1017 '<img src="/img/front/mChat/link_arrow.png" alt="ë§í¬ë²í¼">'; 1018 } else { 1019 link_arrow = ""; 1020 } 1021 1022 html2 += '<li class="select_item select_item' + e.idx + '">'; 1023 html2 += '<button type="button" class="select_btn"'; 1024 html2 += 1025 'onclick="contScrollDown(' + 1026 chat_cnt + 1027 "); getCate(" + 1028 e.idx + 1029 ",'" + 1030 e.nm.replace(/'/g, "`") + 1031 "','" + 1032 e.view_type + 1033 "','" + 1034 e.guide_text.replace(/'/g, "`") + 1035 "','" + 1036 e.content.replace(/'/g, "`") + 1037 "'," + 1038 e.cnt + 1039 ",'" + 1040 e.link + 1041 "','" + 1042 e.attach_file + 1043 "','" + 1044 e.attach_file_ori + 1045 "','" + 1046 e.page_type + 1047 "', '" + 1048 e.view_type_sub + 1049 "')\" >" + 1050 e.nm.replace(/'/g, "`") + 1051 link_arrow + 1052 "</button> </li>"; 1053 }); 1054 1055 html2 += "</ul>"; 1056 html2 += "</div>"; 1057 1058 $(".banner_box").append(html2); 1059 html2 = ""; 1060 1061 // select btn active 1062 select_list(); 1063 }, 1064 }); 1065 } 1066} 1067 1068/* ====================================================================== 1069* 1070* 문ì í기 íëì½ë© start 1071* 1072====================================================================== */ 1073 1074const dummyData = { 1075 "AS 문ì": `ì í ì ê² ë° AS 문ìê° ìì¼ì ê°ì?<br/>ìë í목ì ì ë ¥í´ì£¼ì¸ì.`, 1076 "ì í 문ì": 1077 "ì í ì¬ì, ì¬ì©ë² ë±ì ëí´ ê¶ê¸íì ê°ì?<br/>ìë í목ì ì ë ¥í´ì£¼ì¸ì.", 1078}; 1079const dummyForm = { 1080 "AS 문ì": `asForm`, 1081 "ì í 문ì": "prdForm", 1082 "기í 문ì": "etcForm", 1083}; 1084
1085const dummyDataEn = { 1086 "AS Inquiry": `Do you have a product inspection or A/S inquiry?<br/>Please enter the details below.`, 1087 "Product Inquiry": 1088 "Have questions about product specifications or usage?<br/>Please enter the details below.", 1089}; 1090const dummyFormEn = { 1091 "AS Inquiry": `asForm`, 1092 "Product Inquiry": "prdForm", 1093}; 1094 1095// hardChat ìì 1096$(".items.hard_chat").click(function () { 1097 hardChatFunc(); 1098 hardQuestion(); 1099}); 1100 1101// 기본 íë©´ ì ê±° 1102function hardChatFunc() { 1103 $(".hard_chat").addClass("active"); 1104 $(".goBack").removeClass("dn"); 1105 $(".mchat_hard").addClass("dn"); 1106 $(".banner_box").empty(); 1107 $(".greeting").hide(); 1108} 1109 1110// hardChat ë´ì ìì 1111function resetHardChat() { 1112 $(".hardChatSection").html(null); 1113 if ($(".privacySection").children().length > 0) { 1114 $(".privacySection").html(null); 1115 } 1116} 1117 1118// ê´ë¦¬ì ëí ìì± 1119function hardQuestion() { 1120 const enHtml = ` 1121 <div class="bubble bubble_admin"> 1122 <div class="bubble_top_box"> 1123 <div class="bubble_status_icon"> 1124 <img src="${chat_img}"> 1125 </div> 1126 <div class="bubble_status_box"> 1127 <span class="status">OSANG HEALTHCARE</span> 1128 <span class="status_now en_font">${getNow()}</span> 1129 </div> 1130 </div> 1131 <div class="bubble_box bubble_box--admin"> 1132 Hello! Welcome to OSANG HEALTHCARE. 1133 </div> 1134 <div class="bubble_box bubble_box--admin"> 1135 Just let us know what you need,<br/>and weâll be happy to assist you quickly and accurately. 1136 </div> 1137 </div> 1138 1139 <ul class="select_list"> 1140 <li class="select_item select_item"><button type="button" class="select_btn hrad"> 1141 AS Inquiry</button> 1142 </li> 1143 <li class="select_item select_item"><button type="button" class="select_btn hrad"> 1144 Product Inquiry</button> 1145 </li> 1146 <li class="select_item select_item"><button type="button" class="select_btn contacts" onclick="location.href='/en/support/contacts'"> 1147 Others Inquiry</button> 1148 </li> 1149 </ul>`; 1150 const html = ` 1151 <div class="bubble bubble_admin"> 1152 <div class="bubble_top_box"> 1153 <div class="bubble_status_icon"> 1154 <img src="${chat_img}"> 1155 </div> 1156 <div class="bubble_status_box"> 1157 <span class="status">ì¤ìí¬ì¤ì¼ì´</span> 1158 <span class="status_now en_font">${getNow()}</span> 1159 </div> 1160 </div> 1161 <div class="bubble_box bubble_box--admin"> 1162 ìë íì¸ì! ì¤ìí¬ì¤ì¼ì´ì ëë¤ :) 1163 </div> 1164 <div class="bubble_box bubble_box--admin"> 1165 ìíìë ì 무를 ì íí´ ì£¼ìë©´,<br/> 1166 ë¹ ë¥´ê³ ì ííê² ëìì ëë¦¬ê² ìµëë¤. 1167 </div> 1168 </div> 1169 1170 <ul class="select_list"> 1171 <li class="select_item select_item"><button type="button" class="select_btn hrad"> 1172 AS 문ì</button> 1173 </li> 1174 <li class="select_item select_item"><button type="button" class="select_btn hrad"> 1175 ì í 문ì</button> 1176 </li> 1177 <li class="select_item select_item"><button type="button" class="select_btn contacts" onclick="location.href='/support/contacts'"> 1178 기í 문ì</button> 1179 </li> 1180 </ul>`; 1181 if (location.pathname.split("/")[1] === "en") { 1182 $(".bubbleSection").html(enHtml); 1183 } else { 1184 $(".bubbleSection").html(html); 1185 } 1186 1187 // ì íì§ ì´ë²¤í¸ 리ì¤ë 1188 $(".select_btn.hrad").on("click", function () { 1189 const _this = $(this); 1190 // 문ììì ìì± í¸ì¶ 1191 hardHtml(_this.text()); 1192 }); 1193} 1194// 문ììì ìì± 1195function hardHtml(key) { 1196 const value = key.trim(); 1197 const html = ` 1198 <div id="ddd" class="bubble bubble_customer"> 1199 <span class="status_now en_font">${getNow()}</span> 1200 <div class="bubble_box chat_move_0" 1201 style="background-color: rgb(206, 234, 254); color: black;"> 1202 ${value} 1203 </div> 1204 </div> 1205 <div class="bubble_box bubble_box--admin"> 1206 ${dummyData[value]} 1207 </div> 1208 <div class="submit_hard"> 1209 <div class="move_dot"> 1210 <div class="perv_arrow"> 1211 </div> 1212 <div data-now="trx_1" data-prev="trx_0" class="dot trx_1 active"></div> 1213 <div data-now="trx_2" data-prev="trx_1" class="dot trx_2"></div> 1214 ${ 1215 value == "기í 문ì" 1216 ? `` 1217 : `<div data-now="trx_3" data-prev="trx_2" class="dot trx_3"></div>` 1218 } 1219 </div> 1220 <div class="move_section"> 1221 <form class="form_chat_box" id="${ 1222 dummyForm[value] 1223 }" action=""> 1224 <div class="form_chat form_1"> 1225 <p class="info"> 1226 문ìì ë¹ ë¥´ê² ëµë³ë리기 ìí´ <br /> 1227 ê³ ê°ëì ìì¤í ì 보를 ì ë ¥í´ì£¼ì¸ì. 1228 </p> 1229 <p class="info_sub"> 1230 ê·íê° ì ê³µíì ê°ì¸ì ë³´(ì´ë¦, ì°ë½ì², ì´ë©ì¼)ë ìë¹ì¤ ì ê³µ ë° <br /> 1231 문ì ìë를 ìí´ìë§ ì¬ì©ëë©°, ê´ë ¨ ë²ë ¹ì ë°ë¼ ìì íê² ê´ë¦¬ë©ëë¤. 1232 </p> 1233 <input type="hidden" id="inquiry_category" name="inquiry_category" value="${value}"> 1234 <label class="label" for="user_name">ì´ë¦*</label> 1235 <input autocomplete="off" class="require" data-vali="ì´ë¦ì ì ë ¥í´ì£¼ì¸ì." id="user_name" name="user_name" placeholder="ì´ë¦ì ì ë ¥í´ì£¼ì¸ì. ex)í길ë" type="text"> 1236 <label class="label" for="user_phone">ì°ë½ì² *</label> 1237 <input autocomplete="off" class="require" data-vali="ì°ë½ì²ë¥¼ ì ë ¥í´ì£¼ì¸ì." id="user_phone" name="user_phone" placeholder="ì°ë½ì²ë¥¼ ì ë ¥í´ì£¼ì¸ì. ex)010-1111-1111" type="phone"> 1238 <label class="label" for="user_email">ì´ë©ì¼ *</label> 1239 <input autocomplete="off" class="require" data-vali="ì´ë©ì¼ì ì ë ¥í´ ì£¼ì¸ì." id="user_email" name="user_email" placeholder="ì´ë©ì¼ì ì ë ¥í´ ì£¼ì¸ì. ex)[email protected]" type="text"> 1240 <label class="label" for="user_country">êµê° *</label> 1241 <input autocomplete="off" class="require" data-vali="êµê°ë¥¼ ì ë ¥í´ ì£¼ì¸ì." id="user_country" name="user_country" placeholder="êµê°ë¥¼ ì ë ¥í´ ì£¼ì¸ì. ex)ëí민êµ" type="text"> 1242 <input type="checkbox" data-vali="ê°ì¸ì ë³´ ìì§ì´ì© ëì를 ì²´í¬í´ì£¼ì¸ì." class="require" id="privacy_chk" name="privacy_chk"> 1243 <label for="privacy_chk">ê°ì¸ì ë³´ ìì§ì´ì© ëì (íì) <a href="javascript:void(0);"><span class="underline">ì 문보기</span></a></label> 1244 <div class="next_box"> 1245 <p class="next" data-id="trx_2">ë¤ì</p> 1246 </div> 1247 </div> 1248 <div class="form_chat form_2"> 1249 1250 <label class="label">
1250문ìíê³ ì¶ì ë´ì©ì ëí´ ìì¸íê² ìë ¤ì£¼ì¸ì.</label> 1251 <textarea autocomplete="off" data-vali="문ìíì¤ ë´ì©ì ìì±í´ì£¼ì¸ì." name="project_cont" class="require" placeholder="문ìíì¤ ë´ì©ì ìì±í´ì£¼ì¸ì.*" id=""></textarea> 1252 <p class="info_file">íì¼ ì í : pdf, ppt, word, excel, jpg, png, zip ìµë 10MB 1253 </p> 1254 <div class="file_box"> 1255 <label class="hard_file_label disalbed">íì¼ì²¨ë¶+</label> 1256 <label class="hard_file_label hard_file3" for="hard_file3">íì¼ì²¨ë¶+</label> 1257 <label class="hard_file_label hard_file2" for="hard_file2">íì¼ì²¨ë¶+</label> 1258 <label class="hard_file_label hard_file1" for="hard_file1">íì¼ì²¨ë¶+</label> 1259 </div> 1260 <div class="file_li"> 1261 </div> 1262 <input id="hard_file1" class="real_files" name="upload[]" type="file" accept=".pdf, .ppt, .word, .excel, .jpg, .png, .zip" hidden> 1263 <input id="hard_file2" class="real_files" name="upload[]" type="file" accept=".pdf, .ppt, .word, .excel, .jpg, .png, .zip" hidden> 1264 <input id="hard_file3" class="real_files" name="upload[]" type="file" accept=".pdf, .ppt, .word, .excel, .jpg, .png, .zip" hidden> 1265 <div class="next_box"> 1266 ${ 1267 value == "기í 문ì" 1268 ? `<button type="button" class="submit" onclick="submitActions('${value}', this)">문ìí기</button>` 1269 : `<p class="next" data-id="trx_3">ë¤ì</p>` 1270 } 1271 </div> 1272 </div> 1273 ${ 1274 value == "기í 문ì" 1275 ? "" 1276 : ` 1277 <div class="form_chat form_3"> 1278 <label class="label"> 1279 ê²ì¬ì§íµ í¹ì 측ì 기 ë·ë©´ì 1280 기ì¬ë Lot No를 기ì¬íì¬ ì£¼ììì.<br /> 1281 <span class="info_sub">*ë§ì½ íì¸ì´ ì´ë ¤ì°ìë©´ ìì±íì§ ìì¼ì ë ë©ëë¤.</span> 1282 </label> 1283 <textarea autocomplete="off" name="lot_no_cont" placeholder="Lot No" id=""></textarea> 1284 <div class="next_box"> 1285 <button type="button" class="submit" onclick="submitActions('${value}', this)">문ìí기</button> 1286 </div> 1287 </div> 1288 ` 1289 } 1290 </form> 1291 </div> 1292 </div> 1293 <a href="javascript:void(0);" class="goHome"> 1294 <svg width="12.25" height="12.25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.99 2.638a2.344 2.344 0 0 1 3.02 0l7.032 5.93c.528.445.833 1.1.833 1.791v9.698a1.823 1.823 0 0 1-1.823 1.823h-3.646a1.823 1.823 0 0 1-1.823-1.823V14.84a.26.26 0 0 0-.26-.26h-3.646a.26.26 0 0 0-.26.26v5.216a1.823 1.823 0 0 1-1.823 1.823H4.948a1.823 1.823 0 0 1-1.823-1.823v-9.698c0-.69.305-1.346.833-1.792l7.031-5.93zm2.014 1.194a.781.781 0 0 0-1.008 0l-7.03 5.93a.781.781 0 0 0-.279.597v9.698c0 .144.117.26.26.26h3.647a.26.26 0 0 0 .26-.26V14.84c0-1.007.816-1.823 1.823-1.823h3.646c1.007 0 1.823.816 1.823 1.823v5.216c0 .144.116.26.26.26h3.646a.26.26 0 0 0 .26-.26v-9.698a.781.781 0 0 0-.277-.597l-7.031-5.93z" fill="#0063EF"/></svg> 첫 íë©´ì¼ë¡ ëìê°ê¸° 1295 </a> 1296 `; 1297 const enHtml = ` 1298 <div id="ddd" class="bubble bubble_customer"> 1299 <span class="status_now en_font">${getNow()}</span> 1300 <div class="bubble_box chat_move_0" 1301 style="background-color: rgb(206, 234, 254); color: black;"> 1302 ${value} 1303 </div> 1304 </div> 1305 <div class="bubble_box bubble_box--admin"> 1306 ${dummyDataEn[value]} 1307 </div> 1308 <div class="submit_hard"> 1309 <div class="move_dot"> 1310 <div class="perv_arrow"> 1311 </div> 1312 <div data-now="trx_1" data-prev="trx_0" class="dot trx_1 active"></div> 1313 <div data-now="trx_2" data-prev="trx_1" class="dot trx_2"></div> 1314 ${ 1315 value == "기í 문ì" 1316 ? `` 1317 : `<div data-now="trx_3" data-prev="trx_2" class="dot trx_3"></div>` 1318 } 1319 </div> 1320 <div class="move_section"> 1321 <form class="form_chat_box" id="${ 1322 dummyFormEn[value] 1323 }" action=""> 1324 <div class="form_chat form_1"> 1325 <p class="info"> 1326 To provide you with a quick response,<br /> 1327 please provide your valuable information. 1328 </p> 1329 <p class="info_sub"> 1330 The personal information you provide (name, contact number, email) <br /> 1331 will only be used for service provision and inquiry responses,<br />and will be securely managed in accordance with applicable laws. 1332 </p> 1333 <input type="hidden" id="inquiry_category" name="inquiry_category" value="${value}"> 1334 <label class="label" for="user_name">Name*</label> 1335 <input autocomplete="off" class="require" data-vali="Please enter your name." id="user_name" name="user_name" placeholder="Please enter your name." type="text"> 1336 <label class="label" for="user_phone">Contact number *</label> 1337 <input autocomplete="off" class="require" data-vali="Please enter your contact number." id="user_phone" name="user_phone" placeholder="Please enter your contact number." type="phone"> 1338 <label class="label" for="user_email">Email *</label> 1339 <input autocomplete="off" class="require" data-vali="Please enter your email." id="user_email" name="user_email" placeholder="Please enter your email address." type="text"> 1340 <label class="label" for="user_country">Country *</label> 1341 <input autocomplete="off" class="require" data-vali="Please enter your country." id="user_country" name="user_country" placeholder="Please enter your country." type="text"> 1342 <input type="checkbox" data-vali="Please check the box to agree to the collection and use of personal information." class="require" id="privacy_chk" name="privacy_chk"> 1343 <label for="privacy_chk">Consent to collecting and using personal information (required) <a href="javascript:void(0);"><span class="underline">Full contents view</span></a></label> 1344 <div class="next_box"> 1345 <p class="next" data-id="trx_2">Next</p> 1346 </div> 1347 </div> 1348 <div class="form_chat form_2"> 1349 ${ 1350 value == "기í 문ì" 1351 ? "" 1352 : `
1353 <label class="label">Which OSANG HEALTHCARE product would you like to inquire about?</label> 1354 <input autocomplete="off" name="product_name" data-vali="Please enter the product name." class="require" placeholder="Product name*" type="text"></input>` 1355 } 1356 <label class="label">Please provide detailed information about your inquiry to OSANG HEALTHCARE.</label> 1357 <textarea autocomplete="off" data-vali="Enter the details of your inquiry below." name="project_cont" class="require" placeholder="Enter the details of your inquiry below.*" id=""></textarea> 1358 <p class="info_file"> Allowed formats : pdf, ppt, word, excel, jpg, zip / Maximum size : 10MB 1359 </p> 1360 <div class="file_box"> 1361 <label class="hard_file_label disalbed">UPLOAD+</label> 1362 <label class="hard_file_label hard_file3" for="hard_file3">UPLOAD+</label> 1363 <label class="hard_file_label hard_file2" for="hard_file2">UPLOAD+</label> 1364 <label class="hard_file_label hard_file1" for="hard_file1">UPLOAD+</label> 1365 </div> 1366 <div class="file_li"> 1367 </div> 1368 <input id="hard_file1" class="real_files" name="upload[]" type="file" accept=".pdf, .ppt, .word, .excel, .jpg, .png, .zip" hidden> 1369 <input id="hard_file2" class="real_files" name="upload[]" type="file" accept=".pdf, .ppt, .word, .excel, .jpg, .png, .zip" hidden> 1370 <input id="hard_file3" class="real_files" name="upload[]" type="file" accept=".pdf, .ppt, .word, .excel, .jpg, .png, .zip" hidden> 1371 <div class="next_box"> 1372 ${ 1373 value == "기í 문ì" 1374 ? `<button type="button" class="submit" onclick="submitActions('${value}', this)">문ìí기</button>` 1375 : `<p class="next" data-id="trx_3">Submission</p>` 1376 } 1377 </div> 1378 </div> 1379 ${ 1380 value == "기í 문ì" 1381 ? "" 1382 : ` 1383 <div class="form_chat form_3"> 1384 <label class="label"> 1385 Please enter the LOT number found on the test strip vial or the back of the device.<br /> 1386 <span class="info_sub">*If unknown, you may leave this field blank.</span> 1387 </label> 1388 <textarea autocomplete="off" name="lot_no_cont" placeholder="Lot No" id=""></textarea> 1389 <div class="next_box"> 1390 <p class="submit" onclick="submitActions('${value}', this)">Submission</p> 1391 </div> 1392 </div> 1393 ` 1394 } 1395 </form> 1396 </div> 1397 </div> 1398 <a href="javascript:void(0);" class="goHome"> 1399 <svg width="12.25" height="12.25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.99 2.638a2.344 2.344 0 0 1 3.02 0l7.032 5.93c.528.445.833 1.1.833 1.791v9.698a1.823 1.823 0 0 1-1.823 1.823h-3.646a1.823 1.823 0 0 1-1.823-1.823V14.84a.26.26 0 0 0-.26-.26h-3.646a.26.26 0 0 0-.26.26v5.216a1.823 1.823 0 0 1-1.823 1.823H4.948a1.823 1.823 0 0 1-1.823-1.823v-9.698c0-.69.305-1.346.833-1.792l7.031-5.93zm2.014 1.194a.781.781 0 0 0-1.008 0l-7.03 5.93a.781.781 0 0 0-.279.597v9.698c0 .144.117.26.26.26h3.647a.26.26 0 0 0 .26-.26V14.84c0-1.007.816-1.823 1.823-1.823h3.646c1.007 0 1.823.816 1.823 1.823v5.216c0 .144.116.26.26.26h3.646a.26.26 0 0 0 .26-.26v-9.698a.781.781 0 0 0-.277-.597l-7.031-5.93z" fill="#0063EF"/></svg> Back To Home 1400 </a> 1401 `; 1402 1403 if (location.pathname.split("/")[1] === "en") { 1404 $(".hardChatSection").html(enHtml); 1405 } else { 1406 $(".hardChatSection").html(html); 1407 } 1408 contScrollDown(0); 1409 1410 $(".underline").on("click", function () { 1411 const _this = $(this); 1412 // 문ììì ìì± í¸ì¶ 1413 privacy(_this.text()); 1414 $(".hardChatSection .goHome").remove(); 1415 }); 1416 1417 /** 1418 * 문ììì ì´ë²¤í¸ 리ì¤ë 1419 */ 1420 1421 $("#user_phone").on("input", function () { 1422 const numbersOnly = $(this).val().replace(/\D/g, "").slice(0, 11); 1423 let formatted = numbersOnly; 1424 1425 if (numbersOnly.length >= 10) { 1426 formatted = numbersOnly.replace(/(\d{3})(\d{3,4})(\d{4})/, "$1-$2-$3"); 1427 } else if (numbersOnly.length >= 4) { 1428 formatted = numbersOnly.replace(/(\d{3})(\d+)/, "$1-$2"); 1429 } 1430 1431 $(this).val(formatted); 1432 }); 1433 1434 $(".next").on("click", function () { 1435 const _this = $(this); 1436 const this_id = _this.data("id"); 1437 const this_form = _this 1438 .parents(".form_chat") 1439 .find("input.require, textarea.require"); 1440 const patternPhone = /^[0-9]{3}-[0-9]{3,4}-[0-9]{4}$/; 1441 const patternEmail = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; 1442 let msg, 1443 status = null; 1444 1445 this_form.each(function () { 1446 if (!$(this).val() || $(this).val() == "") { 1447 status = $(this).data("vali"); 1448 return false;
1449 } 1450 if ( 1451 $(this).prop("id") == "user_phone" && 1452 !patternPhone.test($(this).val()) 1453 ) { 1454 status = $(this).data("vali"); 1455 if (isEnPage()) { 1456 msg = "Use the format: 010-1111-1111."; 1457 } else { 1458 msg = "ex) 010-1111-1111ì íìì¼ë¡ ìì±í´ì¼í©ëë¤."; 1459 } 1460 return false; 1461 } 1462 if ( 1463 $(this).prop("id") == "user_email" && 1464 !patternEmail.test($(this).val()) 1465 ) { 1466 status = $(this).data("vali"); 1467 if (isEnPage()) { 1468 msg = "Use the format: [email protected]."; 1469 } else { 1470 msg = "ex) [email protected]ì íìì¼ë¡ ìì±í´ì¼í©ëë¤."; 1471 } 1472 return false; 1473 } 1474 if ($(this).prop("id") == "privacy_chk" && !$(this).prop("checked")) { 1475 status = $(this).data("vali"); 1476 return false; 1477 } 1478 }); 1479 1480 if (status != null) { 1481 let tempMsg = msg == null ? status : msg; 1482 return alert(tempMsg); 1483 } 1484 1485 $(".perv_arrow").addClass("active"); 1486 $(".form_chat_box").addClass(this_id); 1487 $(".dot").each(function () { 1488 $(".dot").removeClass("active"); 1489 $(`.dot.${this_id}`).addClass("active"); 1490 }); 1491 }); 1492 1493 $(".perv_arrow").on("click", function () { 1494 const now_id = $(".dot.active").data("now"); 1495 const prev_id = $(".dot.active").data("prev"); 1496 if (prev_id == "trx_1") { 1497 $(".perv_arrow").removeClass("active"); 1498 } 1499 $(".form_chat_box").removeClass(now_id); 1500 $(`.dot.${now_id}`).removeClass("active"); 1501 $(`.dot.${prev_id}`).addClass("active"); 1502 }); 1503 1504 // file 리ì¤ë 1505 $(".real_files").change(function () { 1506 const fileSize = $(this).prop("files")[0].size; 1507 let maxSize = 10 * 1024 * 1024; //* 10MB ì¬ì´ì¦ ì í 1508 if (fileSize > maxSize) { 1509 $(this).val(""); 1510 return alert("íì¼ì 10MB ì´ë´ë¡ ì ë¡ë ê°ë¥í©ëë¤."); 1511 } 1512 1513 const id = $(this).attr("id"); 1514 const file_name = $(this).prop("files")[0].name; 1515 const fileList = $(".file_li"); 1516 $(`label.${id}`).addClass("hasFile"); 1517 fileList.append( 1518 `<p class="file_names" data-id="${id}">${file_name}<i class="delete_file"></i></p>` 1519 ); 1520 1521 // íì¼ ìì 1522 $(".delete_file").click(function () { 1523 const del_elem = $(this).parents(".file_names"); 1524 const del_id = del_elem.data("id"); 1525 $(`label.${del_id}`).removeClass("hasFile"); 1526 $(`input.${del_id}`).val(""); 1527 del_elem.remove(); 1528 }); 1529 }); 1530} 1531 1532function privacy(key) { 1533 const value = key.trim(); 1534 const html = ` 1535 <div id="ddd" class="bubble bubble_customer"> 1536 <span class="status_now en_font">${getNow()}</span> 1537 <div class="bubble_box chat_move_0" 1538 style="background-color: rgb(206, 234, 254); color: black;"> 1539 ${value} 1540 </div> 1541 </div> 1542 <div class="submit_hard"> 1543 ê°ì¸ì ë³´ ìì§ ë° ì´ì©<br/><br/> 1544ãì¤ìí¬ì¤ì¼ì´ë ë¤ìì 목ì ì ìí´ì ìëì ëì´ë ê°ì¸ì ë³´ í목ì ííì¬ ìì§, ì´ì© ë° ì²ë¦¬ 를 í©ëë¤. ìì§ë ê°ì¸ì ë³´ë ì í´ì§ 목ì ì´ì¸ìë ì´ì©ëì§ ìì¼ë©°, í´ë¹ 목ì ì´ ë³ê²½ë ê²½ì°ìë ì 보주체ìê² ìë¦¬ê³ ëì를 ë°ì ìì ì ëë¤.<br/><br/> 15451. 목ì <br/> 1546ìë¹ì¤ 문ì, ê³ ê°ì í ë±ë¡, ì±ì© ìë´ ë° ì´ë ¥ì ë± ì ì ì ë³´<br/><br/> 1547 15482. í목<br/> 1549[ ìì§íë ê°ì¸ì ë³´ í목 ]<br/><br/> 1550 15511. ìë¹ì¤ 문ì : ì´ë¦, ì°ë½ì², ì´ë©ì¼<br/> 15522. ê³ ê°ì í ë±ë¡ : ì´ë¦, ì°ë½ì², ì´ë©ì¼, ì±ë³, ìë ìì¼<br/> 15533. ì±ì© ìë´ ë° ì´ë ¥ì ë± ì ìì ë³´<br/> 15541) íìí목 : ê°ì¸ìë³ì ë³´(ì¦ëª ì¬ì§, ì±ëª , ìë ìì¼, ì±ë³, 주ì, ì íë²í¸, ì ìì°í¸ì£¼ì, 긴ê¸ì°ë½ì²), êµì ì¬í(êµì /ë¹ìì ì¢ ë¥), íë ¥ì¬í(ì¬í기ê°, íêµ, ì ê³µ, 졸ì ì¬ë¶, 본êµ/ë¶êµ, íê· íì ë±), ë³ìì¬í(êµ°ë³, ë³ê³¼, ê³ê¸, ì ëì¬ë¶, 복무기ê°, ë©´ì ì¬ì ë±), ê²½ë ¥ì¬í(근무기ê°, 근무ì², ì§ì, ë´ë¹ì 무, ì°ë´ì ë³´ ë±), 기íì¬í(ì¥ì /ë³´íëìì¬ë¶)<br/> 15552) ì íí목 : êµì¡ìë£, ì격ì¦, ê³µì¸ì´íì ì, í´ì¸ê²½í, 취미, í¹ê¸°, í¡ì°ì¬ë¶ ë± ê¸°í ì±ì© ê´ë ¨ ì ë³´<br/> 1556ìì ìì§í목 ì기í 목ì ì ìí´ íìí ìµìíì ê°ì¸ì ë³´ì ëë¤. ì ê³µíì ê°ì¸ì ë³´ì ì²ë¦¬ì ê´í 구체ì ì¸ ë´ì© ë° ë°©ì¹¨ì íì¬ì ê°ì¸ì ë³´ì²ë¦¬ë°©ì¹¨ì íí ì°¸ì¡°í´ ì£¼ì기 ë°ëëë¤. ì기 ë´ì© ë° íì¬ì ê°ì¸ì ë³´ì²ë¦¬ë°©ì¹¨ì ë°ëì ì½ì¼ìê³ , ê°ì¸ì 보를 ì ê³µ, ìë¹ì¤ ë±ì ì´ì©í´ 주 ì기 ë°ë¼ë©°, ê·¸ë¬í ìì², ì´ì© ì§íììë ì ê³µíì ê°ì¸ì ë³´ì ìì§, ì´ì© ë° ì²ë¦¬ì ìµì¢ ëìí ì ê²ì¼ë¡ ê°ì£¼ë©ëë¤. ë¨, ì 보주체ë í´ë¹ ëì를 ê±°ë¶í ê¶ë¦¬ê° ìê³ ê±°ë¶ììë ìì²íì ìë¹ì¤ ë±ì´ ì íë ì ììì 미리 ê³ ì§íì¬ ë리ë ë°ì ëë¤.<br/> 1557 </div> 1558 <a href="javascript:void(0);" class="goHome">
1559 <svg width="12.25" height="12.25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.99 2.638a2.344 2.344 0 0 1 3.02 0l7.032 5.93c.528.445.833 1.1.833 1.791v9.698a1.823 1.823 0 0 1-1.823 1.823h-3.646a1.823 1.823 0 0 1-1.823-1.823V14.84a.26.26 0 0 0-.26-.26h-3.646a.26.26 0 0 0-.26.26v5.216a1.823 1.823 0 0 1-1.823 1.823H4.948a1.823 1.823 0 0 1-1.823-1.823v-9.698c0-.69.305-1.346.833-1.792l7.031-5.93zm2.014 1.194a.781.781 0 0 0-1.008 0l-7.03 5.93a.781.781 0 0 0-.279.597v9.698c0 .144.117.26.26.26h3.647a.26.26 0 0 0 .26-.26V14.84c0-1.007.816-1.823 1.823-1.823h3.646c1.007 0 1.823.816 1.823 1.823v5.216c0 .144.116.26.26.26h3.646a.26.26 0 0 0 .26-.26v-9.698a.781.781 0 0 0-.277-.597l-7.031-5.93z" fill="#0063EF"/></svg> 첫 íë©´ì¼ë¡ ëìê°ê¸° 1560 </a> 1561 `; 1562 const enhtml = ` 1563 <div id="ddd" class="bubble bubble_customer"> 1564 <span class="status_now en_font">${getNow()}</span> 1565 <div class="bubble_box chat_move_0" 1566 style="background-color: rgb(206, 234, 254); color: black;"> 1567 ${value} 1568 </div> 1569 </div> 1570 <div class="submit_hard"> 1571 Collection and Use of Personal Information<br/><br/> 1572OSANG HEALTHCARE, Co. Ltd. collects, uses, and processes the following personal information items solely for the purposes listed below. The collected personal information will not be used for purposes other than those specified. Should the purpose of use change, we will notify the data subject and obtain additional consent.<br/><br/> 15731. Purpose<br/> 1574Service inquiries, Customer Product Registration, Recruitment Information and Resume Submission<br/><br/> 1575 15762. Information Items Collected<br/> 1577[ Items of Personal Information Collected ]<br/><br/> 1578 15791. Service Inquiries: Name, Contact Info, Email<br/> 15802. Customer Product Registration: Name, Contact Info, Email, Gender, Year/Date of Birth<br/> 15813. Recruitment Information and Resume Submission<br/> 15821) Required Items : Personal Identification Information (photo, name, year/date of birth, gender, address, phone number, email address, emergency contact), Nationality (nationality/visa type), Education (attendance period, school, major, graduation status, main branch/branch, average grade), Military Service (branch, type, rank, discharge status, service period, exemption reason etc.), Work Experience (employment period, employer, position, job duties, salary information etc.), Other Information (disability/war veteran status)<br/> 15832) Optional Items : Education completion, certificates, language proficiency, overseas experience, hobbies, special skills, smoking status, etc. The above-listed personal information items are the minimum required to fulfill the stated purposes. For more specific details regarding the processing of your personal information, please refer to our companyâs Privacy Policy.<br/> 1584Please make sure to read the above statement and our Privacy Policy carefully. By providing your personal information and using our services, you are regarded to have given your final consent to the collection, use, and processing of your information. However, you have the right to refuse consent. Please note that if you choose not to consent, the service(s) you request may be restricted. 1585 </div> 1586 <a href="javascript:void(0);" class="goHome"> 1587 <svg width="12.25" height="12.25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.99 2.638a2.344 2.344 0 0 1 3.02 0l7.032 5.93c.528.445.833 1.1.833 1.791v9.698a1.823 1.823 0 0 1-1.823 1.823h-3.646a1.823 1.823 0 0 1-1.823-1.823V14.84a.26.26 0 0 0-.26-.26h-3.646a.26.26 0 0 0-.26.26v5.216a1.823 1.823 0 0 1-1.823 1.823H4.948a1.823 1.823 0 0 1-1.823-1.823v-9.698c0-.69.305-1.346.833-1.792l7.031-5.93zm2.014 1.194a.781.781 0 0 0-1.008 0l-7.03 5.93a.781.781 0 0 0-.279.597v9.698c0 .144.117.26.26.26h3.647a.26.26 0 0 0 .26-.26V14.84c0-1.007.816-1.823 1.823-1.823h3.646c1.007 0 1.823.816 1.823 1.823v5.216c0 .144.116.26.26.26h3.646a.26.26 0 0 0 .26-.26v-9.698a.781.781 0 0 0-.277-.597l-7.031-5.93z" fill="#0063EF"/></svg> Back to Home 1588 </a> 1589 `; 1590 1591 if (isEnPage()) { 1592 $(".privacySection").html(enhtml); 1593 } else { 1594 $(".privacySection").html(html); 1595 } 1596 1597 contScrollDown(0); 1598} 1599 1600// document.addEventListener("click", e => { 1601// const goHomeBtn = e.target.closest(".goHome"); 1602// if (goHomeBtn) { 1603// e.stopPropagation(); 1604// document.querySelector(".home")?.click(); 1605// } 1606// }); 1607function setSubmitButtonState2(disabled) { 1608 const submitBtn = document.querySelector( 1609 ".bubble .hard_chat .submit_hard .move_section .next_box .submit" 1610 ); 1611 submitBtn.disabled = disabled; 1612 submitBtn.style.opacity = disabled ? "0.5" : "1"; 1613 submitBtn.style.cursor = disabled ? "not-allowed" : "pointer"; 1614} 1615// submit handler 1616function submitActions(type, _this) { 1617 const submitBtn = document.querySelector( 1618 ".bubble .hard_chat .submit_hard .move_section .next_box .submit" 1619 ); 1620 if (submitBtn.disabled) { 1621 return; 1622 } 1623 setSubmitButtonState2(true); 1624 const this_form = $(_this) 1625 .parents(".form_chat") 1626 .find("input.require, textarea.require"); 1627 let status = null; 1628 this_form.each(function () { 1629 if (!$(this).val() || $(this).val() == "") { 1630 status = $(this).data("vali"); 1631 return false;
1632 } 1633 }); 1634 1635 if (status != null) { 1636 return alert(status); 1637 } 1638 1639 const forms = isEnPage() 1640 ? $(`form#${dummyFormEn[type]}`).get(0) 1641 : $(`form#${dummyForm[type]}`).get(0); 1642 const formData = new FormData(forms); 1643 1644 forms.action = "/contact_proc"; 1645 1646 $.ajax({ 1647 url: "/contact_proc", 1648 type: "POST", 1649 data: formData, 1650 contentType: false, // ì¤ì! 1651 processData: false, // ì¤ì! 1652 enctype: "multipart/form-data", 1653 success: function (data) { 1654 if (data.isSuc == "success") { 1655 //êµë¬¸ 1656 if (type == "AS 문ì" || type == "ì í 문ì") { 1657 alert(type + "ê° ìë£ëììµëë¤."); 1658 } 1659 //ì문 1660 else if (type == "AS Inquiry" || type == "Product Inquiry") { 1661 alert("Your " + type + "has been compeleted."); 1662 } 1663 } else { 1664 isEnPage() 1665 ? alert("Contact your administrator.") 1666 : alert("ê´ë¦¬ìì 문ìíì¸ì."); 1667 } 1668 1669 $(".home").trigger("click"); 1670 }, 1671 error: function (error) { 1672 console.error("ìë¬ ë°ì", error); 1673 alert("ì ì¡ ì¤ ìë¬ ë°ì"); 1674 }, 1675 }); 1676} 1677 1678/* ====================================================================== 1679* 1680* 문ì í기 íëì½ë© end 1681* 1682====================================================================== */
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.