1document.addEventListener("DOMContentLoaded", function() { 2 const toc = document.getElementById('toc'); 3 toc.innerHTML = ''; // Clear TOC to avoid duplicates 4 5 const headers = document.querySelectorAll('.main-content h2'); 6 7 headers.forEach(function(header, index) { 8 const id = `heading-${index}`; 9 10 // Set the ID only if it doesn't already exist 11 if (!header.id) { 12 header.id = id; 13 } 14 15 // Create the list item and add the hyperlink to the TOC 16 const listItem = document.createElement('li'); 17 const link = document.createElement('a'); 18 link.href = `#${header.id}`; 19 link.textContent = header.textContent; 20 21 listItem.appendChild(link); 22 toc.appendChild(listItem); 23 }); 24 25 // Scroll offset adjustment when a link is clicked 26 toc.addEventListener('click', function(event) { 27 if (event.target.tagName === 'A') { 28 event.preventDefault(); // Prevent default anchor behavior 29 30 const targetId = event.target.getAttribute('href').substring(1); // Remove the '#' from the href 31 const targetElement = document.getElementById(targetId); 32 33 // Get the element's position and subtract the 200px offset 34 const offsetPosition = targetElement.getBoundingClientRect().top + window.scrollY - 200; 35 36 // Smoothly scroll to the target position 37 window.scrollTo({ 38 top: offsetPosition, 39 behavior: 'smooth' 40 }); 41 42 // Remove 'active' class from all list items 43 const listItems = toc.querySelectorAll('li'); 44 listItems.forEach(function(item) { 45 item.classList.remove('active'); 46 }); 47 48 // Add 'active' class to the clicked list item 49 event.target.parentElement.classList.add('active'); 50 } 51 }); 52 53 // Add 'active' class to the first list item by default 54 const firstListItem = toc.querySelector('li'); 55 if (firstListItem) { 56 firstListItem.classList.add('active'); 57 } 58}); 59 60 61$(document).ready(function() { 62 $('div').each(function() { 63 const lastChild = $(this).children().last(); 64 65 // Ako je zadnji element <img> 66 if (lastChild.is('img')) { 67 lastChild.css('margin-bottom', '0'); 68 } 69 70 // Ako je <img> neposredno prije <h2> 71 $(this).children('h2').each(function() { 72 const prevSibling = $(this).prev('img'); 73 if (prevSibling.length) { 74 prevSibling.css('margin-bottom', '5px'); 75 } 76 }); 77 }); 78}); 79
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.