magma1447 / greasemonkey-geocaching-projectgc

Adds links and data to Geocaching.com to make it collaborate with Project-GC.com
MIT License
18 stars 14 forks source link

Settings menu now reloading page #108

Closed magma1447 closed 2 years ago

magma1447 commented 2 years ago

The settings menu now reloads the page. At least when viewing a cache page.

PleuPleu commented 2 years ago

This has been an issue for about a year, I thought it was mentioned here earlier but apparently it wasn't. There are a couple of pages were it works as it should, for example https://www.geocaching.com/play/search and https://www.geocaching.com/account/settings/profile but on all other pages it reloads. I haven't figured out the difference between these and other pages, but somebody with better knowledge of the script might be able to.

rteitelman commented 2 years ago

Can someone clarify this? I cannot reproduce any error. If I am displaying a cache page, and then go to "Settings" (via the down arrow drop down in the upper right, with three choices: Settings, Help Center, and Sign Out" , it all looks fine to me. That said, I believe this is the error user TTO2 was trying to explain to me. But I can't reproduce any issue. Make sure you are running the current latest version of the script, 2.3.14

PleuPleu commented 2 years ago

rteitelman

The settings-menu for the Project-GC script itself, not the Settings-menu for the general site. It's the down arrow drop down that is positioned between the "Message Center speech bubble" and the Project-GC Profile stats link, not the one to the furthest right.

I have the most recent version of the script and this is still broken. You have to visit the specific previously linked pages to be able to change the settings for the script.

rteitelman commented 2 years ago

OK, I see it now. I will explore with my cohort to see what he thinks.

On Tue, Aug 23, 2022 at 4:13 PM PleuPleu @.***> wrote:

rteitelman

The settings-menu for the Project-GC script itself, not the Settings-menu for the general site. It's the down arrow drop down that is positioned between the "Message Center speech bubble" and the Project-GC Profile stats link, not the one to the furthest right.

I have the most recent version of the script and this is still broken. You have to visit the specific previously linked pages to be able to change the settings for the script.

— Reply to this email directly, view it on GitHub https://github.com/magma1447/greasemonkey-geocaching-projectgc/issues/108#issuecomment-1224892925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQF3ITNCS34UJKIEHY75I5DV2U5GHANCNFSM5UITCUEQ . You are receiving this because you commented.Message ID: @.*** com>

rteitelman commented 2 years ago

The PGC Settings menu is also displaying as two columns when it pops up, with the first column being cut off as it's to the left of my screen. To at least be able to see the whole list of 29 settings, I changed the number of columns from 2 to 1. around line 389. Its a long line I can't display in Github but it starts:

var settings =

from: columns: 2

to: columns: 1

rteitelman commented 2 years ago

This one is sure a mystery. But if all else fails, could we do this? from whatever geocaching.com page the user is on when they click on the Big down arrow script settings button, immediately switch the page to a page that doesn't have the reload issue such as "https://www.geocaching.com/play/search" and THEN display the Settings Menu?

GeekNJ commented 2 years ago

The 2 columns should be fine but the dialog that opens needs to be moved right under the drop down that opens it. I'm not sure on all screen sizes what is best, but it definitely is initially positioned too far left. Image posted below.

GeekNJ commented 2 years ago

Setting_Menu

rteitelman commented 2 years ago

I just changed back the columns from 1 to 2. AND then changed this line under GM_addStyle (around line 397):

pgcUserMenu, #pgcUserMenu_gclh { right: 19rem; }\

to read "1rem" instead of "19rem".

Now two columns fit on my screen. Screenshot 2022-08-24 133034

rteitelman commented 2 years ago

well, since selecting the settings menu from the page '/play/search' works fine, right before the line that selects the settings $('#pgcUserMenu').show();

I inserted the statement "path = /play/search"

then I went to a random gc page such as "https://www.geocaching.com/geocache/GC8PFP8_poison-spiders" and selected the settings button. It did NOT work. The settings menu popped up but then the cache page reloaded and the settings menu disappeared. So that theory did not pan out.

capoaira commented 2 years ago

I have never received so many notifications on this repo since I've been watch this 🤣😅 I'm a developer of the GClh and also did the last changes here on the menu (so maybe one of these has caused the bug). Sadly, the header work on some pages different to others, so perhaps we had to add different css to different pages and have to rename some classes or IDs.

rteitelman commented 2 years ago

What is GClh? I see it referenced in the code, and I suspect it has something to do with this issue.

In the browser console, I see lots of these errors, but I guess must be related to this issue? I am not a java guy by any means....

Screenshot 2022-08-26 074537

capoaira commented 2 years ago

What is GClh? I see it referenced in the code, and I suspect it has something to do with this issue.

The GC little helper (GClh) is a js extension like this one, which improves the website a lot. Have a look at https://github.com/2Abendsegler/GClh Because we change a lot, we have sometimes troubles with other scripts like this, GCTour or send2cgeo.

In the browser console, I see lots of these errors, but I guess must be related to this issue?

I cannot confirm these errors. The upper right corner of an error message should show which script is causing it. Could you upload a screenshot with this information?

I am not a java guy by any means....

Off-topic: Java and JavaScript are complete different languages, just the name is similar 😉

rteitelman commented 2 years ago

well, I think the script causing it is background.js . :1 and :49 - whatever that means.

Screenshot 2022-08-26 074537

rteitelman commented 2 years ago

right side of the java console browser window.
Screenshot 2022-08-26 084016

rteitelman commented 2 years ago

It appears to me that GClh is another greasemonkey script which does additional things to the cache page, but wouldn't I have had to install it to make it run? I didn't and if I test this line in the project-gc/gm script: if ($('#GClh_II_running')[0] && $('gclh_nav#ctl00_gcNavigation')[0]) {

it looks like its not true, so GClh is not the issue here. Am I right?

rteitelman commented 2 years ago

well, that one error: "g_CS(e) is null" from background.js and there is this in the script: " $("#pgcUserMenuButton").click(function(e) { $('#pgcUserMenu').show(); })

is "e" an issue?

capoaira commented 2 years ago

it looks like its not true, so GClh is not the issue here. Am I right?

Yes

is "e" an issue?

e is a often used name for a variable for some events. I'm pretty sure that both e's have nothing to do with each other. But you're right that something in this quoted code caused the bug ...

But I'm not sure about your consol error. I have the same bug, but without the console errors

cghove commented 2 years ago

To prevent reloading of geocache page when opening PGC settings, add e.preventDefault(); to line 436 (as of v. 2.3.18) image Also different topic I know, but not sure what the intended image is supposed to be here: #pgcUserMenuForm button:hover, #pgcUserMenuForm_gclh button:hover { background: #e4d8cb url(images/ui-bgflag_100_e4d8cb_40x100.png) 50% 50% repeat-x !important; }\ But it doesn't exist

rteitelman commented 2 years ago

I just tested, and it works for me. How bout that! With a cache page open, I select the script settings menu and the page no longer reloads. Nice work, cghove.

capoaira commented 2 years ago

I've just installed the newest version, but the bug is still there on cache pages.

rteitelman commented 2 years ago

I just now loaded 2.3.19, tested, and I see the issue as fixed. Here's the settings menu being displayed on a cache page. Before the settings menu would disappear within a second, and the cache page would be reloaded.

Screenshot 2022-09-05 093836

cghove commented 2 years ago

Are you running any other scripts, that could interferens?

man. 5. sep. 2022, 16:39 skrev rteitelman @.***>:

I loaded it, tested, and I see the issue as fixed. Here's the settings menu being displayed on a cache page. [image: Screenshot 2022-09-05 093836] https://user-images.githubusercontent.com/67875917/188473521-d35c925a-2fd8-4e5a-a481-075f147dbefa.jpg

— Reply to this email directly, view it on GitHub https://github.com/magma1447/greasemonkey-geocaching-projectgc/issues/108#issuecomment-1237142273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGIGLO2I3SEZDEEBYTZJ4ITV4YA2XANCNFSM5UITCUEQ . You are receiving this because you commented.Message ID: @.*** com>

capoaira commented 2 years ago

Ok, found the Issue: With the GClh it does not work. Without, this issue is fixed. I'll open a new issue, and maybe I find some time next week to take a look into it.

rteitelman commented 2 years ago

What does the Geocaching Little Helper (GClh) greasemonkey script do that is not done by this Project-GC script?

On Mon, Sep 5, 2022 at 9:47 AM capoaira @.***> wrote:

Ok, found the Issue: With the GClh it does not work. Without, this issue is fixed. I'll open a new issue, and maybe I find some time next week to take a look into it.

— Reply to this email directly, view it on GitHub https://github.com/magma1447/greasemonkey-geocaching-projectgc/issues/108#issuecomment-1237153282, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQF3ITMOYL3U7HIRP7NBMGLV4YBXDANCNFSM5UITCUEQ . You are receiving this because you commented.Message ID: @.*** com>

magma1447 commented 2 years ago

What does the Geocaching Little Helper (GClh) greasemonkey script do that is not done by this Project-GC script?

A lot. It's older than Project-GC itself. But also does a lot that would be considered out of scope for Project-GC. But it's great if they are compatible.