1(function ($) { 2 3 SR_ROS_ALERT_MODAL = { 4 5 initOnDOMReady: function () { 6 7 var root = SR_ROS.getRootItem(); 8 9 if (root.find('.alert-layer').length) { 10 this.checkForCurrentDay(root); 11 } 12 }, 13 14 checkForCurrentDay: function (root) { 15 let alertLayer = root.find('.alert-layer'), 16 today = new Date(), 17 currentDate = parseInt(today.getTime() / 1000) - (today.getTimezoneOffset() * 60), 18 startDate = parseInt(alertLayer.attr('data-layer-start')) || 0, 19 endDate = parseInt(alertLayer.attr('data-layer-end')) || 0, 20 delay = ((parseInt(alertLayer.attr('data-alert-delay')) || 0) * 1000) + 1; 21 22 let started = (startDate === 0 || startDate < currentDate), 23 ended = (endDate !== 0 && currentDate > endDate); 24 25 if (!started || ended) { 26 $.removeCookie('cookie_alertlayer', {path: '/'}); 27 28 } else if ($.cookie('cookie_alertlayer') !== 'true') { 29 setTimeout(this.initAlertLayer, delay, root, alertLayer); 30 } 31 }, 32 33 initAlertLayer: function (root, layer) { 34 35 let pageDimmer = root.find('#js_page-dimmer'), 36 alertLayer = layer, 37 cookieExpiration = parseInt(alertLayer.attr('data-cookie-expires')) || 1; 38 39 pageDimmer.fadeIn(300); 40 alertLayer.fadeIn(300); 41 42 root.find('.js_alert-layer-close').off('click').on('click', function (event) { 43 $.cookie('cookie_alertlayer', true, {expires: cookieExpiration, path: '/'}); 44 45 pageDimmer.fadeOut(300); 46 alertLayer.fadeOut(300); 47 48 if (!$(event.currentTarget).hasClass('js_alert-layer-forward')) { 49 event.preventDefault(); 50 } 51 }); 52 } 53 }; 54 55 SR_ROS_ALERT_MODAL.initOnDOMReady(); 56})(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.