Untitled Snippet

const showHidePass = document.getElementById(‘showHidePassword’); const userPassword = document.getElementById(‘password’); showHidePass.addEventListener(‘click’, function(e) { let showHideAttr = userPassword.getAttribute(‘type’); if (showHideAttr === ‘password’) { showHideAttr = ‘text’; } else { showHideAttr = ‘password’; } userPassword.setAttribute(‘type’, showHideAttr); this.classList.toggle(‘fa-eye-slash’); });Continue reading

Retain Query Params

document.addEventListener(‘DOMContentLoaded’, function() { var queryString = window.location.search; var links = document.querySelectorAll(‘.elementor a’); // Target elementor links if (queryString) { links.forEach(function(link) { var originalUrl = link.href; // Ensure the query parameters are appended correctly without creating duplicates if (originalUrl.indexOf(‘?’) === -1)…Continue reading

Show more Landings

document.addEventListener(“DOMContentLoaded”, function () { // Get all Read More buttons const readMoreButtons = document.querySelectorAll(‘.read-more’); readMoreButtons.forEach(button => { button.addEventListener(‘click’, function (event) { event.preventDefault(); const feature = this.closest(‘.feature’); const longDesc = feature.querySelector(‘.long-desc’); const shortDesc = feature.querySelector(‘.short-desc’); if (longDesc.style.display === “none”) { longDesc.style.display…Continue reading

Untitled Snippet

// Define the API URL const apiUrl = ‘https://api.example.com/data’; // Make a GET request fetch(apiUrl) .then(response => { if (!response.ok) { throw new Error(‘Network response was not ok’); } return response.json(); }) .then(data => { console.log(data); }) .catch(error => {…Continue reading

CONNECT TO API GATEWAY

// Define the API URL const apiUrl = ‘https://api.example.com/data’; // Make a GET request fetch(apiUrl) .then(response => { if (!response.ok) { throw new Error(‘Network response was not ok’); } return response.json(); }) .then(data => { console.log(data); }) .catch(error => {…Continue reading

AIOSEO FAQ Block accordion

;(() => { const accordionItems = document.querySelectorAll(“.wp-block-aioseo-faq”); if (!accordionItems.length) { return; } accordionItems.forEach((item) => { const itemSummary = item.querySelector(“.aioseo-faq-block-question”); const itemContent = item.querySelector(“.aioseo-faq-block-answer”); itemSummary?.addEventListener(“click”, () => { itemContent?.style.setProperty( “–content-height”, `${itemContent.scrollHeight}px` ); item.classList.toggle(“is-open”); }); }); const faqStyles = ` .wp-block-aioseo-faq {…Continue reading

GREGORY_AUTOSCROLL_JS

const initRepeatedKadence = () => { console.log(“initRepeatedKadence”); let idBlock = 0; for(const child of document.querySelectorAll(“.wp-block-kadence-column”)) { console.log(child); let newDiv = document.createElement(‘div’); newDiv.className = `scroll-ads-content-block scroll-ads-content-block-${++idBlock} scroll-ads-content-block-li`; child.parentNode.insertBefore(newDiv, child); newDiv.appendChild(child); } } const initNormalArticleKadence = () => { console.log(“initNormalArticleKadence”); const article…Continue reading

GREGORY_ADS_JS

document.addEventListener(“DOMContentLoaded”, function() { console.log(‘Add ads’); console.log(window.ADS_MODEL); window.changeAdsSpot = async (htmltag, evttype, placeholder, oldspot, newspot) => { // update model window.ADS_MODEL[evttype]._showing[placeholder] = newspot; console.log(window.ADS_MODEL[evttype]._showing); // disable previous placeholder + delete ezstandalone.cmd.push(function() { ezstandalone.destroyPlaceholders(placeholder); }); await new Promise(resolve => setTimeout(resolve, 1000)); document.querySelector(`.spot-ads-${htmltag}-${oldspot}`).innerHTML…Continue reading