From dfac27dfaa84329699c978487f2f2d038771dc42 Mon Sep 17 00:00:00 2001
From: 2Abendsegler <2Abendsegler@users.noreply.github.com>
Date: Sat, 5 Feb 2022 02:20:50 +0100
Subject: [PATCH 1/7] [Cache Listing / Browse Map / Search Map] Log totals are
no longer displayed correct.
#2044
3. Die Log Totals im Popup der Browse Map werden nicht mehr korrekt dargestellt.
---
gc_little_helper_II.user.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/gc_little_helper_II.user.js b/gc_little_helper_II.user.js
index 4898e768d..afd049f1b 100644
--- a/gc_little_helper_II.user.js
+++ b/gc_little_helper_II.user.js
@@ -10544,6 +10544,7 @@ var mainGC = function() {
css += "div.gclh_latest_log:hover span, span.gclh_cache_note:hover span {font-size: 13px; display: block; top: 16px; border: 1px solid #8c9e65; background-color:#dfe1d2; z-index:10000;}";
css += "span.premium_only img {margin-right:0px;}";
css += "#ownBMLsCount {cursor: default;} .map-item .send2gps img {margin-right: 0px;}";
+ css += ".LogTotals, .LogTotals li {display: inline-block; margin: 0;} .LogTotals li {margin-right: 5px;}";
if (browser == 'firefox') css += ".gclh_owner {max-width: 110px;} .map-item h4 a {max-width: 265px;} .gclh_owner, .map-item h4 a {display: inline-block; white-space: nowrap; overflow: -moz-hidden-unscrollable; text-overflow: ellipsis;}";
appendCssStyle(css);
@@ -10629,8 +10630,9 @@ var mainGC = function() {
}
// Get all type of logs and their count.
- var all_logs = $(text).find('.LogTotals')[0].innerHTML.replace(/alt="(.*?)"/g, "alt=\"...\"");
-
+ if ($(text).find('#ctl00_ContentBody_lblFindCounts')[0]) {
+ var all_logs = $(text).find('#ctl00_ContentBody_lblFindCounts')[0].innerHTML.replace(/alt="(.*?)"/g, "alt=\"...\"").replace(/ /g, " ");
+ } else var all_logs = '';
// Get the number of trackables in the cache.
var trachables = 0;
$(text).find('.CacheDetailNavigationWidget').each(function(){
@@ -10661,7 +10663,7 @@ var mainGC = function() {
else var place = $(text).find('#ctl00_ContentBody_Location')[0].innerHTML.replace(/(.*?)\s/,'');
// Put all together.
- var new_text = 'Logs:' + all_logs.replace(/ /g, " ") + '
';
+ var new_text = 'Logs:' + all_logs + '
';
new_text += $(last_logs).prop('outerHTML');
new_text += '
';
if (settings_show_country_in_place) new_text += '' + place + ' | ';
From 067d976af0138905317d25a5b7200b081e028e66 Mon Sep 17 00:00:00 2001
From: 2Abendsegler <2Abendsegler@users.noreply.github.com>
Date: Sat, 5 Feb 2022 02:23:28 +0100
Subject: [PATCH 2/7] [Cache Listing / Browse Map / Search Map] Log totals are
no longer displayed correct.
#2044
3. Die Log Totals im Popup der Browse Map werden nicht mehr korrekt dargestellt.
---
gc_little_helper_II.user.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/gc_little_helper_II.user.js b/gc_little_helper_II.user.js
index afd049f1b..6f366f8cc 100644
--- a/gc_little_helper_II.user.js
+++ b/gc_little_helper_II.user.js
@@ -10633,6 +10633,7 @@ var mainGC = function() {
if ($(text).find('#ctl00_ContentBody_lblFindCounts')[0]) {
var all_logs = $(text).find('#ctl00_ContentBody_lblFindCounts')[0].innerHTML.replace(/alt="(.*?)"/g, "alt=\"...\"").replace(/ /g, " ");
} else var all_logs = '';
+
// Get the number of trackables in the cache.
var trachables = 0;
$(text).find('.CacheDetailNavigationWidget').each(function(){
From 2ecb9f3b76c7192b075efd03045b43cd3acf54b4 Mon Sep 17 00:00:00 2001
From: capoaira
Date: Sun, 6 Mar 2022 21:34:54 +0100
Subject: [PATCH 3/7] Search Map
---
gc_little_helper_II.user.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/gc_little_helper_II.user.js b/gc_little_helper_II.user.js
index 6f366f8cc..c83e83ea9 100644
--- a/gc_little_helper_II.user.js
+++ b/gc_little_helper_II.user.js
@@ -9947,6 +9947,7 @@ var mainGC = function() {
css += '#searchmap_sidebar_enhancements .gclh_link:hover {color: #02874d;}';
css += '#searchmap_sidebar_enhancements a {color: #4a4a4a; text-decoration: none;}';
css += '#searchmap_sidebar_enhancements img {vertical-align: bottom; height: 14px;}';
+ css += "#searchmap_sidebar_enhancements li {display: inline-block; margin-right: 5px;}";
// GClh Action Bar (Save as PQ and Hide Header Buttons).
css += '#gclh_action_bar {display: flex; color: #4a4a4a; cursor: default;}'
css += '.geocache-action-bar.sidebar-control {padding-top: 0px !important;}';
From 3ea0c966285c110302b4551bf564beb71262c504 Mon Sep 17 00:00:00 2001
From: capoaira
Date: Mon, 7 Mar 2022 19:46:13 +0100
Subject: [PATCH 4/7] Log Totals on Logs
---
gc_little_helper_II.user.js | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/gc_little_helper_II.user.js b/gc_little_helper_II.user.js
index c83e83ea9..7bdc9b1b2 100644
--- a/gc_little_helper_II.user.js
+++ b/gc_little_helper_II.user.js
@@ -7473,8 +7473,8 @@ var mainGC = function() {
// Filter logs.
function gclh_filter(logs) {
function gclh_filter_logs() {
- if (!this.childNodes[0]) return false;
- var log_type = this.childNodes[0].title;
+ if (!this.childNodes[0].childNodes[0]) return false;
+ var log_type = this.childNodes[0].childNodes[0].title;
if (!log_type) return false;
if (log_type.match(/VIP/)) log_type = "VIP";
if (this.name && this.name == "vip_list") {
@@ -7502,21 +7502,20 @@ var mainGC = function() {
if (!document.getElementById("ctl00_ContentBody_lblFindCounts").childNodes[0]) return false;
var legend = document.getElementById("ctl00_ContentBody_lblFindCounts").childNodes[0];
- var new_legend = document.createElement("p");
+ var new_legend = document.createElement("ul");
new_legend.className = "LogTotals";
for (var i = 0; i < legend.childNodes.length; i++) {
- if (legend.childNodes[i].tagName == "IMG") {
- var link = document.createElement("a");
- link.setAttribute("href", "javascript:void(0);");
- link.style.textDecoration = 'none';
- link.addEventListener("click", gclh_filter_logs, false);
- link.appendChild(legend.childNodes[i].cloneNode(true));
- i++;
- link.appendChild(legend.childNodes[i].cloneNode(true));
- new_legend.appendChild(link);
- }
+ var li = document.createElement("li");
+ var link = document.createElement("a");
+ link.setAttribute("href", "javascript:void(0);");
+ link.style.textDecoration = 'none';
+ link.addEventListener("click", gclh_filter_logs, false);
+ link.appendChild(legend.childNodes[i].cloneNode(true));
+ li.appendChild(link);
+ new_legend.appendChild(li);
}
if (settings_show_vip_list) {
+ var li = document.createElement("li");
var link = document.createElement("a");
link.setAttribute("href", "javascript:void(0);");
link.setAttribute("style", "text-decoration: 'none'; padding-right: 18px;");
@@ -7526,7 +7525,8 @@ var mainGC = function() {
img.setAttribute("src", global_logs_vip_icon);
img.setAttribute("title", "VIP logs");
link.appendChild(img);
- new_legend.appendChild(link);
+ li.appendChild(link);
+ new_legend.appendChild(li);
}
document.getElementById('ctl00_ContentBody_lblFindCounts').replaceChild(new_legend, legend);
if (document.getElementById("lnk_gclh_vip_list")) {
@@ -7632,8 +7632,8 @@ var mainGC = function() {
activateLoadAndSearch();
}
- if (!$('#ctl00_ContentBody_lblFindCounts p')[0]) return false;
- $('#ctl00_ContentBody_lblFindCounts p').append('Search in logs: ');
+ if (!$('#ctl00_ContentBody_lblFindCounts ul')[0]) return false;
+ $('#ctl00_ContentBody_lblFindCounts ul').append('Search in logs: ');
if (!settings_add_search_in_logs_func) $('#search_logs')[0].style.display = 'none';
$('#search_logs').append('');
$('#search_logs_input')[0].addEventListener("keyup", gclh_search_logs, false);
@@ -12692,7 +12692,7 @@ var mainGC = function() {
for (var i = 0; i < logTypes.length; i++) {
var matches = logTypes[i].innerHTML.replace(/(,|\.)/g, "").match(/>(\s*)(\d+)/);
if (matches && matches[2]) {
- logCounter[logTypes[i].childNodes[0].title] = parseInt(matches[2]);
+ logCounter[logTypes[i].childNodes[0].childNodes[0].title] = parseInt(matches[2]);
logCounter["all"] += parseInt(matches[2]);
}
}
From 0db27b4bf5d52c802a0f6228475acc0b6cdaff86 Mon Sep 17 00:00:00 2001
From: capoaira
Date: Mon, 7 Mar 2022 19:56:00 +0100
Subject: [PATCH 5/7] Log Totals on the Top on cache listing
---
gc_little_helper_II.user.js | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/gc_little_helper_II.user.js b/gc_little_helper_II.user.js
index 7bdc9b1b2..6c4c4fab2 100644
--- a/gc_little_helper_II.user.js
+++ b/gc_little_helper_II.user.js
@@ -2146,7 +2146,7 @@ var mainGC = function() {
var div = document.createElement('div');
div.className = "gclh_LogTotals Clear";
var span = document.createElement('span');
- span.innerHTML = $('.LogTotals')[0].innerHTML.replace(/alt="(.*?)"/g, "alt=\" \"").replace(/( ){5}/g, " ");
+ span.innerHTML = $('.LogTotals')[0].outerHTML;
div.appendChild(span);
$('#ctl00_ContentBody_size')[0].parentNode.insertBefore(div, $('#ctl00_ContentBody_size')[0].nextSibling.nextSibling.nextSibling);
appendCssStyle('.gclh_LogTotals {float: right;} .gclh_LogTotals img {vertical-align: bottom;}');
@@ -7545,18 +7545,17 @@ var mainGC = function() {
}
if (!$('.gclh_LogTotals')[0] || !$('.gclh_LogTotals')[0].childNodes[0]) return;
var legend = $('.gclh_LogTotals')[0].childNodes[0];
- var new_legend = document.createElement('span');
+ var new_legend = document.createElement('ul');
+ new_legend.className = "LogTotals";
for (var i = 0; i < legend.childNodes.length; i++) {
- if (legend.childNodes[i].tagName == "IMG") {
- var link = document.createElement("a");
- link.setAttribute("href", clearUrlAppendix(document.location.href, false) + 'logs_section');
- link.style.textDecoration = 'none';
- link.addEventListener("click", gclh_filter_logs, false);
- link.appendChild(legend.childNodes[i].cloneNode(true));
- i++;
- link.appendChild(legend.childNodes[i].cloneNode(true));
- new_legend.appendChild(link);
- }
+ var li = document.createElement("li");
+ var link = document.createElement("a");
+ link.setAttribute("href", clearUrlAppendix(document.location.href, false) + 'logs_section');
+ link.style.textDecoration = 'none';
+ link.addEventListener("click", gclh_filter_logs, false);
+ link.appendChild(legend.childNodes[i].cloneNode(true));
+ li.appendChild(link);
+ new_legend.appendChild(li);
}
$('.gclh_LogTotals')[0].replaceChild(new_legend, legend);
}
From 26de7a26faee5577ad9b68509bf98b6eee5a79d4 Mon Sep 17 00:00:00 2001
From: 2Abendsegler <2Abendsegler@users.noreply.github.com>
Date: Tue, 8 Mar 2022 08:18:04 +0100
Subject: [PATCH 6/7] Ausrichtung Log Counter im Cache Listing oben und unten
---
gc_little_helper_II.user.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gc_little_helper_II.user.js b/gc_little_helper_II.user.js
index 6c4c4fab2..da55c2f89 100644
--- a/gc_little_helper_II.user.js
+++ b/gc_little_helper_II.user.js
@@ -2149,7 +2149,7 @@ var mainGC = function() {
span.innerHTML = $('.LogTotals')[0].outerHTML;
div.appendChild(span);
$('#ctl00_ContentBody_size')[0].parentNode.insertBefore(div, $('#ctl00_ContentBody_size')[0].nextSibling.nextSibling.nextSibling);
- appendCssStyle('.gclh_LogTotals {float: right;} .gclh_LogTotals img {vertical-align: bottom;}');
+ appendCssStyle('.gclh_LogTotals {float: right;} .gclh_LogTotals img {vertical-align: bottom;} .LogTotals li + li {margin-left: 8px;} .LogTotals {margin-bottom: 0px;}');
} catch(e) {gclh_error("Show log totals symbols at the top",e);}
}
From aaa37ec3a93a9932e1917d1c96d7b93d0143694a Mon Sep 17 00:00:00 2001
From: capoaira
Date: Tue, 8 Mar 2022 09:44:34 +0100
Subject: [PATCH 7/7] little fix
---
gc_little_helper_II.user.js | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/gc_little_helper_II.user.js b/gc_little_helper_II.user.js
index da55c2f89..f61c17b08 100644
--- a/gc_little_helper_II.user.js
+++ b/gc_little_helper_II.user.js
@@ -7473,8 +7473,8 @@ var mainGC = function() {
// Filter logs.
function gclh_filter(logs) {
function gclh_filter_logs() {
- if (!this.childNodes[0].childNodes[0]) return false;
- var log_type = this.childNodes[0].childNodes[0].title;
+ if (!this.childNodes[0]) return false;
+ var log_type = this.childNodes[0].title;
if (!log_type) return false;
if (log_type.match(/VIP/)) log_type = "VIP";
if (this.name && this.name == "vip_list") {
@@ -7510,7 +7510,8 @@ var mainGC = function() {
link.setAttribute("href", "javascript:void(0);");
link.style.textDecoration = 'none';
link.addEventListener("click", gclh_filter_logs, false);
- link.appendChild(legend.childNodes[i].cloneNode(true));
+ link.appendChild(legend.childNodes[i].childNodes[0].cloneNode(true));
+ link.appendChild(legend.childNodes[i].childNodes[1].cloneNode(true));
li.appendChild(link);
new_legend.appendChild(li);
}
@@ -7547,13 +7548,14 @@ var mainGC = function() {
var legend = $('.gclh_LogTotals')[0].childNodes[0];
var new_legend = document.createElement('ul');
new_legend.className = "LogTotals";
- for (var i = 0; i < legend.childNodes.length; i++) {
+ for (var i = 0; i < legend.childNodes[0].childNodes.length; i++) {
var li = document.createElement("li");
var link = document.createElement("a");
link.setAttribute("href", clearUrlAppendix(document.location.href, false) + 'logs_section');
link.style.textDecoration = 'none';
link.addEventListener("click", gclh_filter_logs, false);
- link.appendChild(legend.childNodes[i].cloneNode(true));
+ link.appendChild(legend.childNodes[0].childNodes[i].childNodes[0].cloneNode(true));
+ link.appendChild(legend.childNodes[0].childNodes[i].childNodes[1].cloneNode(true));
li.appendChild(link);
new_legend.appendChild(li);
}
@@ -12687,11 +12689,11 @@ var mainGC = function() {
setTimeout(function() {
var logCounter = new Object();
logCounter["all"] = 0;
- var logTypes = $('.LogTotals a');
+ var logTypes = $('#ctl00_ContentBody_lblFindCounts .LogTotals a');
for (var i = 0; i < logTypes.length; i++) {
var matches = logTypes[i].innerHTML.replace(/(,|\.)/g, "").match(/>(\s*)(\d+)/);
if (matches && matches[2]) {
- logCounter[logTypes[i].childNodes[0].childNodes[0].title] = parseInt(matches[2]);
+ logCounter[logTypes[i].childNodes[0].title] = parseInt(matches[2]);
logCounter["all"] += parseInt(matches[2]);
}
}