Modernize frontend assets and security baseline
All checks were successful
Publish static bundles / publish (push) Successful in 3m19s
All checks were successful
Publish static bundles / publish (push) Successful in 3m19s
This commit is contained in:
parent
33d9509678
commit
1d55bdb691
995 changed files with 10228 additions and 16769 deletions
6
js/jquery.min.js
vendored
6
js/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
71
js/site.js
Normal file
71
js/site.js
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
(function () {
|
||||
"use strict";
|
||||
|
||||
function ready() {
|
||||
document.body.classList.remove("tribe-no-js");
|
||||
document.body.classList.add("tribe-js");
|
||||
|
||||
var navigation = document.getElementById("access");
|
||||
var navigationToggle = document.getElementById("nav-toggle");
|
||||
|
||||
if (navigation && navigationToggle) {
|
||||
navigationToggle.setAttribute("aria-controls", "access");
|
||||
navigationToggle.setAttribute("aria-expanded", "false");
|
||||
|
||||
navigationToggle.addEventListener("click", function (event) {
|
||||
event.preventDefault();
|
||||
var open = navigation.classList.toggle("is-open");
|
||||
navigationToggle.setAttribute("aria-expanded", String(open));
|
||||
});
|
||||
|
||||
navigation.querySelectorAll(".menu-item-has-children > a").forEach(function (link) {
|
||||
link.setAttribute("aria-haspopup", "true");
|
||||
link.setAttribute("aria-expanded", "false");
|
||||
|
||||
link.addEventListener("click", function (event) {
|
||||
if (!window.matchMedia("(max-width: 650px)").matches) return;
|
||||
|
||||
var expanded = link.getAttribute("aria-expanded") === "true";
|
||||
if (!expanded) {
|
||||
event.preventDefault();
|
||||
link.setAttribute("aria-expanded", "true");
|
||||
link.parentElement.classList.add("submenu-open");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var backToTop = document.getElementById("toTop");
|
||||
if (backToTop) {
|
||||
var updateBackToTop = function () {
|
||||
backToTop.classList.toggle("is-visible", window.scrollY > 160);
|
||||
};
|
||||
|
||||
backToTop.addEventListener("click", function () {
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
});
|
||||
window.addEventListener("scroll", updateBackToTop, { passive: true });
|
||||
updateBackToTop();
|
||||
}
|
||||
|
||||
document.querySelectorAll('.entry-content iframe[src*="youtube.com"], .entry-content iframe[src*="youtube-nocookie.com"], .entry-content iframe[src*="player.vimeo.com"]').forEach(function (video) {
|
||||
if (video.parentElement && video.parentElement.classList.contains("fluid-width-video-wrapper")) return;
|
||||
|
||||
var width = Number(video.getAttribute("width")) || 16;
|
||||
var height = Number(video.getAttribute("height")) || 9;
|
||||
var wrapper = document.createElement("div");
|
||||
wrapper.className = "fluid-width-video-wrapper";
|
||||
wrapper.style.setProperty("--video-aspect", String(width / height));
|
||||
video.parentNode.insertBefore(wrapper, video);
|
||||
wrapper.appendChild(video);
|
||||
video.removeAttribute("width");
|
||||
video.removeAttribute("height");
|
||||
});
|
||||
}
|
||||
|
||||
if (document.readyState === "loading") {
|
||||
document.addEventListener("DOMContentLoaded", ready, { once: true });
|
||||
} else {
|
||||
ready();
|
||||
}
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue