From b860cf6c4030e04eef73638f2f014dfad795e6c0 Mon Sep 17 00:00:00 2001 From: Ana Date: Fri, 17 Jul 2026 18:02:33 +0200 Subject: [PATCH] =?UTF-8?q?El=20bot=C3=B3n=20del=20lightbox=20copia=20la?= =?UTF-8?q?=20URL=20de=20la=20imagen=20del=20mapa=20(v1.6.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sustituye el botón de compartir por «Copy map URL»: copia al portapapeles la URL del archivo de imagen a tamaño completo del mapa visible, en lugar del enlace con ancla #map-, que resultaba confuso. Los enlaces #map- siguen funcionando al abrirlos. --- assets/js/geep-maps.js | 20 ++++++-------------- fp-genocide-maps.php | 6 +++--- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/assets/js/geep-maps.js b/assets/js/geep-maps.js index b7de533..bf5bd67 100644 --- a/assets/js/geep-maps.js +++ b/assets/js/geep-maps.js @@ -128,14 +128,6 @@ * Shareable URLs: #map- selects that map on page load. * ---------------------------------------------------------------- */ - function shareUrl() { - var base = window.location.href.split('#')[0]; - if (!current) { - return base; - } - return base + HASH_PREFIX + encodeURIComponent(current.getAttribute('data-slug')); - } - function openFromHash() { if (window.location.hash.indexOf(HASH_PREFIX) !== 0) { return; @@ -185,8 +177,8 @@ '
' + '
' + '' + '' + '
' + @@ -262,12 +254,12 @@ } function share() { - var url = shareUrl(); - var title = current ? current.querySelector('.geep-toggle-title').textContent : document.title; - if (navigator.share) { - navigator.share({ title: title, url: url }).catch(function () {}); + // Copy the full-size image URL of the map currently on screen. + var active = root.querySelector('.geep-map-img.is-active'); + if (!active) { return; } + var url = active.src; // src attribute holds the full-size file. if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(url).then(toast, function () { fallbackCopy(url); diff --git a/fp-genocide-maps.php b/fp-genocide-maps.php index 11e6c93..dc7a2ff 100644 --- a/fp-genocide-maps.php +++ b/fp-genocide-maps.php @@ -3,7 +3,7 @@ * Plugin Name: FP Genocide Maps * Plugin URI: https://freepress.coop * Description: Manages the "Architecture of Genocide" maps shown on the home page. Each map is a post (title + description + image); the [geep_maps] shortcode renders the accordion + map image replicating the original Divi design, swapping the image when a toggle is opened. - * Version: 1.5.2 + * Version: 1.6.0 * Author: Freepress Coop * Author URI: https://www.freepress.coop * Requires PHP: 7.4 @@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) { } const FPGM_CPT = 'geep_map'; -const FPGM_VERSION = '1.5.2'; +const FPGM_VERSION = '1.6.0'; /** * Register the Map custom post type (admin-only, not publicly queryable). @@ -155,7 +155,7 @@ function fpgm_shortcode() { // UI labels for the lightbox, in the language of the current page. $is_ar = 'ar' === apply_filters( 'wpml_current_language', null ); $labels = array( - 'share' => $is_ar ? 'مشاركة الخريطة' : 'Share map', + 'copy' => $is_ar ? 'نسخ رابط الخريطة' : 'Copy map URL', 'copied' => $is_ar ? 'تم نسخ الرابط' : 'Link copied!', 'close' => $is_ar ? 'إغلاق' : 'Close', 'zoom' => $is_ar ? 'عرض الخريطة بحجم أكبر' : 'View map larger',