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

window.addEventListener(“load”, () => { const iFrame = document.getElementById(“surveyFrame”); // Load survey in background AFTER page load if (iFrame && iFrame.dataset.src) { iFrame.src = iFrame.dataset.src; } // Show modal after 12 seconds setTimeout(() => { // Show the modal const modal…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

document.addEventListener(‘click’, function (e) { const btn = e.target.closest(‘a.copy-post-url’); if (!btn) return; e.preventDefault(); const url = btn.href; if (!url) return; navigator.clipboard.writeText(url).then(() => { const original = btn.textContent; btn.textContent = ‘Link copied’; setTimeout(() => (btn.textContent = original), 1500); }); });Continue reading

Corrección de widgets tipo “slides.default”

(function(jQuery) { ‘use strict’; const fixSlidesClases = function() { if (elementorFrontend && elementorFrontend.hooks) { // Filtramos específicamente por el widget de slides elementorFrontend.hooks.addAction(‘frontend/element_ready/slides.default’, function($scope) { // Buscamos el wrapper que debería tener la clase de swiper // En versiones recientes…Continue reading

Address Book.js

jQuery(function($){ const P = window.addressBookParams; if (!P) return; const $modal = $(‘#address_modal’).appendTo(‘body’), $grid = $(‘#address_book_grid’), $form = $(‘#address_form’), $header = $(‘.address-book-header’), $title = $(‘#modal_title’); function refresh(html){ $(‘.address-error-bar’).remove(); $grid.html(html); } function showError(msg){ $(‘.address-error-bar’).remove(); const $bar = $(` ${msg} `); $header.after($bar); }…Continue reading

Custom Checkout.js

/** * custom-checkout.js (canonical fields + live address refresh) * — Two-step navigation * — Ship-to-different handling via hidden input * — Address book modal (add/edit/delete) with instant UI refresh * — Address book integration on checkout * — Coupon…Continue reading