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(‘header, .elementor-location-header’); const $body = jQuery(‘body’); if ($header.length) { let headerHeight = $header.outerHeight(); //…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

Shop Manager – View Only.js

add_action(‘admin_menu’, function () { $user = wp_get_current_user(); if (!in_array(‘shop_manager_-_view_only’, (array) $user->roles)) { return; } global $menu, $submenu; // Top-level menu whitelist $allowed_top = [ ‘index.php’, // Dashboard ‘woocommerce’, // WooCommerce ‘users.php’, // Users ‘woocommerce-marketing’, // Marketing ]; foreach ($menu as…Continue reading

Smash Ballon Content “load more” Link entfernen

jQuery(document).ready(function ($) { function unwrapSbiExpandLinks(context) { $(context).find(‘.sbi_expand > a’).each(function () { // entfernen, Inhalt behalten (z.B. …) $(this).replaceWith($(this).contents()); }); } // 1) initial unwrapSbiExpandLinks(document); // 2) nach Klick auf “Mehr laden” (zusätzliche Absicherung) $(document).on(‘click’, ‘#sbi_load .sbi_load_btn, .sbi_load_btn’, function () {…Continue reading

Smash Balloon Bild-Links Tabindex

jQuery(document).ready(function ($) { const observer = new MutationObserver(function () { $(‘.sbi_photo’).attr(‘tabindex’, ‘0’); }); observer.observe(document.body, { childList: true, subtree: true }); });Continue reading