Geocaching Fix Log Page Reload
When entering an "Update Coordinates" log, this script automatically enables the coordinates input boxes. If you subsequently disable those input boxes, the script will warn you that the log won't work.
Groundspeak has re-written the functionality of the Update Coordinates log in relation to the "Add a Waypoint to the log" several times. They just can't seem to get it right. As of March, 2010, it's pretty close, but still missing one important piece. This script fills in that blank.
Part of the June 24, 2009 website update was:
- Forced "add a waypoint to the log" checkbox when "update coordinates" is selected from the log type dropdown when logging a cache.
- When adding a waypoint to a log the coordinate entry field will now auto-populate the cache's coordinates.
The 1st change noted above introduced the page refresh when selecting a log type. Basically the page is calling back to the server with the newly selected log type, and the server would serve up the page again. If the new log type is "Update Coordinates" then the "Add a waypoint to the log" box would get enabled automatically and the coordinate input boxes would be shown. For all other log types there was no change to the page, but it would still refresh.
The 2nd change noted above is actually a nice feature, because if you're only changing one or two digits, you don't have to re-type the whole thing.
However, by the next day, there were several posts in the thread noting a) displeasure with the page refresh, and b) that the auto-population of the coordinates was working too well; it would ignore what you typed and change them back after you edited them.
Groundspeak quickly got out a hotfix for the coordinate change bug, allowing changes to actually work again.
It wasn't until the July 28, 2009 website update when they finally got rid of the annoying refresh:
- 11214: No postback when selecting cache log type please - Rolled back change which introduced this bug.
However, it quickly became apparent that this "rollback" also brought back the coordinate change bug.
Shortly after midnight that night, Raine fixed the coordinate change bug. OpinioNate later clarified that "The fix was to simply roll back the new code." In other words, he rolled back the rollback, and brought back the refresh. The least of the evils, I guess.
Looking at the past release schedule, I estimate that they'll get out another website update in mid- to late-August, when they'll hopefully get these two issues to work correctly together. In the meantime, I wanted to see if I could pound out a quick fix with Greasemonkey. It was actually quite easy. Instead of calling back to the server every time a log type is selected, it will now only call back if the newly selected log type is "Update Coordinates." I'm guessing this is how Groundspeak will fix it in a week or two, even though there is a much better way to handle it, without calling back to the server at all.
August 13, 2009 Update:
They released an update today which removed the reload. Problem is, they didn't leave the reload in for the one case that really needs it: when you select the Update Coordinates log. So version 2.0 of this script adds that simple functionality back in.
January 12, 2010 Update:
Groundspeak released a major update today. It didn't specifically address the problem this script was designed to fix, but some unrelated changes on the log page broke this script. I put out a minor update to get it working again.
February 24, 2010 Update:
Another update came out today. They don't mention any changes to the log type or coordinate input functionality, but something changed. My script was still sort-of working, so I didn't notice the issue right away. A week later I was changing the coordinates on one of my own caches and noticed things weren't working quite right. I banged out a fix which makes the page work smooth again.
2.3 - 2010/06/08
- Minor logic change for smoother operation. Don't show error message when reloading automatically.
- Don't need to run on benchmark or travel bug log pages.
2.2 - 2010/03/02
- Instead of doing a postback with the changed Log Type, click the checkbox automatically, which in turn triggers a postback. This seems to be more reliable.
- Show a warning if the user disables the coordinates when entering an Update Coordinates log.
- Fix error that occurred when just viewing a log.
- Now compatible with Opera when used with the GM compatibility functions by TarquinWJ. Other browsers untested but should also work.
2.1 - 2010/01/12 - Reworked to accommodate website changes.
2.0 - 2009/09/01 - Reworked logic after a website change.
- Add postback for when Update Coordinates log type is selected.
- Make sure the "Add a waypoint" checkbox is checked after Update Coordinates is selected.
1.0 - 2009/08/11 - Initial release.