From 4d74b2a74efc5772be09760aea598ce8192a00b7 Mon Sep 17 00:00:00 2001 From: 2Abendsegler <2Abendsegler@users.noreply.github.com> Date: Thu, 29 Sep 2022 02:59:38 +0200 Subject: [PATCH 1/2] gclh_build_vipvupmail run into issues if settings_show_vip_list is off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prüfung ob VIP aktiv fehlte bei - Cache Zusatzdaten auf Search Map - Cache Zusatzdaten auf Browse Map --- gc_little_helper_II.user.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/gc_little_helper_II.user.js b/gc_little_helper_II.user.js index c0a00c557..b2bbdfb57 100644 --- a/gc_little_helper_II.user.js +++ b/gc_little_helper_II.user.js @@ -9308,6 +9308,7 @@ var mainGC = function() { // Add VIP, VUP and mail icon to owner. function addVipVupMailToOwner() { + if (!settings_show_vip_list) return; if (($('.gclhOwner a')[0] && !$('.gclhOwner .gclh_vip')[0]) || (!$('.gclhOwner a')[0] && $('.geocache-owner-name a')[0] && !$('.geocache-owner-name .gclh_vip')[0])) { var user = $('.gclhOwner a, .geocache-owner-name a')[0].href.match(/https?:\/\/www\.geocaching\.com\/(profile|p)\/\?u=(.*)/); if (user && user[2]) { @@ -11066,15 +11067,17 @@ var mainGC = function() { guid = side.attr('href').substring(15,36+15); username = side.text(); buildSendIcons(side[0], username, "per guid", guid); - var link = gclh_build_vipvup(username, global_vips, "vip"); - link.children[0].style.marginLeft = "5px"; - link.children[0].style.marginRight = "3px"; - side[0].appendChild(link); - // Build VUP Icon. - if (settings_process_vup && username != global_activ_username) { - link = gclh_build_vipvup(username, global_vups, "vup"); - link.children[0].setAttribute("style", "margin-left: 0px; margin-right: 0px"); + if (settings_show_vip_list) { + var link = gclh_build_vipvup(username, global_vips, "vip"); + link.children[0].style.marginLeft = "5px"; + link.children[0].style.marginRight = "3px"; side[0].appendChild(link); + // Build VUP Icon. + if (settings_process_vup && username != global_activ_username) { + link = gclh_build_vipvup(username, global_vups, "vup"); + link.children[0].setAttribute("style", "margin-left: 0px; margin-right: 0px"); + side[0].appendChild(link); + } } addCopyToClipboardLink(gccode, $(this).find('h4')[0], "GC Code", "float: right;"); }); From 3563be80febfe55957733f4efd4f675286fde236 Mon Sep 17 00:00:00 2001 From: 2Abendsegler <2Abendsegler@users.noreply.github.com> Date: Sun, 2 Oct 2022 12:14:44 +0200 Subject: [PATCH 2/2] eMail Icon aufbauen --- gc_little_helper_II.user.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gc_little_helper_II.user.js b/gc_little_helper_II.user.js index b2bbdfb57..452678b21 100644 --- a/gc_little_helper_II.user.js +++ b/gc_little_helper_II.user.js @@ -9308,8 +9308,7 @@ var mainGC = function() { // Add VIP, VUP and mail icon to owner. function addVipVupMailToOwner() { - if (!settings_show_vip_list) return; - if (($('.gclhOwner a')[0] && !$('.gclhOwner .gclh_vip')[0]) || (!$('.gclhOwner a')[0] && $('.geocache-owner-name a')[0] && !$('.geocache-owner-name .gclh_vip')[0])) { + if (($('.gclhOwner a')[0] && !$('.gclhOwner .gclh_vip')[0] && !$('.gclhOwner a[href*="email"]')[0]) || (!$('.gclhOwner a')[0] && $('.geocache-owner-name a')[0] && !$('.geocache-owner-name .gclh_vip')[0] && !$('.geocache-owner a[href*="email"]')[0])) { var user = $('.gclhOwner a, .geocache-owner-name a')[0].href.match(/https?:\/\/www\.geocaching\.com\/(profile|p)\/\?u=(.*)/); if (user && user[2]) { if ($('.gclh-cache-link')[0] && $('.gclh-cache-link')[0].childNodes[1] && $('.gclh-cache-link')[0].childNodes[1].data && $('.cache-metadata-code')[0]) { @@ -9317,8 +9316,13 @@ var mainGC = function() { global_code = $('.cache-metadata-code')[0].innerHTML; global_link = 'https://coord.info/' + global_code; } - if ($('.gclhOwner a')[0]) gclh_build_vipvupmail($('.gclhOwner a')[0], decodeUnicodeURIComponent(user[2])); - else gclh_build_vipvupmail($('.geocache-owner-name a')[0], decodeUnicodeURIComponent(user[2])); + if (settings_show_vip_list) { + if ($('.gclhOwner a')[0]) gclh_build_vipvupmail($('.gclhOwner a')[0], decodeUnicodeURIComponent(user[2])); + else gclh_build_vipvupmail($('.geocache-owner-name a')[0], decodeUnicodeURIComponent(user[2])); + } else { + if ($('.gclhOwner a')[0]) buildSendIcons($('.gclhOwner a')[0], decodeUnicodeURIComponent(user[2]), "per u"); + else buildSendIcons($('.geocache-owner-name a')[0], decodeUnicodeURIComponent(user[2]), "per u"); + } } } }