1var FXNP = ( function( FXNP, $ ) { 2 3 4 $(window).on( 'load', () => { 5 FXNP.Popup.init() 6 }) 7 8 9 FXNP.Popup = { 10 $popup: null, 11 $closeBtn: null, 12 cookieName: null, 13 14 15 init() { 16 this.$popup = $('.js-notification-popup') 17 this.$closeBtn = $('.js-notification-popup-close') 18 19 if( this.$popup.length && this.$closeBtn.length ) { 20 this.getCookieName() 21 this.checkForCookie() 22 } 23 }, 24 25 26 getCookieName() { 27 let cookieName = 'fx_notification_popup_1' 28 29 if( undefined !== FXNP.fx_notification_popup_time && FXNP.fx_notification_popup_time.length ) { 30 cookieName = `fx_notification_popup_${FXNP.fx_notification_popup_time}` 31 } 32 33 this.cookieName = cookieName 34 }, 35 36 37 checkForCookie() { 38 let cookies = decodeURIComponent( document.cookie ).split( ';' ) 39 40 for( let i = 0; i < cookies.length; i++ ) { 41 let cookie = cookies[i].trim() 42 43 if( cookie.includes( this.cookieName ) ) { 44 this.hidePopup() 45 return 46 } 47 } 48 49 this.showPopup() 50 this.bind() 51 }, 52 53 54 showPopup() { 55 this.$popup.addClass('is-visible') 56 }, 57 58 59 hidePopup() { 60 this.$popup.removeClass('is-visible') 61 }, 62 63 64 bind() { 65 this.$closeBtn.on( 'click', this.handleBtnClick.bind( this ) ) 66 }, 67 68 69 handleBtnClick() { 70 this.hidePopup() 71 72 // set cookie to prevent notification popup from showing up again 73 const date = new Date() 74 date.setTime( date.getTime() + 2592000000 ) // +30 days 75 76 document.cookie = `${this.cookieName}=1;expires=${date.toUTCString()};path=/` 77 } 78 79 } 80 81 82 return FXNP 83 84} ( FXNP || {}, jQuery ) )
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.