1window.addEventListener('DOMContentLoaded', () => { 2 3 // Pop-up script 4 5 let modalTriggers = document.querySelectorAll('.wiget-action-button'); 6 let podeliModalTriggers = document.querySelectorAll('.podeli-action-button'); 7 let podeliModalTriggers2 = document.querySelectorAll('.podeli-action-button2'); 8 9 let modals = document.querySelectorAll('.rb-modal-wrapper'); 10 let podeliModals = document.querySelectorAll('.podeli-wrapper'); 11 12 let scroll = calcScroll(); 13 14 modalTriggers.forEach((modalTrigger, index) => { 15 modalTrigger.addEventListener('click', () => { 16 modals[index].classList.add('rb-show-modal'); 17 // document.body.style.overflow = 'hidden'; 18 // document.body.style.paddingRight = `${scroll}px`; 19 }); 20 }); 21 22 podeliModalTriggers.forEach((modalTrigger, index) => { 23 modalTrigger.addEventListener('click', () => { 24 podeliModals[index].classList.add('rb-show-modal'); 25 // document.body.style.overflow = 'hidden'; 26 // document.body.style.paddingRight = `${scroll}px`; 27 }); 28 }); 29 30 podeliModalTriggers2.forEach((modalTrigger, index) => { 31 modalTrigger.addEventListener('click', () => { 32 podeliModals[index].classList.add('rb-show-modal'); 33 // document.body.style.overflow = 'hidden'; 34 // document.body.style.paddingRight = `${scroll}px`; 35 }); 36 }); 37 38 function closeModal() { 39 modals.forEach((modal) => { 40 modal.classList.remove('rb-show-modal'); 41 }); 42 podeliModals.forEach((modal) => { 43 modal.classList.remove('rb-show-modal'); 44 }); 45 // document.body.style.overflow = ''; 46 // document.body.style.paddingRight = '0px'; 47 }; 48 49 function calcScroll() { 50 let div = document.createElement('div'); 51 div.style.width = '50px'; 52 div.style.height = '50px'; 53 div.style.overflowY = 'scroll'; 54 div.style.visibility = 'hidden'; 55 56 document.body.appendChild(div); 57 let scrollWidth = div.offsetWidth - div.clientWidth; 58 div.remove(); 59 60 return scrollWidth; 61 }; 62 63 let modalCloseButtons = document.querySelectorAll('.close-modal'); 64 modalCloseButtons.forEach((modalCloseButton) => { 65 modalCloseButton.addEventListener('click', closeModal); 66 }); 67 68 modals.forEach((modal) => { 69 modal.addEventListener('click', (e) => { 70 if (e.target === modal) { 71 closeModal(); 72 } 73 }); 74 }); 75 76 podeliModals.forEach((modal) => { 77 modal.addEventListener('click', (e) => { 78 if (e.target === modal) { 79 closeModal(); 80 } 81 }); 82 }); 83 84 document.addEventListener('keydown', (e) => { 85 if (e.code === "Escape") { 86 closeModal(); 87 } 88 }); 89 90 // END Pop-up script 91 92}); 93 94function toggleActive(element) { 95 const parent = element.parentElement; 96 const items = parent.getElementsByClassName("active"); 97 for (const item of items) { 98 item.classList.remove("active"); 99 } 100 101 element.classList.add("active"); 102}
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.