1/** 2 * ë ì´ì´ íì ì¡´ ê´ë ¨ ì¤í¬ë¦½í¸ 3 * 4 * @author ryeon 5 * @since 2020. 04. 21. * 6 */ 7 8var today = new Date(); 9 10$(document).ready(function() { 11 clearExpiredLocalStorage(); 12 showLayerpopupzone(); 13 14 $("[type=checkbox][name^=nomoretoday]").click(function () { 15 var $container = $(this).closest("[data-layer-index]"); 16 var index = $container.data("layer-index"); 17 var hiddenLayersInfo = localStorage.getItem("hiddenLayersInfo"); 18 if (hiddenLayersInfo) { 19 hiddenLayersInfo = JSON.parse(hiddenLayersInfo); 20 hiddenLayersInfo.push({ layerIdx: index, day: getDayKey(today) }); 21 localStorage.setItem("hiddenLayersInfo", JSON.stringify(hiddenLayersInfo)); 22 } else { 23 localStorage.setItem("hiddenLayersInfo", JSON.stringify([{ layerIdx: index, day: getDayKey(today) }])); 24 } 25 }); 26}); 27 28function clearExpiredLocalStorage() { 29 var hiddenLayersInfo = localStorage.getItem("hiddenLayersInfo"); 30 if (hiddenLayersInfo) { 31 hiddenLayersInfo = JSON.parse(hiddenLayersInfo); 32 33 var notExpired = hiddenLayersInfo.filter(function (e, i) { return e.day == getDayKey(today) }); 34 if (notExpired != undefined && notExpired != null && notExpired.length > 0) { 35 localStorage.setItem("hiddenLayersInfo", JSON.stringify(notExpired)); 36 } else { 37 localStorage.removeItem("hiddenLayersInfo"); 38 } 39 } 40} 41 42function showLayerpopupzone() { 43 var hiddenLayersInfo = localStorage.getItem("hiddenLayersInfo"); 44 if (hiddenLayersInfo) { 45 hiddenLayersInfo = JSON.parse(hiddenLayersInfo); 46 if (hiddenLayersInfo) { 47 var hiddenLayerIdxs = $(hiddenLayersInfo) 48 .map(function () { return this.layerIdx; }) 49 .get(); 50 $("[id^=layerpopupzoneContainer]") 51 .filter(function () { 52 return hiddenLayerIdxs.indexOf($(this).data("layer-index")) == -1; 53 }) 54 .show(); 55 } else { 56 $("[id^=layerpopupzoneContainer]").show(); 57 } 58 } else { 59 $("[id^=layerpopupzoneContainer]").show(); 60 } 61} 62 63function getDayKey(day) { 64 return day.getMonth() + "/" + day.getDate(); 65} 66 67// =============================== 68// ë©ì¸ ë ì´ì´ íì 69// =============================== 70 71//const layerPopupItems = [ 72// { 73// img: `${mainImgURL}/popup-01.png`, 74// alt: "2023ë ì§ìì ì©ë³´ì¦ì¬ë¨ ë³´ì¦ì§ì ì기공모 : ì§ìì ì©ë³´ì¦ì¬ë¨ ë³´ì¦ì§ìì íµí´ ê²½ìì기를 견ëê³ ì´ê²¨ëë ì기ì ììê³µì¸ ì¬ë¬ë¶ì ì§ìí ì´ì¼ê¸°ë¥¼ ë¤ë ¤ì£¼ì¸ì. ê³µëª¨ê¸°ê° : 2023ë 7ì 10ì¼ë¶í° 2023ë 9ì 22ì¼", 75// }, 76// { 77// img: `${mainImgURL}/popup-02.jpg`, 78// alt: "í¨ê» ë§ëë 모ëì ì¼ìì´ ìì í ëí민êµ: êµê°ìì ìì¤í ê°í¸ ì¢ í©ëì± - íì ìì ë¶ ì£¼ê´", 79// }, 80// { 81// img: `${mainImgURL}/popup-03.jpg`, 82// alt: "2023ë ë ì¤ì기ì ì§ììì± ë¶ì°ê´ìì 주ê´", 83// }, 84// { 85// img: `${mainImgURL}/popup-04.jpg`, 86// alt: "ë¶ì°ê³¼ ë¨ë¶ê¶ì ìë¡ì´ 미ë 100ë ! ê°ëëì ê³µí 조기 ê°í ë¶ì°ê´ìì 주ê´", 87// }, 88// { 89// img: `${mainImgURL}/popup-05.jpg`, 90// alt: "ìë¡ì´ X4를 ìí´? 2030ë¶ì°ì¸ê³ë°ëí : ëíë¯¼êµ ì²«ë²ì§¸ ìëí´ëì¤ ìì¤í¬", 91// }, 92//]; 93// 94//layerPopupItems.map((item, i) => { 95// const slideCont = document.createElement("div"); 96// slideCont.classList.add("swiper-slide"); 97// slideCont.innerHTML = ` 98// <a key=${i} class="layer_popup-slide"> 99// <img src="${item.img}" alt="${item.alt}" /> 100// </a> 101// `; 102// document.querySelector(".layer_popup-wrapper").append(slideCont); 103//}); 104$(document).ready(function() { 105 const layerPopup = new Swiper(".layer_popup .inner", { 106 slidesPerView: 1, 107 loop: true, 108 autoplay: { 109 delay: 3000, 110 disableOnInteraction: false, 111 }, 112 pagination: { 113 el: ".layer_popup .swiper-pagination", 114 type: "fraction", 115 }, 116 navigation: { 117 nextEl: ".layer_popup .swiper-button-next", 118 prevEl: ".layer_popup .swiper-button-prev", 119 }, 120 }); 121 $("#btnSwLayerPopupPlay").on("click", function () { 122 layerPopup.autoplay.start(); 123 }); 124 $("#btnSwLayerPopupPause").on("click", function () { 125 layerPopup.autoplay.stop(); 126 }); 127 $("#btnSwLayerPopupPause").click(function () { 128 $("#btnSwLayerPopupPause").removeClass("active"); 129 $("#btnSwLayerPopupPlay").addClass("active"); 130 }); 131 $("#btnSwLayerPopupPlay").click(function () { 132 $("#btnSwLayerPopupPlay").removeClass("active"); 133 $("#btnSwLayerPopupPause").addClass("active"); 134 }); 135 136 const elLayerPopup = document.querySelector(".layer_popup"); 137 const btnCloseLayerPopup = document.querySelector("#closeLayerPopup"); 138}); 139 140$(document).ready(function () { 141 $(".layer_popup .btn_close").click(function () { 142 // ì ë í¸ ë°ì¤ ì²´í¬ ì¬ë¶ íì¸ 143 var dontShowMeAgainTodayLayerChecked = $("[name='dontShowMeAgainTodayLayer']").is(":checked"); 144 // ì¬ì©ìê° íì¸ì ì íí ê²½ì°ìë§ ì¿ í¤ì ì ë³´ ì ì¥ 145 if (dontShowMeAgainTodayLayerChecked) { 146 // ì¤ë ë ì§ë¥¼ ê°ì ¸ì´ 147 var today = new Date(); 148 // ì¤ë ë ì§ë¥¼ 문ìì´ë¡ ë³ííì¬ ì¿ í¤ì ë§ë£ ë ì§ë¡ ì¤ì 149 var expires = new Date(today); 150 // ì¿ í¤ë¥¼ í루 ëì ì ì§íëë¡ ì¤ì 151 expires.setDate(today.getDate() + 1); 152 // ì¿ í¤ ì´ë¦ ì¤ì 153 var cookieName = location.pathname.indexOf("/finance") === 0 ? "financePopupClosedStatus" : "popupClosedStatus";
154 // ì¿ í¤ ê° ì¤ì 155 var cookieValue = "true"; 156 // ì¿ í¤ì ì ì¥ 157 document.cookie = cookieName + "=" + cookieValue + "; expires=" + expires.toUTCString() + "; path=/"; 158 console.log("Popup closed status saved successfully."); 159 } 160 $(".layer_popup").hide(); 161 return false; 162 }); 163}); 164 165
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.