From 649e4c3e840c66aba52f305af4f25dbfec70de26 Mon Sep 17 00:00:00 2001 From: asus Date: Fri, 24 Nov 2023 16:42:11 +0100 Subject: [PATCH] some modifications for the iframe version --- srcs/plugins/map_prof/scripts/mp_create_map.js | 4 ++-- srcs/plugins/map_prof/scripts/mp_info_window.js | 2 +- srcs/plugins/map_prof/srcs/map/mp_get_events.php | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/srcs/plugins/map_prof/scripts/mp_create_map.js b/srcs/plugins/map_prof/scripts/mp_create_map.js index ead03cc..9a22ddf 100644 --- a/srcs/plugins/map_prof/scripts/mp_create_map.js +++ b/srcs/plugins/map_prof/scripts/mp_create_map.js @@ -25,8 +25,8 @@ function create_map(map_div) { scaleControl: true, zoom: map_zoom, - //gestureHandling: "cooperative", - gestureHandling: "greedy", + gestureHandling: "cooperative", + //gestureHandling: "greedy", //gestureHandling: "none", //gestureHandling: "auto", diff --git a/srcs/plugins/map_prof/scripts/mp_info_window.js b/srcs/plugins/map_prof/scripts/mp_info_window.js index 062d72e..8dca77e 100644 --- a/srcs/plugins/map_prof/scripts/mp_info_window.js +++ b/srcs/plugins/map_prof/scripts/mp_info_window.js @@ -21,7 +21,7 @@ function attach_info_window(map, marker, events, infowindow) { //lejourdesprofs.org //local_lejourduprof.com window_content += ` - +

${events[key].title}

`; diff --git a/srcs/plugins/map_prof/srcs/map/mp_get_events.php b/srcs/plugins/map_prof/srcs/map/mp_get_events.php index f572a8c..2704b0e 100644 --- a/srcs/plugins/map_prof/srcs/map/mp_get_events.php +++ b/srcs/plugins/map_prof/srcs/map/mp_get_events.php @@ -135,8 +135,10 @@ function mp_fill_fields_value($id) { } // add post url + /* iframe version modification : hiding it now $event->url = get_post_permalink($id); - mp_console_log($event->url); + */ + return $event; } @@ -149,6 +151,10 @@ function mp_get_published_events() { $event = mp_fill_fields_value($post->ID); $event->id = $post->ID; $event->title = trim($post->post_title, " "); + + // iframe version modification : doing it now instead of inside mp_fill_fields_value() + $event->url = "https://lejourdesprofs.org/" . get_page_uri($post->ID); + $event->index = null; array_push($events, $event); }