1 2$(function(){ 3 4 5 var loginTimer; 6 7 8 // OCI}EX 9 $(".nh2_option .nh2_login").hover(function(){ 10 11 clearTimeout(loginTimer); 12 13 $(".nh2_login_drop").show(); 14 15 loginTimer = setTimeout(function(){ 16 $(".nh2_option .nh2_login").addClass("active"); 17 }, 10); 18 19 },function(){ 20 clearTimeout(loginTimer); 21 22 $(this).removeClass("active"); 23 24 loginTimer = setTimeout(function(){ 25 $(".nh2_login_drop").hide(); 26 }, 300); 27 }); 28 29 30 var dropTimer; 31 32 33 // VbsOÅßéET[rXÅßéI}EX 34 $(".nh2_menu .nh2_shopping, .nh2_menu .nh2_service, .nh2_menu .nh2_investment").hover(function(){ 35 36 37 $(".nh2_menu .nh2_shopping .nh2_drop").hide(); 38 $(".nh2_menu .nh2_service .nh2_drop").hide(); 39 $(".nh2_menu .nh2_investment .nh2_drop").hide(); 40 41 42 nh2DropSet(); 43 44 $(this).find(".nh2_drop").show(); 45 46 var thisTarget = $(this); 47 48 clearTimeout(dropTimer); 49 50 dropTimer = setTimeout(function(){ 51 thisTarget.addClass("active"); 52 }, 10); 53 54 55 },function(){ 56 $(this).removeClass("active"); 57 58 clearTimeout(dropTimer); 59 60 dropTimer = setTimeout(function(){ 61 $(".nh2_menu .nh2_shopping .nh2_drop").hide(); 62 $(".nh2_menu .nh2_service .nh2_drop").hide(); 63 $(".nh2_menu .nh2_investment .nh2_drop").hide(); 64 }, 300); 65 }); 66 67 68 69 // XN[ 70 $(window).scroll(function (){ 71 nh2DropSet(); 72 }); 73 74 // TCY 75 $(window).bind('resize',function(){ 76 nh2DropSet(); 77 }); 78 79 80 nh2DropSet(); 81}); 82 83 84// hbv_EÌYÀW 85function nh2DropSet(){ 86 87 // XN[Êuðæ¾ 88 if(navigator.userAgent.indexOf('IE') != -1){ 89 var h = $('html, body'); 90 Hscroll = h.scrollTop(); 91 } 92 else{ 93 Hscroll = window.pageYOffset; 94 } 95 96 if ($('html').hasClass('page-sitetop') && $('.js-header-message').length) { 97 headerTop = $('.js-header-message').outerHeight(); 98 $(".nh2_drop").css("top", $("#new_header2").outerHeight() + headerTop - 1 - Hscroll); 99 } else { 100 $(".nh2_drop").css("top", $("#new_header2").outerHeight() - 1 - Hscroll); 101 } 102 103 $(".nh2_login_drop").css("top", $(".nh2_login").outerHeight()); 104 $(".nh2_login_drop").css("left", ($(".nh2_login").width() - $(".nh2_login_drop").width()) / 2); 105} 106 107 108 109/* ---------------------------------------------------------------------------- 110@j [Jg\¦ 111---------------------------------------------------------------------------- */ 112$(function(){ 113 114 115// T[rXÅßéiURLzñj 116var nh2ServiceArray =[ 117 "/contents/extra/service/", 118 "/contents/extra/gaingame/", 119 "/openpc/sugoroku/", 120 "/contents/extra/gainapp/" 121]; 122 123// |Cgðg¤Eð··éiURLzñj 124var nh2UseArray =[ 125 "/openpc/item/" 126]; 127 128// |Cgð^p·éiURLzñj 129var nh2InvestmentArray =[ 130 "/contents/extra/pointunyou_op/" 131]; 132// |CgðØèéiURLzñj 133var nh2LendingArray =[ 134 "/contents/extra/pointlending/", 135 "/contents/extra/kariru/", 136 "/openpc/USD0700S03.do", 137 "/openpc/USD0700S04.do", 138 "/openpc/USD0700S05.do" 139]; 140 141 142 143// Êí 144if($("#new_header2").hasClass("iframe_var") == false){ 145 nhThisUrl = location.href; 146} 147// iframe 148else{ 149 nhThisUrl = parent.location.href; 150} 151 152 153for(nh2ServiceNo = 0; nh2ServiceNo <= nh2ServiceArray.length; nh2ServiceNo++){ 154 if(nhThisUrl.indexOf(nh2ServiceArray[nh2ServiceNo]) != -1){ 155 $("#new_header2 .nh2_shopping").removeClass("now"); 156 $("#new_header2 .nh2_service").addClass("now"); 157 } 158} 159for(nh2UseNo = 0; nh2UseNo <= nh2UseArray.length; nh2UseNo++){ 160 if(nhThisUrl.indexOf(nh2UseArray[nh2UseNo]) != -1){ 161 $("#new_header2 .nh2_shopping").removeClass("now"); 162 $("#new_header2 .nh2_use").addClass("now"); 163 } 164} 165for(nh2InvestmentNo = 0; nh2InvestmentNo <= nh2InvestmentArray.length; nh2InvestmentNo++){ 166 if(nhThisUrl.indexOf(nh2InvestmentArray[nh2InvestmentNo]) != -1){ 167 $("#new_header2 .nh2_shopping").removeClass("now"); 168 $("#new_header2 .nh2_investment").addClass("now"); 169 } 170} 171for(nh2LendingNo = 0; nh2LendingNo <= nh2LendingArray.length; nh2LendingNo++){ 172 if(nhThisUrl.indexOf(nh2LendingArray[nh2LendingNo]) != -1){ 173 $("#new_header2 .nh2_shopping").removeClass("now"); 174 $("#new_header2 .nh2_borrow").addClass("now"); 175 } 176} 177 178}); 179 180 181 182 183/* ---------------------------------------------------------------------------- 184@Lbhi1280px`950pxj 185---------------------------------------------------------------------------- */ 186$(function(){ 187 newHeader2LiquidResize(); 188}); 189 190$(function(){ 191 $(window).bind('resize',function(){ 192 newHeader2LiquidResize(); 193 }); 194}); 195 196$(window).load(function(){ 197 newHeader2LiquidResize(); 198}); 199 200function newHeader2LiquidResize(){ 201 202 paddingPer = -((1000 - $(window).width()) / 280); 203 paddingText = Math.floor(10 * paddingPer); 204 paddingText = "0px " + paddingText + "px 0"; 205 206 if($(window).width() > 1280){ 207 $(".nh2_liquid").width(1260); 208 $(".nh2_liquid").css("padding","0 10px"); 209 } 210 else if($(window).width() <= 950){ 211 $(".nh2_liquid").width(950); 212 $(".nh2_liquid").css("padding","0 0"); 213 } 214 else{ 215 $(".nh2_liquid").width("auto"); 216 $(".debug").text(paddingText) 217 $(".nh2_liquid").css("padding",paddingText); 218 } 219} 220 221 222 223 224 225 226 227 228 229 230/* ---------------------------------------------------------------------------- 231@EH[NX[æÊ 232---------------------------------------------------------------------------- */ 233$(function(){ 234 235 236// Øp 237if(location.href.indexOf('?checkoverlay=wt') != -1){ 238 $("#walk_through, #wt_bg").fadeIn(200, 239 function(){ 240 walkThroughResize(); 241 }); 242 243 // cookieuoverlayfadevÌ[_ðí 244 $("#modal, #modal_bg").remove(); 245 246 247} 248else if (jQuery.cookie('overlay') != null || jQuery.cookie('overlay') != undefined) { 249 250 251 252// cookieuoverlayvªÈ¢ 253} else { 254 255 // or»Êp 256 if($.cookie("wt") == null){ 257 $("#walk_through, #wt_bg").fadeIn(200, 258 function(){ 259 walkThroughResize(); 260 }); 261 262 // cookieuoverlayfadevÌ[_ðí 263 $("#modal, #modal_bg").remove(); 264 265 // or»Êpcookieì¬
266 $.cookie('wt', 'on', {expires: 3650 ,path: '/'}); 267 268 } 269} 270 271}); 272 273 274 275 276// ¶é{^ 277$(function(){ 278 $(".wt_close, #wt_bg, .wt_use").click(function(){ 279 $("#walk_through, #wt_bg").fadeOut(); 280 281 282 // XN[Ö~ð 283 if((navigator.userAgent.indexOf('iPhone') == -1) && (navigator.userAgent.indexOf('Android') == -1)){ 284 $("html, body").css("overflow-y","auto"); 285 $(window).off('.noScroll'); 286 } 287 288 }); 289}); 290 291// TCY 292function walkThroughResize(){ 293 $(".wt_slide_wrapper").height($(".wt_slide_long").outerHeight()); 294 $("#walk_through").css("top", (window.innerHeight - $("#walk_through").height()) / 2); 295} 296 297 298 299$(window).bind('resize',function(){ 300 walkThroughResize(); 301}); 302 303 304$(function(){ 305 walkThroughResize(); 306}); 307 308 309$(function(){ 310 $(".wt_slide").eq(0).show(); 311 $(".wt_paging li").eq(0).addClass("active"); 312 $(".wt_prev").hide(); 313}); 314 315 316var wtNow; 317var wtNext; 318var wtTotal; 319 320// Ö 321function wtNextFun(){ 322 323 wtTotal = $(".wt_paging li").length - 1; 324 325 $(".wt_paging .active").each(function(){ 326 wtNow = $(".wt_paging li").index(this); 327 }); 328 329 if(wtNow != wtTotal){ 330 wtNext = wtNow + 1; 331 332 333 wtSlideleft = $(".wt_slide").eq(wtNext).position().left; 334 $(".wt_slide_long").animate({left: -wtSlideleft}, 500); 335 336 337 338 339 $(".wt_paging li").removeClass("active"); 340 $(".wt_paging li").eq(wtNext).addClass("active"); 341 } 342 343 wtNaviCheck(); 344} 345 346// OÖ 347function wtPrevFun(){ 348 349 wtTotal = $(".wt_paging li").length - 1; 350 351 $(".wt_paging .active").each(function(){ 352 wtNow = $(".wt_paging li").index(this); 353 }); 354 355 if(wtNow != 0){ 356 wtNext = wtNow - 1; 357 358 wtSlideleft = $(".wt_slide").eq(wtNext).position().left; 359 $(".wt_slide_long").animate({left: -wtSlideleft}, 500); 360 361 $(".wt_paging li").removeClass("active"); 362 $(".wt_paging li").eq(wtNext).addClass("active"); 363 } 364 365 wtNaviCheck(); 366} 367 368// y[WONbN 369$(function(){ 370 $(".wt_paging li").click(function(){ 371 wtNow = $(".wt_paging li").index(this); 372 373 wtSlideleft = $(".wt_slide").eq(wtNow).position().left; 374 $(".wt_slide_long").animate({left: -wtSlideleft}, 500); 375 376 $(".wt_paging li").removeClass("active"); 377 $(this).addClass("active"); 378 379 wtNaviCheck(); 380 }); 381}); 382 383 384// touchwipe 385$(function(){ 386 /*$("#walk_through").touchwipe({ 387 wipeLeft: function() { wtNextFun(); }, 388 wipeRight: function() { smPrevFun(); }, 389 min_move_x: 30, 390 preventDefaultEvents: false 391 });*/ 392}); 393 394 395// ir\¦ñ\¦`FbN 396function wtNaviCheck(){ 397 398 wtTotal = $(".wt_paging li").length - 1; 399 400 $(".wt_paging .active").each(function(){ 401 wtNow = $(".wt_paging li").index(this); 402 }); 403 404 if(wtNow == 0){ 405 $(".wt_prev").hide(); 406 $(".wt_next").show(); 407 } 408 else if(wtNow == wtTotal){ 409 $(".wt_prev").show(); 410 $(".wt_next").hide(); 411 } 412 else{ 413 $(".wt_prev").show(); 414 $(".wt_next").show(); 415 } 416} 417 418(() => { 419 'use strict'; 420 421 const initHTMLAttribute = () => { 422 var docElement = document.documentElement; 423 424 if (docElement && docElement.nodeType === 1) { 425 426 if (location.pathname === '/openpc/USA0000S01.do') { 427 docElement.classList.add('page-sitetop'); 428 } 429 } 430 431 docElement = null; 432 }; 433 434 initHTMLAttribute(); 435})(); 436 437(() => { 438 'use strict'; 439 440 window.cpPopup = (() => { 441 let popupElement = null; 442 443 const init = () => { 444 popupElement = document.querySelector('.js-cpPopup'); 445 446 if (!popupElement) { 447 return; 448 } 449 450 managePopupDisplay(); 451 }; 452 453 const getFormattedDate = (date) => { 454 const year = date.getFullYear();
455 const month = ('0' + (date.getMonth() + 1)).slice(-2); 456 const day = ('0' + date.getDate()).slice(-2); 457 return `${year}-${month}-${day}`; 458 }; 459 460 const setCookie = (name, value, days) => { 461 const expires = new Date(); 462 expires.setTime(expires.getTime() + (days * 24 * 60 * 60 * 1000)); 463 document.cookie = `${name}=${value};expires=${expires.toUTCString()};path=/`; 464 }; 465 466 const deleteCookie = (cookieName) => { 467 document.cookie = cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; 468 }; 469 470 const getCookie = (name) => { 471 const cookieName = `${name}=`; 472 const cookies = document.cookie.split(';'); 473 for (let i = 0; i < cookies.length; i++) { 474 let cookie = cookies[i].trim(); 475 if (cookie.indexOf(cookieName) === 0) { 476 return cookie.substring(cookieName.length, cookie.length); 477 } 478 } 479 return null; 480 }; 481 482 const setLastPopupDate = () => { 483 const currentDate = new Date(); 484 const formattedCurrentDate = getFormattedDate(currentDate); 485 setCookie('popupDisplayedDateOnThanksPage', formattedCurrentDate, 1); 486 }; 487 488 const managePopupDisplay = () => { 489 const lastPopupDate = getCookie('popupDisplayedDateOnThanksPage'); 490 const currentDate = new Date(); 491 const formattedCurrentDate = getFormattedDate(currentDate); 492 493 if (!lastPopupDate || lastPopupDate !== formattedCurrentDate) { 494 if (lastPopupDate) { 495 deleteCookie('popupDisplayedDateOnThanksPage'); 496 } 497 498 showPopup(); 499 attachClickCloseButton(); 500 attachClickLink(); 501 } 502 }; 503 504 const attachClickCloseButton = () => { 505 const btnClose = popupElement.querySelector('.js-cpPopupClose'); 506 507 if (btnClose) { 508 btnClose.addEventListener('click', () => { 509 setLastPopupDate(); 510 hidePopup(); 511 }); 512 } 513 }; 514 515 const attachClickLink = () => { 516 const link = popupElement.querySelector('.js-cpPopup-link'); 517 518 if (link) { 519 link.addEventListener('click', (event) => { 520 event.preventDefault(); 521 setLastPopupDate(); 522 window.open(event.currentTarget.href, '_blank'); 523 // window.location.href = event.currentTarget.href; 524 }); 525 } 526 }; 527 528 const showPopup = () => { 529 if (popupElement) { 530 popupElement.classList.add('is-show'); 531 } 532 }; 533 534 const hidePopup = () => { 535 if (popupElement) { 536 popupElement.classList.remove('is-show'); 537 } 538 }; 539 540 const scrollDown = () => { 541 if (popupElement) { 542 popupElement.classList.add('is-scrollDown'); 543 } 544 }; 545 546 const scrollUp = () => { 547 if (popupElement) { 548 popupElement.classList.remove('is-scrollDown'); 549 } 550 }; 551 552 return {init,scrollDown,scrollUp}; 553 })(); 554 555 document.addEventListener('DOMContentLoaded', () => { 556 window.cpPopup.init(); 557 }); 558})(); 559 560(() => { 561 'use strict'; 562 563 window.shopDetailPopup = (() => { 564 let popupElement = null; 565 let closeCount = 0; 566 let displayedDate = null; 567 const cookieNameDisplayedDate = 'popupDisplayedDateOnDetailsPage'; 568 const cookieNameCloseCount = 'popupCloseCountOnDetailPage'; 569 570 const isDisplayable = () => { 571 const isExtraPage = document.querySelector('.js-extraShopDetailPopup') ? true : false; 572 573 if (isExtraPage && popupElement) { 574 return true; 575 } 576 577 const toolbarLink = document.querySelector('.js-pointArea-toolbarLink'); 578 const shopnum = location.pathname.replace(/\/+$/, "").split('/').pop().replace('.html', ''); 579 580 if ( 581 popupElement && 582 toolbarLink && 583 /^\/shopping\/detail\/PT\d+\.html$/.test(location.pathname) && 584 /^PT\d+$/.test(shopnum) && 585 ( 586 Array.isArray(window.popupIgnoreList) && 587 !window.popupIgnoreList.includes(shopnum) 588 ) 589 ) { 590 return true; 591 } 592 593 return false; 594 }; 595 596 const init = () => { 597 popupElement = document.querySelector('.js-shopDetailPopup'); 598 599 if (!isDisplayable()) { 600 return; 601 } 602 603 displayedDate = getDateFromCookie(cookieNameDisplayedDate); 604 605 if (displayedDate) { 606 deleteCookie(cookieNameCloseCount); 607 return; 608 } 609 610 closeCount = getCloseCount(); 611 612 if (closeCount <= 2) { 613 showPopup(); 614 615 return; 616 } 617 }; 618 619 const getCookie = (name) => { 620 const cookieName = `${name}=`; 621 const cookies = document.cookie.split(';'); 622 for (let i = 0; i < cookies.length; i++) { 623 let cookie = cookies[i].trim(); 624 if (cookie.indexOf(cookieName) === 0) { 625 return cookie.substring(cookieName.length, cookie.length); 626 } 627 } 628 629 return null; 630 }; 631
632 const setCookie = (name, value, days) => { 633 let expires = ""; 634 635 if (days) { 636 const date = new Date(); 637 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 638 expires = "; expires=" + date.toUTCString(); 639 } 640 641 document.cookie = name + "=" + (value || "") + expires + "; path=/"; 642 }; 643 644 const deleteCookie = (cookieName) => { 645 document.cookie = cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; 646 }; 647 648 const getCloseCount = () => { 649 const closeCount = getCookie(cookieNameCloseCount); 650 651 if (closeCount && typeof closeCount === 'string') { 652 return parseInt(closeCount, 10); 653 } 654 655 return 0; 656 }; 657 658 const getDateFromCookie = (cookieName) => { 659 const dateString = getCookie(cookieName); 660 661 if (dateString) { 662 return new Date(dateString); 663 } 664 665 return null; 666 }; 667 668 const attachClickCloseButton = () => { 669 const btnClose = popupElement.querySelector('.js-shopDetailPopup-buttonCLose'); 670 671 if (btnClose) { 672 btnClose.addEventListener('click', () => { 673 if (closeCount >= 2) { 674 deleteCookie(cookieNameCloseCount); 675 setCookie(cookieNameDisplayedDate, new Date().toISOString(), 7); 676 } else if (closeCount <= 1) { 677 setCookie(cookieNameCloseCount, (closeCount + 1), 7); 678 } 679 680 hidePopup(); 681 }); 682 } 683 }; 684 685 const attachClickLink = () => { 686 const link = popupElement.querySelector('.js-shopDetailPopup-link'); 687 688 if (link) { 689 link.addEventListener('click', (event) => { 690 deleteCookie(cookieNameCloseCount); 691 setCookie(cookieNameDisplayedDate, new Date().toISOString(), 7); 692 }); 693 } 694 }; 695 696 const showPopup = () => { 697 if (popupElement) { 698 attachClickCloseButton(); 699 attachClickLink(); 700 popupElement.classList.add('is-show'); 701 } 702 }; 703 704 const hidePopup = () => { 705 if (popupElement) { 706 popupElement.classList.remove('is-show'); 707 } 708 }; 709 710 const scrollDown = () => { 711 if (popupElement) { 712 popupElement.classList.add('is-scrollDown'); 713 } 714 }; 715 716 const scrollUp = () => { 717 if (popupElement) { 718 popupElement.classList.remove('is-scrollDown'); 719 } 720 }; 721 722 return {init,scrollDown,scrollUp}; 723 })(); 724 725 document.addEventListener('DOMContentLoaded', () => { 726 window.shopDetailPopup.init(); 727 }); 728})(); 729 730/* ---------------------------------------------------------------------------- 731@¤Ê 732---------------------------------------------------------------------------- */ 733window.Common = (() => { 734 const Common = {}; 735 736 /** 737 * CÓÌNbL[ðæ¾·é 738 * @param {string} name - æ¾·éNbL[¼ 739 * @returns {string|null} NbL[Ìli¶ÝµÈ¢êÍnullj 740 */ 741 Common.getCookie = (name) => { 742 const cookieString = document.cookie; 743 const cookies = cookieString.split('; '); 744 745 for (let cookie of cookies) { 746 const [key, value] = cookie.split('='); 747 if (key === name) { 748 return decodeURIComponent(value); 749 } 750 } 751 752 return null; 753 }; 754 755 /** 756 * CÓÌNbL[ðÇÁ·é 757 * @param {string} name - Ýè·éNbL[¼ 758 * @param {string} value - Ýè·él 759 * @param {string} hours - LøúÀiÔj 760 * @returns {void} 761 */ 762 Common.setCookie = (name, value, hours) => { 763 const expires = new Date(); 764 expires.setTime(expires.getTime() + (hours * 60 * 60 * 1000)); 765 document.cookie = `${name}=${value};expires=${expires.toUTCString()};path=/`; 766 }; 767 768 return Common; 769})(); 770 771/* ---------------------------------------------------------------------------- 772@vªÖA 773---------------------------------------------------------------------------- */ 774window.Analytics = (() => { 775 const Analytics = {}; 776 777 /** 778 * @initialize 779 * @returns {void} 780 */ 781 Analytics.init = () => { 782 document.addEventListener('DOMContentLoaded', () => { 783 Analytics.attachGameServiceClick(); 784 }); 785 }; 786 787 /** 788 * GTMCxgÌÎ 789 * @param {stging} eventName - Cxg¼ 790 * @param {object} parameters - CÓÌMp[^ 791 * @returns {void} 792 */ 793 Analytics.triggerGTMEvent = function (eventName, parameters = {}) { 794 window.dataLayer = window.dataLayer || []; 795 796 window.dataLayer.push({ 797 event: eventName, 798 ...parameters 799 }); 800 }; 801 802 /** 803 * »ÝÌURLðæ¾·éÖ 804 * @param {boolean} includeParams - true: NGp[^ðÜßé 805 * @param {boolean} includeHash - true: nbV ðÜßé 806 * @returns {string} - wèðÌURL 807 */ 808 Analytics.getCurrentUrl = (needParams = false, needHash = false) => { 809 let url = window.location.origin + window.location.pathname; 810 811 if (needParams && window.location.search) { 812 url += window.location.search; 813 } 814 815 if (needHash && window.location.hash) { 816 url += window.location.hash; 817 } 818 819 return url; 820 }; 821 822 /** 823 * ÎÛtH[Ìp[gi[IDðæ¾·é 824 * @param {string} formId - tH[Ìid®« 825 * @returns {string} ÎÛ³µÌêÍó¶ 826 */ 827 Analytics.getFormPartnerId = (formId = '') => { 828 const form = document.getElementById(formId); 829 830 if (form) { 831 const input = form.querySelector('input[name="partnerId"]'); 832 833 if (input) { 834 return input.value; 835 } 836 } 837 838 return ''; 839 }; 840 841 /** 842 * ÎÛtH[ÌP[V¼ðæ¾·é 843 * @param {string} formId - tH[Ìid®« 844 * @returns {string} ÎÛ³µÌêÍó¶ 845 */ 846 Analytics.getFormLocation = (formId = '') => { 847 const form = document.getElementById(formId); 848 849 if (form) { 850 const input = form.querySelector('input[name="form_submit_location"]'); 851 852 if (input) { 853 return input.value; 854 } 855 } 856 857 return ''; 858 }; 859 860 /** 861 * Q[ET[rXÌNÉNbNCxgðt^ 862 * @returns {void} 863 */ 864 Analytics.attachGameServiceClick = () => { 865 const linkList = document.querySelectorAll('.js-gtm-gsLink'); 866 867 linkList.forEach((link) => { 868 link.addEventListener('click', (event) => { 869 Analytics.pushGTMGameServiceSubmit(event.currentTarget); 870 }); 871 }); 872 }; 873 874 /** 875 * Q[ET[rXÌíÊðæ¾·é 876 * @param {Element} target - NbN³ê½Nvf 877 * @returns {string} íÊ 878 */
879 Analytics.getSubmitCategory = (target = null) => { 880 const types = { 881 shopping: 'shopping', 882 game: 'game', 883 service: 'service' 884 }; 885 const pathnames = { 886 game: '/contents/extra/gaingame/index.html', 887 service: '/contents/extra/service/index.html' 888 }; 889 890 if (target) { 891 const dataType = target.getAttribute('data-gtm-link-category') || ''; 892 893 if (dataType.length) { 894 return dataType; 895 } 896 897 const currentPathname = location.pathname; 898 899 if (currentPathname === pathnames.game) { 900 return types.game; 901 } else if (currentPathname === pathnames.service) { 902 return types.service; 903 } 904 } 905 906 return ''; 907 }; 908 909 Analytics.getLinkLocation = (target = null) => { 910 if (target) { 911 const dataType = target.dataset.gtmLinkLocation || ''; 912 913 if (dataType.length) { 914 return dataType; 915 } 916 } 917 918 return ''; 919 }; 920 921 /** 922 * Q[ET[rX̼Ìðæ¾·é 923 * @param {Element} target - NbN³ê½Nvf 924 * @returns {string} ¼Ì 925 */ 926 Analytics.getServiceGameName = (target = null) => { 927 const title = target.querySelector('.js-gtm-gsTitle'); 928 929 if (title && title.textContent.length) { 930 return title.textContent; 931 } 932 933 if (title && title.tagName.toLocaleLowerCase() === 'img') { 934 const altText = title.getAttribute('alt'); 935 936 if (altText && altText.length) { 937 return altText; 938 } 939 } 940 941 return ''; 942 }; 943 944 /** 945 * Q[ET[rXÌNðæ¾·é 946 * @param {Element} target - NbN³ê½Nvf 947 * @returns {string} N 948 */ 949 Analytics.getServiceGameLink = (target = null) => { 950 let href = typeof target.href === 'string' ? target.href : ''; 951 952 if (href.length) { 953 return href; 954 } 955 956 const innerLink = target.querySelector('a'); 957 958 href = innerLink && typeof innerLink.href === 'string' ? innerLink.href : ''; 959 960 if (href.length) { 961 return href; 962 } 963 964 return ''; 965 }; 966 967 /** 968 * form_submitÎÉdataLayer.pushR}hðÀs·é 969 * @param {string} formId - ØÎÛÌformId 970 */ 971 Analytics.pushGTMFormSubmit = (formId = '') => { 972 window.dataLayer = window.dataLayer || []; 973 974 const partnerId = Analytics.getFormPartnerId(formId); 975 976 if (!partnerId.length) { 977 return; 978 } 979 980 const url = Analytics.getCurrentUrl(); 981 const location = Analytics.getFormLocation(formId); 982 const loginType = parseInt(Common.getCookie('aq_div'), 10) || 0; 983 984 Analytics.triggerGTMEvent( 985 'form_submit_goshop', 986 { 987 form_submit_partnerId: partnerId, 988 form_submit_url: url, 989 form_submit_location: location, 990 form_submit_loginType: loginType 991 } 992 ); 993 }; 994 995 /** 996 * Q[ET[rXÌNbNvª 997 * @param {string} targetElement - NbN³ê½Nvf 998 * @returns {void} 999 */ 1000 Analytics.pushGTMGameServiceSubmit = (targetElement = null) => { 1001 window.dataLayer = window.dataLayer || []; 1002 1003 const name = Analytics.getServiceGameName(targetElement); 1004 const category = Analytics.getSubmitCategory(targetElement); 1005 const location = Analytics.getLinkLocation(targetElement); 1006 const link = Analytics.getServiceGameLink(targetElement); 1007 const loginType = parseInt(Common.getCookie('aq_div'), 10) || 0; 1008 1009 if (name.length && category.length && location.length && link.length && !isNaN(loginType)) { 1010 Analytics.triggerGTMEvent( 1011 'gameservice_submit_goshop', 1012 { 1013 gameservice_submit_name: name, 1014 gameservice_submit_category: category, 1015 gameservice_submit_location: location, 1016 gameservice_submit_link: link, 1017 gameservice_submit_loginType: loginType 1018 } 1019 ); 1020 } 1021 }; 1022 1023 Analytics.init(); 1024 1025 return Analytics; 1026})(); 1027 1028(() => { 1029 'use strict'; 1030 1031 window.popupNotice = (() => { 1032 let popupElement = null; 1033 const popupKey = 'isDisplayedPopupNotice'; 1034 1035 const init = () => { 1036 popupElement = selectRandomPopup(); 1037 1038 if (!popupElement) { 1039 return; 1040 } 1041 1042 if (!sessionStorage.getItem(popupKey) || getCookie(popupKey) === null) { 1043 showPopup(); 1044 } 1045 }; 1046 1047 const selectRandomPopup = () => { 1048 const popupList = document.querySelectorAll('.js-popupNotice'); 1049 1050 if (!popupList.length) { 1051 return null; 1052 } 1053 1054 const randomIndex = Math.floor(Math.random() * popupList.length); 1055 1056 return popupList[randomIndex]; 1057 }; 1058 1059 const isSPLayout = () => { 1060 return document.querySelector('#new_header2 > .nh2_liquid') ? false : true; 1061 }; 1062 1063 const showImage = () => { 1064 const imageList = popupElement.querySelectorAll('.js-popupNoticeImage'); 1065 1066 if (!imageList.length) { 1067 return; 1068 } 1069 1070 if (imageList.length === 1) { 1071 imageList[0].classList.add('is-show'); 1072 1073 return; 1074 } 1075 1076 const spImage = popupElement.querySelector('.js-popupNoticeImage.is-sp'); 1077 1078 for (const el of imageList) { 1079 if (isSPLayout() && spImage) { 1080 if (el === spImage) { 1081 el.classList.add('is-show'); 1082 1083 break; 1084 } 1085 1086 continue; 1087 } 1088 1089 if (!el.classList.contains('is-sp')) { 1090 el.classList.add('is-show'); 1091 1092 break; 1093 } 1094 } 1095 }; 1096
1097 const setCookieExpMinites = (name, value, minutes) => { 1098 const expires = new Date(Date.now() + minutes * 60 * 1000).toUTCString(); 1099 document.cookie = `${name}=${value}; expires=${expires}; path=/;`; 1100 }; 1101 1102 const deleteCookie = (cookieName) => { 1103 document.cookie = cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; 1104 }; 1105 1106 const getCookie = (name) => { 1107 const cookieName = `${name}`; 1108 const cookies = document.cookie.split(';'); 1109 for (let i = 0; i < cookies.length; i++) { 1110 let cookie = cookies[i].trim(); 1111 if (cookie.indexOf(cookieName) === 0) { 1112 return cookie.substring(cookieName.length, cookie.length); 1113 } 1114 } 1115 return null; 1116 }; 1117 1118 const attachClickCloseButton = () => { 1119 const btnClose = popupElement.querySelector('.js-popupNoticeClose'); 1120 1121 if (btnClose) { 1122 btnClose.addEventListener('click', () => { 1123 sessionStorage.setItem(popupKey, 'true'); 1124 setCookieExpMinites(popupKey, 'true', 30); 1125 hidePopup(); 1126 }); 1127 } 1128 }; 1129 1130 const attachClickLink = () => { 1131 const link = popupElement.querySelector('.js-popupNotice-link'); 1132 1133 if (link) { 1134 link.addEventListener('click', (event) => { 1135 sessionStorage.setItem(popupKey, 'true'); 1136 setCookieExpMinites(popupKey, 'true', 30); 1137 }); 1138 } 1139 }; 1140 1141 const showPopup = () => { 1142 if (popupElement) { 1143 showImage(); 1144 popupElement.classList.add('is-show'); 1145 } 1146 1147 deleteCookie(popupKey); 1148 attachClickCloseButton(); 1149 attachClickLink(); 1150 }; 1151 1152 const hidePopup = () => { 1153 if (popupElement) { 1154 popupElement.classList.remove('is-show'); 1155 } 1156 }; 1157 1158 const scrollDown = () => { 1159 if (popupElement) { 1160 popupElement.classList.add('is-scrollDown'); 1161 } 1162 }; 1163 1164 const scrollUp = () => { 1165 if (popupElement) { 1166 popupElement.classList.remove('is-scrollDown'); 1167 } 1168 }; 1169 1170 document.addEventListener('DOMContentLoaded', () => { 1171 init(); 1172 }); 1173 1174 return {init,scrollDown,scrollUp}; 1175 })(); 1176})(); 1177 1178 1179 1180
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.