1const mainContent = document.querySelector("main"); 2document 3 .getElementById("skip-to-content") 4 .addEventListener("click", function (e) { 5 e.preventDefault(); 6 var target = mainContent.querySelectorAll("h1, h2, h3, h4, h5, h6")[0]; 7 target.setAttribute("tabindex", "-1"); 8 target.focus(); 9 }); 10 11////////////////////////////////////////////////////////////////////////// 12// Mobile Menu 13 14const primaryMenu = document.querySelector(".bcm-mobilemenu"); 15const primaryMenuBtn = document.querySelector(".primary-menu-btn"); 16primaryMenuBtn.addEventListener("click", toggleMenu); 17 18function toggleMenu() { 19 const visibility = primaryMenu.getAttribute("data-mobile-visible"); 20 21 if (visibility === "false") { 22 primaryMenu.setAttribute("data-mobile-visible", "true"); 23 primaryMenuBtn.setAttribute("aria-expanded", "true"); 24 primaryMenuBtn.classList.add("menu-active"); 25 primaryMenuLinks.forEach(function (link) { 26 link.removeAttribute("tabindex"); 27 }); 28 } else { 29 primaryMenu.setAttribute("data-mobile-visible", "false"); 30 primaryMenuBtn.setAttribute("aria-expanded", "false"); 31 primaryMenuBtn.classList.remove("menu-active"); 32 primaryMenuLinks.forEach((link) => { 33 link.setAttribute("tabindex", "-1"); 34 }); 35 } 36} 37 38primaryMenuBtn.addEventListener("keydown", (e) => { 39 if (e.key === "Enter" || e.key === " ") { 40 toggleMenu(); 41 e.preventDefault(); 42 } 43}); 44 45const primaryMenuLinks = document.querySelectorAll("#primary-menu a"); 46 47primaryMenuLinks.forEach((link) => { 48 link.addEventListener("click", () => { 49 primaryMenu.setAttribute("data-mobile-visible", "false"); 50 primaryMenuBtn.setAttribute("aria-expanded", "false"); 51 }); 52}); 53 54window.addEventListener("keydown", (e) => { 55 if ( 56 e.key === "Tab" && 57 primaryMenu.getAttribute("data-mobile-visible") === "true" 58 ) { 59 const firstInteractiveEl = primaryMenuBtn; // Button should be the first focusable element 60 const lastInteractiveEl = primaryMenuLinks[primaryMenuLinks.length - 1]; // Last link should be the last focusable element 61 62 if (e.shiftKey && document.activeElement === firstInteractiveEl) { 63 e.preventDefault(); 64 lastInteractiveEl.focus(); 65 } else if (!e.shiftKey && document.activeElement === lastInteractiveEl) { 66 e.preventDefault(); 67 firstInteractiveEl.focus(); 68 } 69 } 70}); 71 72document.onclick = function (e) { 73 const visibility = primaryMenu.getAttribute("data-mobile-visible"); 74 75 if (visibility === "true") { 76 if ( 77 primaryMenu !== e.target && 78 primaryMenuBtn !== e.target && 79 primaryMenu !== e.target.offsetParent && 80 primaryMenuBtn !== e.target.offsetParent 81 ) { 82 primaryMenu.setAttribute("data-mobile-visible", "false"); 83 primaryMenuBtn.setAttribute("aria-expanded", "false"); 84 primaryMenuBtn.classList.remove("menu-active"); 85 } 86 } 87}; 88 89window.addEventListener("keydown", (e) => { 90 // if (e.keyCode == 27) { 91 let keydownEscape = e.key === "Escape" || e.keyCode === 27; 92 const visibility = primaryMenu.getAttribute("data-mobile-visible"); 93 94 if (visibility === "true") { 95 if (keydownEscape) { 96 primaryMenu.setAttribute("data-mobile-visible", "false"); 97 primaryMenuBtn.setAttribute("aria-expanded", "false"); 98 primaryMenuBtn.classList.remove("menu-active"); 99 } 100 } 101}); 102 103////////////////////////////////////////////////////////////////////////// 104 105// search 106// tab through and other code for search 107const search = document.getElementById("search"); 108 109function openSearch() { 110 search.style.marginTop = "0px"; 111 search.style.height = "204px"; 112 search.style.opacity = "1"; 113 search.style.zIndex = "9999"; 114 search.classList.add("opensearch"); 115} 116function closeSearch() { 117 search.style.marginTop = "-204px"; 118 search.style.height = "0px"; 119 search.style.opacity = "0"; 120 search.style.zIndex = "-1"; 121 search.classList.remove("opensearch"); 122} 123 124const focusableElements = 125 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'; 126const modal = document.querySelector("#search"); 127 128const firstFocusableElement = modal.querySelectorAll(focusableElements)[0]; 129const focusableContent = modal.querySelectorAll(focusableElements); 130const lastFocusableElement = focusableContent[focusableContent.length - 1]; 131 132document.addEventListener("keydown", function (e) { 133 let isTabPressed = e.key === "Tab" || e.keyCode === 9; 134 135 if (!isTabPressed) { 136 return; 137 } 138 139 if (e.shiftKey) { 140 if (document.activeElement === firstFocusableElement) { 141 lastFocusableElement.focus(); 142 e.preventDefault(); 143 } 144 } else { 145 if (document.activeElement === lastFocusableElement) { 146 firstFocusableElement.focus(); 147 e.preventDefault(); 148 } 149 } 150}); 151 152firstFocusableElement.focus(); 153 154document.addEventListener("keydown", function (e) { 155 let keydownEscape = e.key === "Escape" || e.keyCode === 27; 156 157 if (!keydownEscape) { 158 return; 159 } 160 161 if (keydownEscape) { 162 if ((search.style.display = "flex")) { 163 if ((e.key = "Escape")) { 164 search.style.display = "none"; 165 } 166 } 167 } 168}); 169 170let accordians = Array.from(document.querySelectorAll(".elementor-tab-title")); 171let tabContent = Array.from( 172 document.querySelectorAll(".elementor-tab-content") 173); 174 175window.onload = (e) => { 176 accordians.forEach((accordian) => { 177 accordian.classList.remove("elementor-active"); 178 }); 179 180 let delay = 10; 181 setTimeout(function () { 182 tabContent.forEach((tab) => { 183 tab.style.display = "none"; 184 }, 10); 185 }); 186}; 187 188const btnHolidayHours = document.querySelector("#bcm-holidayhours-btn-show a"); 189const holidayHours = document.getElementById("bcm-holidayhours"); 190 191console.log(btnHolidayHours); 192 193btnHolidayHours.addEventListener("click", () => { 194 holidayHours.classList.toggle("showHolidayHours"); 195});
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.