1(() => { 2 // src/js/frontend/frontend.js 3 jQuery(document).ready(function($) { 4 function fehlendes_title_attribute_hinzufuegen() { 5 $("a").each(function() { 6 var $link = $(this); 7 var title = $link.attr("title"); 8 if (!title) { 9 var linkText = $link.text().trim(); 10 var imgAlt = $link.find("img").attr("alt"); 11 if (linkText) { 12 title = linkText.replace(/\n/g, "").trim().substring(0, 30); 13 } else if (imgAlt) { 14 title = imgAlt.replace(/\n/g, "").trim().substring(0, 30); 15 } else { 16 var linkHref = $link.attr("href"); 17 if (linkHref) { 18 var linkTitle = linkHref.replace(/^https?:\/\/[^/]+/, "").replace(/\/$/, "").replace(/^\//, ""); 19 title = linkTitle.replace(/\n/g, "").trim().substring(0, 20); 20 } 21 } 22 if (title) { 23 $link.attr("title", title); 24 } 25 } 26 }); 27 } 28 fehlendes_title_attribute_hinzufuegen(); 29 const hamburger = document.querySelector(".hamburger"); 30 const body = document.body; 31 const lupen = document.querySelectorAll("header .lupe"); 32 const header = document.querySelector("header"); 33 const searchRow = header?.querySelector(".search_row"); 34 const searchContainer = header?.querySelector(".asp_w_container_1"); 35 hamburger?.addEventListener("click", function() { 36 this.classList.toggle("is-active"); 37 if (body.classList.contains("search_open")) { 38 body.classList.remove("search_open"); 39 searchRow?.classList.remove("is_active"); 40 searchContainer?.classList.remove("is_active", "visible"); 41 } 42 const menuIsOpen = body.classList.toggle("menu_open"); 43 if (menuIsOpen) { 44 body.classList.remove("search_open"); 45 } 46 }); 47 lupen.forEach((lupe) => { 48 lupe.addEventListener("click", function() { 49 if (body.classList.contains("menu_open")) { 50 body.classList.remove("menu_open"); 51 hamburger?.classList.remove("is-active"); 52 } 53 const isOpen = body.classList.contains("search_open"); 54 body.classList.toggle("search_open", !isOpen); 55 searchRow?.classList.toggle("is_active", !isOpen); 56 searchContainer?.classList.toggle("is_active", !isOpen); 57 searchContainer?.classList.toggle("visible", !isOpen); 58 if (!isOpen) { 59 const searchInput = document.querySelector( 60 ".proinput input.orig" 61 ); 62 searchInput?.focus(); 63 } 64 }); 65 }); 66 document.addEventListener("click", function(e) { 67 if (!document.body.classList.contains("search_open")) return; 68 const target = e.target; 69 if (target.closest(".search_row") || target.closest(".asp_r") || target.closest(".lupe")) { 70 return; 71 } 72 document.body.classList.remove("search_open"); 73 const searchRow2 = document.querySelector(".search_row"); 74 const searchContainer2 = document.querySelector(".asp_r"); 75 searchRow2?.classList.remove("is_active"); 76 searchContainer2?.classList.remove("is_active", "visible"); 77 if (typeof ASP !== "undefined" && ASP.instances) { 78 Object.values(ASP.instances).forEach((inst) => { 79 if (typeof inst.close === "function") { 80 inst.close(); 81 } 82 }); 83 } 84 }); 85 document.querySelectorAll(".glightbox").forEach((el) => { 86 el.addEventListener("click", () => el.blur()); 87 }); 88 GLightbox({ selector: ".glightbox" }); 89 const containers = document.querySelectorAll(".is-style-masonry"); 90 const grids = []; 91 if (typeof imagesLoaded !== "undefined") { 92 containers.forEach((container) => { 93 const children = Array.from(container.children); 94 children.forEach((child) => { 95 if (child.nodeType !== 1) return; 96 const wrapper = document.createElement("div"); 97 wrapper.classList.add("masonry-item"); 98 container.replaceChild(wrapper, child); 99 wrapper.appendChild(child); 100 }); 101 imagesLoaded(container, () => { 102 const iso = new Isotope(container, { 103 itemSelector: ".masonry-item", 104 layoutMode: "masonry", 105 transitionDuration: "0.2s", 106 percentPosition: true 107 }); 108 grids.push({ container, iso }); 109 iso.layout(); 110 setTimeout(() => iso.layout(), 100); 111 setTimeout(() => iso.layout(), 500); 112 container.classList.add("is-masonry-initialized"); 113 }); 114 }); 115 } 116 let lastScrollTop = 0; 117 const $header = $("header"); 118 $(window).on("scroll", function() { 119 let currentScroll = $(this).scrollTop(); 120 if (currentScroll > 100) { 121 if (currentScroll > lastScrollTop) { 122 $header.addClass("is-hidden"); 123 } else { 124 $header.removeClass("is-hidden"); 125 } 126 } else { 127 $header.removeClass("is-hidden"); 128 } 129 lastScrollTop = currentScroll <= 0 ? 0 : currentScroll; 130 }); 131 function resizeAccordion($accordionContent) { 132 if ($accordionContent.length) { 133 var innerHeight = $accordionContent.find(".ud-accordion__content-inner").outerHeight(true); 134 $accordionContent.css("max-height", innerHeight + "px"); 135 } 136 } 137 $(document).on("click", ".ff-btn-next, .ff-btn-prev", function() { 138 var $accordionContent = $(this).closest(".ud-accordion").find(".ud-accordion__content"); 139 resizeAccordion($accordionContent); 140 }); 141 var uploadList = document.querySelector(".ff-uploaded-list"); 142 if (uploadList) { 143 var observer = new MutationObserver(function() { 144 var $accordionContent = $(uploadList).closest( 145 ".ud-accordion__content" 146 ); 147 resizeAccordion($accordionContent); 148 var count = $(uploadList).children().length; 149 if (count > 0) { 150 $accordionContent.find(".zusammenfassung-uploads").html(" hinzugef\xFCgt"); 151 } else { 152 $accordionContent.find(".zusammenfassung-uploads").empty(); 153 } 154 }); 155 observer.observe(uploadList, { 156 childList: true, 157 subtree: false 158 }); 159 } 160 var bodyElement = $("body"); 161 var htmlElement = $("html"); 162 function addClassesIfMissing() { 163 var responsiveContainer = $( 164 ".wp-block-navigation__responsive-container" 165 ); 166 if (responsiveContainer.length > 0) { 167 responsiveContainer.addClass("has-modal-open is-menu-open"); 168 bodyElement.addClass("has-modal-open is-menu-open"); 169 htmlElement.addClass("has-modal-open"); 170 } 171 } 172 function startMutationObserver() { 173 var targetNode = document.body; 174 var config = { childList: true, subtree: true }; 175 var observer2 = new MutationObserver(function(mutationsList) { 176 for (var mutation of mutationsList) { 177 if (mutation.type === "childList") { 178 addClassesIfMissing(); 179 break; 180 } 181 } 182 }); 183 observer2.observe(targetNode, config); 184 addClassesIfMissing(); 185 } 186 const header_schule = document.querySelector("header"); 187 if (!header) return; 188 header_schule.querySelectorAll("p.schule a").forEach((link) => { 189 link.setAttribute("target", "_blank"); 190 link.setAttribute("rel", "noopener noreferrer"); 191 }); 192 document.addEventListener("click", () => { 193 setTimeout(() => { 194 const entryContent = document.querySelector(".entry-content"); 195 if (!entryContent) return; 196 if (entryContent.querySelector(".wp-block-ud-filter-tag-block")) { 197 return; 198 } 199 entryContent.querySelectorAll( 200 ".accordion-block-container .wp-block-ud-link-block" 201 ).forEach((el) => { 202 if (el.hasAttribute("style")) { 203 el.removeAttribute("style"); 204 } 205 }); 206 }, 300); 207 }); 208 }); 209})();
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.