1 // ì¿ í¤ ì¤ì í¨ì 2 function setCookie(name, value, hours) { 3 const date = new Date(); 4 date.setTime(date.getTime() + (hours * 60 * 60 * 1000)); 5 document.cookie = `${name}=${value};expires=${date.toUTCString()};path=/`; 6 } 7 8 // ì¿ í¤ ê°ì ¸ì¤ê¸° 9 function getCookie(name) { 10 const cookies = document.cookie.split(';'); 11 for (let c of cookies) { 12 const [key, val] = c.trim().split('='); 13 if (key === name) return val; 14 } 15 return null; 16 } 17 18 // íì ë«ê¸° í¨ì 19 function closePopup() { 20 if (document.getElementById('hideToday').checked) { 21 setCookie('hidePopupToday', 'Y', 24); // 24ìê° ì ì§ 22 } 23 document.getElementById('popup').style.display = 'none'; 24 } 25 26 /*기존 íì ëì ìì¤ START*/ 27 function popup_up(pop_id){ 28 var $pop_id = $(pop_id); 29 30 //ì¿ í¤ìì hideTodayì²´í¬ 31 const cookieName = 'hide_'+ pop_id; 32 if( getCookie(cookieName) !== 'Y'){ 33 $pop_id.fadeIn(); // hideê° ìëë©´ íì ì¶ë ¥ 34 } 35 36 var $pop_idWidth = Math.floor($pop_id.outerWidth()); 37 var $pop_idHeight = Math.floor($pop_id.outerHeight()); 38 var docWidth = $(document).width(); 39 var docHeight = $(document).height(); 40 41 if($pop_idHeight < docHeight || $pop_idWidth < docWidth){ 42 $pop_id.css({marginTop: -$pop_idHeight /2, marginLeft: -$pop_idWidth/2}); 43 }else{ 44 $pop_id.css({top: 0, left: 0}); 45 } 46 47 //ë«ê¸°ë²í¼ì´ë²¤í¸ 48 $pop_id.find('.btn_pane a.btn-close').click(function(){ 49 popup_close(pop_id,cookieName); 50 }); 51 $pop_id.find('.close-x').click(function(){ 52 popup_close(pop_id,cookieName); 53 }); 54 55 56 57 } 58 function popup_close(pop_id, cookieName){ 59 const $pop_id = $(pop_id); 60 const checkbox = $pop_id.find('.hide-today'); 61 if( checkbox.is(':checked')){ 62 setCookie(cookieName, 'Y', 1); // 24Hëì íì ì ëì°ì§ ìì 63 } 64 $pop_id.fadeOut(); 65 return false; 66 } 67 /*기존 íì ëì ìì¤ START*/ 68 69
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.