1function newsPopup() { 2 document.querySelectorAll('.popup-news').forEach((popup) => { 3 const id = popup.getAttribute('data-id') 4 const close = popup.querySelector('.js-popup-news--close') 5 const button = popup.querySelector('.popup-news__descr--btn') 6 const title = popup.querySelector(".popup-news__desc--title").innerText 7 const text = popup.querySelector(".popup-news__descr--text").innerText 8 const textContainer = popup.querySelector(".popup-news__descr--text") 9 const textLength = text.length 10 const flag = 'is_hide_news_popup_' + id 11 12 close.addEventListener('click', () => { 13 popup.style.display = 'none' 14 localStorage.setItem(flag, 1) 15 }) 16 button.addEventListener('click', () => { 17 localStorage.setItem(flag, 1) 18 }) 19 20 if (localStorage.getItem(flag)) { 21 popup.style.display = 'none' 22 } else { 23 popup.style.display = 'block' 24 } 25 26 if (textLength > 110) { 27 textContainer.innerText = text.substring(0, 110) + " " + "..." 28 } 29 }); 30} 31 32newsPopup()
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.