$(document).ready(function() { // Check for click events on the navbar burger icon $(".navbar-burger").click(function() { // Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu" $(".navbar-burger").toggleClass("is-active"); $(".navbar-menu").toggleClass("is-active"); }); }); function fadeloop(el,timeout,timein,loop){ var $el = $(el),intId,fn = function(){ $el.fadeTo(timeout, 0.2); $el.fadeTo(timein, 1); }; fn(); if(loop){ intId = setInterval(fn,timeout+timein+100); return intId; } return false; } function replaceQueryParam(param, value) { var currentUrl = window.location.href; var url = new URL(currentUrl); url.searchParams.set(param, value); history.replaceState(null, '', url.href); } function safeText(text) { function escapeHtml(text) { var map = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; return text.replace(/[&<>"']/g, function(m) { return map[m]; }); } return escapeHtml(text); } function unescapeHtml(text) { var tempElement = document.createElement('div'); tempElement.innerHTML = text; return tempElement.textContent || tempElement.innerText; } function sanitizeInput(input) { const config = { ALLOWED_TAGS: ['a', 'abbr', 'code', 'pre', 'acronym', 'b', 'blockquote', 'code', 'em', 'i', 'li', 'ol', 'strong', 'ul', 'p', 'br', 'div', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], ALLOWED_ATTR: ['href', 'title'] }; const sanitizedInput = DOMPurify.sanitize(input, config); return sanitizedInput; }