1//libraries like jquery etc 2//main.js file 3const html = document.querySelector('html'); 4let body = document.getElementById('body'); 5let themeToggle = document.getElementById('theme-toggle'); 6let toggleDot = document.getElementById('toggle-dot'); 7 8let hamburger = document.getElementById('hamburger-btn'); 9let mobileMenu = document.getElementById('mobile-menu'); 10let desktopMenu = document.getElementById('desktop-mobile-nav-hide'); 11let hamburgerOpen = document.getElementById('hamburger-btn-open'); 12let hamburgerClosed = document.getElementById('hamburger-btn-closed'); 13let userProfile = document.getElementById('user-profile-btn'); 14let profileMenu = document.getElementById('profile-menu'); 15 16//method on valid DOM elements 17if (hamburger) { 18 hamburger.addEventListener('click', function(){ 19 if (userProfile == null) 20 { 21 hamburgerOpen.classList.toggle('hidden'); 22 hamburgerClosed.classList.toggle('hidden'); 23 } 24 themeToggle.classList.toggle('menu-open'); 25 themeToggle.classList.remove('profile-open'); 26 body.classList.toggle('fixedPosition'); 27 body.classList.remove('fixedPosition-profile'); 28 closeOpenItems(mobileMenu); 29 }); 30} 31 32 33if (typeof(userProfile) != 'undefined' && userProfile != null) 34{ 35 userProfile.addEventListener('click', function(){ 36 themeToggle.classList.toggle('profile-open'); 37 themeToggle.classList.remove('menu-open'); 38 body.classList.toggle('fixedPosition-profile'); 39 body.classList.remove('fixedPosition'); 40 closeOpenItems(profileMenu); 41 }); 42} 43 44function closeOpenItems(menuItem){ 45 46 openMenus = document.querySelectorAll('.dropMenu'); 47 openMenus.forEach(function(menu){ 48 if (menu !== menuItem){ 49 if(menuItem === mobileMenu){ 50 hamburgerOpen.classList.toggle('hidden'); 51 hamburgerClosed.classList.toggle('hidden'); 52 } 53 else{ 54 hamburgerOpen.classList.remove('hidden'); 55 hamburgerClosed.classList.add('hidden'); 56 } 57 menu.classList.add('hidden'); 58 } 59 }); 60 61 menuItem.classList.toggle('hidden'); 62} 63 64if (window.NodeList && !NodeList.prototype.forEach) { 65 NodeList.prototype.forEach = Array.prototype.forEach; 66} 67 68const images = document.querySelectorAll('img.lazyload'); 69if ("IntersectionObserver"in window) { 70 const observer = new IntersectionObserver(function(entries, observer) { 71 entries.forEach(function(entry) { 72 if (entry.isIntersecting) { 73 var img = entry.target; 74 img.classList.remove("lazyload"); 75 img.src = img.dataset.src; 76 // console.log(img.dataset.src); 77 observer.unobserve(img); 78 } 79 }); 80 }, { 81 rootMargin: "0px 0px 200px 0px" 82 }); 83 images.forEach(function (img) { 84 observer.observe(img); 85 }); 86} else { 87 images.forEach(function (img) { 88 img.src = img.dataset.src; 89 }); 90} 91 92 93function menuToggle(d){ 94 let navSection = d.getAttribute("data-nav-section"); 95 let subNav = document.getElementById(navSection); 96 subNav.classList.toggle('hidden'); 97} 98 99function closeAlert(event){ 100 let element = event.target; 101 while(element.nodeName !== "BUTTON"){ 102 element = element.parentNode; 103 } 104 element.parentNode.parentNode.removeChild(element.parentNode); 105} 106 107function confirmAction() 108{ 109 var x = confirm("Da li ste sigurni da želite izvršiti akciju?"); 110 if (x) 111 return true; 112 else 113 return false; 114}
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.