Untitled Snippet

document.addEventListener(“click”, (e) => { const pill = e.target.closest(“.rs-pill”); if (!pill) return; const row = pill.parentElement; row.querySelectorAll(“.rs-pill”).forEach(p => p.classList.remove(“active”)); pill.classList.add(“active”); });Continue reading

Replace APFWS Matching Product Notice

(function () { if (typeof window === ‘undefined’ || !document) return; // Exit if WooCommerce frontend scripts are not present. if (typeof window.wc_add_to_cart_params === ‘undefined’) return; // Exit if WooCommerce APFS is not present (guards by checking for its AJAX…Continue reading

Determinar altura del header (copy)

jQuery(window).on(‘elementor/frontend/init’, function() { // Elementor tiene su propio evento de carga de componentes jQuery(window).on(‘load’, function() { function updateHeaderHeight() { // Seleccionamos el header const $header = jQuery(‘header, .elementor-location-header’); const $body = jQuery(‘body’); if ($header.length) { let headerHeight = 0; if…Continue reading

SurveyVista – Script to Control Modal

// To store timeline of Survey submitted (One Month) window.addEventListener(“message”, function (event) { if (event.data === “surveySubmitted”) { closeModal(); const threeMinutes = 30 * 24 * 60 * 60 * 1000; // 1 Month (Update this value as needed) const…Continue reading

Determinar altura del header

jQuery(window).on(‘elementor/frontend/init’, function() { // Elementor tiene su propio evento de carga de componentes jQuery(window).on(‘load’, function() { function updateHeaderHeight() { // Seleccionamos el header const $header = jQuery(‘.elementor-location-header .elementor-sticky’); const $body = jQuery(‘body’); if ($header.length) { let headerHeight = 0; if…Continue reading

Glossary sorting

(function () { if (window.__glossaryAZSorterInstalled) return; window.__glossaryAZSorterInstalled = true; function isGlossaryPage() { return !!( document.querySelector(“nav.nav-az”) && document.querySelector(“section.letter#A”) && document.querySelector(“article.glossary-entry h2”) ); } function getTitle(article) { var h2 = article.querySelector(“h2”); return (h2 ? h2.textContent : “”).trim(); } function getCollator() { var…Continue reading

Wide – Convert to GR – JavaScript (Frontend – Real-time)

(function($) { ‘use strict’; // Ελληνικοί τόνοι -> χωρίς τόνους const accentMap = { ‘ά’: ‘α’, ‘έ’: ‘ε’, ‘ή’: ‘η’, ‘ί’: ‘ι’, ‘ό’: ‘ο’, ‘ύ’: ‘υ’, ‘ώ’: ‘ω’, ‘Ά’: ‘Α’, ‘Έ’: ‘Ε’, ‘Ή’: ‘Η’, ‘Ί’: ‘Ι’, ‘Ό’: ‘Ο’, ‘Ύ’: ‘Υ’,…Continue reading

Copy Current Link

// Copy Post URL — Universal (works with or without dynamic link) document.addEventListener(‘click’, function (e) { const btn = e.target.closest(‘.copy-post-url’); if (!btn) return; e.preventDefault(); // Use the button’s href if it’s a real link, otherwise use the page URL const…Continue reading