1$(function(){ 2 //Ãæ¼ä¸ã§ãç¥ãããããã¢ãããéãã 3 $('#popup_button').on('click',function(){ 4 $('.popup').fadeOut(); 5 }); 6}); 7 8function popupGetCookie(name) { 9 if (typeof Cookies !== 'undefined' && typeof Cookies.get === 'function') { 10 return Cookies.get(name); 11 } 12 var escapedName = name.replace(/([.$?*|{}()\\[\]\/+^])/g, '\\$1'); 13 var match = document.cookie.match(new RegExp('(?:^|; )' + escapedName + '=([^;]*)')); 14 return match ? decodeURIComponent(match[1]) : undefined; 15} 16 17function popupSetCookie(name, value) { 18 if (typeof Cookies !== 'undefined' && typeof Cookies.set === 'function') { 19 Cookies.set(name, value); 20 return; 21 } 22 document.cookie = name + '=' + encodeURIComponent(value) + '; path=/'; 23} 24 25$(window).on('load', function() { 26 var displayPopupFlg = false; 27 var nowDateTime = new Date(); 28 var popupModified = $('#popup_modified').val(); 29 var popupModifiedDateTime = new Date(popupModified); 30 var cookiePopupModified = popupGetCookie('_popup_modified'); 31 var cookiePopupModifiedDateTime = new Date(cookiePopupModified); 32 var isLoggedIn = $('#popup_is_logged_in').val(); 33 if (isLoggedIn == 1) { 34 displayPopupFlg = true; 35 }
35 else if (typeof cookiePopupModified === 'undefined' || 36 (cookiePopupModifiedDateTime instanceof Date && popupModifiedDateTime instanceof Date && cookiePopupModifiedDateTime < popupModifiedDateTime)) { 37 // ãããã¢ããæ´æ°æ¥æãcookieã«ãªãã¾ãã¯ä»ååå¾ããæ´æ°æ¥æãcookieã«ãããã®ããæ°ããå ´åããããã¢ããã表示ãã 38 displayPopupFlg = true; 39 // cookieã®ãããã¢ããæ´æ°æ¥æãæ´æ°ãã 40 popupSetCookie("_popup_modified", popupModifiedDateTime); 41 } else { 42 var cookiePopup = popupGetCookie('_popup'); 43 if (typeof cookiePopup !== 'undefined') { 44 // cookieãæ®ã£ã¦ããå ´å 45 var cookiePopupDateTime = new Date(cookiePopup); 46 if (cookiePopupDateTime instanceof Date && cookiePopupDateTime < nowDateTime) { 47 // cookieã«è¨å®ããæå»ï¼åå表示æããï¼æéå¾ï¼ãéãã¦ããå ´åããããã¢ããã表示ãã 48 displayPopupFlg = true; 49 } 50 } else { 51 // cookieãæ®ã£ã¦ããªãå ´åããããã¢ããã表示ãã 52 displayPopupFlg = true; 53 } 54 } 55 if (displayPopupFlg) { 56 // Currently, the `display: flex;` in `.popup_show` on the CSS side is overriding the fade-in effect, 57 // so if you want to enable the fade-in effect again in the future, please write it as follows. 58 // $('.popup').addClass('popup_show').hide().fadeIn(1000); 59 $('.popup').addClass('popup_show').fadeIn('slow'); 60 if (isLoggedIn != 1) { 61 // cookieãæ´æ°ãã¦ãï¼æéã¯å表示ãããªãããã«ãã 62 nowDateTime.setHours(nowDateTime.getHours() + 1); 63 popupSetCookie("_popup", nowDateTime); 64 } 65 } else { 66 $('.popup').remove(); 67 } 68});
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.