// ==UserScript== // @name GC little helper II // @description Some little things to make life easy (on www.geocaching.com). //--> $$000 // @version 0.15.8 //<-- $$000 // @copyright 2010-2016 Torsten Amshove, 2016-2024 2Abendsegler, 2017-2021 Ruko2010, 2019-2024 capoaira // @author Torsten Amshove; 2Abendsegler; Ruko2010; capoaira // @license GNU General Public License v2.0 // @supportURL https://github.com/2Abendsegler/GClh/issues // @namespace http://www.amshove.net // @charset UTF-8 // @icon https://raw.githubusercontent.com/2Abendsegler/GClh/master/images/gclh_logo.png // @match https://www.geocaching.com/* // @match https://project-gc.com/Tools/PQSplit* // @match https://www.openstreetmap.org/* // @match https://www.certitudes.org/* // @include https://maps.google.tld/* // @include https://www.google.tld/maps* // @include https://www.google.tld/search* // @exclude /^https?://www\.geocaching\.com/(login|jobs|careers|brandedpromotions|promotions|blog|help|seek/sendtogps|profile/profilecontent)/ // @require https://raw.githubusercontent.com/2Abendsegler/GClh/master/data/init.js // @require https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js // @require https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js // @require https://cdnjs.cloudflare.com/ajax/libs/dropbox.js/2.5.2/Dropbox-sdk.min.js // @require https://www.geocaching.com/scripts/MarkdownDeepLib.min.js // @require https://www.geocaching.com/scripts/SmileyConverter.js // @resource maincss https://raw.githubusercontent.com/2Abendsegler/GClh/master/data/main.css // @resource headerhtml https://raw.githubusercontent.com/2Abendsegler/GClh/master/data/header.html // @resource jscolor https://raw.githubusercontent.com/2Abendsegler/GClh/master/data/jscolor.js // @resource leafletjs https://raw.githubusercontent.com/2Abendsegler/GClh/master/data/leaflet.js // @resource leafletcss https://raw.githubusercontent.com/2Abendsegler/GClh/master/data/leaflet.css // @connect maps.googleapis.com // @connect raw.githubusercontent.com // @connect api.open-elevation.com // @connect api.geonames.org // @connect coord.info // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_log // @grant GM_xmlhttpRequest // @grant GM_getResourceText // @grant GM_info // @grant GM.info // @grant GM_addStyle // @grant GM_registerMenuCommand // ==/UserScript== ////////////////////////////////////// // 1. Declaration, Init, Start ($$cap) ////////////////////////////////////// var start = function(c) { checksBeforeRunning(); setTestLogConsole(); quitOnAdFrames() .then(function() {return jqueryInit(c);}) .then(function() {return browserInit(c);}) .then(function() {return constInit(c);}) .then(function() {return variablesInit(c);}) .done(function() { function checkBodyContent(waitCount) { if ($('body').children().length > 1 || ($('body').children().length == 1 && document.location.href.match(/^https:\/\/www\.certitudes\.org\/(certify|certitude\?wp=[A-Z0-9]{1,15})/))) { tlc('BodyContent found'); if (document.location.href.match(/^https:\/\/maps\.google\./) || document.location.href.match(/^https:\/\/www\.google\.[a-zA-Z.]*\/maps/)) { mainGMaps(); } else if (document.location.href.match(/^https:\/\/www\.google\.[a-zA-Z.]*\/search/)){ mainGSearch(); } else if (document.location.href.match(/^https:\/\/www\.openstreetmap\.org/)) { mainOSM(); } else if (document.location.href.match(/^https:\/\/www\.geocaching\.com/)) { mainGCWait(); } else if (document.location.href.match(/^https:\/\/project-gc\.com\/Tools\/PQSplit/)) { mainPGC(); } else if (document.location.href.match(/^https:\/\/www\.certitudes\.org\/(certify|certitude\?wp=[A-Z0-9]{1,15})/)) { mainCertitudes(); } } else {waitCount++; if (waitCount <= 5000) setTimeout(function(){checkBodyContent(waitCount);}, 10);} } tlc('START checkBodyContent'); checkBodyContent(0); }); }; var checksBeforeRunning = function() { if (typeof GM.info != "undefined" && typeof GM.info.scriptHandler != "undefined" && GM.info.scriptHandler == 'Greasemonkey') { var text = 'Sorry, the script GC little helper II does not run with script manager Greasemonkey. Please use the script manager Tampermonkey or an other similar script manager.\n\nDo you want to see the "Tips for the installation"?\n '; var url = 'https://github.com/2Abendsegler/GClh/blob/master/docu/tips_installation.md#en'; if (window.confirm(text)) window.open(url, '_blank'); throw Error('Abort because of GClh II installation under script manager Greasemonkey.'); } if (document.getElementsByTagName('head')[0] && document.getElementById('GClh_II_running')) { var text = 'Sorry, the script GC little helper II is already running. Please make sure that it runs only once.\n\nDo you want to see tips on how this could happen and what you can do about it?'; var url = 'https://github.com/2Abendsegler/GClh/blob/master/docu/faq.md#1-en'; if (window.confirm(text)) window.open(url, '_blank'); throw Error('Abort because of GClh II already running.'); } else appendMetaId("GClh_II_running"); function checkForOldGClh(waitCount) { var linklists = 0; $('gclh_nav ul li a.Dropdown').each(function() {if ($(this)[0].innerHTML == 'Linklist') linklists++;} ); if (linklists > 1) { var text = 'Sorry, the script GC little helper II does not run together with the OLDER GC little helper (without the "II").\n\nYou have installed also the older GC little helper as script in your script manager or as add on in your browser. This older GC little helper has not been maintained since 2016 and works not correctly.\n\nPlease delete this older GC little helper.\n'; alert(text); throw Error('Abort because of older GClh installation.'); } else {waitCount++; if (waitCount <= 20) setTimeout(function(){checkForOldGClh(waitCount);}, 500);} } checkForOldGClh(0); }; var setTestLogConsole = function() { test_log_console = GM_getValue('test_log_console', false); GM_setValue('test_log_console', test_log_console); }; var quitOnAdFrames = function(c) { tlc('START quitOnAdFrames'); var quitOnAdFramesDeref = new jQuery.Deferred(); if (window.name) { if (window.name.substring(0, 18) !== 'google_ads_iframe_') quitOnAdFramesDeref.resolve(); else quitOnAdFramesDeref.reject(); } else { quitOnAdFramesDeref.resolve(); } return quitOnAdFramesDeref.promise(); }; var jqueryInit = function(c) { tlc('START jqueryInit'); if (typeof c.$ === "undefined") c.$ = c.$ || unsafeWindow.$ || window.$ || null; if (typeof c.jQuery === "undefined") c.jQuery = c.jQuery || unsafeWindow.jQuery || window.jQuery || null; var jqueryInitDeref = new jQuery.Deferred(); jqueryInitDeref.resolve(); return jqueryInitDeref.promise(); }; var browserInit = function(c) { tlc('START browserInit'); var browserInitDeref = new jQuery.Deferred(); c.CONFIG = JSON.parse(GM_getValue("CONFIG", '{}')); if (test_log_console != getValue('settings_test_log_console', false)) setValue('settings_test_log_console', test_log_console); c.browser = (typeof(chrome) !== "undefined") ? "chrome" : "firefox"; c.GM_setValue("browser", c.browser); tlc('Browser is '+c.browser); if (typeof GM_info != "undefined" && typeof GM_info.scriptHandler != "undefined") c.scriptHandler = GM_info.scriptHandler; else c.scriptHandler = false; c.GM_setValue("scriptHandler", c.scriptHandler); tlc('Script manager is '+c.scriptHandler); browserInitDeref.resolve(); return browserInitDeref.promise(); }; var constInit = function(c) { tlc('START constInit'); var constInitDeref = new jQuery.Deferred(); c.scriptVersion = GM_info.script.version; c.scriptName = GM_info.script.name; c.anzCustom = 10; c.anzTemplates = 10; c.bookmarks_def = new Array(31, 69, 14, 16, 32, 33, 48, "0", 8, 18, 54, 51, 55, 47, 10, 2, 35, 9, 17, 22, 66, 68); c.defaultConfigLink = "/my/default.aspx#GClhShowConfig"; c.defaultSyncLink = "/my/default.aspx#GClhShowSync"; c.defaultFindPlayerLink = "/my/default.aspx#GClhShowFindPlayer"; c.urlScript = "https://raw.githubusercontent.com/2Abendsegler/GClh/master/gc_little_helper_II.user.js"; c.urlLastVersion = "https://raw.githubusercontent.com/2Abendsegler/GClh/master/last_version.txt"; c.urlConfigSt = "https://raw.githubusercontent.com/2Abendsegler/GClh/master/data/config_standard.txt"; c.urlChangelog = "https://github.com/2Abendsegler/GClh/blob/master/docu/changelog.md#readme"; c.urlFaq = "https://github.com/2Abendsegler/GClh/blob/master/docu/faq.md#readme"; c.urlFaqHelp = "https://github.com/2Abendsegler/GClh/blob/master/docu/faq.md#8-en"; c.urlFaqReport = "https://github.com/2Abendsegler/GClh/blob/master/docu/faq.md#9-en"; c.urlDocu = "https://github.com/2Abendsegler/GClh/blob/master/docu/"; c.urlImages = "https://raw.githubusercontent.com/2Abendsegler/GClh/master/images/"; c.urlImagesSvg = "https://rawgit.com/2Abendsegler/GClh/master/images/"; c.urlGoogleMaps = "https://maps.google.de/maps?q={markerLat},{markerLon}&z={zoom}&ll={lat},{lon}"; c.urlOSM = "https://www.openstreetmap.org/?#map={zoom}/{lat}/{lon}"; c.urlFlopps = "https://flopp.net/?c={lat}:{lon}&z={zoom}&t=OSM&f=n&m=&d="; c.urlGeoHack = "https://tools.wmflabs.org/geohack/geohack.php?pagename=Geocaching¶ms={latDeg}_{latMin}_{latSec}_{latOrient}_{lonDeg}_{lonMin}_{lonSec}_{lonOrient}"; c.urlKomoot = "https://www.komoot.com/plan/@{lat},{lon},{zoomMinus1}z"; c.idCopyName = "idName"; c.idCopyCode = "idCode"; c.idCopyUrl = "idUrl"; c.idCopyOrgCoords = "idOrgCoords"; c.idCopyCorrCoords = "idCorrCoords"; c.idCopyGCTourCoords = "idGCTourCoords"; // Define bookmarks: c.bookmarks = new Array(); // WICHTIG: Die Reihenfolge darf hier auf keinen Fall geändert werden, weil dadurch eine falsche Zuordnung zu den gespeicherten Userdaten erfolgen würde! bookmark("Watchlist", "/my/watchlist.aspx", c.bookmarks); bookmark("Logs Geocaches", "/my/geocaches.aspx", c.bookmarks); bookmark("Own Geocaches", "/my/owned.aspx", c.bookmarks); bookmark("Logs Trackables", "/my/travelbugs.aspx", c.bookmarks); bookmark("Trackables Inventory", "/my/inventory.aspx", c.bookmarks); bookmark("Trackables Collection", "/my/collection.aspx", c.bookmarks); bookmark("Logs Benchmarks", "/my/benchmarks.aspx", c.bookmarks); bookmark("Member Features", "/my/subscription.aspx", c.bookmarks); bookmark("Friends", "/my/myfriends.aspx", c.bookmarks); bookmark("Account Details", "/account/default.aspx", c.bookmarks); bookmark("Public Profile", "/profile/", c.bookmarks); bookmark("Search GC (old adv.)", "/seek/nearest.aspx", c.bookmarks); bookmark("Routes", "/my/userroutes.aspx#find", c.bookmarks); bookmark("Drafts Upload", "/my/uploadfieldnotes.aspx", c.bookmarks); bookmark("Pocket Queries", "/pocket/default.aspx", c.bookmarks); bookmark("Pocket Queries Saved", "/pocket/default.aspx#DownloadablePQs", c.bookmarks); bookmark("Bookmark Lists", "/account/lists", c.bookmarks); bookmark("Notifications", "/notify/default.aspx", c.bookmarks); profileSpecialBookmark("Find Player", defaultFindPlayerLink, "lnk_findplayer", c.bookmarks); bookmark("E-Mail", "/email/default.aspx", c.bookmarks); bookmark("Statbar", "/my/statbar.aspx", c.bookmarks); bookmark("Guidelines", "/about/guidelines.aspx", c.bookmarks); profileSpecialBookmark("GClh II Config", "/my/default.aspx#GClhShowConfig", "lnk_gclhconfig", c.bookmarks); externalBookmark("Forum Groundspeak", "https://forums.groundspeak.com/", c.bookmarks); externalBookmark("Blog Groundspeak", "/blog/", c.bookmarks); bookmark("Favorites", "/my/favorites.aspx", c.bookmarks); externalBookmark("Geoclub", "https://www.geoclub.de/", c.bookmarks); bookmark("Public Profile Geocaches", "/p/default.aspx?tab=geocaches#profilepanel", c.bookmarks); bookmark("Public Profile Trackables", "/p/default.aspx?tab=trackables#profilepanel", c.bookmarks); bookmark("Public Profile Gallery", "/p/default.aspx?tab=gallery#profilepanel", c.bookmarks); bookmark("Public Profile Lists", "/p/default.aspx?tab=lists#profilepanel", c.bookmarks); bookmark("Dashboard", "/my/", c.bookmarks); profileSpecialBookmark("Nearest List", "/seek/nearest.aspx?#gclhpb#errhomecoord", "lnk_nearestlist", c.bookmarks); profileSpecialBookmark("Nearest Map", "/seek/nearest.aspx?#gclhpb#errhomecoord", "lnk_nearestmap", c.bookmarks); profileSpecialBookmark("Nearest List (w/o Founds)", "/seek/nearest.aspx?#gclhpb#errhomecoord", "lnk_nearestlist_wo", c.bookmarks); profileSpecialBookmark("Own Trackables", "/track/search.aspx?#gclhpb#errowntrackables", "lnk_my_trackables", c.bookmarks); // Custom Bookmarks. var num = c.bookmarks.length; for (var i = 0; i < c.anzCustom; i++) { c.bookmarks[num] = Object(); if (getValue("settings_custom_bookmark[" + i + "]", "") != "") c.bookmarks[num]['href'] = getValue("settings_custom_bookmark[" + i + "]"); else c.bookmarks[num]['href'] = "#"; if (getValue("settings_bookmarks_title[" + num + "]", "") != "") c.bookmarks[num]['title'] = getValue("settings_bookmarks_title[" + num + "]"); else { c.bookmarks[num]['title'] = "Custom" + i; setValue("settings_bookmarks_title[" + num + "]", bookmarks[num]['title']); } if (getValue("settings_custom_bookmark_target[" + i + "]", "") != "") { c.bookmarks[num]['target'] = getValue("settings_custom_bookmark_target[" + i + "]"); c.bookmarks[num]['rel'] = "external"; } else c.bookmarks[num]['target'] = ""; c.bookmarks[num]['custom'] = true; num++; } // More Bookmarks. bookmark("Public Profile Souvenirs", "/p/default.aspx?tab=souvenirs#profilepanel", c.bookmarks); bookmark("Statistics", "/my/statistics.aspx", c.bookmarks); bookmark("Drafts", "/my/fieldnotes.aspx", c.bookmarks); bookmark("Public Profile Statistics", "/p/default.aspx?tab=stats#profilepanel", c.bookmarks); bookmark("Geocaches RecViewed", "/my/recentlyviewedcaches.aspx", c.bookmarks); bookmark("Search TB", "/track/travelbug.aspx", c.bookmarks); bookmark("Search Geocoin", "/track/geocoin.aspx", c.bookmarks); externalBookmark("Geocaches Labs", "https://labs.geocaching.com/", c.bookmarks); bookmark("Search GC", "/play/search/", c.bookmarks); bookmark("Geocache Hide", "/play/hide/", c.bookmarks); bookmark("Message Center", "/account/messagecenter", c.bookmarks); bookmark("Search GC (old)", "/seek/", c.bookmarks); bookmark("Glossary of Terms", "/about/glossary.aspx", c.bookmarks); bookmark("Event Calendar", "/calendar/", c.bookmarks); bookmark("Geocache Adoption", "/adopt/", c.bookmarks); externalBookmark("Flopps Karte", "https://flopp.net/", c.bookmarks); externalBookmark("Geokrety", "https://geokrety.org/", c.bookmarks); externalBookmark("Project Geocaching", "https://project-gc.com/", c.bookmarks); bookmark("Search TB adv.", "/track/search.aspx", c.bookmarks); bookmark("Browse Map", "/map/", c.bookmarks); profileSpecialBookmark("GClh II Sync", defaultSyncLink, "lnk_gclhsync", c.bookmarks); externalBookmark("Forum Geoclub", "https://geoclub.de/forum/index.php", c.bookmarks); externalBookmark("Changelog GClh II", urlChangelog, c.bookmarks); bookmark("Lists", "/my/lists.aspx", c.bookmarks); bookmark("Souvenirs", "/my/souvenirs.aspx", c.bookmarks); bookmark("Leaderboard", "/play/leaderboard", c.bookmarks); bookmark("Trackables", "/track/", c.bookmarks); bookmark("GeoTours", "/play/geotours", c.bookmarks); bookmark("Unpublished Hides", "/play/owner/unpublished", c.bookmarks); bookmark("Search Map", "/play/map", c.bookmarks); bookmark("Ignore List", "/plan/lists/ignored", c.bookmarks); bookmark("Found Geocaches", "/seek/nearest.aspx?ul={me}", c.bookmarks); bookmark("Hidden Geocaches", "/seek/nearest.aspx?u={me}", c.bookmarks); bookmark("Archived Hides", "/play/owner/archived", c.bookmarks); bookmark("Cache owner dashboard", "/play/owner", c.bookmarks); bookmark("Published Disabled", "/play/owner/published?filter=disabledPublished", c.bookmarks); bookmark("Published Hides", "/play/owner/published", c.bookmarks); bookmark("Published Needs Maintenance", "/play/owner/published?filter=needsMaintenance", c.bookmarks); bookmark("Published Reviewer Note", "/play/owner/published?filter=publishedReviewerNote", c.bookmarks); bookmark("Unpublished Reviewer Note", "/play/owner/unpublished?filter=unpublishedReviewerNote", c.bookmarks); bookmark("Published Events", "/play/owner/published/events", c.bookmarks); bookmark("Unpublished Events", "/play/owner/unpublished/events", c.bookmarks); bookmark("Archived Events", "/play/owner/archived/events", c.bookmarks); // Custom Bookmark-title. c.bookmarks_orig_title = new Array(); for (var i = 0; i < c.bookmarks.length; i++) { if (getValue("settings_bookmarks_title[" + i + "]", "") != "") { c.bookmarks_orig_title[i] = c.bookmarks[i]['title']; c.bookmarks[i]['title'] = getValue("settings_bookmarks_title[" + i + "]"); } } c.gclhConfigKeysIgnoreForBackup = {"declared_version": true, "update_next_check": true, "settings_DB_auth_token": true}; tlc('START iconsInit'); iconsInit(c); tlc('START layersInit'); layersInit(c); tlc('START elevationServicesDataInit'); elevationServicesDataInit(c); tlc('START country_idInit'); country_idInit(c); tlc('START states_idInit'); states_idInit(c); tlc('START collectionInit'); collectionInit(c); // Old header of GS. tlc('START headerhtml'); c.header_old = GM_getResourceText('headerhtml'); // Part of core css of GS, Config and others. tlc('START maincss'); c.main_css = GM_getResourceText('maincss'); constInitDeref.resolve(); return constInitDeref.promise(); }; var variablesInit = function(c) { tlc('START variablesInit'); var variablesInitDeref = new jQuery.Deferred(); c.userInfo = c.userInfo || window.userInfo || null; c.isLoggedIn = c.isLoggedIn || window.isLoggedIn || null; c.userDefinedCoords = c.userDefinedCoords || window.userDefinedCoords || null; c.userToken = c.userToken || window.userToken || null; c.http = "http"; if (document.location.href.toLowerCase().indexOf("https") === 0) c.http = "https"; c.global_dependents = new Array(); c.global_mod_reset = false; c.global_rc_data = ""; c.global_rc_status = ""; c.global_me = false; c.global_isBasic = false; c.global_avatarUrl = false; c.global_findCount = false; c.global_locale = false; c.global_running = false; c.global_open_popup_count = 0; c.global_open_popups = new Array(); c.map_url = "https://www.geocaching.com/map/default.aspx"; c.new_map_url = "https://www.geocaching.com/play/map/"; c.remove_navi_play = getValue("remove_navi_play", false); c.remove_navi_community = getValue("remove_navi_community", false); c.remove_navi_shop = getValue("remove_navi_shop", false); c.settings_submit_log_button = getValue("settings_submit_log_button", true); c.settings_log_inline = getValue("settings_log_inline", false); c.settings_log_inline_pmo4basic = getValue("settings_log_inline_pmo4basic", true); c.settings_bookmarks_show = getValue("settings_bookmarks_show", true); c.settings_change_header_layout = getValue("settings_change_header_layout", true); c.settings_fixed_header_layout = getValue("settings_fixed_header_layout", false); c.settings_remove_logo = getValue("settings_remove_logo", false); c.settings_remove_message_in_header = getValue("settings_remove_message_in_header", false); c.settings_bookmarks_on_top = getValue("settings_bookmarks_on_top", true); c.settings_bookmarks_top_menu = getValue("settings_bookmarks_top_menu", "true"); c.settings_bookmarks_search = getValue("settings_bookmarks_search", "true"); c.settings_bookmarks_search_default = repApo(getValue("settings_bookmarks_search_default", "")); c.settings_redirect_to_map = getValue("settings_redirect_to_map", false); c.settings_new_width = getValue("settings_new_width", 1000); c.settings_hide_facebook = getValue("settings_hide_facebook", false); c.settings_hide_socialshare = getValue("settings_hide_socialshare", false); c.settings_hide_disclaimer = getValue("settings_hide_disclaimer", true); c.settings_hide_cache_notes = getValue("settings_hide_cache_notes", false); c.settings_adapt_height_cache_notes = getValue("settings_adapt_height_cache_notes", true); c.settings_hide_empty_cache_notes = getValue("settings_hide_empty_cache_notes", true); c.settings_show_all_logs = getValue("settings_show_all_logs", true); c.settings_show_all_logs_count = getValue("settings_show_all_logs_count", "30"); c.settings_decrypt_hint = getValue("settings_decrypt_hint", true); c.settings_visitCount_geocheckerCom = getValue("settings_visitCount_geocheckerCom", true); c.settings_show_bbcode = getValue("settings_show_bbcode", true); c.settings_show_mail = getValue("settings_show_mail", true); c.settings_font_size_menu = getValue("settings_font_size_menu", 16); c.settings_font_size_submenu = getValue("settings_font_size_submenu", 15); c.settings_distance_menu = getValue("settings_distance_menu", 16); c.settings_distance_submenu = getValue("settings_distance_submenu", 8); c.settings_font_color_menu_submenu = getValue("settings_font_color_menu_submenu", "93B516"); c.settings_font_color_menu = getValue("settings_font_color_menu", getValue("settings_font_color_menu_submenu", "93B516")); c.settings_font_color_submenu = getValue("settings_font_color_submenu", getValue("settings_font_color_menu_submenu", "93B516")); c.settings_menu_number_of_lines = getValue("settings_menu_number_of_lines", 1); c.settings_menu_show_separator = getValue("settings_menu_show_separator", false); c.settings_menu_float_right = getValue("settings_menu_float_right", false); c.settings_gc_tour_is_working = getValue("settings_gc_tour_is_working", false); c.settings_show_smaller_gc_link = getValue("settings_show_smaller_gc_link", true); c.settings_show_message = getValue("settings_show_message", true); c.settings_show_remove_ignoring_link = getValue("settings_show_remove_ignoring_link", true); c.settings_use_one_click_ignoring = getValue("settings_use_one_click_ignoring", true); c.settings_show_common_lists_in_zebra = getValue("settings_show_common_lists_in_zebra", true); c.settings_show_common_lists_color_user = getValue("settings_show_common_lists_color_user", true); c.settings_show_cache_listings_in_zebra = getValue("settings_show_cache_listings_in_zebra", false); c.settings_show_cache_listings_color_user = getValue("settings_show_cache_listings_color_user", true); c.settings_show_cache_listings_color_owner = getValue("settings_show_cache_listings_color_owner", true); c.settings_show_cache_listings_color_reviewer = getValue("settings_show_cache_listings_color_reviewer", true); c.settings_show_cache_listings_color_vip = getValue("settings_show_cache_listings_color_vip", true); c.settings_show_tb_listings_in_zebra = getValue("settings_show_tb_listings_in_zebra", true); c.settings_show_tb_listings_color_user = getValue("settings_show_tb_listings_color_user", true); c.settings_show_tb_listings_color_owner = getValue("settings_show_tb_listings_color_owner", true); c.settings_show_tb_listings_color_reviewer = getValue("settings_show_tb_listings_color_reviewer", true); c.settings_show_tb_listings_color_vip = getValue("settings_show_tb_listings_color_vip", true); c.settings_lines_color_zebra = getValue("settings_lines_color_zebra", "EBECED"); c.settings_lines_color_user = getValue("settings_lines_color_user", "C2E0C3"); c.settings_lines_color_owner = getValue("settings_lines_color_owner", "E0E0C3"); c.settings_lines_color_reviewer = getValue("settings_lines_color_reviewer", "EAD0C3"); c.settings_lines_color_vip = getValue("settings_lines_color_vip", "F0F0A0"); c.settings_show_mail_in_allmyvips = getValue("settings_show_mail_in_allmyvips", true); c.settings_show_mail_in_viplist = getValue("settings_show_mail_in_viplist", true); c.settings_process_vup = getValue("settings_process_vup", true); c.settings_show_vup_friends = getValue("settings_show_vup_friends", false); c.settings_vup_hide_avatar = getValue("settings_vup_hide_avatar", false); c.settings_vup_hide_log = getValue("settings_vup_hide_log", false); c.settings_f2_save_gclh_config = getValue("settings_f2_save_gclh_config", true); c.settings_esc_close_gclh_config = getValue("settings_esc_close_gclh_config", true); c.settings_f4_call_gclh_config = getValue("settings_f4_call_gclh_config", true); c.settings_call_config_via_sriptmanager = getValue("settings_call_config_via_sriptmanager", true); c.settings_f10_call_gclh_sync = getValue("settings_f10_call_gclh_sync", true); c.settings_call_sync_via_sriptmanager = getValue("settings_call_sync_via_sriptmanager", true); c.settings_show_sums_in_bookmark_lists = getValue("settings_show_sums_in_bookmark_lists", true); c.settings_show_sums_in_watchlist = getValue("settings_show_sums_in_watchlist", true); c.settings_hide_warning_message = getValue("settings_hide_warning_message", true); c.settings_show_save_message = getValue("settings_show_save_message", true); c.settings_map_overview_build = getValue("settings_map_overview_build", true); c.settings_map_overview_zoom = getValue("settings_map_overview_zoom", 11); c.settings_map_overview_layer = getValue("settings_map_overview_layer", "Geocaching"); c.settings_logit_for_basic_in_pmo = getValue("settings_logit_for_basic_in_pmo", true); c.settings_log_statistic = getValue("settings_log_statistic", true); c.settings_log_statistic_percentage = getValue("settings_log_statistic_percentage", true); c.settings_log_statistic_reload = getValue("settings_log_statistic_reload", 8); c.settings_count_own_matrix = getValue("settings_count_own_matrix", true); c.settings_count_foreign_matrix = getValue("settings_count_foreign_matrix", true); c.settings_count_own_matrix_show_next = getValue("settings_count_own_matrix_show_next", true); c.settings_count_own_matrix_show_count_next = getValue("settings_count_own_matrix_show_count_next", 2); c.settings_count_own_matrix_show_color_next = getValue("settings_count_own_matrix_show_color_next", "5151FB"); c.settings_count_own_matrix_links_radius = getValue("settings_count_own_matrix_links_radius", 25); c.settings_count_own_matrix_links = getValue("settings_count_own_matrix_links", "map"); c.settings_hide_left_sidebar_on_google_maps = getValue("settings_hide_left_sidebar_on_google_maps", true); c.settings_add_link_gc_map_on_google_maps = getValue("settings_add_link_gc_map_on_google_maps", true); c.settings_switch_from_google_maps_to_gc_map_in_same_tab = getValue("settings_switch_from_google_maps_to_gc_map_in_same_tab", false); c.settings_add_link_new_gc_map_on_google_maps = getValue("settings_add_link_new_gc_map_on_google_maps", true); c.settings_switch_from_google_maps_to_new_gc_map_in_same_tab = getValue("settings_switch_from_google_maps_to_new_gc_map_in_same_tab", false); c.settings_add_link_google_maps_on_gc_map = getValue("settings_add_link_google_maps_on_gc_map", true); c.settings_switch_to_google_maps_in_same_tab = getValue("settings_switch_to_google_maps_in_same_tab", false); c.settings_add_links_google_maps_on_google_search = getValue("settings_add_links_google_maps_on_google_search", false); c.settings_add_link_gc_map_on_osm = getValue("settings_add_link_gc_map_on_osm", true); c.settings_switch_from_osm_to_gc_map_in_same_tab = getValue("settings_switch_from_osm_to_gc_map_in_same_tab", false); c.settings_add_link_new_gc_map_on_osm = getValue("settings_add_link_new_gc_map_on_osm", true); c.settings_switch_from_osm_to_new_gc_map_in_same_tab = getValue("settings_switch_from_osm_to_new_gc_map_in_same_tab", false); c.settings_add_link_osm_on_gc_map = getValue("settings_add_link_osm_on_gc_map", true); c.settings_switch_to_osm_in_same_tab = getValue("settings_switch_to_osm_in_same_tab", false); c.settings_add_link_flopps_on_gc_map = getValue("settings_add_link_flopps_on_gc_map", true); c.settings_switch_to_flopps_in_same_tab = getValue("settings_switch_to_flopps_in_same_tab", false); c.settings_add_link_geohack_on_gc_map = getValue("settings_add_link_geohack_on_gc_map", true); c.settings_switch_to_geohack_in_same_tab = getValue("settings_switch_to_geohack_in_same_tab", false); c.settings_add_link_komoot_on_gc_map = getValue("settings_add_link_komoot_on_gc_map", true); c.settings_switch_to_komoot_in_same_tab = getValue("settings_switch_to_komoot_in_same_tab", false); c.settings_sort_default_bookmarks = getValue("settings_sort_default_bookmarks", true); c.settings_make_vip_lists_hideable = getValue("settings_make_vip_lists_hideable", true); c.settings_show_latest_logs_symbols = getValue("settings_show_latest_logs_symbols", true); c.settings_show_latest_logs_symbols_count = getValue("settings_show_latest_logs_symbols_count", 10); c.settings_set_default_langu = getValue("settings_set_default_langu", false); c.settings_default_langu = getValue("settings_default_langu", "English"); c.settings_hide_colored_versions = getValue("settings_hide_colored_versions", false); c.settings_make_config_main_areas_hideable = getValue("settings_make_config_main_areas_hideable", true); c.settings_faster_profile_trackables = getValue("settings_faster_profile_trackables", false); c.settings_show_eventday = getValue("settings_show_eventday", true); c.settings_show_eventtime_with_24_hours = getValue("settings_show_eventtime_with_24_hours", false); c.settings_show_google_maps = getValue("settings_show_google_maps", true); c.settings_show_log_it = getValue("settings_show_log_it", true); c.settings_show_nearestuser_profil_link = getValue("settings_show_nearestuser_profil_link", true); c.settings_show_homezone = getValue("settings_show_homezone", true); c.settings_homezone_radius = getValue("settings_homezone_radius", "10"); c.settings_homezone_color = getValue("settings_homezone_color", "#0000FF"); c.settings_homezone_opacity = getValue("settings_homezone_opacity", 10); c.settings_multi_homezone = JSON.parse(getValue("settings_multi_homezone", "{}")); c.settings_show_hillshadow = getValue("settings_show_hillshadow", false); c.settings_map_layers = getValue("settings_map_layers", "").split("###"); c.settings_default_logtype = getValue("settings_default_logtype", "-1"); c.settings_default_logtype_event = getValue("settings_default_logtype_event", c.settings_default_logtype); c.settings_default_logtype_owner = getValue("settings_default_logtype_owner", c.settings_default_logtype); c.settings_default_tb_logtype = getValue("settings_default_tb_logtype", "-1"); c.settings_bookmarks_list = JSON.parse(getValue("settings_bookmarks_list", JSON.stringify(c.bookmarks_def)).replace(/, (?=,)/g, ",null")); if (c.settings_bookmarks_list.length == 0) c.settings_bookmarks_list = c.bookmarks_def; c.settings_sync_last = new Date(getValue("settings_sync_last", "Thu Jan 01 1970 01:00:00 GMT+0100 (Mitteleuropäische Zeit)")); c.settings_sync_hash = getValue("settings_sync_hash", ""); c.settings_sync_time = getValue("settings_sync_time", 36000000); // 10 Stunden c.settings_sync_autoImport = getValue("settings_sync_autoImport", false); c.settings_hide_advert_link = getValue('settings_hide_advert_link', true); c.settings_hide_spoilerwarning = getValue('settings_hide_spoilerwarning', true); c.settings_hide_hint = getValue('settings_hide_hint', true); c.settings_strike_archived = getValue('settings_strike_archived', true); c.settings_highlight_usercoords = getValue('settings_highlight_usercoords', true); c.settings_highlight_usercoords_bb = getValue('settings_highlight_usercoords_bb', false); c.settings_highlight_usercoords_it = getValue('settings_highlight_usercoords_it', true); c.settings_map_hide_found = getValue('settings_map_hide_found', true); c.settings_map_hide_hidden = getValue('settings_map_hide_hidden', true); c.settings_map_hide_dnfs = getValue('settings_map_hide_dnfs', true); c.settings_map_hide_2 = getValue('settings_map_hide_2', false); c.settings_map_hide_9 = getValue('settings_map_hide_9', false); c.settings_map_hide_5 = getValue('settings_map_hide_5', false); c.settings_map_hide_3 = getValue('settings_map_hide_3', false); c.settings_map_hide_6 = getValue('settings_map_hide_6', false); c.settings_map_hide_453 = getValue('settings_map_hide_453', false); c.settings_map_hide_7005 = getValue('settings_map_hide_7005', false); c.settings_map_hide_13 = getValue('settings_map_hide_13', false); c.settings_map_hide_1304 = getValue('settings_map_hide_1304', false); c.settings_map_hide_4 = getValue('settings_map_hide_4', false); c.settings_map_hide_11 = getValue('settings_map_hide_11', false); c.settings_map_hide_137 = getValue('settings_map_hide_137', false); c.settings_map_hide_8 = getValue('settings_map_hide_8', false); c.settings_map_hide_1858 = getValue('settings_map_hide_1858', false); c.settings_show_fav_percentage = getValue('settings_show_fav_percentage', true); c.settings_show_vip_list = getValue('settings_show_vip_list', true); c.settings_show_owner_vip_list = getValue('settings_show_owner_vip_list', true); c.settings_autovisit = getValue("settings_autovisit", true); c.settings_autovisit_default = getValue("settings_autovisit_default", false); c.settings_show_thumbnails = getValue("settings_show_thumbnails", true); c.settings_imgcaption_on_top = getValue("settings_imgcaption_on_top", false); c.settings_hide_avatar = getValue("settings_hide_avatar", false); c.settings_link_big_listing = getValue("settings_link_big_listing", true); c.settings_show_big_gallery = getValue("settings_show_big_gallery", false); c.settings_automatic_friend_reset = getValue("settings_automatic_friend_reset", false); c.settings_show_long_vip = getValue("settings_show_long_vip", false); c.settings_load_logs_with_gclh = getValue("settings_load_logs_with_gclh", true); c.settings_map_add_layer = getValue("settings_map_add_layer", true); c.settings_map_default_layer = getValue("settings_map_default_layer", "OpenStreetMap Default"); c.settings_hide_map_header = getValue("settings_hide_map_header", false); c.settings_spoiler_strings = repApo(getValue("settings_spoiler_strings", "spoiler|hinweis")); c.settings_replace_log_by_last_log = getValue("settings_replace_log_by_last_log", false); c.settings_hide_top_button = getValue("settings_hide_top_button", false); c.settings_show_real_owner = getValue("settings_show_real_owner", false); c.settings_hide_archived_in_owned = getValue("settings_hide_archived_in_owned", false); c.settings_show_button_for_hide_archived = getValue("settings_show_button_for_hide_archived", true); c.settings_hide_visits_in_profile = getValue("settings_hide_visits_in_profile", false); c.settings_add_log_templates = getValue("settings_add_log_templates", true); c.settings_add_cache_log_signature_as_log_template = getValue("settings_add_cache_log_signature_as_log_template", false); c.settings_add_tb_log_signature_as_log_template = getValue("settings_add_tb_log_signature_as_log_template", false); c.settings_add_cache_log_signature = getValue("settings_add_cache_log_signature", true); c.settings_log_signature_on_fieldnotes = getValue("settings_log_signature_on_fieldnotes", true); c.settings_add_tb_log_signature = getValue("settings_add_tb_log_signature", true); c.settings_map_hide_sidebar = getValue("settings_map_hide_sidebar", true); c.settings_hover_image_max_size = getValue("settings_hover_image_max_size", 600); c.settings_vip_show_nofound = getValue("settings_vip_show_nofound", true); c.settings_use_gclh_layercontrol = getValue("settings_use_gclh_layercontrol", true); c.settings_use_gclh_layercontrol_on_browse_map = getValue("settings_use_gclh_layercontrol_on_browse_map", true); c.settings_use_gclh_layercontrol_on_search_map = getValue("settings_use_gclh_layercontrol_on_search_map", true); c.settings_fixed_pq_header = getValue("settings_fixed_pq_header", true); c.settings_friendlist_summary = getValue("settings_friendlist_summary", true); c.settings_friendlist_summary_viponly = getValue("settings_friendlist_summary_viponly", false); c.settings_search_data = JSON.parse(getValue("settings_search_data", "[]")); c.settings_search_enable_user_defined = getValue("settings_search_enable_user_defined",true); c.settings_pq_warning = getValue("settings_pq_warning",true); c.settings_pq_set_cachestotal = getValue("settings_pq_set_cachestotal",true); c.settings_pq_cachestotal = getValue("settings_pq_cachestotal",1000); c.settings_pq_option_ihaventfound = getValue("settings_pq_option_ihaventfound",true); c.settings_pq_option_idontown = getValue("settings_pq_option_idontown",true); c.settings_pq_option_ignorelist = getValue("settings_pq_option_ignorelist",true); c.settings_pq_option_isenabled = getValue("settings_pq_option_isenabled",true); c.settings_pq_option_filename = getValue("settings_pq_option_filename",true); c.settings_pq_set_terrain = getValue("settings_pq_set_terrain",true); c.settings_pq_set_difficulty = getValue("settings_pq_set_difficulty",true); c.settings_pq_difficulty = getValue("settings_pq_difficulty",">="); c.settings_pq_difficulty_score = getValue("settings_pq_difficulty_score","1"); c.settings_pq_terrain = getValue("settings_pq_terrain",">="); c.settings_pq_terrain_score = getValue("settings_pq_terrain_score","1"); c.settings_pq_automatically_day = getValue("settings_pq_automatically_day",false); c.settings_pq_previewmap = getValue("settings_pq_previewmap",true); c.settings_pq_previewmap_layer = getValue("settings_pq_previewmap_layer","Geocaching"); c.settings_mail_icon_new_win = getValue("settings_mail_icon_new_win",false); c.settings_message_icon_new_win = getValue("settings_message_icon_new_win",false); c.settings_hide_cache_approvals = getValue("settings_hide_cache_approvals", true); c.settings_driving_direction_link = getValue("settings_driving_direction_link",true); c.settings_driving_direction_parking_area = getValue("settings_driving_direction_parking_area",false); c.settings_show_elevation_of_waypoints = getValue("settings_show_elevation_of_waypoints", true); c.settings_primary_elevation_service = getValue("settings_primary_elevation_service", 3); c.settings_secondary_elevation_service = getValue("settings_secondary_elevation_service", 2); c.settings_distance_units = getValue("settings_distance_units", ""); c.settings_img_warning = getValue("settings_img_warning", false); c.settings_remove_banner = getValue("settings_remove_banner", false); c.settings_remove_banner_text_ids = JSON.parse(getValue("settings_remove_banner_text_ids", "[]")); c.settings_compact_layout_bm_lists = getValue("settings_compact_layout_bm_lists", true); c.settings_compact_layout_pqs = getValue("settings_compact_layout_pqs", true); c.settings_compact_layout_list_of_pqs = getValue("settings_compact_layout_list_of_pqs", true); c.settings_compact_layout_nearest = getValue("settings_compact_layout_nearest", true); c.settings_compact_layout_recviewed = getValue("settings_compact_layout_recviewed", true); c.settings_map_links_statistic = getValue("settings_map_links_statistic", true); c.settings_map_percentage_statistic = getValue("settings_map_percentage_statistic", true); c.settings_improve_add_to_list_height = getValue("settings_improve_add_to_list_height", 205); c.settings_improve_add_to_list = getValue("settings_improve_add_to_list", true); c.settings_show_flopps_link = getValue("settings_show_flopps_link", true); c.settings_show_brouter_link = getValue("settings_show_brouter_link", true); c.settings_show_gpsvisualizer_link = getValue("settings_show_gpsvisualizer_link", true); c.settings_show_gpsvisualizer_gcsymbols = getValue("settings_show_gpsvisualizer_gcsymbols", true); c.settings_show_gpsvisualizer_typedesc = getValue("settings_show_gpsvisualizer_typedesc", true); c.settings_show_openrouteservice_link = getValue("settings_show_openrouteservice_link", true); c.settings_show_openrouteservice_home = getValue("settings_show_openrouteservice_home", false); c.settings_show_openrouteservice_medium = getValue("settings_show_openrouteservice_medium", "2b"); c.settings_show_copydata_menu = getValue("settings_show_copydata_menu", true); c.settings_show_default_links = getValue("settings_show_default_links", true); c.settings_bm_changed_and_go = getValue("settings_bm_changed_and_go", true); c.settings_bml_changed_and_go = getValue("settings_bml_changed_and_go", true); c.settings_show_tb_inv = getValue("settings_show_tb_inv", true); c.settings_but_search_map = getValue("settings_but_search_map", true); c.settings_but_search_map_new_tab = getValue("settings_but_search_map_new_tab", false); c.settings_show_pseudo_as_owner = getValue("settings_show_pseudo_as_owner", true); c.settings_fav_proz_nearest = getValue("settings_fav_proz_nearest", true); c.settings_open_tabs_nearest = getValue("settings_open_tabs_nearest", true); c.settings_fav_proz_pqs = getValue("settings_fav_proz_pqs", true); c.settings_open_tabs_pqs = getValue("settings_open_tabs_pqs", true); c.settings_fav_proz_recviewed = getValue("settings_fav_proz_recviewed", true); c.settings_show_all_logs_but = getValue("settings_show_all_logs_but", true); c.settings_show_log_counter_but = getValue("settings_show_log_counter_but", true); c.settings_show_log_counter = getValue("settings_show_log_counter", false); c.settings_show_bigger_avatars_but = getValue("settings_show_bigger_avatars_but", true); c.settings_show_who_gave_favorite_but = getValue("settings_show_who_gave_favorite_but", true); c.settings_hide_feedback_icon = getValue("settings_hide_feedback_icon", false); c.settings_compact_layout_new_dashboard = getValue("settings_compact_layout_new_dashboard", false); c.settings_show_draft_indicator = getValue("settings_show_draft_indicator", true); c.settings_show_enhanced_map_popup = getValue("settings_show_enhanced_map_popup", true); c.settings_show_enhanced_map_coords = getValue("settings_show_enhanced_map_coords", true); c.settings_show_latest_logs_symbols_count_map = getValue("settings_show_latest_logs_symbols_count_map", 16); c.settings_modify_new_drafts_page = getValue("settings_modify_new_drafts_page", true); c.settings_gclherror_alert = getValue("settings_gclherror_alert", false); c.settings_embedded_smartlink_ignorelist = getValue("settings_embedded_smartlink_ignorelist", true); c.settings_both_tabs_list_of_pqs_one_page = getValue("settings_both_tabs_list_of_pqs_one_page", false); c.settings_past_events_on_bm = getValue("settings_past_events_on_bm", true); c.settings_show_log_totals = getValue("settings_show_log_totals", true); c.settings_show_reviewer_as_vip = getValue("settings_show_reviewer_as_vip", true); c.settings_show_lackey_as_vip = getValue("settings_show_lackey_as_vip", false); c.settings_hide_found_count = getValue("settings_hide_found_count", false); c.settings_show_compact_logbook_but = getValue("settings_show_compact_logbook_but", true); c.settings_log_status_icon_visible = getValue("settings_log_status_icon_visible", true); c.settings_cache_type_icon_visible = getValue("settings_cache_type_icon_visible", true); c.settings_showUnpublishedHides = getValue("settings_showUnpublishedHides", true); c.settings_set_showUnpublishedHides_sort = getValue("settings_set_showUnpublishedHides_sort", true); c.settings_showUnpublishedHides_sort = getValue("settings_showUnpublishedHides_sort", "abc"); c.settings_lists_compact_layout = getValue("settings_lists_compact_layout", false); c.settings_lists_disabled = getValue("settings_lists_disabled", false); c.settings_lists_disabled_color = getValue("settings_lists_disabled_color", "4A4A4A"); c.settings_lists_disabled_strikethrough = getValue("settings_lists_disabled_strikethrough", true); c.settings_lists_archived = getValue("settings_lists_archived", false); c.settings_lists_archived_color = getValue("settings_lists_archived_color", "8C0B0B"); c.settings_lists_archived_strikethrough = getValue("settings_lists_archived_strikethrough", true); c.settings_lists_icons_visible = getValue("settings_lists_icons_visible", false); c.settings_lists_log_status_icons_visible = getValue("settings_lists_log_status_icons_visible", true); c.settings_lists_cache_type_icons_visible = getValue("settings_lists_cache_type_icons_visible", true); c.settings_lists_premium_column = getValue("settings_lists_premium_column", false); c.settings_lists_found_column_bml = getValue("settings_lists_found_column_bml", false); c.settings_lists_show_log_it = getValue("settings_lists_show_log_it", false); c.settings_lists_back_to_top = getValue("settings_lists_back_to_top", false); c.settings_searchmap_autoupdate_after_dragging = getValue("settings_searchmap_autoupdate_after_dragging", true); c.settings_improve_character_counter = getValue("settings_improve_character_counter", true); c.settings_searchmap_compact_layout = getValue("settings_searchmap_compact_layout", true); c.settings_searchmap_disabled = getValue("settings_searchmap_disabled", false); c.settings_searchmap_disabled_strikethrough = getValue("settings_searchmap_disabled_strikethrough", true); c.settings_searchmap_disabled_color = getValue("settings_searchmap_disabled_color", '4A4A4A'); c.settings_searchmap_show_hint = getValue("settings_searchmap_show_hint", false); c.settings_show_copydata_own_stuff_show = getValue("settings_show_copydata_own_stuff_show", false); c.settings_show_copydata_own_stuff_name = getValue("settings_show_copydata_own_stuff_name", 'Photo file name'); c.settings_show_copydata_own_stuff_value = getValue("settings_show_copydata_own_stuff_value", '#yyyy#.#mm#.#dd# - #GCName# - #GCCode# - 01'); c.settings_show_copydata_own_stuff = JSON.parse(getValue("settings_show_copydata_own_stuff", "{}")); c.settings_relocate_other_map_buttons = getValue("settings_relocate_other_map_buttons", true); c.settings_show_radius_on_flopps = getValue("settings_show_radius_on_flopps", true); c.settings_show_edit_links_for_logs = getValue("settings_show_edit_links_for_logs", true); c.settings_show_copydata_plus = getValue("settings_show_copydata_plus", false); c.settings_show_copydata_separator = getValue("settings_show_copydata_separator", "\n"); c.settings_lists_show_dd = getValue("settings_lists_show_dd", true); c.settings_lists_hide_desc = getValue("settings_lists_hide_desc", true); c.settings_lists_upload_file = getValue("settings_lists_upload_file", true); c.settings_lists_open_tabs = getValue("settings_lists_open_tabs", true); c.settings_profile_old_links = getValue("settings_profile_old_links", false); c.settings_listing_old_links = getValue("settings_listing_old_links", false); c.settings_searchmap_show_btn_save_as_pq = getValue("settings_searchmap_show_btn_save_as_pq", true); c.settings_map_overview_browse_map_icon = getValue("settings_map_overview_browse_map_icon", true); c.settings_map_overview_browse_map_icon_new_tab = getValue("settings_map_overview_browse_map_icon_new_tab", false); c.settings_map_overview_search_map_icon = getValue("settings_map_overview_search_map_icon", true); c.settings_map_overview_search_map_icon_new_tab = getValue("settings_map_overview_search_map_icon_new_tab", false); c.settings_cache_notes_min_size = getValue("settings_cache_notes_min_size", 54); c.settings_show_link_to_browse_map = getValue("settings_show_link_to_browse_map", false); c.settings_show_hide_upvotes_but = getValue("settings_show_hide_upvotes_but", false); c.settings_hide_upvotes = getValue("settings_hide_upvotes", false); c.settings_smaller_upvotes_icons = getValue("settings_smaller_upvotes_icons", true); c.settings_no_wiggle_upvotes_click = getValue("settings_no_wiggle_upvotes_click", true); c.settings_show_country_in_place = getValue("settings_show_country_in_place", true); c.settings_color_bg = getValue("settings_color_bg", "D8CD9D"); c.settings_color_if = getValue("settings_color_if", "D8CD9D"); c.settings_color_ht = getValue("settings_color_ht", "D8CD9D"); c.settings_color_bh = getValue("settings_color_bh", "D8CD9D"); c.settings_color_bu = getValue("settings_color_bu", "D8CD9D)"); c.settings_color_bo = getValue("settings_color_bo", "778555"); c.settings_color_nv = getValue("settings_color_nv", "F0DFC6"); c.settings_color_navi_search = getValue("settings_color_navi_search", false); c.settings_map_show_btn_hide_header = getValue("settings_map_show_btn_hide_header", true); c.settings_show_found_caches_at_corrected_coords_but = getValue("settings_show_found_caches_at_corrected_coords_but", true); c.settings_save_as_pq_set_defaults = getValue("settings_save_as_pq_set_defaults", false); c.settings_save_as_pq_set_all = getValue("settings_save_as_pq_set_all", true); c.settings_compact_layout_cod = getValue("settings_compact_layout_cod", false); c.settings_show_button_fav_proz_cod = getValue("settings_show_button_fav_proz_cod", true); c.settings_show_compact_certitude_information = getValue("settings_show_compact_certitude_information", true); c.settings_anonymous_on_certitude = getValue("settings_anonymous_on_certitude", false); c.settings_change_font_cache_notes = getValue("settings_change_font_cache_notes", false); c.settings_larger_map_as_browse_map = getValue("settings_larger_map_as_browse_map", false); c.settings_fav_proz_cod = getValue("settings_fav_proz_cod", true); c.settings_logs_old_fashioned = getValue("settings_logs_old_fashioned", false); c.settings_prevent_watchclick_popup = getValue("settings_prevent_watchclick_popup", false); c.settings_upgrade_button_header_remove = getValue("settings_upgrade_button_header_remove", false); c.settings_unsaved_log_message = getValue("settings_unsaved_log_message", true); c.settings_sort_map_layers = getValue("settings_sort_map_layers", false); c.settings_add_search_in_logs_func = getValue("settings_add_search_in_logs_func", true); c.settings_show_add_cache_info_in_log_page = getValue("settings_show_add_cache_info_in_log_page", true); c.settings_pq_splitter_pqname = getValue("settings_pq_splitter_pqname", 'PQ_Splitter_'); c.settings_pq_splitter_how_often = getValue("settings_pq_splitter_how_often", 2); c.settings_pq_splitter_not_ignored = getValue("settings_pq_splitter_not_ignored", false); c.settings_pq_splitter_is_enabled = getValue("settings_pq_splitter_is_enabled", false); c.settings_pq_splitter_email = getValue("settings_pq_splitter_email", 1); c.settings_pq_splitter_include_pq_name = getValue("settings_pq_splitter_include_pq_name", false); c.settings_show_create_pq_from_pq_splitter = getValue("settings_show_create_pq_from_pq_splitter", true); c.settings_drafts_cache_link = getValue("settings_drafts_cache_link", true); c.settings_drafts_cache_link_new_tab = getValue("settings_drafts_cache_link_new_tab", false); c.settings_drafts_color_visited_link = getValue("settings_drafts_color_visited_link", true); c.settings_drafts_old_log_form = getValue("settings_drafts_old_log_form", false); c.settings_drafts_log_icons = getValue("settings_drafts_log_icons", true); c.settings_drafts_go_automatic_back = getValue("settings_drafts_go_automatic_back", false); c.settings_drafts_after_new_logging_view_log = getValue("settings_drafts_after_new_logging_view_log", false); c.settings_after_new_logging_view_log = getValue("settings_after_new_logging_view_log", false); c.settings_listing_hide_external_link_warning = getValue("settings_listing_hide_external_link_warning", false); c.settings_listing_links_new_tab = getValue("settings_listing_links_new_tab", false); c.settings_show_cache_type_icons_in_dashboard = getValue("settings_show_cache_type_icons_in_dashboard", false); c.settings_public_profile_avatar_show_thumbnail = getValue("settings_public_profile_avatar_show_thumbnail", true); c.settings_drafts_download_show_button = getValue("settings_drafts_download_show_button", true); c.settings_drafts_download_change_logdate = getValue("settings_drafts_download_change_logdate", false); c.settings_dashboard_show_logs_in_markdown = getValue("settings_dashboard_show_logs_in_markdown", true); c.settings_public_profile_smaller_privacy_btn = getValue("settings_public_profile_smaller_privacy_btn", false); c.settings_searchmap_improve_add_to_list = getValue("settings_searchmap_improve_add_to_list", true); c.settings_searchmap_improve_add_to_list_height = getValue("settings_searchmap_improve_add_to_list_height", 130); c.settings_improve_notifications = getValue("settings_improve_notifications", true); c.settings_remove_target_log_form = getValue("settings_remove_target_log_form", false); c.settings_remove_target_log_view = getValue("settings_remove_target_log_view", false); c.settings_hide_locked_tbs_log_form = getValue("settings_hide_locked_tbs_log_form", true); c.settings_hide_own_tbs_log_form = getValue("settings_hide_own_tbs_log_form", false); c.settings_hide_share_log_button_log_view = getValue("settings_hide_share_log_button_log_view", false); c.settings_dashboard_hide_tb_activity = getValue("settings_dashboard_hide_tb_activity", false); c.settings_button_sort_tbs_by_name_log_form = getValue("settings_button_sort_tbs_by_name_log_form", true); c.settings_larger_content_width_log_form = getValue("settings_larger_content_width_log_form", true); c.settings_less_space_log_lines_log_form = getValue("settings_less_space_log_lines_log_form", true); tlc('START userToken'); try { if (c.userToken === null) { c.userData = $('#aspnetForm script:not([src])').filter(function() { return this.innerHTML.indexOf("ccConversions") != -1; }).html(); if (c.userData !== null) { if (typeof c.userData !== "undefined") { c.userData = c.userData.replace('{ID: ', '{"ID": '); var regex = /([a-zA-Z0-9öÖäÄüÜß]+)([ ]?=[ ]?)(((({.+})(;)))|(((\[.+\])(;)))|(((".+")(;)))|((('.+')(;)))|(([^'"{\[].+)(;)))/g; var match; while (match = regex.exec(userData)) { if (match[1] == "eventCacheData") continue; var data = (match[6] || match[10] || match[14] || match[18] || match[21]).trim(); if (data.charAt(0) == '"' || data.charAt(0) == "'") data = data.slice(1, data.length - 1); data = data.trim(); if (data.charAt(0) == '{' || data.charAt(0) == '[') data = JSON.parse(data); if (typeof c.chromeUserData === "undefined") c.chromeUserData = {}; c.chromeUserData[match[1].replace('"', '').replace("'", "").trim()] = data; } if (c.chromeUserData["userInfo"]) c.userInfo = chromeUserData["userInfo"]; if (c.chromeUserData["isLoggedIn"]) c.isLoggedIn = chromeUserData["isLoggedIn"]; if (c.chromeUserData["userDefinedCoords"]) c.userDefinedCoords = c.chromeUserData["userDefinedCoords"]; if (c.chromeUserData["userToken"]) c.userToken = c.chromeUserData["userToken"]; } } } } catch(e) {gclh_error("Error parsing userdata from page",e);} variablesInitDeref.resolve(); return variablesInitDeref.promise(); }; ///////////////////////// // 2. Google Maps ($$cap) ///////////////////////// var mainGMaps = function() { try { // Add links to GC Maps on Google Maps page. if (settings_add_link_gc_map_on_google_maps || settings_add_link_new_gc_map_on_google_maps) { function addGcButton(waitCount) { if (document.getElementById("gbwa")) { var code = ""; code += "function openGcMap(mapType, switchToSameTab){"; code += " var matches = document.location.href.match(/@(-?[0-9.]*),(-?[0-9.]*),([0-9.]*)z/);"; code += " if (matches != null) {"; code += " var zoom = matches[3];"; code += " } else {"; // Bei Earth gibt es kein z für Zoom sondern ein m für Meter. Meter in Zoom umrechnen. code += " var matches = document.location.href.match(/@(-?[0-9.]*),(-?[0-9.]*),([0-9.]*)m/);"; code += " if (matches != null) {"; code += " var zoom = 26 - Math.round(Math.log2(matches[3]));"; code += " }"; code += " }"; code += " if (matches != null) {"; code += " var matchesMarker = document.location.href.match(/!3d(-?[0-9.]*)!4d(-?[0-9.]*)/);"; code += " if (matchesMarker != null) {"; code += " if (mapType == 'old') var url = '" + map_url + "?lat=' + matchesMarker[1] + '&lng=' + matchesMarker[2] + '#?ll=' + matches[1] + ',' + matches[2] + '&z=' + zoom;"; code += " else var url = '" + new_map_url + "?lat=' + matchesMarker[1] + '&lng=' + matchesMarker[2] + '&zoom=' + zoom;"; code += " } else {"; code += " if (mapType == 'old') var url = '" + map_url + "?lat=' + matches[1] + '&lng=' + matches[2] + '&z=' + zoom;"; code += " else var url = '" + new_map_url + "?lat=' + matches[1] + '&lng=' + matches[2] + '&zoom=' + zoom;"; code += " }"; code += " if (switchToSameTab) location = url;"; code += " else window.open(url);"; code += " } else {"; code += " alert('This map has no geographical coordinates in its link. Just zoom or drag the map, afterwards this will work fine.');"; code += " }"; code += "}"; injectPageScript(code, "body"); var div = document.createElement("div"); div.id = "gclh_map_links"; div.setAttribute("style", "display: inline-block;"); if (settings_add_link_new_gc_map_on_google_maps) { div.innerHTML += '' + search_map_icon + ''; } if (settings_add_link_gc_map_on_google_maps) { div.innerHTML += '' + browse_map_icon + ''; } var side = document.getElementById("gbwa"); side.parentNode.insertBefore(div, side); var css = ''; css += '#gclh_map_links a {margin-left: 8px;}'; css += '#gclh_map_links svg {width: 25px; height: 25px; vertical-align: middle; color: black; opacity: 0.55;}'; css += '#gclh_map_links svg:hover {opacity: 0.85;}'; css += '.search_map_icon {height: 20px !important;}'; css += '.gb_nd {padding-left: 4px;}'; css += '.UV9Ngc {padding-right: 48px !important;}'; appendCssStyle(css); } else {waitCount++; if (waitCount <= 50) setTimeout(function(){addGcButton(waitCount);}, 200);} } addGcButton(0); } // Hide left sidebar on Google Maps. if (settings_hide_left_sidebar_on_google_maps) { function hideLeftSidebar(waitCount) { if ($('#gbwa')[0] && $('.widget-pane-toggle-button')[0] && $('.widget-pane')[0]) { if (!$('.widget-pane')[0].className.match("widget-pane-collapsed")) $('.widget-pane-toggle-button')[0].click(); } else {waitCount++; if (waitCount <= 60) setTimeout(function(){hideLeftSidebar(waitCount);}, 250);} } hideLeftSidebar(0); } } catch(e) {gclh_error("mainGMaps",e);} }; var mainGSearch = function() { try { // Add links to Google Maps on Google Search Results pages. if (settings_add_links_google_maps_on_google_search) { function setGMapsLinks() { var searchPara = new URLSearchParams(window.location.search).get('q'); if (searchPara) { var mapsUrl = 'https://maps.google.com/maps?q=' + encodeURIComponent(searchPara); // Examples: "fürstenlager bensheim", "bensheim auerbach". if ($('a img#lu_map')[0]) { if ($('a[href*="/maps/place/"] img#lu_map')[0]) return; var link = $('img#lu_map')[0].closest('a'); link.href = mapsUrl; // Example: "N 49° 41.000 E 008° 37.000", an address. } else if ($('div#lu_map')[0]) { if ($('a div#lu_map')[0]) return; var map = $('div#lu_map')[0]; var link = document.createElement('a'); link.href = mapsUrl; map.parentNode.insertBefore(link, map); link.appendChild(map); // Example: "Bensheim", "Ukraine", "Rhein" } else if ($('div.EeWPwe')[0]) { if ($('div.EeWPwe a[href*="/maps/place/"]')[0]) return; var button = ''; button += ''; button += '
'; button += '
'; button += ''; button += ''; button += ''; button += '
'; button += '
Open in Maps
'; button += '
'; button += '
'; $('div.EeWPwe').append(button); // Missing CSS. var css = ''; css += '.ZkkK1e.ZkkK1e {line-height: normal; font-family: arial,sans-serif;}'; css += '.ZkkK1e {-moz-box-sizing: border-box; box-sizing: border-box; border-radius: 18px; cursor: pointer; display: inline-block; height: 36px; min-width: 36px; position: relative; background: #fff; border: 1px solid #dadce0; color: #3c4043;}'; css += '.POUQwd.WN4Zxc {padding: 7px 0 7px 11px;}'; css += '.xlY4q, .POUQwd, .XqKfz {-moz-box-sizing: border-box; box-sizing: border-box; display: inline-block; height: 34px; vertical-align: bottom;}'; css += '.xlY4q.VIZLse {padding-right: 11px;}'; css += '.xlY4q {font-size: 14px; line-height: 34px; padding: 0 8px; padding-right: 8px;}'; css += '.VDgVie {text-align: center;}'; appendCssStyle(css); // Example: "Nil" } else if ($('div.V1GY4c img')[0]) { if ($('div.V1GY4c img')[0].closest('a[href]:not([href=""]):not([href=" "])')) return; var map = $('div.V1GY4c')[0]; var link = document.createElement('a'); link.href = mapsUrl; map.parentNode.insertBefore(link, map); link.appendChild(map); } } } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', setGMapsLinks); else setGMapsLinks(); } } catch(e) {gclh_error("mainGSearch",e);} }; //////////////////////////////// // 3. Project GC ($$cap) // 3.1 Project GC - Main ($$cap) //////////////////////////////// var mainPGC = function() { try { // Tables with PQ definitions are available. if ($('.row table').length > 0 && settings_show_create_pq_from_pq_splitter) { // No errors available for month name related functions. global_error = false; // Get user language of the page. var lang = getLanguage(); // Build output boxes for both tables with the PQ definitions. $('.row table').each(function(table_index) { buildOutputBox(this, table_index); }); // Build css. buildCss(); } } catch(e) {gclh_error("mainPGC",e);} ///////////////////////////////////// // 3.2 Project GC - Functions ($$cap) ///////////////////////////////////// // Build output box. function buildOutputBox(side, table_index) { var html = ''; html += ''; html += '

Create PQ(s) on geocaching.com'; html += '0 | 0 | 0

'; var error_text = checkSelectErrorAvailable(); if (error_text != '') { html += '
Error:
'; html += '

' + error_text + '

'; html += ''; $(side).append(html); } else { html += '

PQ name (prefix): '; html += ' '; html += '

'; html += '
Configuration:
'; html += '

Choose how often your PQ(s) should run:
'; html += '
'; html += '
'; html += '

'; html += '


'; html += '

'; html += '

Output to email:
'; html += 'The secondary email will only work if you have two or more email addresses in your profile.

'; html += '

'; html += '
Instruction:
'; html += '

If you click the "Create PQ(s)" button, the GC little helper II will open as many pop ups as PQs should be created. The number of simultaneously loaded pop ups is limited to 5. All PQs will get the name that you entered in the field above and an ongoing digit prefix. The pop ups close by themselves after the associated PQ has been created. We will display a message if all PQs are created. Please wait until all pop ups are loaded.

'; html += '

Please make sure you do not have a pop up blocker enabled. Otherwise this feature will not work as expected. How to change pop up blocker settings in browser Mozilla Firefox, Google Chrome.

'; html += '

This is a feature of GC little helper II.

'; html += ''; $(side).append(html); $(side).find('.pq_name')[0].addEventListener("change", function() { if ($(this)[0].value != '') setValue('settings_pq_splitter_pqname', $(this)[0].value); }); $(side).find('.button_create_pq')[0].addEventListener("click", prepareCreatePQ, false); $(side).find('#how_often_' + table_index + '_' + settings_pq_splitter_how_often).attr('checked', true); $(side).find('.how_often').each(function() { $(this)[0].addEventListener("click", function() { setValue('settings_pq_splitter_how_often', $(this).attr('index')); }); }); $(side).find('.not_ignored')[0].addEventListener("click", function() { setValue('settings_pq_splitter_not_ignored', $(this).prop('checked')); }); $(side).find('.is_enabled')[0].addEventListener("click", function() { setValue('settings_pq_splitter_is_enabled', $(this).prop('checked')); }); $(side).find('.output_email')[0].value = settings_pq_splitter_email; $(side).find('.output_email')[0].addEventListener("change", function() { setValue('settings_pq_splitter_email', $(this)[0].value); }); $(side).find('.include_pq_name')[0].addEventListener("click", function() { setValue('settings_pq_splitter_include_pq_name', $(this).prop('checked')); }); } } // Build css. function buildCss() { var css = ''; css += 'tfoot {background-color: #d4edda;}'; css += 'tfoot h4 > span {font-size: 14px; font-weight: normal; float: right; margin-top: 2px;}'; css += 'tfoot h5 {margin-top: 18px;}'; css += 'tfoot label {padding-left: 4px; margin-bottom: 0px; font-weight: normal;}'; css += 'tfoot h4, tfoot h5, tfoot p {margin-left: 9px; margin-right: 9px;}'; css += '.working {opacity: 0.6;}'; css += '.gclh_counter.gclh_running {display: block;}'; css += '.gclh_counter {display: none; cursor: default;}'; appendCssStyle(css); } // Prepare create PQ(s). function prepareCreatePQ() { var urls_for_pqs_to_create = []; var current_table = $(this).closest('table'); // Determine number of PQs and number of digits for the ongoing digit prefix. var nPQs = 0; $(current_table).find('tr').each(function() { if ($(this).context.rowIndex > 0 && $(this).children().eq(1).text() != "") { nPQs++; } }); var nDigits = parseInt((nPQs + '').length); // Build urls. $(current_table).find('tr').each(function() { if ($(this).context.rowIndex > 0 && $(this).children().eq(1).text() != "") { var [start_month, start_day, start_year] = getDateParts($(this).children().eq(1).text()); var [end_month, end_day, end_year] = getDateParts($(this).children().eq(2).text()); var cache_count = parseInt($(current_table).find('.pq_name').attr('cache_count')); var pq_name = $(current_table).find('.pq_name').val() + $(this).context.rowIndex.toString(10).padStart(nDigits, '0'); var how_often = $(current_table).find('.how_often:checked').attr('index'); var not_ignored = $(current_table).find('.not_ignored').prop('checked') ? 1 : 0; var is_enabled = $(current_table).find('.is_enabled').prop('checked') ? 1 : 0; var email = $(current_table).find('.output_email').val(); var include_pq_name = $(current_table).find('.include_pq_name').prop('checked') ? 1 : 0; var param = {PQSplit: 1, n: pq_name, c: cache_count, ho: how_often, e: email, sm: start_month, sd: start_day, sy: start_year, em: end_month, ed: end_day, ey: end_year, ni: not_ignored, ie: is_enabled, in: include_pq_name}; var sel = getSelection(); var new_url = "https://www.geocaching.com/pocket/gcquery.aspx?" + $.param(param) + '&' + $.param(sel); urls_for_pqs_to_create.push(new_url); } }); // Process error or rather create PQs. if (checkEndErrorAvailable(urls_for_pqs_to_create)) { setRunSettings(false); return false; } else { setRunSettings(true); $(current_table).find('.gclh_counter_total')[0].innerHTML = urls_for_pqs_to_create.length; $(current_table).find('.gclh_counter').addClass('gclh_running'); create_pqs(urls_for_pqs_to_create, true); } } // Check whether select errors are available. function checkSelectErrorAvailable() { // There are restrictions for difficulty and terrain. Not all combinations can be specified on the PQ page. function checkDT(name) { var error = ''; var n = 0; var first = false; var last = false; var next = ''; var all = ''; $('#' + name + 'select option[selected=""]').each(function() { var content = $(this).val(); if (!first || content < first) first = content; if (!last || content > last) last = content; if (next == '' || next == parseInt(content.replace(/(\.|,)/, ''))) { next = parseInt(content.replace(/(\.|,)/, '')) + 5; } else if (!next) { } else { next = false; } all += (n == 0 ? '' : '/') + content; n++; }); if (n <= 1 || (n > 1 && first == '1.0' && next) || (n > 1 && last == '5.0' && next)) { } else { error = "Your " + name + " specifications " + all + " can not be specified on the PQ page.
"; } return error; } return checkDT('difficulty') + checkDT('terrain'); } // Get selection parameter. function getSelection() { var sel = new Object(); $('#filtertoggle2div > div:not(.row,.hide) select, #filtertoggle2div > div:not(.row,.hide) input:not(.btn)').each(function() { if ($(this).val() != null && $(this).val() != '') { var name = $(this).attr('name').replace(/(\[|\])/g, ''); if ($(this).attr('multiple')) { for (var i = 0; i < $(this).val().length; i++) { sel[name+"["+i+"]"] = $(this).val()[i]; } } else if ($(this)[0].id.match(/hidden_to(yyyy|mm|dd)/)) { sel[name] = $(this).val(); } else if ($(this)[0].type == 'checkbox' && $(this)[0].checked) { sel[name] = $(this).val(); } else if ($(this)[0].type == 'text' && $(this).val() != '') { sel[name] = $(this).val(); } } }); return sel; } // Create PQ(s). function create_pqs(urls_for_pqs_to_create, first_run) { // Cleanup last run, if there is one. if (first_run) { if (typeof global_open_popups !== 'undefined' && global_open_popups != null && Array.isArray(global_open_popups)) { for (var i = 0; i < global_open_popups.length; i++) { if (typeof global_open_popups[i] !== 'undefined' && global_open_popups[i] != null && global_open_popups[i] !== false) { global_open_popups[i].close(); } } } global_open_popups = new Array(urls_for_pqs_to_create.length); global_open_popup_count = 0; $('.gclh_running .gclh_counter_total').innerHTML = urls_for_pqs_to_create.length; } // Handle pop ups. var already_done_count = 0; for (var i = 0; i < urls_for_pqs_to_create.length; i++) { if (urls_for_pqs_to_create[i] != '') { if (global_open_popup_count < 5) { global_open_popups[i] = window.open(urls_for_pqs_to_create[i], 'PQ_' + i, 'scrollbars=1, menubar=0, resizable=1, width=400, height=250, top=0, left=10000'); $('.gclh_running .gclh_counter_started').innerHTML = $('.gclh_running .gclh_counter_started').innerHTML + 1; // A pop up could not be opened in browser, probably because of a pop up blocker, so we'll stop here and inform the user. if (global_open_popups[i] == null) { setRunSettings(false); alert("A pop up blocker was detected. Please allow pop ups for this site, reload the page and try again. Please be aware, that the first two PQs should already be created. So please go to geocaching.com and delete them."); return false; } global_open_popup_count++; urls_for_pqs_to_create[i] = ''; $('.gclh_running .gclh_counter_started')[0].innerHTML = parseInt($('.gclh_running .gclh_counter_started')[0].innerHTML) + 1; } } else { already_done_count++; } if (typeof global_open_popups[i] !== 'undefined' && global_open_popups[i] !== false && global_open_popups[i].closed) { global_open_popup_count--; global_open_popups[i] = false; $('.gclh_running .gclh_counter_completed')[0].innerHTML = parseInt($('.gclh_running .gclh_counter_completed')[0].innerHTML) + 1; } } // Restart creating of PQs until everything is finished. if (already_done_count < urls_for_pqs_to_create.length || global_open_popup_count > 0) { setTimeout(function(){create_pqs(urls_for_pqs_to_create, false);}, 250); } else { setRunSettings(false); alert("The GC little helper II is done creating your " + already_done_count + " PQ(s)."); } } // Set or stop the running environment. function setRunSettings(set) { if (set) { $('.gclh_running').removeClass('gclh_running'); $('.gclh_counter span').each(function(){this.innerHTML = 0;}); $('.button_create_pq').prop("disabled", true); $('.button_create_pq').addClass('working'); } else { $('.button_create_pq').prop("disabled", false); $('.button_create_pq').removeClass('working'); } } // Check whether errors during the identification of the language related month names or the length of the URLs are available. function checkEndErrorAvailable(urls) { var err = ''; if (global_error) { err += "One or more of the determined, month name and language related, start and end dates are failed. Please select another language, such as English or German, at the top right of the page and try again.\n"; } for (var i = 0; i < urls.length; i++) { if (urls[i].length > 2000) { err += "One or more of the determined URLs to calling geocaching.com and creating PQ(s) are too long. You are using too many filters. Please reduce the filters and try again.\n"; break; } } if (err != '') { alert(err); return true; } else return false; } // Get user language of the page. function getLanguage() { if ($('ul.navbar-right .drowdown-toggle img[src*="country_flags"]')[0]) { var match = $('ul.navbar-right .drowdown-toggle img[src*="country_flags"]')[0].src.match(/country_flags(2\/png|_manual)\/(.*)\./); if (match && match[1] && match[2]) { lang = match[2].replace(/catalonia/, 'es').toUpperCase(); if ($('#menu_locales a[href*="_' + lang + '"]')[0]) { var match = $('#menu_locales a[href*="_' + lang + '"]')[0].href.match(/#(.{2})/); if (match && match[1]) { return match[1]; } } } } return false; } // Break down the date string and return its components. function getDateParts(str) { if (str.indexOf("/") == -1) return ['', '', '']; var arr = str.split('/'); var m = convertMonthNameToNumber(lang, arr[0]); var d = parseInt(arr[1]); var y = parseInt(arr[2]); return [m, d, y]; } // Convert the name of a month with a given language to the month number. function convertMonthNameToNumber(lang, name) { var name_l = name.toLowerCase(); for (var nr = 1; nr <= 12; nr++) { var [month, month_l] = convertMonthNumberToName(lang, nr); if (name == month || name_l == month_l) return nr; } global_error = true; return false; } // Convert the number of a month to the month name with a given language. function convertMonthNumberToName(lang, nr) { if (new Intl.DateTimeFormat(lang, {month:'long'}).format(new Date(nr + '/1/2000'))) { var month = new Intl.DateTimeFormat(lang, {month:'long'}).format(new Date(nr + '/1/2000')); } else { var month = false; } var month_l = month.toLowerCase(); return [month, month_l]; } }; // End of mainPGC. /////////////////////// // 4. Certitude ($$cap) /////////////////////// // URLs for testing: // https://www.certitudes.org/certitude?wp=GC8J1H9 // https://www.certitudes.org/certitude?wp=GC71TFG (with fileurl and filename) // Certitude: GCLH var mainCertitudes = function() { // Certitude stay anonymous. if (document.location.href.match(/^https:\/\/www\.certitudes\.org\/certitude\?wp=[A-Z0-9]{1,15}/) && settings_anonymous_on_certitude && document.getElementsByName('anonymous')[0]) { try { document.getElementsByName('anonymous')[0].checked = true; } catch(e) {gclh_error("Certitude stay anonymous.",e);} } // Certitude compact information and copy to clipboard button. if (document.location.href.match(/^https:\/\/www\.certitudes\.org\/certify/) && settings_show_compact_certitude_information && $('.user-input .embossed.success')[0] && $('.user-input .embossed.success')[0].innerHTML) { try { function copyElementByIdToClipboard(element) { try { var range = document.createRange(); range.selectNode(document.getElementById(element)); window.getSelection().removeAllRanges(); window.getSelection().addRange(range); document.execCommand("copy"); window.getSelection().removeAllRanges(); } catch(e) {gclh_error("Certitude copy to clipboard",e);} } function addCompactCertitude() { var output = '
'; output += ''; output += '
'; output += 'Certitude: ' + $('.user-input .embossed.success')[0].innerHTML; if ($('.user-input .embossed.success')[1] && $('.user-input .embossed.success')[1].innerHTML) { output += '

Final: ' + $('.user-input .embossed.success')[1].innerHTML; } if ($('.user-input .embossed .hint')[0] && $('.user-input .embossed .hint')[0].innerHTML) { output += '
Info: ' + $('.user-input .embossed .hint')[0].innerHTML; } if ($('.user-input a.logo img.thumbnail')[0] && $('.user-input a.logo img.thumbnail')[0].src) { output += '
Spoiler: ' + $('.user-input a.logo img.thumbnail')[0].src; } if ($('.user-input .embossed .bonus a')[0] && $('.user-input .embossed .bonus a')[0].href && $('.user-input .embossed .bonus a')[0].download) { output += '
' + $('.user-input .embossed .bonus a')[0].download + ': ' + $('.user-input .embossed .bonus a')[0].href; } output += '

'; if ($('form.card')[0]) { $('form.card:first').after(output); var copyBtn = document.querySelector('.gclh_copy_btn'); copyBtn.addEventListener('click', function(event) { copyElementByIdToClipboard('gclh_solution'); }) } } addCompactCertitude(); var css = ''; css += '.certifys-container {grid-template-columns: 300px auto 200px;}'; css += '.header {grid-template-columns: 300px auto;}'; appendCssStyle(css); } catch(e) {gclh_error("mainCertitudes",e);} } }; // End of mainCertitudes. /////////////////////////// // 5. Openstreetmap ($$cap) /////////////////////////// var mainOSM = function() { try { // Add link to GC Map on Openstreetmap. function addGCButton(waitCount) { if (document.location.href.match(/^https?:\/\/www\.openstreetmap\.org\/(.*)#map=/) && $(".control-key").length) { if (settings_add_link_new_gc_map_on_osm) { var code = '
' + search_map_icon + '
'; $(".control-share").after(code); } if (settings_add_link_gc_map_on_osm) { var code = '
' + browse_map_icon + '
'; $(".control-share").after(code); } $(".control-gc").click(function() { var matches = document.location.href.match(/=([0-9]+)\/(-?[0-9.]*)\/(-?[0-9.]*)/); if (matches != null) { if ($(this).find('.gc-map')[0]) { var url = map_url + '?lat=' + matches[2] + '&lng=' + matches[3] + '#?ll=' + matches[2] + ',' + matches[3] + '&z=' + matches[1]; if (settings_switch_from_osm_to_gc_map_in_same_tab) location = url; else window.open(url); } else { var url = new_map_url + '?lat=' + matches[2] + '&lng=' + matches[3] + '&zoom=' + matches[1]; if (settings_switch_from_osm_to_new_gc_map_in_same_tab) location = url; else window.open(url); } } else alert('This map has no geographical coordinates in its link. Just zoom or drag the map, afterwards this will work fine.'); }); var css = ''; css += '.control-gc svg {width: 25px; height: 25px; margin-left: 9px; margin-top: 8px; vertical-align: middle; color: white;}'; css += '#search_map_icon {margin-top: 11px;}'; appendCssStyle(css); } else {waitCount++; if (waitCount <= 50) setTimeout(function(){addGCButton(waitCount);}, 1000);} } addGCButton(0); } catch(e) {gclh_error("mainOSM",e);} }; //////////////////////////// // 6. GC ($$cap) (For the geocaching webpages.) // 6.1 GC - Main ($$cap) (For the geocaching webpages.) // 6.1.1 GC - Main 1 ($$cap) (For the geocaching webpages.) //////////////////////////// var mainGCWait = function() { tlc('START mainGCWait'); // Hide login procedures via Facebook, Google, Apple ... . if (settings_hide_facebook && (document.location.href.match(/\.com\/(account\/register|login|account\/login|account\/signin|account\/join)/))) { try { if ($('.btn.btn-facebook')[0]) $('.btn.btn-facebook')[0].style.display = "none"; if ($('.divider-flex')[0]) $('.divider-flex')[0].style.display = "none"; if ($('.divider')[0]) $('.divider')[0].style.display = "none"; if ($('.disclaimer')[0]) $('.disclaimer')[0].style.display = "none"; if ($('.login-with-facebook')[0]) $('.login-with-facebook')[0].style.display = "none"; if ($('.horizontal-rule')[0]) $('.horizontal-rule')[0].style.display = "none"; if ($('.oauth-providers-login')[0]) $('.oauth-providers-login')[0].style.display = "none"; } catch(e) {gclh_error("Hide Facebook",e);} } // Improve print page cache listing. tlc('START Improve print page'); if (document.location.href.match(/\.com\/seek\/cdpf\.aspx/)) { try { // Hide disclaimer. if (settings_hide_disclaimer) { var d = ($('.Note.Disclaimer')[0] || $('.DisclaimerWidget')[0] || $('.TermsWidget.no-print')[0]); if (d) d.remove(); } // Decrypt hints. if (settings_decrypt_hint) { if ($('#uxDecryptedHint')[0]) $('#uxDecryptedHint')[0].style.display = 'none'; if ($('#uxEncryptedHint')[0]) $('#uxEncryptedHint')[0].style.display = ''; if ($('.EncryptionKey')[0]) $('.EncryptionKey')[0].remove(); } // Show other coord formats. var box = document.getElementsByClassName("UTM Meta")[0]; var coords = document.getElementsByClassName("LatLong Meta")[0]; if (box && coords) { var match = coords.innerHTML.match(/((N|S) [0-9][0-9]. [0-9][0-9]\.[0-9][0-9][0-9] (E|W) [0-9][0-9][0-9]. [0-9][0-9]\.[0-9][0-9][0-9])/); if (match && match[1]) { coords = match[1]; otherFormats(box, coords, "
"); } } // Hide side rights. if ($('#Footer')[0]) $('#Footer')[0].remove(); // Display listing images in maximum available width for FF and chrome. Only for display, print was ok. appendCssStyle('.item-content img {max-width: -moz-available; max-width: -webkit-fill-available;}'); } catch(e) {gclh_error("Improve print page cache listing",e);} } // Set global user data and check if logged in. tlc('START waitingForUserData'); function waitingForUserData(waitCount) { if (typeof headerSettings !== 'undefined' && typeof headerSettings.username !== 'undefined' && headerSettings.username !== null) { tlc('Global user data headerSettings found'); if (typeof headerSettings.username !== 'undefined') global_me = headerSettings.username; if (typeof headerSettings.avatarUrl !== 'undefined') global_avatarUrl = headerSettings.avatarUrl; if (typeof headerSettings.locale !== 'undefined') global_locale = headerSettings.locale; if (typeof headerSettings.findCount !== 'undefined') global_findCount = headerSettings.findCount; if (typeof headerSettings.isBasic !== 'undefined') global_isBasic = headerSettings.isBasic; } if (typeof chromeSettings !== 'undefined' && typeof chromeSettings.username !== 'undefined' && chromeSettings.username !== null) { tlc('Global user data chromeSettings found'); if (typeof chromeSettings.username !== 'undefined') global_me = chromeSettings.username; if (typeof chromeSettings.avatarUrl !== 'undefined') global_avatarUrl = chromeSettings.avatarUrl; if (typeof chromeSettings.locale !== 'undefined') global_locale = chromeSettings.locale; if (typeof chromeSettings.findCount !== 'undefined') global_findCount = chromeSettings.findCount; if (typeof chromeSettings.isBasic !== 'undefined') global_isBasic = chromeSettings.isBasic; } // Used on page: https://www.geocaching.com/plan/lists if (typeof _gcUser !== 'undefined' && typeof _gcUser.username !== 'undefined' && _gcUser.username !== null) { tlc('Global user data _gcUser found'); if (typeof _gcUser.username !== 'undefined') global_me = _gcUser.username; if (typeof _gcUser.image !== 'undefined' && typeof _gcUser.image.imageUrl !== 'undefined') global_avatarUrl = _gcUser.image.imageUrl.replace(/\{0\}/,'avatar'); if (typeof _gcUser.locale !== 'undefined') global_locale = _gcUser.locale; if (typeof _gcUser.findCount !== 'undefined') global_findCount = _gcUser.findCount; if (typeof _gcUser.membershipLevel !== 'undefined' && _gcUser.membershipLevel == 1) global_isBasic = true; } // Used on page: https://www.geocaching.com/live/geocache/GC40/log if (typeof $('#__NEXT_DATA__')[0] !== 'undefined' && $('#__NEXT_DATA__')[0].innerText) { try { try { var userdata = JSON.parse($('#__NEXT_DATA__')[0].innerText); } catch(e) {} if (typeof userdata !== 'undefined' && typeof userdata.props !== 'undefined' && typeof userdata.props.pageProps !== 'undefined' && typeof userdata.props.pageProps.gcUser !== 'undefined') { var gcUser = userdata.props.pageProps.gcUser; if (typeof gcUser !== 'undefined' && typeof gcUser.username !== 'undefined' && gcUser.username !== null) { tlc('Global user data userdata.props.pageProps.gcUser found'); if (typeof gcUser.username !== 'undefined') global_me = gcUser.username; if (typeof gcUser.image !== 'undefined' && typeof gcUser.image.imageUrl !== 'undefined') global_avatarUrl = gcUser.image.imageUrl.replace(/\{0\}/,'avatar'); if (typeof gcUser.locale !== 'undefined') global_locale = gcUser.locale; if (typeof gcUser.findCount !== 'undefined') global_findCount = gcUser.findCount; if (typeof gcUser.membershipLevel !== 'undefined' && gcUser.membershipLevel == 1) global_isBasic = true; } } } catch(e) {gclh_error("Determine user data for id '__NEXT_DATA__'",e);} } if (global_me !== false && global_avatarUrl !== false && global_locale !== false && global_findCount !== false) { tlc('All global user data found'); tlc('- global_me: '+global_me+' / global_avatarUrl: '+global_avatarUrl); tlc('- global_findCount: '+global_findCount+' / global_locale: '+global_locale+' / global_isBasic: '+global_isBasic); mainGC(); } else { waitCount++; if (waitCount <= 200) {setTimeout(function(){waitingForUserData(waitCount);}, 50);} else { tlc('STOP not all global user data found'); tlc('- global_me: '+global_me+' / global_avatarUrl: '+global_avatarUrl); tlc('- global_findCount: '+global_findCount+' / global_locale: '+global_locale+' / global_isBasic: '+global_isBasic); } } } waitingForUserData(0); }; //////////////////////////// // 6.1.2 GC - Main 2 ($$cap) (For the geocaching webpages.) //////////////////////////// var mainGC = function() { tlc('START maingc'); // Part of core css of GS, Config and others. var css = main_css; // Css for config, sync ... coloring. css += create_coloring_css(); // Special css for searchmap. if (is_page('searchmap')) { css += 'gclh_nav .wrapper {z-index: 1006;} gclh_nav li input {height: unset !important;}'; css += '.profile-panel .li-user-toggle svg {height: 13px;}'; } appendCssStyle(css); // After change of a bookmark respectively a bookmark list go automatically from confirmation screen to bookmark list. tlc('START After change'); if (((settings_bm_changed_and_go && document.location.href.match(/\.com\/bookmarks\/mark\.aspx\?(guid=|ID=|view=legacy&guid=|view=legacy&ID=)/)) || (settings_bml_changed_and_go && document.location.href.match(/\.com\/bookmarks\/edit\.aspx/))) && $('#divContentMain')[0] && $('p.Success a[href*="/bookmarks/view.aspx?guid="]')[0]) { $('#divContentMain').css("visibility", "hidden"); document.location.href = $('p.Success a')[0].href; } // Set language to default language. tlc('START Set language'); try { var langu_string = langus_code[langus.indexOf(settings_default_langu)] + '-'; if (settings_set_default_langu && !global_locale.match(langu_string)) { function waitForLanguageSelector(waitCount) { if ($('.language-selector button')[0]) { $('.language-selector button')[0].click(); function waitForLanguagePopover(waitCount) { if ($('.language-popover button')[0]) { if ($('.language-popover button[data-lang*="'+langu_string+'"]')[0]) { $('.language-popover button[data-lang*="'+langu_string+'"]')[0].click(); } else { $('.language-selector button')[0].click(); } } else {waitCount++; if (waitCount <= 500) setTimeout(function(){waitForLanguagePopover(waitCount);}, 10);} window.scroll(0, 0); } waitForLanguagePopover(0); } else {waitCount++; if (waitCount <= 500) setTimeout(function(){waitForLanguageSelector(waitCount);}, 10);} } waitForLanguageSelector(0); } } catch(e) {gclh_error("Set language to default language",e);} // Faster loading trackables without images. tlc('START Faster loading'); if (settings_faster_profile_trackables && is_page("publicProfile") && $('#ctl00_ContentBody_ProfilePanel1_lnkCollectibles.Active')[0]) { try { $('table.Table tbody tr td a img').each(function() {this.src = "/images/icons/16/watch.png"; this.title = ""; this.style.paddingLeft = "15px";}); } catch(e) {gclh_error("Faster loading trackables without images",e);} } // Migration: Installationszähler. Migrationsaufgaben erledigen. tlc('START Migration'); var declaredVersion = getValue("declared_version"); if (declaredVersion != scriptVersion) { try { instCount(declaredVersion); migrationTasks(); } catch(e) {gclh_error("Migration",e);} } // Redirect to Map (von Search Liste direkt in Karte springen). tlc('START Redirect'); if (settings_redirect_to_map && document.location.href.match(/\.com\/seek\/nearest\.aspx\?/)) { if (!document.location.href.match(/&disable_redirect=/) && !document.location.href.match(/key=/) && !document.location.href.match(/ul=/) && $('#ctl00_ContentBody_LocationPanel1_lnkMapIt')[0]) { $('#ctl00_ContentBody_LocationPanel1_lnkMapIt')[0].click(); } } // F2, F4, F10 keys. tlc('START F-keys'); try { // F2 key. // (For F2 key in filter screens of Search Map and search page, see "prepareKeydownF2InFilterScreen".) if (settings_submit_log_button) { function setButtonDescInnerHTMLF2(waitCount, id) { if (document.getElementById(id) && document.getElementById(id).innerHTML && !document.getElementById(id).innerHTML.match(/(F2)/)) { document.getElementById(id).innerHTML += " (F2)"; } if (waitCount <= 20) setTimeout(function(){setButtonDescInnerHTMLF2(waitCount, id);}, 100); } // Send Log from log form is developed in the "Improve log form" area. // Log abschicken (Cache und TB). if (document.location.href.match(/\.com\/(seek|track)\/log\.aspx\?(id|wid|guid|ID|wp|LUID|PLogGuid|code)\=/)) var id = "ctl00_ContentBody_LogBookPanel1_btnSubmitLog"; // PQ speichern | "Bookmark Pocket Query", aus BM PQ erzeugen | PQ zu Routen. if (document.location.href.match(/\.com\/pocket\/(gcquery|bmquery|urquery)\.aspx/)) var id = "ctl00_ContentBody_btnSubmit"; // "Create a Bookmark" entry, "Edit a Bookmark" entry. if (document.location.href.match(/\.com\/bookmarks\/mark\.aspx/)) var id = "ctl00_ContentBody_Bookmark_btnCreate"; // "Create New Bookmark List", Edit a Bookmark list. if (document.location.href.match(/\.com\/bookmarks\/edit\.aspx/)) var id = "ctl00_ContentBody_BookmarkListEditControl1_btnSubmit"; // "Create Notification", "Edit Notification". if (document.location.href.match(/\.com\/notify\/edit\.aspx/)) var id = "ctl00_ContentBody_LogNotify_btnGo"; // Hide cache process speichern. if (document.location.href.match(/\.com\/hide\//)) { if ($('#btnContinue')[0]) var id = "btnContinue"; else if ($('#ctl00_ContentBody_btnSaveAndPreview')[0]) var id = "ctl00_ContentBody_btnSaveAndPreview"; else if ($('#btnSubmit')[0]) var id = "btnSubmit"; else if ($('#btnNext')[0]) var id = "btnNext"; else if ($('#ctl00_ContentBody_btnSubmit')[0]) var id = "ctl00_ContentBody_btnSubmit"; else if ($('#ctl00_ContentBody_Attributes_btnUpdate')[0]) var id = "ctl00_ContentBody_Attributes_btnUpdate"; else if ($('#ctl00_ContentBody_WaypointEdit_uxSubmitIt')[0]) var id = "ctl00_ContentBody_WaypointEdit_uxSubmitIt"; } // "Save" personal cache note in cache listing. if (is_page("cache_listing") && $('.js-pcn-submit')[0]) { var id = "gclh_js-pcn-submit"; $('.js-pcn-submit')[0].id = id; setButtonDescInnerHTMLF2(0, id); } if (id && document.getElementById(id)) { function keydownF2(e) { if (!check_config_page() && $('#'+id)[0].offsetParent != null) { if (e.keyCode == 113 && noSpecialKey(e)) { document.getElementById(id).click(); } if (e.keyCode == 83 && e.ctrlKey == true && e.altKey == false && e.shiftKey == false) { e.preventDefault(); document.getElementById(id).click(); } } } document.getElementById(id).value += " (F2)"; window.addEventListener('keydown', keydownF2, true); } } // Aufruf Config per F4 Taste. Nur auf erlaubten Seiten. Nicht im Config. if (settings_f4_call_gclh_config && !check_config_page()) { function keydownF4(e) { if (e.keyCode == 115 && noSpecialKey(e) && !check_config_page()) { if (checkTaskAllowed('Config', false) == true) gclh_showConfig(); else document.location.href = defaultConfigLink; } } window.addEventListener('keydown', keydownF4, true); } // Aufruf Sync per F10 Taste. Nur auf erlaubten Seiten. Nicht im Sync. Nicht im Config Reset Modus. if (settings_f10_call_gclh_sync && !check_sync_page()) { function keydownF10(e) { if (e.keyCode == 121 && noSpecialKey(e) && !check_sync_page() && !global_mod_reset) { if (checkTaskAllowed('Sync', false) == true) gclh_showSync(); else document.location.href = defaultSyncLink; } } window.addEventListener('keydown', keydownF10, true); } } catch(e) {gclh_error("F2, F4, F10 keys",e);} // Wait for header and build up header. tlc('START buildUpHeader'); try { function buildUpHeader(waitCount) { if ($('#gc-header, #GCHeader')[0] && !$('#ctl00_gcNavigation')[0]) { tlc('Header found'); // Integrate old header. ($('#gc-header') || $('#GCHeader')).after(header_old); // Run header relevant features. tlc('START setUserParameter'); setUserParameter(); tlc('START setMessageIndicator'); setMessageIndicator(0); tlc('START setUpgradeButton'); setUpgradeButton(); tlc('START changeHeaderLayout'); changeHeaderLayout(); tlc('START newWidth'); newWidth(); tlc('START removeGCMenues'); removeGCMenues(); tlc('START linklistOnTop'); linklistOnTop(); tlc('START buildSpecialLinklistLinks'); buildSpecialLinklistLinks(); tlc('START setSpecialLinks'); setSpecialLinks(); tlc('START runAfterRedirect'); runAfterRedirect(); tlc('START showDraftIndicatorInHeader'); showDraftIndicatorInHeader(); // User profile menu bend into shape. tlc('START User profile'); $('#ctl00_uxLoginStatus_divSignedIn button.li-user-toggle')[0].addEventListener('click', function(){ $('#ctl00_uxLoginStatus_divSignedIn li.li-user:not(#pgc_gclh)').toggleClass('gclh_open'); }); // Disable user profile menu by clicking anywhere else. $(document).click(function(){ if (!$(this)[0].activeElement.className.match(/li-user-toggle/)) { $('#ctl00_uxLoginStatus_divSignedIn li.li-user').removeClass('gclh_open'); } }); tlc('START OK'); } waitCount++; if (waitCount <= 1000) {setTimeout(function(){buildUpHeader(waitCount);}, 10);} else if (!$('#ctl00_gcNavigation')[0]) {tlc('STOP No header found');} } buildUpHeader(0); } catch(e) {gclh_error("Wait for header and build up header",e);} // Set user avatar, user and found count in new header. function setUserParameter() { if ($('#ctl00_uxLoginStatus_hlHeaderAvatar')[0]) $('#ctl00_uxLoginStatus_hlHeaderAvatar')[0].src = global_avatarUrl; if ($('.li-user-info .user-name')[0]) $('.li-user-info .user-name')[0].innerHTML = global_me; if ($('.li-user-info .cache-count')[0]) $('.li-user-info .cache-count')[0].innerHTML = global_findCount + ' Finds'; } // Set message center message indicator. function setMessageIndicator(waitCount) { if ($('.message-center i')[0] && $('.gclh_message-center')[0]) { $('.gclh_message-center svg').before(' '); } else {waitCount++; if (waitCount <= 20) setTimeout(function(){setMessageIndicator(waitCount);}, 500);} } // Set upgrade button. function setUpgradeButton() { if (global_isBasic && !settings_upgrade_button_header_remove) { $('.messagecenterheaderwidget.li-messages').before('
  • Upgrade
  • '); } } // Change Header layout. function changeHeaderLayout() { try { if (settings_change_header_layout) { if (isMemberInPmoCache()) { if ($('#ctl00_siteHeader')[0]) $('#ctl00_siteHeader')[0].remove(); return; } // Alle Seiten: Grundeinstellungen: // ---------- var css = ""; // Font-Size für Menüs, Font-Size für Untermenüs in Pixel. var font_size_menu = parseInt(settings_font_size_menu); if ((font_size_menu == 0) || (font_size_menu < 0) || (font_size_menu > 16)) font_size_menu = 16; var font_size_submenu = parseInt(settings_font_size_submenu); if ((font_size_submenu == 0) || (font_size_submenu < 0) || (font_size_submenu > 16)) font_size_submenu = 15; // Abstand zwischen Menüs, Abstand zwischen Untermenüs in Pixel. var distance_menu = parseInt(settings_distance_menu); if ((distance_menu < 0) || (distance_menu > 99)) distance_menu = (50 / 2); else distance_menu = (distance_menu / 2); if (settings_bookmarks_top_menu == false && settings_menu_show_separator == true) distance_menu = (distance_menu / 2); var distance_submenu = parseInt(settings_distance_submenu); if ((distance_submenu < 0) || (distance_submenu > 32)) distance_submenu = (8); // (8/2) else distance_submenu = (distance_submenu); // (.../2) // Font-Color in Menüs, Untermenüs. var font_color_menu = settings_font_color_menu; if (font_color_menu == "") font_color_menu = "93B516"; var font_color_submenu = settings_font_color_submenu; if (font_color_submenu == "") font_color_submenu = "93B516"; // Background color and cursor on submenu if hover. css += '.#sm a.noLink, .#sm li.noLink {opacity: 0.7;}'; css += '.#sm a.noLink:hover, .#sm li.noLink:hover {background-color: unset; cursor: default;}'; css += '.#sm a:hover, .#sm li:hover {background-color: #e8f6ef;}'; // Menüweite berechnen. var new_width = 950; var new_width_menu = 950; var new_width_menu_cut_old = 0; var new_padding_right = 0; if (getValue("settings_new_width") > 0) new_width = parseInt(getValue("settings_new_width")); new_padding_right = 261 - 14; if (settings_show_smaller_gc_link) { new_width_menu = new_width - 261 + 20 - 28; new_width_menu_cut_old = 28; } else { new_width_menu = new_width - 261 + 20 - 190; new_width_menu_cut_old = 190; } // Im neuen Dashboard Upgrade Erinnerung entfernen. $('.sidebar-upsell').remove(); // Icons aus Play Menü entfernen. $('#ctl00_gcNavigation .menu .charcoal').remove(); $('.li-attention').removeClass('li-attention').addClass('li-attention_gclh'); css += // Schriftfarbe Menü. ".#m li a, .#m li a:link, .#m li a:visited, .#m li {color: #" + font_color_menu + " !important;}" + ".#m li a:hover, .#m li a:focus {color: #FFFFFF !important; outline: unset !important;}" + // Schriftfarbe Search Field. "#navi_search {color: #4a4a4a;} #navi_search:focus, #navi_search:focus-visible, #navi_search:active {outline: none; box-shadow: none;}" + // Submenü im Vordergrund. ".#m .#sm {z-index: 1001;}" + // Schriftfarbe Untermenü. ".#m .#sm li a, .#m .#sm li a:link, .#m .#sm li a:visited, .#m .#sm li {color: #" + font_color_submenu + " !important;}" + // Schriftgröße Menü. ".#m {font-size: 16px !important;}" + ".#m li, .#m li a, .#m li input {font-size: " + font_size_menu + "px !important;}" + // Abstände Menü. "ul.#m > li {margin-left: " + distance_menu + "px !important; margin-right: " + distance_menu + "px !important;} ul.#m li a {padding: .25em .25em .25em 0 !important;}" + // Schriftgröße Untermenü. ".#m ul.#sm, .#m ul.#sm li {font-size: 16px !important;}" + ".#m ul.#sm li a {font-size: " + font_size_submenu + "px !important;}" + // Abstände Untermenü und Seiten. "ul.#sm li a, ul.#sm li button {padding: " + (distance_submenu / 2) + "px 9px !important; margin: 0px !important;} .#sm a {line-height: unset;} .#m a {overflow: initial}" + "ul.#sm li {margin: -1px 9px 1px 9px;} ul.#sm li form {margin: 0px !important; padding: 0px !important}" + // Menühöhe. ".#m {height: 35px !important;}" + // Markierung eines neuen Untermenüs. "ul.#sm li span.flag-new {color: #3d76c5; margin-left: 16px;}" + // Verschieben Submenüs unterbinden. ".#m .#sm {margin-left: 0 !important}"; // Vertikales Menü ausrichten. if (settings_bookmarks_top_menu) { // Menüzeilenhöhe, Menü nicht flex. css += "ul.#m {line-height: 16px; display: block;}"; // Zwischen Menüname und Submenü keine Lücke lassen, sonst klappts nicht mit einfachem Aufklappen. css += ".#m li a, .#m li a:link, .#m li a:visited {margin-bottom: 13px;} .#m ul.#sm {margin-top: -6px;}"; // Horizontales Menü ausrichten. } else { // Menüzeilenhöhe. css += "ul.#m {line-height: 16px !important;}"; css += "ul.#m > li{margin-bottom: 2px;}"; // Zeilenabstand in Abhängigkeit von Anzahl Zeilen. if (settings_menu_number_of_lines == 2) css += "ul.#m li a {padding-top: 4px !important; padding-bottom: 4px !important;}"; else if (settings_menu_number_of_lines == 3) css += "ul.#m li a {padding-top: 1px !important; padding-bottom: 1px !important;}"; } // Message Center Icon entfernen. if (settings_remove_message_in_header) $('.messagecenterheaderwidget').remove(); // Geocaching Logo ersetzen, verschieben oder entfernen. if ($('.logo')[0]) { var side = $('.logo')[0]; changeGcLogo(side); } css += "#l {flex: unset; overflow: unset; margin-left: -32px} #newgclogo {width: 30px !important;}" + ".#m {width: " + new_width_menu + "px !important; margin-left: 6px !important;}" + "nav .wrapper, gclh_nav .wrapper {min-width: " + (new_width + 40) + "px !important; max-width: unset;}"; // Bereich links ausrichten in Abhängigkeit davon, ob Logo geändert wird und ob GC Tour im Einsatz ist. if (!settings_show_smaller_gc_link && !settings_gc_tour_is_working) css += "#l {margin-top: 0px; fill: #ffffff;}"; else if (!settings_show_smaller_gc_link && settings_gc_tour_is_working) css += "#l {margin-top: -47px; fill: #ffffff;}"; else if (settings_show_smaller_gc_link && !settings_gc_tour_is_working) css += "#l {margin-top: 6px; width: 30px;}"; else if (settings_show_smaller_gc_link && settings_gc_tour_is_working) css += "#l {margin-top: -41px; width: 30px;}"; // Account Settings, Message Center, Cache suchen, Cache verstecken, Geotours, Karten, account/dashboard und track: // ---------- if (is_page("settings") || is_page("messagecenter") || is_page("find_cache") || is_page("collection_1") || is_page("geotours") || is_page("map") || is_page("dashboard-section") || is_page("track")) { css += "nav .wrapper {padding-right: " + new_padding_right + "px !important; width: unset;}"; // Vertikales Menü ausrichten. if (settings_bookmarks_top_menu) { if (is_page("find_cache")) { css += ".#m li:not(.attention-link-parent) ul.#sm {margin-top: 17px;}"; } css += ".#m ul.#sm {margin-top: 0px; margin-left: 32px !important;} .#m .submenu::after {left: 4px; width: 26px;}"; // Menü, Searchfield ausrichten in Abhängigkeit von Schriftgröße. Menü nicht flex. if (settings_menu_float_right) { css += "ul.#m > li {margin-top: " + (3 + (16 - font_size_menu) / 2) + "px;}"; } else { if (is_page("map")) css += "ul.#m > li {margin-top: " + (3 + (16 - font_size_menu) / 2) + "px;}"; else css += "ul.#m > li {margin-top: " + (4 + (16 - font_size_menu) / 2) + "px;}"; } // Menü in Karte ausrichten. if (is_page("map") && !settings_menu_float_right) css += ".#m {height: unset !important;}"; if (is_page("map") && settings_menu_float_right) css += "#navi_search {margin: 0 !important;}"; // Horizontales Menü ausrichten in Abhängigkeit von Anzahl Zeilen. } else { if (settings_menu_number_of_lines == 1) css += "ul.#m {top: 4px !important; position: inherit;}"; else if (settings_menu_number_of_lines == 2) css += "ul.#m {top: -8px !important; position: inherit; flex-wrap: wrap;}"; else if (settings_menu_number_of_lines == 3) css += "ul.#m {top: -13px !important; position: inherit; flex-wrap: wrap;}"; } // Prevent the user area in the header from moving to the left on narrow screens. css += "ul.menu {order: unset;} #ctl00_uxLoginStatus_divSignedIn {height: auto;} .messagecenterheaderwidget.li-messages {position: static;}"; // Prevent the play menu from disappear on narrow screens. css += ".menu .attention-link-parent > a {display: block;};"; // Altes Seiten Design und restliche Seiten: // ---------- } else { if (settings_fixed_header_layout && !is_page("searchmap")) { css += "nav .wrapper, gclh_nav .wrapper {width: " + new_width + "px !important; padding-left: 50px; padding-right: 30px; min-width: unset}"; if (settings_remove_logo && settings_show_smaller_gc_link) css += ".#m {margin-left: -28px !important;}"; } // Vertikales Menü ausrichten. if (settings_bookmarks_top_menu) { if (is_page("cache_listing") && $('.ul__cache-details.unstyled')[0]) { css += ".#m ul.#sm {margin-top: -10px; margin-left: 32px !important;} .#m .submenu::after {left: 4px; width: 26px;}"; } else { css += ".#m ul.#sm {margin-top: 17px; margin-left: 32px !important;} .#m .submenu::after {left: 4px; width: 26px;}"; } // Zwischen Menüname und Submenü keine Lücke lassen, sonst klappt das nicht mit dem einfachen Aufklappen. css += ".#m > li .dropdown {padding-bottom: 14px !important;}"; // Menü, Searchfield ausrichten in Abhängigkeit von Schriftgröße. Menü nicht flex. if (settings_menu_float_right) { css += "ul.#m > li {margin-top: " + (7 + (16 - font_size_menu) / 2) + "px;}"; } else { css += "ul.#m > li {margin-top: " + (5 + (16 - font_size_menu) / 2) + "px;}"; } // Horizontales Menü ausrichten in Abhängigkeit von Anzahl Zeilen. } else { if (settings_menu_number_of_lines == 1) css += "ul.#m {top: 4px !important; position: inherit;}"; else if (settings_menu_number_of_lines == 2) css += "ul.#m {top: -8px !important; position: inherit; flex-wrap: wrap;}"; else if (settings_menu_number_of_lines == 3) css += "ul.#m {top: -13px !important; position: inherit; flex-wrap: wrap;}"; } } // Alle Seiten: Platzhalter umsetzen: // ---------- css = css.replace(/#m/gi, "menu").replace(/#sm/gi, "submenu").replace(/#l/gi, "nav .logo, gclh_nav .logo"); appendCssStyle(css); } } catch(e) {gclh_error("Change header layout",e);} } // GC Logo. function changeGcLogo(side) { if (settings_show_smaller_gc_link && side && side.children[0]) { side.children[0].remove(); if (!settings_remove_logo) { var gc_link = document.createElement("a"); var gc_img = document.createElement("img"); gc_img.setAttribute("style", "clip: unset; width: 35px; margin-top: -3px;"); gc_img.setAttribute("title", "Geocaching"); gc_img.setAttribute("id", "newgclogo"); gc_img.setAttribute("src", global_gc_icon2); gc_link.appendChild(gc_img); gc_link.setAttribute("href", "/"); side.appendChild(gc_link); } } } // New Width. (Menüweite wird bei Change Header Layout gesetzt.) function newWidth() { try { // Keine Anpassungen. if (is_page('lists') || is_page('searchmap') || is_page("messagecenter") || is_page("settings") || is_page("hide_cache") || is_page("collection_1") || is_page("find_cache") || is_page("geotours") || is_page("map") || is_page("dashboard-section") || is_page("track") || is_page("owner_dashboard") || is_page("promos") || is_page("logbook")) return; if (getValue("settings_new_width") > 0) { var new_width = parseInt(getValue("settings_new_width")); var css = ""; // Header- und Fußbereich: css += "header, nav, footer {min-width: " + (new_width + 40) + "px !important;}"; css += "header .container, nav .container {max-width: unset;}"; // Keine weiteren Anpassungen. if (document.location.href.match(/\.com\/pocket\/gcquery\.aspx/) || // Pocket Query: Einstellungen zur Selektion document.location.href.match(/\.com\/pocket\/bmquery\.aspx/)); // Pocket Query aus Bockmarkliste: Einstellungen zur Selektion else { css += "#Content .container, #Content .span-24, .span-24 {width: " + new_width + "px;}"; css += ".CacheStarLabels.span-6 {width: " + ((new_width - 300 - 190 - 10 - 10) / 2) + "px !important;}"; css += ".span-6.right {width: " + ((new_width - 300 - 190 - 10 - 10) / 2) + "px !important;}"; css += ".span-8 {width: " + ((new_width - 330 - 10) / 2) + "px !important;}"; css += ".span-10 {width: " + ((new_width - 170) / 2) + "px !important;}"; css += ".span-15 {width: " + (new_width - 360) + "px !important;}"; css += ".span-16 {width: " + (new_width - 320 - 10) + "px !important;}"; css += ".span-17 {width: " + (new_width - 300) + "px !important;}"; css += ".span-19 {width: " + (new_width - 200) + "px !important;}"; css += ".span-20 {width: " + (new_width - 160) + "px;}"; css += ".LogDisplayRight {width: " + (new_width - 180) + "px !important;}"; css += "#log_tabs .LogDisplayRight {width: " + (new_width - 355) + "px !important;}"; css += "#uxBookmarkListName {width: " + (new_width - 470 - 5) + "px !important;}"; css += "table.TrackableItemLogTable div {width: " + (new_width - 160) + "px !important; max-width: unset;}"; css += ".UserSuppliedContent {max-width: unset;}"; // Besonderheiten: if (!is_page("cache_listing")) css += ".UserSuppliedContent {width: " + (new_width - 200) + "px;}"; if (is_page("publicProfile")) css += ".container .profile-panel {width: " + (new_width - 160) + "px;}"; if (is_page("cache_listing")) css += ".span-9 {width: " + (new_width - 300 - 270 - 13 - 13 - 10 - 6) + "px !important;}"; else if (document.location.href.match(/\.com\/my\/statistics\.aspx/) || (is_page("publicProfile") && $('#ctl00_ContentBody_ProfilePanel1_lnkStatistics.Active')[0])) { css += ".span-9 {width: " + ((new_width - 280) / 2) + "px !important; margin-right: 30px;} .last {margin-right: 0px;}"; css += ".StatsTable {width: " + (new_width - 250) + "px !important;}"; if (is_page("publicProfile")) { css += ".ProfileStats {overflow-x: hidden; width: " + (new_width - 210) + "px;}"; } else { css += ".ProfileStats {overflow-x: hidden; width: " + (new_width - 180) + "px;}"; } css += "#ctl00_ContentBody_ProfilePanel1_StatsChronologyControl1_FindsPerMonth, #ctl00_ContentBody_ProfilePanel1_StatsChronologyControl1_CumulativeFindsPerMonth, #CacheTypesFound, #ctl00_ContentBody_StatsChronologyControl1_FindsPerMonth, #ctl00_ContentBody_StatsChronologyControl1_CumulativeFindsPerMonth {margin-left: -15px;}"; css += "#ctl00_ContentBody_ProfilePanel1_StatsChronologyControl1_FindsPerMonth h3, #ctl00_ContentBody_ProfilePanel1_StatsChronologyControl1_CumulativeFindsPerMonth h3, #CacheTypesFound h3, #ctl00_ContentBody_StatsChronologyControl1_FindsPerMonth h3, #ctl00_ContentBody_StatsChronologyControl1_CumulativeFindsPerMonth h3 {margin-left: 15px;}"; } else if (is_page("publicProfile")) { if ($('#ctl00_ContentBody_ProfilePanel1_lnkCollectibles.Active')[0]) { css += ".span-9 {width: " + ((new_width - 250) / 2) + "px !important;} .prepend-1 {padding-left: 10px;}"; } else { css += ".span-9 {width: " + ((new_width - 250) / 2) + "px !important;}"; css += ".StatsTable {width: " + (new_width - 250 - 30) + "px !important;}"; } } else if (document.location.href.match(/\.com\/notify\/default\.aspx/)) { css += ".span-20 {width: " + new_width + "px;}"; } else if (is_page("logform")) { if (settings_larger_content_width_log_form) { css += ".content-container {width: " + new_width + "px !important; max-width: unset !important;}"; css += ".form-container {margin-left: 0px !important; margin-right: 0px !important;}"; css += ".breadcrumbs {margin-left: 0px !important; margin-right: 0px !important; padding-left: 0px !important; padding-right: 0px !important;}"; } if (settings_less_space_log_lines_log_form) { css += "#gc-md-editor_md, .markdown-output {line-height: 1.375; font-size: 14px; gap: 0px;}"; } } } appendCssStyle(css); } } catch(e) {gclh_error("New width",e);} } // Remove GC Menüs. function removeGCMenues() { try { var m = $('ul.(Menu|menu) li a.dropdown'); for (var i = 0; i < m.length; i++) { if ((m[i].href.match(/\/play\/search/) && getValue('remove_navi_play')) || (m[i].href.match(/\/forums\/$/) && getValue('remove_navi_community')) || (m[i].href.match(/shop\.geocaching\.com/) && getValue('remove_navi_shop'))) { m[i].parentNode.remove(); } if (m[i].href.match(/\/play\/search/) || m[i].href.match(/\/forums\/$/) || m[i].href.match(/shop\.geocaching\.com/)) { m[i].href = '#'; } } } catch(e) {gclh_error("Remove GC Menüs",e);} } // Linklist on top. function linklistOnTop() { try { // Replace {me} and apostrophes in bookmarks. for (var i = 0; i < bookmarks.length; i++) { if (bookmarks[i]['href'].match('{me}') && global_me && global_me != "") { bookmarks[i]['href'] = bookmarks[i]['href'].replace('{me}', global_me); } } // Auch ohne Change Header Layout zwischen Menüname und Submenü keine Lücke lassen, sonst klappts nicht mit einfachem Aufklappen. if (!settings_change_header_layout) { if (is_page("map")) { appendCssStyle(".menu > li, .Menu > li {height: 100%; padding-top: 2.0em;} .submenu, .SubMenu {margin-top: 1.9em;}"); } else if (is_page("find_cache") || is_page("hide_cache") || is_page("collection_1") || is_page("geotours") || is_page("dashboard-section") || is_page("track")) { appendCssStyle(".menu > li, .Menu > li {height: 100%; padding-top: 2.1em;} .submenu, .SubMenu {margin-top: 2.0em;}"); } else { appendCssStyle(".menu > li, .Menu > li {height: 100%; padding-top: 2.0em;} .submenu, .SubMenu {margin-top: 2.0em;}"); } } if (settings_bookmarks_on_top && $('.Menu, .menu').length > 0) { var nav_list = $('.Menu, .menu')[0]; var menu = document.createElement("li"); var headline = document.createElement("a"); if (settings_bookmarks_top_menu || settings_change_header_layout == false) { // Navi vertikal headline.setAttribute("href", "#"); headline.setAttribute("class", "Dropdown dropdown"); headline.setAttribute("accesskey", "7"); headline.innerHTML = "Linklist"; menu.appendChild(headline); var submenu = document.createElement("ul"); $(submenu).addClass("SubMenu").addClass("submenu"); menu.appendChild(submenu); for (var i = 0; i < settings_bookmarks_list.length; i++) { var x = settings_bookmarks_list[i]; if (typeof(x) == "undefined" || x == "" || typeof(x) == "object") continue; var sublink = document.createElement("li"); var hyperlink = document.createElement("a"); for (attr in bookmarks[x]) { if (attr != "custom" && attr != "title") hyperlink.setAttribute(attr, bookmarks[x][attr]); } if (bookmarks[x]['href'].match(/^([#\s]*)$/)) { hyperlink.setAttribute('class', 'noLink'); sublink.setAttribute('class', 'noLink'); } hyperlink.appendChild(document.createTextNode(bookmarks[x]['title'])); sublink.appendChild(hyperlink); submenu.appendChild(sublink); } nav_list.appendChild(menu); } else { // Navi horizontal for (var i = 0; i < settings_bookmarks_list.length; i++) { var x = settings_bookmarks_list[i]; if (typeof(x) == "undefined" || x == "" || typeof(x) == "object") continue; var sublink = document.createElement("li"); var hyperlink = document.createElement("a"); for (attr in bookmarks[x]) { if (attr != "custom" && attr != "title") hyperlink.setAttribute(attr, bookmarks[x][attr]); } hyperlink.appendChild(document.createTextNode(bookmarks[x]['title'])); sublink.appendChild(hyperlink); nav_list.appendChild(sublink); } } // Search field. if (settings_bookmarks_search) { var code = "function gclh_search_logs(){"; code += " var search = document.getElementById('navi_search').value.trim();"; code += " if (search.match(/^(GC|TB|GT|PR|BM|GL)[A-Z0-9]{1,10}\\b/i)) document.location.href = 'https://coord.info/'+search;"; code += " else if (search.match(/^[A-Z0-9]{6}\\b$/i)) document.location.href = '/track/details.aspx?tracker='+search;"; code += " else document.location.href = '/seek/nearest.aspx?navi_search='+search;"; code += "}"; injectPageScript(code, "body"); var searchfield = "
  • "; $(".Menu, .menu").append(searchfield); } if (settings_menu_show_separator) { if (settings_bookmarks_top_menu || settings_change_header_layout == false); // Navi vertikal else { // Navi horizontal var menuChilds = $('ul.Menu, ul.menu')[0].children; for (var i = 1; i < menuChilds.length; i += 2) { var separator = document.createElement("li"); separator.appendChild(document.createTextNode("|")); menuChilds[i].parentNode.insertBefore(separator, menuChilds[i]); } } } // Vertikale Menüs rechts ausrichten. if (settings_bookmarks_top_menu && settings_menu_float_right && settings_change_header_layout) { if ($('ul.Menu, ul.menu')[0]) { var menu = $('ul.Menu, ul.menu')[0]; var menuChilds = $('ul.Menu, ul.menu')[0].children; for (var i = 0; i < menuChilds.length; i++) { var child = menu.removeChild(menu.children[menuChilds.length-1-i]); child.setAttribute("style", "float: right;"); menu.appendChild(child); } } } } // Hover für alle Dropdowns aufbauen, auch für die von GS. if ($('.Menu, .menu').length > 0) { buildHover(); } } catch(e) {gclh_error("Linklist on top",e);} } // Hover aufbauen. Muss nach Menüaufbau erfolgen. function buildHover() { $('ul.Menu, ul.menu').children().hover(function() { $(this).addClass('hover'); $(this).addClass('open'); $('ul:first', this).css('visibility', 'visible'); }, function() { $(this).removeClass('hover'); $(this).removeClass('open'); $('ul:first', this).css('visibility', 'hidden'); } ); } // Aufbau Links zum Aufruf von Config, Sync und Find Player aus Linklist (1. Schritt). function buildSpecialLinklistLinks() { try { // GClh Config, Sync und Find Player Aufrufe aus Linklist heraus. if (checkTaskAllowed('Config', false) == true && document.getElementsByName("lnk_gclhconfig")[0]) { document.getElementsByName("lnk_gclhconfig")[0].href = "#GClhShowConfig"; document.getElementsByName("lnk_gclhconfig")[0].addEventListener('click', gclh_showConfig, false); } if (checkTaskAllowed('Sync', false) == true && document.getElementsByName("lnk_gclhsync")[0]) { document.getElementsByName("lnk_gclhsync")[0].href = "#GClhShowSync"; document.getElementsByName("lnk_gclhsync")[0].addEventListener('click', gclh_showSync, false); } if (checkTaskAllowed("Find Player", false) == true && document.getElementsByName("lnk_findplayer")[0]) { document.getElementsByName("lnk_findplayer")[0].href = "#GClhShowFindPlayer"; document.getElementsByName("lnk_findplayer")[0].addEventListener('click', createFindPlayerForm, false); } } catch(e) {gclh_error("Aufbau Links zum Aufruf von Config, Sync und Find Player aus Linklist (1. Schritt)",e);} } // Special Links aus Linklist bzw. Default Links versorgen. function setSpecialLinks() { try { // Links zu Nearest Lists/Map in Linklist und Default Links setzen. if (getValue("home_lat", 0) != 0 && getValue("home_lng") != 0) { var link = "/seek/nearest.aspx?lat=" + (getValue("home_lat") / 10000000) + "&lng=" + (getValue("home_lng") / 10000000) + "&dist=25&disable_redirect="; setLnk("lnk_nearestlist", link); setLnk("lnk_nearestlist_profile", link); var link = map_url + "?lat=" + (getValue("home_lat") / 10000000) + "&lng=" + (getValue("home_lng") / 10000000); setLnk("lnk_nearestmap", link); setLnk("lnk_nearestmap_profile", link); var link = "/seek/nearest.aspx?lat=" + (getValue("home_lat") / 10000000) + "&lng=" + (getValue("home_lng") / 10000000) + "&dist=25&f=1&disable_redirect="; setLnk("lnk_nearestlist_wo", link); setLnk("lnk_nearestlist_wo_profile", link); } // Links zu den eigenen Trackables in Linklist und Default Links setzen. if (getValue("uid", "") != "") { var link = "/track/search.aspx?o=1&uid=" + getValue("uid"); setLnk("lnk_my_trackables", link); setLnk("lnk_my_trackables_profile", link); } } catch(e) {gclh_error("Special Links",e);} } function setLnk(lnk, link) { if (document.getElementsByName(lnk)[0]) document.getElementsByName(lnk)[0].href = link; if (document.getElementsByName(lnk)[1]) document.getElementsByName(lnk)[1].href = link; } // Run after redirect. function runAfterRedirect() { try { var splitter = document.location.href.split("#"); if (splitter && splitter[1] && splitter[1] == "gclhpb" && splitter[2] && splitter[2] != "") { var postbackValue = splitter[2]; // Adopt home coords in GClh. if (postbackValue == "errhomecoord") { var mess = "To use this link, the GC little helper II has to know your home coordinates. " + "Do you want to go to the special area and let GC little helper II save " + "your home coordinates automatically?\n\n" + "GC little helper II will save it automatically. You have nothing to do at the " + "following page \"Home Location\", except, to choose your link again.\n" + "(But, please wait until page \"Home Location\" is loading complete.)"; if (window.confirm(mess)) document.location.href = "/account/settings/homelocation"; else document.location.href = document.location.href.replace("?#"+splitter[1]+"#"+splitter[2]+"#", ""); // Adopt uid of own trackables in GClh. } else if (postbackValue == "errowntrackables") { var mess = "To use this link, GC little helper II has to know the identification of " + "your trackables. Do you want to go to your dashboard and " + "let GC little helper II save the identification (uid) automatically?\n\n" + "GC little helper II will save it automatically. You have nothing to do at the " + "following page \"Dashboard\", except, to choose your link again.\n" + "(But, please wait until page \"Dashboard\" is loading complete.)"; if (window.confirm(mess)) document.location.href = "/my/default.aspx"; else document.location.href = document.location.href.replace("?#"+splitter[1]+"#"+splitter[2], ""); } } } catch(e) {gclh_error("Run after redirect",e);} } // Show draft indicator in header. function showDraftIndicatorInHeader() { if (settings_show_draft_indicator) { try { $.get('https://www.geocaching.com/account/dashboard', null, function(text) { // Look for drafts in old layout. draft_list = $(text).find('#uxDraftLogs span'); if (draft_list != null) drafts = draft_list[0]; else drafts = false; if (!drafts) { // If not found, Look for drafts in new layout. draft_list = $(text).find("nav a[href='/my/fieldnotes.aspx']"); if (draft_list != null) drafts = draft_list[0]; else drafts = false; } if (drafts) { draft_count = parseInt(drafts.innerHTML.match(/\d+/)); if (Number.isInteger(draft_count) && draft_count > 0) { $('.li-user-info .user-avatar, .player-profile').prepend('' + draft_count + ''); } } }); } catch(e) {gclh_error("Show draft indicator in header",e);} } } // Automatic processing after logging with new or old log form. try { // Drafts related logging with new or old log form. if ((is_page("cache_listing") && $('#uxViewNewLogLink')[0] && $('#uxNewLogExtraLink')[0]) || (document.location.href.match(/\.com\/seek\/log\.aspx\?PLogGuid=([a-zA-Z0-9-]*)/) && $('#ctl00_ContentBody_LogBookPanel1_lblErrorMessage .Success')[0])) { // Automatic go back to drafts page. if (settings_drafts_go_automatic_back) document.location = 'https://www.geocaching.com/account/drafts'; // Automatic go to view log page. else if (settings_drafts_after_new_logging_view_log && $('#uxViewNewLogLink')[0]) document.location = $('#uxViewNewLogLink')[0].href + '&gclhDraft'; // Non Drafts related logging with new log form. } else if (is_page("cache_listing") && $('#uxViewNewLogLink')[0] && !$('#uxNewLogExtraLink')[0]) { // Automatic go to view log page. if (settings_after_new_logging_view_log) document.location = $('#uxViewNewLogLink')[0].href; } // After automatic go to view log page, because of Drafts related logging with new log form. if (document.location.href.match(/\.com\/seek\/log\.aspx\?LUID=(.*)&gclhDraft/) && $('#ctl00_ContentBody_LogBookPanel1_CoordInfoLinkControl1_uxCoordInfoLinkPanel p')[0]) { if (!document.location.href.match(/&edit=true/) && !$('#ctl00_ContentBody_LogBookPanel1_btnCancel')[0]) { $('#ctl00_ContentBody_LogBookPanel1_CoordInfoLinkControl1_uxCoordInfoLinkPanel')[0].style.float = 'none'; $('#ctl00_ContentBody_LogBookPanel1_CoordInfoLinkControl1_uxCoordInfoLinkPanel p')[0].style.float = 'right'; $('#ctl00_ContentBody_LogBookPanel1_CoordInfoLinkControl1_uxCoordInfoLinkPanel p').before('

    You have submitted your draft. Submit more drafts.

    '); } } } catch(e) {gclh_error("Automatic processing from listing after logging",e);} // Collection of css for cache listings. if (is_page("cache_listing")) { var css = '' // Define class "working" and "isDisabled". css += ".working, .isDisabled {opacity: 0.4; cursor: default !important; text-decoration: none !important;}"; // Display listing images not over the maximum available width for FF and chrome. css += ".UserSuppliedContent img {max-width: -moz-available; max-width: -webkit-fill-available;}"; appendCssStyle(css); } // Disabled and archived ... if (is_page("cache_listing")) { try { // Ist die letzte Meldung oberhalb des Cachenamens eine archiert oder locked Meldung, dann Cachename in rot. if (($('#ctl00_ContentBody_archivedMessage')[0] || $('#ctl00_ContentBody_lockedMessage')[0]) && $('#ctl00_ContentBody_CacheName')[0]) $('#ctl00_ContentBody_CacheName')[0].style.color = '#8C0B0B'; // Ist die letzte Meldung oberhalb des Cachenamens eine archiert, locked oder disabled Meldung, dann Cachename durchstreichen. if (settings_strike_archived && $('#ctl00_ContentBody_CacheName')[0] && ($('#ctl00_ContentBody_archivedMessage')[0] || $('#ctl00_ContentBody_disabledMessage')[0] || $('#ctl00_ContentBody_lockedMessage')[0])) { $('#ctl00_ContentBody_CacheName')[0].style.textDecoration = 'line-through'; } if ($('.more-cache-logs-link')[0] && $('.more-cache-logs-link')[0].href) $('.more-cache-logs-link')[0].href = "#logs_section"; if (settings_log_status_icon_visible && $('#activityBadge use')[0]) { $('#activityBadge use')[0].setAttribute('xlink:href', $('#activityBadge use')[0].getAttribute('xlink:href').replace('-disabled', '')); } if (settings_cache_type_icon_visible && $('#uxCacheImage use')[0]) { $('#uxCacheImage use')[0].setAttribute('xlink:href', $('#uxCacheImage use')[0].getAttribute('xlink:href').replace('-disabled', '')); } } catch(e) {gclh_error("Disabled and archived",e);} } // Improve calendar link in events. (Im Google Link den Cache Link von &location nach &details verschieben.) if (is_page("cache_listing") && document.getElementById("calLinks")) { try { function impCalLink(waitCount) { if ($('#calLinks').find('a[title*="Google"]')[0]) { var calL = $('#calLinks').find('a[title*="Google"]')[0]; if (calL && calL.href) calL.href = calL.href.replace(/&det(.*)&loc/, "&loc").replace(/%20\(http/, "&details=http").replace(/\)&spr/, "&spr"); } else {waitCount++; if (waitCount <= 20) setTimeout(function(){impCalLink(waitCount);}, 100);} } impCalLink(0); } catch(e) {gclh_error("Improve calendar link",e);} } // Improve event date and event time in cache listing. if (is_page("cache_listing") && $('#cacheDetails svg.cache-icon use')[0] && $('#cacheDetails svg.cache-icon use')[0].href.baseVal.match(/\/cache-types.svg\#icon-(6$|6-|453$|453-|13$|13-|7005$|7005-|3653$|3653-)/)) { // Event, MegaEvent, Cito, GigaEvent, CommunityCelebrationEvents // Show eventday beside date. if (settings_show_eventday) { try { var match = $('meta[name="og:description"]')[0].content.match(/([0-9]{2})\/([0-9]{2})\/([0-9]{4})/); if (match == null) { match = $('meta[name="description"]')[1].content.match(/([0-9]{2})\/([0-9]{2})\/([0-9]{4})/); } if (match != null) { var date = new Date(match[3], match[1]-1, match[2]); if (date != "Invalid Date") { var name = " (" + date.getWeekday() + ") "; var elem = document.createTextNode(name); var side = $('#ctl00_ContentBody_mcd2')[0]; side.insertBefore(elem, side.childNodes[1]); } } } catch(e) {gclh_error("Show eventday beside date",e);} } // Show eventtime in 24 hours format. if (settings_show_eventtime_with_24_hours) { try { if ($('#ctl00_ContentBody_mcd2') && $('#mcd3')[0] && $('#mcd4')[0]) { let sStr = $('#mcd3')[0].innerHTML.trim().match(/^(\D+):\s+(\d{1,2}:\d{2}\s+(AM|PM))$/i); let eStr = $('#mcd4')[0].innerHTML.trim().match(/^(\D+):\s+(\d{1,2}:\d{2}\s+(AM|PM))$/i); if (sStr && sStr.length == 4 && eStr && eStr.length == 4) { var t = convert12To24Hour(sStr[2]); $('#mcd3')[0].innerHTML = $('#mcd3')[0].innerHTML.replace(sStr[2], t); var t = convert12To24Hour(eStr[2]); $('#mcd4')[0].innerHTML = $('#mcd4')[0].innerHTML.replace(eStr[2], t); } } } catch(e) {gclh_error("Show eventtime in 24 hours format",e);} } } // Show real owner. if (is_page("cache_listing") && $('#ctl00_ContentBody_mcd1')) { try { var real_owner = get_real_owner(); var link_owner = $('#ctl00_ContentBody_mcd1 a[href*="/profile/?guid="], #ctl00_ContentBody_mcd1 a[href*="/p/?guid="]')[0]; if (link_owner && real_owner) { var pseudo = link_owner.innerText; link_owner.innerHTML = (settings_show_real_owner ? real_owner : pseudo); link_owner.title = (settings_show_real_owner ? pseudo : real_owner); } } catch(e) {gclh_error("Show real owner",e);} } // Hide disclaimer on cache listing. if (settings_hide_disclaimer && is_page("cache_listing")) { try { var d = ($('.Note.Disclaimer')[0] || $('.DisclaimerWidget')[0] || $('.TermsWidget.no-print')[0]); if (d) d.remove(); } catch(e) {gclh_error("Hide disclaimer",e);} } // Highlight related web page link. if (is_page("cache_listing") && $('#ctl00_ContentBody_uxCacheUrl')[0]) { try { var lnk = $('#ctl00_ContentBody_uxCacheUrl')[0]; var html = "
    Please note

    "+lnk.parentNode.innerHTML+"

    "; lnk.parentNode.innerHTML = html; } catch(e) {gclh_error("Highlight related web page link",e);} } // Show the latest logs symbols. if (is_page("cache_listing") && settings_show_latest_logs_symbols && settings_load_logs_with_gclh) { try { function showLatestLogsSymbols(waitCount) { var gcLogs = false; if (waitCount == 0) { var logs = $('#cache_logs_table tbody tr.log-row').clone(); // GC Logs if (logs.length >= settings_show_latest_logs_symbols_count) gcLogs = true; } if (!gcLogs) var logs = $('#cache_logs_table2 tbody tr.log-row'); // GClh Logs if (logs.length > 0) { var lateLogs = new Array(); for (var i = 0; i < logs.length; i++) { if (settings_show_latest_logs_symbols_count == i) break; var lateLog = new Object(); if (gcLogs) { // Using initial GCLogs, they look different. lateLog['user'] = $(logs[i]).find('a[href*="/profile/?guid="], a[href*="/p/?guid="]').text(); lateLog['id'] = $(logs[i]).attr('class').match(/l-\d+/)[0].substr(2); } else { lateLog['user'] = $(logs[i]).find('.logOwnerProfileName a[href*="/profile/?guid="], .logOwnerProfileName a[href*="/p/?guid="]').text(); lateLog['id'] = $(logs[i]).find('.logOwnerProfileName a[href*="/profile/?guid="], .logOwnerProfileName a[href*="/p/?guid="]').attr('id'); } lateLog['src'] = $(logs[i]).find('.LogType img[src*="/images/logtypes/"]').attr('src'); lateLog['type'] = $(logs[i]).find('.LogType img[src*="/images/logtypes/"]').attr('title'); lateLog['date'] = $(logs[i]).find('.LogDate').text(); if (gcLogs) lateLog['log'] = $(logs[i]).find('.LogText').children().clone(); else lateLog['log'] = $(logs[i]).find('.LogContent').children().clone(); lateLogs[i] = lateLog; } if (lateLogs.length > 0 && $('#ctl00_ContentBody_mcd1')[0].parentNode) { var div = document.createElement("div"); var divTitle = ""; div.id = "gclh_latest_logs"; div.appendChild(document.createTextNode("Latest logs:")); if (isEventInCacheListing() == true) { // Alte Events ohne Zeitangabe. if ($('#mcd4')[0] && $('#mcd4')[0].innerHTML.match(/^(\s*)$/)) { div.setAttribute("style", "float: right; padding-right: 0; padding-top: 0px; font-size: 12px"); } else { div.setAttribute("style", "float: right; padding-right: 0; padding-top: 0px; margin-top: -16px; font-size: 12px"); } var side = $('#ctl00_ContentBody_mcd1')[0].parentNode.parentNode; } else { div.setAttribute("style", "float: right; padding-right: 0; padding-top: 2px;"); var side = $('#ctl00_ContentBody_mcd1')[0].parentNode; side.style.display = "initial"; } for (var i = 0; i < lateLogs.length; i++) { var a = document.createElement("a"); a.className = "gclh_latest_log"; if (gcLogs) { a.href = "#"; a.style.cursor = "unset"; } else a.href = "#" + lateLogs[i]['id']; var img = document.createElement("img"); img.src = lateLogs[i]['src']; img.setAttribute("style", "padding-left: 2px; vertical-align: bottom; "); img.title = img.alt = ""; var log_text = document.createElement("span"); log_text.title = ""; log_text.innerHTML = " " + lateLogs[i]['user'] + " - " + lateLogs[i]['date'] + "
    "; a.appendChild(img); for (var j = 0; j < lateLogs[i]['log'].length; j++) { if (j == 0 && !gcLogs) continue; log_text.appendChild(lateLogs[i]['log'][j]); } a.appendChild(log_text); div.appendChild(a); divTitle += (divTitle == "" ? "" : "\n" ) + lateLogs[i]['type'] + " - " + lateLogs[i]['date'] + " - " + lateLogs[i]['user']; } div.title = divTitle; side.appendChild(div); if (getValue("settings_new_width") > 0) var new_width = parseInt(getValue("settings_new_width")) - 310 - 180; else var new_width = 950 - 310 - 180; var css = "a.gclh_latest_log:hover {position: relative;}" + "a.gclh_latest_log span {display: none; position: absolute; left: -" + new_width + "px; width: " + new_width + "px; padding: 5px; text-decoration:none; text-align:left; vertical-align:top; color: #000000;}" + "a.gclh_latest_log:hover span {font-size: 13px; display: block; top: 16px; border: 1px solid #8c9e65; background-color:#dfe1d2; z-index:10000;}"; appendCssStyle(css); // In den GC Logs ist die Id für die Logs immer die Gleiche ..., ja doch ..., is klar ne ..., GS halt. // Deshalb müssen die Ids der Latest logs nachträglich in den GClh Logs ermittelt werden. function corrLatestLogsIds(waitCount) { if ($('#cache_logs_table2 tbody tr.log-row').length > 0) { var logsIds = $('#cache_logs_table2 tbody tr.log-row .logOwnerProfileName a'); var latestLogsIds = $('#gclh_latest_logs .gclh_latest_log'); for (var i = 0; i < 10; i++) { if (!logsIds[i] || !latestLogsIds[i]) break; latestLogsIds[i].href = '#'+logsIds[i].id; latestLogsIds[i].style.cursor = "pointer"; } } else {waitCount++; if (waitCount <= 250) setTimeout(function(){corrLatestLogsIds(waitCount);}, 200);} } if (gcLogs) corrLatestLogsIds(0); } } else {waitCount++; if (waitCount <= 250) setTimeout(function(){showLatestLogsSymbols(waitCount);}, 200);} } showLatestLogsSymbols(0); } catch(e) {gclh_error("Show the latest logs symbols",e);} } // Show log totals symbols at the top of cache listing. if (is_page("cache_listing") && settings_show_log_totals && $('.LogTotals')[0] && $('#ctl00_ContentBody_size')[0]) { try { var div = document.createElement('div'); div.className = "gclh_LogTotals Clear"; var span = document.createElement('span'); 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;} .LogTotals li + li {margin-left: 8px;} .LogTotals {margin-bottom: 0px;}'); } catch(e) {gclh_error("Show log totals symbols at the top",e);} } // Copy coordinates to clipboard. if (is_page("cache_listing") && $('#uxLatLon')[0]) { try { var cc2c = false; var span2 = document.createElement('span'); span2.innerHTML = ' '; var cc2c_pos = ($('#uxLatLonLink')[0] ? $('#uxLatLonLink')[0] : $('#uxLatLon')[0]) cc2c_pos.parentNode.insertBefore(span2, cc2c_pos); function copyCoordinatesToClipboard(waitCount) { if ( typeof unsafeWindow.mapLatLng !== "undefined" && unsafeWindow.mapLatLng !== null && (typeof unsafeWindow.mapLatLng.isUserDefined !== "undefined" || is_page("unpublished_cache")) ) { $('#gclh_cc2c').removeClass('working'); $('#gclh_cc2c')[0].setAttribute('title', (determineListingCoords('Corr') !== "" ? "Copy Corrected Coordinates to Clipboard" : "Copy Coordinates to Clipboard")); $('#gclh_cc2c')[0].addEventListener('click', function() { // Tastenkombination Strg+c ausführen für eigene Verarbeitung. cc2c = true; document.execCommand('copy'); }, false); document.addEventListener('copy', function(e){ // Normale Tastenkombination Strg+c für markierter Bereich hier nicht verarbeiten. Nur eigene Tastenkombination Strg+c hier verarbeiten. if (!cc2c) return; // Gegebenenfalls markierter Bereich wird hier nicht beachtet. e.preventDefault(); // Angezeigte Koordinaten werden hier verarbeitet. e.clipboardData.setData('text/plain', determineListingCoords('CorrOrg')); animateClick($('#gclh_cc2c')[0]); cc2c = false; }); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){copyCoordinatesToClipboard(waitCount);}, 100);} } copyCoordinatesToClipboard(0); } catch(e) {gclh_error("Copy coordinates to clipboard",e);} } // Copy GC Code to clipboard. if (is_page('cache_listing') && $('.CoordInfoLink')[0] && $('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0]) { // Project-gc makes the ctoc for the gccode disappear again. function build_ctoc_gccode(waitCount) { if (!$('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode').closest('div').find('.ctoc_link')[0]) { addCopyToClipboardLink($('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0], $('.CoordInfoLink')[0], "GC Code"); } waitCount++; if (waitCount <= 100) setTimeout(function(){build_ctoc_gccode(waitCount);}, 100); } build_ctoc_gccode(0); } // Show favorite percentage. if (settings_show_fav_percentage && is_page("cache_listing") && $('#uxFavContainerLink')[0]) { try { function gclh_load_score(waitCount) { if ($('.favorite-container')[0] && $('.favorite-dropdown')[0]) { var fav = $('.favorite-container')[0]; // Eigener Favoritenpunkt. Class hideMe -> kein Favoritenpunkt. Keine class hideMe -> Favoritenpunkt. var myfav = $('#pnlFavoriteCache')[0]; var myfavHTML = ""; if (myfav) { if (myfav.className.match("hideMe")) myfavHTML = ' '; else myfavHTML = ' '; } fav.getElementsByTagName('span')[0].nextSibling.remove(); fav.innerHTML += myfavHTML; var dd = $('.favorite-dropdown')[0]; dd.style.borderTop = "1px solid #f0edeb"; dd.style.borderTopLeftRadius = "5px"; dd.style.minWidth = "190px"; var gccode = $('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0].innerHTML; getFavoriteScore(gccode, function(score) { if ($('.favorite-value')[0]) $('.favorite-value').after(''+score+"%"+''); }); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){gclh_load_score(waitCount);}, 100);} } gclh_load_score(0); } catch(e) {gclh_error("Show favorite percentage",e);} } // Highlight usercoords. Improve screen "Enter solved coordinates" (only in english). if (is_page("cache_listing")) { try { var css = (settings_highlight_usercoords ? ".myLatLon {color: #FF0000; " : ".myLatLon {color: unset; ") + (settings_highlight_usercoords_bb ? "border-bottom: 2px solid #999; " : "border-bottom: unset; ") + (settings_highlight_usercoords_it ? "font-style: italic;}" : "font-style: unset;}"); if ($('#tmpl_CacheCoordinateUpdate')[0] && $('#tmpl_CacheCoordinateUpdate')[0].innerHTML.match(/Enter solved coordinates/)) { css += '#coordinateParse dl dd {padding-bottom: 7px;}'; css += '#newCoordinates {width: 75%; padding: 6px 6px; margin-top: -7px; margin-bottom: 0px;}'; css += '#updatedCoords {font-style: normal;}'; $('#tmpl_CacheCoordinateUpdate')[0].innerHTML = $('#tmpl_CacheCoordinateUpdate')[0].innerHTML.replace('size="35"', 'size="30"'); } appendCssStyle(css); } catch(e) {gclh_error("Highlight usercoords",e);} } // Show other coord formats cache listing. if (is_page("cache_listing") && $('#uxLatLon')[0]) { try { var box = $('#ctl00_ContentBody_LocationSubPanel')[0]; box.innerHTML = box.innerHTML.replace("
    ", ""); var coords = $('#uxLatLon')[0].innerHTML; otherFormats(box, coords, " - "); box.innerHTML = "" + box.innerHTML + "
    "; } catch(e) {gclh_error("Show other coord formats listing",e);} } // Map this Location. if (is_page("cache_listing") && settings_show_link_to_browse_map && $('#uxLatLon')[0]) { try { var coords = toDec($('#uxLatLon')[0].innerHTML); var link = $('#uxLatLon').parents(".NoBottomSpacing"); var small = document.createElement("small"); small.innerHTML = 'Map this Location'; link.append(small); } catch(e) {gclh_error("Map this Location",e);} } // Prevent pop up when clicking on "Watch" or "Stop Watching". if (is_page("cache_listing") && settings_prevent_watchclick_popup) { appendCssStyle('.qtip.qtip-light.qtip-pos-rc:not(.qtip-shadow):not(.pop-modal) {display: none !important;}'); } // Improve Ignore, Stop Ignoring button handling. if (is_page("cache_listing") && (settings_show_remove_ignoring_link && settings_use_one_click_ignoring)) { appendCssStyle("#ignoreSaved {display: none; color: #E0B70A; float: right; padding-left: 0px;}"); } if (is_page("cache_listing") && settings_show_remove_ignoring_link && $('#ctl00_ContentBody_GeoNav_uxIgnoreBtn')[0]) { try { // Set Ignore. changeIgnoreButton('Ignore'); // Prepare one click Ignore, Stop Ignoring. if (settings_use_one_click_ignoring) { var link = '#ctl00_ContentBody_GeoNav_uxIgnoreBtn a'; $(link).attr('data-url', $(link)[0].href); $(link)[0].href = 'javascript:void(0);'; $(link)[0].addEventListener("click", oneClickIgnoring, false); changeIgnoreButton('Ignore'); var saved = document.createElement('span'); saved.setAttribute('id', 'ignoreSaved'); saved.appendChild(document.createTextNode('saved')); $('#ctl00_ContentBody_GeoNav_uxIgnoreBtn')[0].append(saved); } // Set Stop Ignoring. var bmLs = $('.BookmarkList').last().find('li a[href*="/bookmarks/view.aspx?guid="], li a[href*="/profile/?guid="], li a[href*="/p/?guid="]'); for (var i=0; (i+1) < bmLs.length; i=i+2) { if (bmLs[i].innerHTML.match(/^Ignore List$/) && bmLs[i+1] && bmLs[i+1].innerHTML == global_me) { changeIgnoreButton('Stop Ignoring'); break; } } } catch(e) {gclh_error("Improve Ignore, Stop Ignoring button handling",e);} } function oneClickIgnoring() { var link = '#ctl00_ContentBody_GeoNav_uxIgnoreBtn a'; if ($(link+'.working')[0]) return; $(link).addClass('working'); var url = $(link)[0].getAttribute('data-url'); GM_xmlhttpRequest({ method: 'GET', url: url, onload: function(response) { var viewstate = encodeURIComponent(response.responseText.match(/id="__VIEWSTATE" value="([0-9a-zA-Z+-\/=]*)"/)[1]); var viewstategenerator = (response.responseText.match(/id="__VIEWSTATEGENERATOR" value="([0-9A-Z]*)"/))[1]; var postData = '__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=' + viewstate + '&__VIEWSTATEGENERATOR=' + viewstategenerator + '&navi_search=&ctl00%24ContentBody%24btnYes=Yes.+Ignore+it.'; GM_xmlhttpRequest({ method: 'POST', url: url, data: postData, headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Referer': url }, onload: function(response) { if (response.responseText.indexOf('

    ') !== -1) { // If cache was just ignored, set button to stop ignoring. if (response.responseText.indexOf('') !== -1) { changeIgnoreButton('Stop Ignoring', 'saved'); // If cache was just restored, set button to ignore. } else { changeIgnoreButton('Ignore', 'saved'); } } $(link).removeClass('working'); }, onerror: function(response) {$(link).removeClass('working');}, ontimeout: function(response) {$(link).removeClass('working');}, onabort: function(response) {$(link).removeClass('working');} }); } }); } function changeIgnoreButton(buttonSetTo, saved) { var link = '#ctl00_ContentBody_GeoNav_uxIgnoreBtn a'; if (saved && saved == 'saved') { $('#ignoreSaved')[0].style.display = 'inline'; $('#ignoreSaved').fadeOut(2000, 'swing'); } $(link)[0].innerHTML = buttonSetTo; $(link)[0].style.backgroundImage = (buttonSetTo == 'Ignore' ? 'url(/images/icons/16/ignore.png)' : 'url('+global_stop_ignore_icon+')'); } // Improve Add to list in cache listing. if (is_page("cache_listing") && settings_improve_add_to_list && $('.add-to-list')[0]) { try { var height = ((parseInt(settings_improve_add_to_list_height) < 100) ? parseInt(100) : parseInt(settings_improve_add_to_list_height)); var css = ".add-list {max-height: " + height + "px !important;}" + ".add-list li {padding: 2px 0 !important;}" + ".add-list li button {font-size: 14px !important; margin: 0 !important; height: 18px !important;}" + ".status {font-size: 14px !important; width: unset !important;}" + ".status.success, .success-message {right: 2px !important; padding: 0 5px !important; background-color: white !important; color: #E0B70A !important;}" + ".CacheDetailNavigation .add_to_list_count {padding-left: 4px; color: inherit;}"; // Ugly display in Add to List pop up (GS bug since weeks). css += "#newListName {height: 42px;} .add-list-submit {display: inline-block;}"; // Improve clickability on list names of add to list pop up. css += '.add-list li button {width: 100%; text-align: left;}'; appendCssStyle(css); $('.add-to-list').addClass('working'); function check_for_add_to_list(waitCount) { if ( typeof $('#fancybox-loading')[0] !== "undefined") { $('.add-to-list').removeClass('working'); $('.add-to-list')[0].addEventListener("click", function() { window.scroll(0, 0); setFocusToField(0, '#newListName'); }); $('.add-to-list')[0].innerHTML = '' + $('.add-to-list')[0].innerHTML + ''; if ($('.sidebar')[0] && $('#ctl00_ContentBody_GeoNav_uxAddToListBtn')[0]) { var [ownBMLsCount, ownBMLsText, ownBMLsList] = getOwnBMLs($('.sidebar')[0]); $('#ctl00_ContentBody_GeoNav_uxAddToListBtn a')[0].append($('(' + ownBMLsCount + ')')[0]); $('.add-to-list a')[0].setAttribute('title', ownBMLsText); $('.add_to_list_count')[0].setAttribute('title', ownBMLsList); } } else {waitCount++; if (waitCount <= 100) setTimeout(function(){check_for_add_to_list(waitCount);}, 100);} } check_for_add_to_list(0); } catch(e) {gclh_error("Improve Add to list",e);} } // Add link to waypoint list and cache logs to right sidebar. if (is_page("cache_listing") && $("#cache_logs_container")[0] && $(".InformationWidget")[0]) { try { if (document.getElementById('ctl00_ContentBody_GeoNav_foundStatus')) { var log_link = document.getElementById('ctl00_ContentBody_GeoNav_logDate').children[0].href; $("#ctl00_ContentBody_GeoNav_logDate").append('Edit Log'); var css = '#ctl00_ContentBody_GeoNav_foundStatus a[href*="&edit=true"]{background-image:url(/images/icons/16/edit.png); background-repeat: no-repeat; overflow: hidden; display: inline-block; height: 16px; width: 16px; font-size: 0!important; margin-left: 5px; vertical-align: bottom;}'; appendCssStyle(css); } if (getWaypointTable().length > 0) { $(".CacheDetailNavigation:first > ul:first").append('

  • Go to Waypoint List
  • '); } $(".InformationWidget").attr('id','logs_section'); $(".CacheDetailNavigation:first > ul:first").append('
  • Go to Logs
  • '); var css = ""; css += '.CacheDetailNavigation a[href*="#ctl00_ContentBody_bottomSection"]{background-image:url(/images/icons/16/waypoints.png);}'; css += '.CacheDetailNavigation a[href*="#logs_section"]{background-image:url(' + global_logs_icon + ');}'; appendCssStyle(css); } catch(e) {gclh_error("Add link to waypoint list and cache logs",e);} } // Button to copy data to clipboard at right sidebar. function create_copydata_menu() { var css = ""; css += ".copydata-content-layer.plus {"; css += " cursor: pointer;"; css += " padding: 0px;}"; css += ".copydata-content-layer.plus span {"; css += " color: black;"; css += " width: 154px;"; css += " text-decoration: none;"; css += " padding: 5px 8px;}"; css += ".copydata-content-layer.plus a {"; css += " padding: 5px 8px;}"; css += ".copydata-content-layer.plus img {"; css += " width: 16px;"; css += " height: 16px;"; css += " vertical-align: sub;}"; css += ".copydata-content-layer.plus:hover {"; css += " background-color: #f9f9f9;}"; css += ".copydata-content-layer.plus span:hover {"; css += " text-decoration: none;"; css += " background-color: #e1e1e1;}"; css += ".copydata-content-layer.plus a:hover {"; css += " background-color: #e1e1e1;}"; css += ".copydata-content-layer {"; css += " color: black;"; css += " padding: 5px 12px 5px 14px;"; css += " text-decoration: none;"; css += " display: block;}"; css += ".copydata-content-layer:hover {"; css += " background-color: #e1e1e1;"; css += " cursor: pointer;}"; css += ".copydata-sidebar-icon {"; css += " background-image: url(" + global_copy_icon + ")}"; appendCssStyle(css); var html = ""; html += '
    '; html += ' Copy Data to Clipboard'; html += '
    ' $('.CacheDetailNavigation ul').first().append('
  • '+html+'
  • '); check_for_copydata_menu(0); } function check_for_copydata_menu(waitCount) { if ( typeof unsafeWindow.mapLatLng !== "undefined" && unsafeWindow.mapLatLng !== null && (typeof unsafeWindow.mapLatLng.isUserDefined !== "undefined" || is_page("unpublished_cache") )) { $('.copydata_click').removeClass('working'); $('.copydata_head')[0].addEventListener('mouseover', create_copydata_menu_content); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){check_for_copydata_menu(waitCount);}, 100);} } function create_copydata_menu_content() { if ($('#CopyDropDown.hover')[0]) return; remove_copydata_menu_content(); var html = ""; html += '
    '; html += '
    {plus2}Cache Name{plus3}
    '; html = replacePlus(html); html += '
    {plus2}GC Code{plus3}
    '; html = replacePlus(html); html += '
    {plus2}Cache Link{plus3}
    '; html = replacePlus(html); if (determineListingCoords("Corr") !== "") { html += '
    {plus2}Corrected Coordinates{plus3}
    '; html = replacePlus(html); html += '
    {plus2}Original Coordinates{plus3}
    '; html = replacePlus(html); } else { html += '
    {plus2}Coordinates{plus3}
    '; html = replacePlus(html); } if (determineListingCoords("GCTour") !== "") { html += '
    {plus2}GCTour Coordinates{plus3}
    '; html = replacePlus(html); } if (settings_show_copydata_menu) { if (settings_show_copydata_own_stuff_show) { html += '
    {plus2}'+repApo(settings_show_copydata_own_stuff_name)+'{plus3}
    '; html = replacePlus(html); } for (var i in settings_show_copydata_own_stuff) { if (settings_show_copydata_own_stuff[i].show) { html += '
    {plus2}'+repApo(settings_show_copydata_own_stuff[i].name)+'{plus3}
    '; html = replacePlus(html); } } } html += '
    '; $('.copydata_click')[0].parentNode.innerHTML += html; $('#CopyDropDown').addClass('hover'); $('.copydata_head')[0].addEventListener('mouseleave', remove_copydata_menu_content); if (settings_show_copydata_plus) { $('.copydata_click span').click(function() { copydata_copy($(this).closest('div'), false); }); $('.copydata_click a').click(function() { copydata_copy($(this).closest('div'), true); }); } else { $('.copydata_click').click(function() { copydata_copy($(this)); }); } } function replacePlus(html) { var dataName = ""; if (html.match(/\{plus2\}(.*)\{plus3\}/)) { var dataNameTmp = html.match(/\{plus2\}(.*)\{plus3\}/); if (dataNameTmp && dataNameTmp[0] && dataNameTmp[1]) { dataName = dataNameTmp[1]; } } if (settings_show_copydata_plus) { html = html.replace(/\{plus0\}/, ' plus'); html = html.replace(/\{plus1\}/, ''); html = html.replace(/\{plus2\}/, ''); html = html.replace(/\{plus3\}/, ''); } else { html = html.replace(/\{plus0\}/, '').replace(/\{plus2\}/, '').replace(/\{plus3\}/, ''); html = html.replace(/\{plus1\}/, ' title="Clear Clipboard and copy \'' + dataName + '\' to Clipboard"'); } return html; } function remove_copydata_menu_content() { $('#CopyDropDown').remove(); } function copydata_copy(thisObject, plus) { const el = document.createElement('textarea'); if ($(thisObject).data('id') == idCopyName) { el.value = $('#ctl00_ContentBody_CacheName')[0].innerHTML.replace(new RegExp(' ', 'g'),' '); } else if ($(thisObject).data('id') == idCopyCode) { el.value = $('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0].innerHTML; } else if ($(thisObject).data('id') == idCopyUrl) { el.value = "https://coord.info/"+$('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0].innerHTML; } else if ($(thisObject).data('id') == idCopyCorrCoords) { el.value = determineListingCoords('Corr'); } else if ($(thisObject).data('id') == idCopyOrgCoords) { el.value = determineListingCoords('Org'); } else if ($(thisObject).data('id') == idCopyGCTourCoords) { el.value = determineListingCoords('GCTour'); } else if ($(thisObject).data('id') == 'idOwnStuff') { if ($(thisObject).data('value')) { el.value = $(thisObject).data('value'); var [year, month, day] = determineCurrentDate(); el.value = el.value.replace(/#yyyy#/ig, year); el.value = el.value.replace(/#mm#/ig, month); el.value = el.value.replace(/#dd#/ig, day); var [aDate, aTime, aDateTime] = getDateTime(); el.value = el.value.replace(/#Date#/ig, aDate); el.value = el.value.replace(/#Time#/ig, aTime); el.value = el.value.replace(/#DateTime#/ig, aDateTime); var GCName = $('#ctl00_ContentBody_CacheName')[0].innerHTML.replace(new RegExp(' ', 'g'),' '); var GCCode = $('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0].innerHTML; var GCLink = "https://coord.info/"+$('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0].innerHTML; el.value = el.value.replace(/#GCName#/ig, GCName); el.value = el.value.replace(/#GCCode#/ig, GCCode); el.value = el.value.replace(/#GCLink#/ig, GCLink); el.value = el.value.replace(/#GCNameLink#/ig, "[" + GCName + "](" + GCLink + ")"); el.value = el.value.replace(/#GCType#/ig, ($('.cacheImage')[0] ? $('.cacheImage').attr('title').replace(/(\sgeocache|\scache|-cache|\shybrid)/i,'') : '')) el.value = el.value.replace(/#Coords#/ig, determineListingCoords('CorrOrg')); el.value = el.value.replace(/#Elevation#/ig, ($('#elevation-waypoint-0 span')[0] ? $('#elevation-waypoint-0 span')[0].innerHTML : ($('#elevation-waypoint-0')[0] ? $('#elevation-waypoint-0')[0].innerHTML : ''))); el.value = el.value.replace(/#Founds#/ig, ($('#ctl00_ContentBody_lblFindCounts img[src*="/2.png"]')[0] ? parseInt($('#ctl00_ContentBody_lblFindCounts img[src*="/2.png"]')[0].nextSibling.data.replace(/(,|\.)/g,'')) : 0)); el.value = el.value.replace(/#Attended#/ig, ($('#ctl00_ContentBody_lblFindCounts img[src*="/10.png"]')[0] ? parseInt($('#ctl00_ContentBody_lblFindCounts img[src*="/10.png"]')[0].nextSibling.data.replace(/(,)/,'.')) : 0)); var foundsPlus = 0; if ($('#ctl00_ContentBody_lblFindCounts img[src*="/2.png"]')[0]) foundsPlus += parseInt($('#ctl00_ContentBody_lblFindCounts img[src*="/2.png"]')[0].nextSibling.data.replace(/(,|\.)/g,'')); if ($('#ctl00_ContentBody_lblFindCounts img[src*="/10.png"]')[0]) foundsPlus += parseInt($('#ctl00_ContentBody_lblFindCounts img[src*="/10.png"]')[0].nextSibling.data.replace(/(,|\.)/g,'')); if ($('#ctl00_ContentBody_lblFindCounts img[src*="/11.png"]')[0]) foundsPlus += parseInt($('#ctl00_ContentBody_lblFindCounts img[src*="/11.png"]')[0].nextSibling.data.replace(/(,|\.)/g,'')); el.value = el.value.replace(/#FoundsPlus#/ig, foundsPlus); el.value = el.value.replace(/#WillAttend#/ig, ($('#ctl00_ContentBody_lblFindCounts img[src*="/9.png"]')[0] ? parseInt($('#ctl00_ContentBody_lblFindCounts img[src*="/9.png"]')[0].nextSibling.data.replace(/(,|\.)/g,'')) : 0)); el.value = el.value.replace(/#DNFs#/ig, ($('#ctl00_ContentBody_lblFindCounts img[src*="/3.png"]')[0] ? parseInt($('#ctl00_ContentBody_lblFindCounts img[src*="/3.png"]')[0].nextSibling.data.replace(/(,|\.)/g,'')) : 0)); el.value = el.value.replace(/#Diff#/ig, $('#ctl00_ContentBody_uxLegendScale img').attr('src').match(/stars(\d|\d_\d).gif/)[1].replace('_','.')); el.value = el.value.replace(/#Terr#/ig, $('#ctl00_ContentBody_Localize12 img').attr('src').match(/stars(\d|\d_\d).gif/)[1].replace('_','.')); el.value = el.value.replace(/#Size#/ig, $('#ctl00_ContentBody_size .minorCacheDetails small')[0].innerHTML.replace('(','').replace(')','')); el.value = el.value.replace(/#Owner#/ig, get_real_owner().replace(/'/g,"\\'")); el.value = el.value.replace(/#Favo#/ig, (($('#uxFavContainerLink')[0] && $('#uxFavContainerLink .favorite-value')[0]) ? $('#uxFavContainerLink .favorite-value')[0].innerHTML.replace(/(\s*)/g,'') : '')); el.value = el.value.replace(/#FavoPerc#/ig, ($('.gclh_favorite-score')[0] ? $('.gclh_favorite-score')[0].innerHTML : '')); el.value = el.value.replace(/#Hints#/ig, (($('#div_hint')[0] && $('#div_hint')[0].innerHTML) ? $('#div_hint')[0].innerHTML.replace(/^(\s*)/,'').replace(/
    /g,'\n') : '')); el.value = el.value.replace(/#GCNote#/ig, $('#srOnlyCacheNote').html().replace(new RegExp('>', 'g'),'>').replace(new RegExp('<', 'g'),'<')); // Photo file name: Remove the impossible characters for the file name "<>/\|:*? if ($(thisObject)[0].innerHTML && $(thisObject)[0].innerHTML.match(/Photo file name/)) { el.value = el.value.replace(/(\/|\\|\||\*|\?|:|"|<|>)/g, ''); } } } else { el.value = ""; } var cb = document.createElement('textarea'); cb.value = GM_getValue('clipboard', ''); if (plus && cb.value !== '') { cb.value += settings_show_copydata_separator.replace(/‌/g, "") + el.value; } else { cb.value = el.value; } GM_setValue('clipboard', cb.value); document.body.appendChild(cb); cb.select(); document.execCommand('copy'); document.body.removeChild(cb); remove_copydata_menu_content(); } // Links BRouter, Flopps Map, GPSVisualizer and Openrouteservice at right sidebar. const LatLonDigits = 6; function mapservice_link( service_configuration ) { var uniqueServiceId = service_configuration.uniqueServiceId; var css = ""; css += "."+uniqueServiceId+"-content-layer {"; css += " color: black;"; css += " padding: 5px 16px 5px 16px;"; css += " text-decoration: none;"; css += " display: block;}"; css += "."+uniqueServiceId+"-content-layer:hover {"; css += " background-color: #e1e1e1;"; css += " cursor: pointer;}"; if ( service_configuration.sidebar.icon ) { css += "."+uniqueServiceId+"-sidebar-icon {"; css += " background-image: url(" + service_configuration.sidebar.icondata + ")}"; } if ( service_configuration.waypointtable.icon ) { css += "."+uniqueServiceId+"-waypointtable-icon {"; css += " background-image: url(" + service_configuration.waypointtable.icondata + ")}"; } css += ".noGClhdropbtn {"; css += " display: none !important;}"; appendCssStyle(css); var html = ""; html += '
    '; html += '{linkText}'; var nodropbtn = (service_configuration.defaultMap == "" ? "noGClhdropbtn" : ""); html += '
    '; for ( var layer in service_configuration.layers ) { html += '
    '+service_configuration.layers[layer].displayName+'
    '; } html += '
    '; html += '
    '; html = html.replace(/{uniqueServiceId}/g,uniqueServiceId); // Add map service link to the right sidebar. var htmlSidebar = html.replace('{linkText}', service_configuration.sidebar.linkText); htmlSidebar = htmlSidebar.replace('{customclasses}', ( service_configuration.sidebar.icon )?uniqueServiceId+'-sidebar-icon':''); $('.CacheDetailNavigation ul').first().append('
  • '+htmlSidebar+'
  • '); // Add map service link under waypoint table. var tbl = getWaypointTable(); if (tbl.length > 0) { var htmlWaypointTable = html.replace('{linkText}', service_configuration.waypointtable.linkText); htmlWaypointTable = htmlWaypointTable.replace('{customclasses}',( service_configuration.waypointtable.icon )?uniqueServiceId+'-waypointable-icon':''); tbl.next("p").append('
    '+htmlWaypointTable); } function check_wpdata_mapservice(waitCount, uniqueServiceId) { if (check_wpdata_evaluable()) { $('.mapservice_click-'+uniqueServiceId).removeClass('working'); $('.mapservice_click-'+uniqueServiceId).each(function(){ var parent = $(this)[0].parentNode; $(parent).find('.GClhdropdown-content').removeClass('working'); }); $('.mapservice_click-'+uniqueServiceId).click(function() { service_configuration.action( this, service_configuration ); }); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){check_wpdata_mapservice(waitCount, uniqueServiceId);}, 100);} } check_wpdata_mapservice(0, uniqueServiceId); } function mapservice_open( thisObject, service_configuration ) { var waypoints = queryListingWaypoints(true); if (service_configuration.useHomeCoords == true) { var homeCoords = { name: 'Home coordinates', gccode: $('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0].innerHTML, prefix: "", source: "GClh II Config", typeid: '', latitude: (getValue("home_lat") / 10000000), longitude: (getValue("home_lng") / 10000000), prefixedName: $('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0].innerHTML, }; waypoints.unshift(homeCoords); // Vorne anfügen. } if (!service_configuration.runWithOneWaypoint && waypoints.length == 1) { waypoints.push(waypoints[0]); } var map = $(thisObject).data('map'); var data = { urlTemplate: service_configuration.urlTemplate, map: map, maxZoomLevel: service_configuration.layers[map].maxZoom, waypoints: waypoints, waypointSeparator: service_configuration.waypointSeparator, waypointFunction: service_configuration.waypointFunction, context: service_configuration.context, mapOffset: service_configuration.mapOffset, useHomeCoords: service_configuration.useHomeCoords, runWithOneWaypoint: service_configuration.runWithOneWaypoint }; var url = data.urlTemplate; var waypointString = ""; var boundarybox = undefined; if ( data.context == undefined ) data.context = {}; if ( data.temp == undefined ) data.context.temp = {}; data.context.temp.count = 0; for (var i=0; i service_configuration.maxUrlLength ) { alert("Pay attention the URL is very long ("+url.length+" characters). Data loss is possible."); } window.open(url); } function BoundaryBox( boundarybox, latitude, longitude ) { boundarybox = boundarybox == undefined ? { Latmax : -90.0, Latmin : 90.0, Lonmax : -180.0, Lonmin : 180.0, center : { latitude : 0.0, longitude : 0.0 } } : boundarybox; boundarybox.Latmax = Math.max(boundarybox.Latmax, latitude); boundarybox.Latmin = Math.min(boundarybox.Latmin, latitude); boundarybox.Lonmax = Math.max(boundarybox.Lonmax, longitude); boundarybox.Lonmin = Math.min(boundarybox.Lonmin, longitude); boundarybox.center.latitude = ((boundarybox.Latmax+90.0)+(boundarybox.Latmin+90.0))/2-90.0; boundarybox.center.longitude = ((boundarybox.Lonmax+180.0)+(boundarybox.Lonmin+180.0))/2-180.0; return boundarybox; } function TileMapZoomLevelForBoundaryBox( boundarybox, widthOffset, heightOffset, maxZoom ) { var browserZoomLevel = window.devicePixelRatio; var mapWidth = Math.round(window.innerWidth*browserZoomLevel)+widthOffset; var mapHeigth = Math.round(window.innerHeight*browserZoomLevel)+heightOffset; var zoom=-1; for (zoom=23; zoom>=0; zoom--) { // Calculate tile boundary box. var tileY_min = lat2tile(boundarybox.Latmin,zoom); var tileY_max = lat2tile(boundarybox.Latmax,zoom); var tiles_Y = Math.abs(tileY_min-tileY_max+1); // boundary box heigth in number of tiles var tileX_min = long2tile(boundarybox.Lonmin,zoom); var tileX_max = long2tile(boundarybox.Lonmax,zoom); var tiles_X = Math.abs(tileX_max-tileX_min+1); // boundary box width in number of tiles // Calculate width and height of boundary rectangle (in pixel). var latDelta = Math.abs(tile2lat(tileY_max,zoom)-tile2lat(tileY_min+1,zoom)); var latPixelPerDegree = tiles_Y*256/latDelta; var boundaryHeight = latPixelPerDegree*Math.abs(boundarybox.Latmax-boundarybox.Latmin); var longDelta = Math.abs(tile2long(tileX_max+1,zoom)-tile2long(tileX_min,zoom)); var longPixelPerDegree = tiles_X*256/longDelta; var boundaryWidth = longPixelPerDegree*Math.abs(boundarybox.Lonmax-boundarybox.Lonmin); if ( ((boundaryHeight < mapHeigth) && (boundaryWidth < mapWidth)) && zoom<=maxZoom ) break; } return zoom; } function normalizeName( name ) {return name.replace(/[^a-zA-Z0-9_\-]/g,'_');} function floppsMapWaypoint(waypoint, name, radius, context) { var id = ""; if (waypoint.source == "waypoint") { id = String.fromCharCode(65+Math.floor(context.temp.count%26))+Math.floor(context.temp.count/26+1); // create Flopp's Map id: A1, B1, C1, ..., Z1, A2, B2, C3, .. } else if (waypoint.source == "original" ) { id = "O"; } else if (waypoint.source == "listing" ) { id = "L"; } return id+':'+roundTO(waypoint.latitude,LatLonDigits)+':'+roundTO(waypoint.longitude,LatLonDigits)+':'+radius+':'+name; } function gpsvisualizerWaypoint(waypoint, name, radius, context) { var symbol = ( settings_show_gpsvisualizer_gcsymbols && waypoint.typeid in urlPinIcons ) ? urlPinIcons[waypoint.typeid] : ""; var type = ( settings_show_gpsvisualizer_typedesc && waypoint.typeid in waypointNames ) ? waypointNames[waypoint.typeid] : ""; return name+","+roundTO(waypoint.latitude,LatLonDigits)+','+roundTO(waypoint.longitude,LatLonDigits)+','+radius+"m,"+type+","+symbol; } function brouterWaypoint(waypoint, name, radius, context) { var value = ""; if (waypoint.source == "waypoint" || waypoint.source == "listing") { value = roundTO(waypoint.longitude,LatLonDigits)+','+roundTO(waypoint.latitude,LatLonDigits); } else if (waypoint.source == "original" ) { value = ""; } return value; } function openrouteserviceWaypoint(waypoint, name, radius, context) { return roundTO(waypoint.latitude,LatLonDigits)+','+roundTO(waypoint.longitude,LatLonDigits); } // CSS for BRouter, Flopp's Map, GPSVisualizer, Openrouteservice and Copy Data links. if ((settings_show_brouter_link || settings_show_flopps_link || settings_show_gpsvisualizer_link || settings_show_openrouteservice_link || settings_show_copydata_menu) && is_page("cache_listing")) { css += ".GClhdropbtn {"; css += " white-space: nowrap;"; css += " cursor: pointer;}"; css += ".GClhdropdown {"; css += " position: relative;"; css += " display: inline-block;}"; css += ".GClhdropdown-content {"; css += " display: none;"; css += " position: absolute;"; css += " background-color: #f9f9f9;"; css += " min-width: 202px;"; css += " box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);"; css += " z-index: 1001;}"; css += ".GClhdropdown-content-info {"; css += " color: black;"; css += " background-color: #ffffa5;"; css += " padding: 5px 16px 5px 16px;"; css += " text-decoration: none;"; css += " display: none;}"; css += ".GClhdropdown-content-info:hover {"; css += " background-color: #ffffa5;"; css += " cursor: default;}"; css += ".GClhdropdown:hover .GClhdropdown-content.working {"; css += " display: none;}"; css += ".GClhdropdown:hover .GClhdropdown-content {"; css += " display: block;}"; appendCssStyle(css); // Show links which open Flopp's Map with all waypoints of a cache. if (settings_show_flopps_link) { try { mapservice_link( { uniqueServiceId: "flopps", urlTemplate: 'https://flopp.net/?c={center_latitude}:{center_longitude}&z={zoom}&t={map}&d=O:L&m={waypoints}', layers: {'OSM': { maxZoom: 18, displayName: 'Openstreetmap' }, 'OSM/DE': { maxZoom: 18, displayName: 'OSM German Style' }, 'TOPO': { maxZoom: 15, displayName: 'OpenTopMap' }, 'STAMEN_TERRAIN': { maxZoom: 20, displayName: 'Stamen Terrain' }, 'HUMANITARIAN': { maxZoom: 20, displayName: 'Humanitarian' }, 'ARCGIS_WORLDIMAGERY': { maxZoom: 20, displayName: 'World Imagery' }, 'ARCGIS_WORLDIMAGERY_OVERLAY': { maxZoom: 20, displayName: 'World Imagery + Overlay' }}, waypointSeparator : '*', waypointFunction : floppsMapWaypoint, mapOffset : { width: -280, height: -50 }, defaultMap : 'OSM', sidebar : { linkText : "Show on Flopp\'s Map", icon : true, icondata : global_flopps_map_icon }, waypointtable : { linkText : "Show waypoints on Flopp\'s Map with …", icon : false }, maxUrlLength: 2000, action: mapservice_open, context : {}, useHomeCoords: false, runWithOneWaypoint: true }); } catch(e) {gclh_error("Show Flopp's Map links",e);} } // Show links which open BRouter with all waypoints of a cache. if (settings_show_brouter_link) { try { mapservice_link( { uniqueServiceId: "brouter", urlTemplate: 'https://brouter.de/brouter-web/#map={zoom}/{center_latitude}/{center_longitude}/{map}&lonlats={waypoints}', layers: {'OpenStreetMap': { maxZoom: 18, displayName: 'OpenStreetMap' }, 'OpenStreetMap.de': { maxZoom: 17, displayName: 'OSM German Style' }, 'OpenTopoMap': { maxZoom: 17, displayName: 'OpenTopoMap' }, 'Esri World Imagery': { maxZoom: 18, displayName: 'Esri World Imagery' }}, waypointSeparator : ';', waypointFunction : brouterWaypoint, mapOffset : { width: 0, height: 0 }, defaultMap : 'OpenStreetMap', sidebar : { linkText : "Show on BRouter", icon : true, icondata : global_brouter_icon }, waypointtable : { linkText : "Show route on BRouter with …", icon : false }, maxUrlLength: 4000, action: mapservice_open, context : {}, useHomeCoords: false, runWithOneWaypoint: true }); } catch(e) {gclh_error("Show button BRouter and open BRouter",e);} } // Show links which open GPSVisualizer with all waypoints of a cache. if (settings_show_gpsvisualizer_link) { try { mapservice_link( { uniqueServiceId: "gpsvisualizer", urlTemplate: 'https://www.gpsvisualizer.com/map_input?&width=1244&height=700&trk_list=0&wpt_list=desc_border&bg_map={map}&google_zoom_level=auto&google_street_view=1&google_wpt_labels=1&form:data=name,latitude,longitude,circle_radius,desc,symbol\n{waypoints}', layers: { 'google_map' : { displayName: 'Google street map', maxZoom: 20 }, 'google_satellite' : { displayName: 'Google satellite', maxZoom: 20 }, 'google_hybrid' : { displayName: 'Google hybrid', maxZoom: 20 }, 'google_physical' : { displayName: 'Google terrain', maxZoom: 20 }, 'google_openstreetmap' : { displayName: 'OpenStreetMap', maxZoom: 20 }, 'google_openstreetmap_tf' : { displayName: 'OSM ThunderForest', maxZoom: 20 }, 'google_openstreetmap_komoot' : { displayName: 'OSM Komoot', maxZoom: 20 }, 'google_opencyclemap' : { displayName: 'OpenCycleMap', maxZoom: 20 }, 'google_opentopomap' : { displayName: 'OpenTopoMap', maxZoom: 20 }, 'google_4umaps' : { displayName: 'World topo maps', maxZoom: 20 }}, waypointSeparator : '\n', waypointFunction : gpsvisualizerWaypoint, mapOffset : { width: 0, height: 0 }, defaultMap : 'google_map', sidebar : { linkText : "Show on GPSVisualizer", icon : true, icondata : global_gpsvisualizer_icon }, waypointtable : { linkText : "Show waypoints on GPSVisualizer with …", icon : false }, maxUrlLength: 4000, action: mapservice_open, context : {}, useHomeCoords: false, runWithOneWaypoint: true }); } catch(e) {gclh_error("Show button GPSVisualizer and open GPSVisualizer",e);} } // Show links which open Openrouteservice with all waypoints of a cache. if (settings_show_openrouteservice_link) { try { mapservice_link( { uniqueServiceId: "openrouteservice", urlTemplate: 'https://classic-maps.openrouteservice.org/directions?b='+settings_show_openrouteservice_medium+'&c=0&a={waypoints}', layers: {'': { maxZoom: '', displayName: ''}}, waypointSeparator: ',', waypointFunction: openrouteserviceWaypoint, mapOffset: {width: 0, height: 0}, defaultMap: '', sidebar: {linkText: "Show on Openrouteservice", icon: true, icondata: global_openrouteservice_icon}, waypointtable: {linkText: "Show route on Openrouteservice", icon: false}, maxUrlLength: 4000, action: mapservice_open, context: {}, useHomeCoords: settings_show_openrouteservice_home, runWithOneWaypoint: false }); } catch(e) {gclh_error("Show button Openrouteservice and open Openrouteservice",e);} } // Create 'Copy Data to Clipboard' menu. if (settings_show_copydata_menu) { try { create_copydata_menu(); } catch(e) {gclh_error("Create 'Copy Data to Clipboard' menu",e);} } } // Add link to admin tools to right sidebar. if (is_page("cache_listing") && document.getElementById("ctl00_ContentBody_GeoNav_adminTools")) { try { if (document.getElementById('ctl00_ContentBody_GeoNav_uxArchivedLogType').children[0].href) { var maintenance_link = document.getElementById('ctl00_ContentBody_GeoNav_uxArchivedLogType').children[0].href.replace('LogType=5', 'LogType=46') $("#ctl00_ContentBody_GeoNav_adminTools").append('
  • Owner Maintenance
  • '); var css = '.CacheDetailNavigation a[href$="LogType=46"] {background-image: url(/images/logtypes/46.png); }'; appendCssStyle(css); } } catch(e) {gclh_error("Add link to admin tools",e);} } // Build map overview. if (settings_map_overview_build && is_page("cache_listing") && $('#ctl00_ContentBody_detailWidget')[0]) { try { leafletInit(); var css = ''; css += '.mapIcons {position: relative; z-index: 1000; margin-top: 10px; margin-right: 10px; float: right; height: 23px; border-radius: 4px; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65); background-color: #fff;}'; css += '.mapIcon {margin-top: 0px; margin-right: 0px; box-shadow: unset;}'; css += '.mapIconLeft {border-radius: 4px 0px 0px 4px;}'; css += '.mapIconRight {border-radius: 0px 4px 4px 0px; border-left: 1px solid #ccc;}'; css += '.mapIcon:hover {background-color: #f4f4f4;}'; css += '.mapIcons svg {width: 18px; height: 18px; color: #4a4a4a; opacity: 0.85; padding: 2px;}'; css += '.mapIconRight svg {padding: 3px;}'; css += '.search_map_icon {margin-left: 2px !important;}'; if (!settings_map_overview_search_map_icon) css += '.browse_map_icon {margin-top: 1px;}'; appendCssStyle(css); var html = ""; html += "
    "; html += "
    "; if (settings_map_overview_search_map_icon || settings_map_overview_browse_map_icon) { if (settings_map_overview_search_map_icon && settings_map_overview_browse_map_icon) var bothIcons = true; else var bothIcons = false; html += ""; if (settings_map_overview_browse_map_icon) { html += "" + browse_map_icon + ""; } if (settings_map_overview_search_map_icon) { html += "" + search_map_icon + ""; } html += ""; } html += "
    "; html += "
    "; $(".CacheDetailNavigation").after(html); $(".mapIcons svg").each(function(){$(this)[0].setAttribute("viewBox", "0 0 25 25");}); function build_map_overview(waitCount) { if (typeof lat !== "undefined" && typeof lng !== "undefined") { var previewMap = L.map('gclh_map_overview', { dragging: true, zoomControl: true, }).setView([lat, lng],settings_map_overview_zoom); var layer = ( settings_map_overview_layer == "" || settings_map_overview_layer == "Geocaching" ) ? all_map_layers['OpenStreetMap Default'] : all_map_layers[settings_map_overview_layer]; var layerObj = L.tileLayer( layer.tileUrl, layer ).addTo(previewMap); // Delayed load of GS map layer (we need an access token). if ( settings_map_overview_layer == "Geocaching" ) { gclh_GetGcAccessToken( function(r) { all_map_layers["Geocaching"].accessToken = r.access_token; var layer = all_map_layers['Geocaching']; L.tileLayer( layer.tileUrl, layer ).addTo(previewMap); previewMap.eachLayer(function (layer) { if ( layerObj == layer ) previewMap.removeLayer(layer); }); }); } // Make buttons of zoom control smaller only for overview map. $("#gclh_map_overview .leaflet-bar").attr("style","width: 20px; height: 41px; line-height: 40px;"); $("#gclh_map_overview .leaflet-control-zoom-in").attr("style","width: 20px; height: 20px; line-height: 20px; font-size: 11px; padding-right: 1px;"); $("#gclh_map_overview .leaflet-control-zoom-out").attr("style","width: 20px; height: 20px; line-height: 20px; font-size: 11px; padding-right: 1px;"); // Länge der Kartenbezeichnung ... begrenzen. $("#gclh_map_overview .leaflet-control-attribution").attr("style","max-width: 238px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;"); function build_map_overview_marker(waitCount) { if (typeof unsafeWindow.mapLatLng !== "undefined" && unsafeWindow.mapLatLng !== null) { var marker = L.marker([lat, lng],{icon: L.icon({ iconUrl: 'https://www.geocaching.com/images/wpttypes/pins/' + unsafeWindow.mapLatLng.type + '.png', iconSize: [20, 23], iconAnchor: [10, 23], })}).addTo(previewMap); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){build_map_overview_marker(waitCount);}, 100);} } build_map_overview_marker(0); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){build_map_overview(waitCount);}, 100);} } build_map_overview(0); } catch(e) {gclh_error("Build map overview",e);} } // Personal cache note at cache listing. if (is_page("cache_listing")) { var css = ''; // Improve cursor when displaying or editing the personal cache note. It's upside down. css += '#viewCacheNote {cursor: pointer;} #cacheNoteText {cursor: text;}'; // Adapt height of edit field for personal cache note. $('h3.h4').append($('#pcn_help').remove().get().reverse()); css += '#viewCacheNote {text-decoration: none !important;}'; // Personal cache note: Adapt height of edit field for personal cache note. function calcHeightOfCacheNote() { return ($("#viewCacheNote").parent().height()*1.02+36 > settings_cache_notes_min_size ? $("#viewCacheNote").parent().height()*1.02+36 : settings_cache_notes_min_size); } if (settings_adapt_height_cache_notes) { try { var note = ($('.Note.PersonalCacheNote')[0] || $('.NotesWidget')[0]); if (note) $("#cacheNoteText").height(calcHeightOfCacheNote()); } catch(e) {gclh_error("Adapt size of edit field for personal cache note",e);} } // Change font to monospace. if (settings_change_font_cache_notes) $("#viewCacheNote, #cacheNoteText").css("font-family", "monospace"); // Hide complete and Show/Hide Cache Note. try { var note = ($('.Note.PersonalCacheNote')[0] || $('.NotesWidget')[0]); if (settings_hide_cache_notes && note) note.remove(); if (settings_hide_empty_cache_notes && !settings_hide_cache_notes && note) { var desc = decode_innerHTML(note.getElementsByTagName("label")[0]).replace(":", ""); var noteText = $('#viewCacheNote')[0].innerHTML; var link = document.createElement("font"); link.setAttribute("style", "font-size: 12px;"); link.innerHTML = "Hide "+desc+""; note.setAttribute("id", "gclh_note"); note.parentNode.insertBefore(link, note); if (noteText != null && (noteText == "" || noteText == "Click to enter a note" || noteText == "Klicken zum Eingeben einer Notiz" || noteText == "Pro vložení poznámky klikni sem")) { note.style.display = "none"; if ($('#gclh_hide_note')[0]) $('#gclh_hide_note')[0].innerHTML = 'Show '+desc; } var code = "function gclhHideNote() {" + " if (document.getElementById('gclh_note').style.display == 'none') {" + " document.getElementById('gclh_note').style.display = 'block';" + " if (document.getElementById('gclh_hide_note')) {" + " document.getElementById('gclh_hide_note').innerHTML = 'Hide "+desc+"'" + " }" + " } else {" + " document.getElementById('gclh_note').style.display = 'none';" + " if (document.getElementById('gclh_hide_note')) {" + " document.getElementById('gclh_hide_note').innerHTML = 'Show "+desc+"'" + " }" + " }" + "}"; injectPageScript(code, 'body'); } } catch(e) {gclh_error("Hide complete and Show/Hide Cache Note",e);} // Focus Cachenote-Textarea on Click of the Note (to avoid double click to edit). try { var editCacheNote = document.querySelector('#editCacheNote'); if (editCacheNote) { var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.type == "attributes") { if (document.getElementById('editCacheNote').style.display == '') { document.getElementById('cacheNoteText').focus(); } else { // Take the parent, because empty lines are not handle by span-element #viewCacheNote. if (settings_adapt_height_cache_notes) { if ($("#cacheNoteText").height() != calcHeightOfCacheNote()) { $("#cacheNoteText").height(calcHeightOfCacheNote()); } } } } }); }); observer.observe(editCacheNote, {attributes: true}); } } catch(e) {gclh_error("Focus Cachenote-Textarea on Click of the Note",e);} appendCssStyle(css); } // Show eMail and Message Center Link beside user. (Nicht in Cache Logs im Listing, das erfolgt später bei Log-Template.) show_mail_and_message_icon: try { // Cache, TB, Aktiv User Infos ermitteln. var [global_gc, global_tb, global_code, global_name, global_link, global_activ_username, global_founds, global_date, global_time, global_dateTime] = getGcTbUserInfo(); // Nicht auf Mail, Message Seite ausführen. if ($('#ctl00_ContentBody_SendMessagePanel1_SendEmailPanel')[0] || $('#messageArea')[0]) break show_mail_and_message_icon; if ((settings_show_mail || settings_show_message)) { // Public Profile: if (is_page("publicProfile")) { if ($('#lnkSendMessage')[0] || $('#ctl00_ProfileHead_ProfileHeader_lnkSendMessage')[0]) { var guid = ($('#lnkSendMessage')[0] || $('#ctl00_ProfileHead_ProfileHeader_lnkSendMessage')[0]).href.match(/https?:\/\/www\.geocaching\.com\/account\/messagecenter\?recipientId=([a-zA-Z0-9-]*)/); guid = guid[1]; if ($('#ctl00_ContentBody_ProfilePanel1_lblMemberName, #ctl00_ProfileHead_ProfileHeader_lblMemberName')[0]) { var username = decode_innerHTML($('#ctl00_ContentBody_ProfilePanel1_lblMemberName, #ctl00_ProfileHead_ProfileHeader_lblMemberName')[0]); var side = $('#ctl00_ContentBody_ProfilePanel1_lblMemberName, #ctl00_ProfileHead_ProfileHeader_lblStatusText')[0]; } buildSendIcons(side, username, "per guid"); } // Post Cache new log page: } else if (document.location.href.match(/\.com\/play\/geocache\/gc\w+\/log/)) { function checkBuildSendIcons(waitCount, username, guid) { if (!$('.gclh_send')[0]) { var side = $('.hidden-by a')[0]; buildSendIcons(side, username, "per guid", guid); } waitCount++; if (waitCount <= 50) setTimeout(function(){checkBuildSendIcons(waitCount, username, guid);}, 200); } var id = $('.hidden-by a')[0].href.match(/\/profile\/\?id=(\d+)/); if (id && id[1]) { var idLink = "/p/default.aspx?id=" + id[1] + "&tab=geocaches"; GM_xmlhttpRequest({ method: "GET", url: idLink, onload: function(response) { if (response.responseText) { var [username, guid] = getUserGuidFromProfile(response.responseText); if (username && guid) { checkBuildSendIcons(0, username, guid); } } } }); } // Log form, log edit, log view redesigned new log page: // "side" als Objekt geht verloren, wenn zwischenzeitlich ein Refresh der Seitendaten stattfindet, deshalb immer neu ermitteln. } else if (document.location.pathname.match(/\/live\/(?:log\/(?:gl|tl)|(?:geocache|trackable)\/(?:gc|tb))[a-z0-9]+/i)) { let hiddenUsername = ''; let hiddenGuid = ''; let loggedUsername = ''; let loggedGuid = ''; function checkBuildSendIcons(waitCount, username, guid, sideX) { side = $(sideX)[0]; if (!$('.gclh_send')[0] && side && username && guid) { buildSendIcons(side, username, "per guid", guid); } waitCount++; if (waitCount <= 50) setTimeout(function(){checkBuildSendIcons(waitCount, username, guid, sideX);}, 200); } function getUserGuid(sideX) { side = $(sideX)[0]; var userParts = side.href.match(/\.com\/p(\?|\/\?)(id=|code=|u=)(.+)/); if (userParts && userParts[3]) { var userLink = "/p/default.aspx?" + userParts[2] + userParts[3] + "&tab=geocaches"; GM_xmlhttpRequest({ method: "GET", url: userLink, onload: function(response) { if (response.responseText) { var [username, guid] = getUserGuidFromProfile(response.responseText); if (sideX.match(/hidden/)) { hiddenUsername = username; hiddenGuid = guid; } else { loggedUsername = username; loggedGuid = guid; } if (username && guid) { checkBuildSendIcons(0, username, guid, sideX); } } } }); } } let url = ''; const config = { childList: true, subtree: true }; const logviewSendIconsObserver = new MutationObserver(function(_, observer) { observer.disconnect(); if (url !== document.location.pathname) { if (is_page('logform') && $('.hidden-by a')[0]) { if (hiddenUsername == '') getUserGuid('.hidden-by a'); else checkBuildSendIcons(0, hiddenUsername, hiddenGuid, '.hidden-by a'); url = document.location.pathname; } else if (document.location.pathname.match(/\/live\/log\/(?:gl|tl)[a-z0-9]+/i) && $('.log-sub-header a')[0]) { if (loggedUsername == '') getUserGuid('.log-sub-header a'); else checkBuildSendIcons(0, loggedUsername, loggedGuid, '.log-sub-header a'); url = document.location.pathname; } } observer.observe(document.body, config); }); logviewSendIconsObserver.observe(document.body, config); // Rest: } else { if (is_page("cache_listing")) var links = $('#divContentMain .span-17, #divContentMain .sidebar').find('a[href*="/profile/?guid="], a[href*="/p/?guid="]'); else var links = document.getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { if (links[i].href.match(/https?:\/\/www\.geocaching\.com\/(profile|p)\/\?guid=/)) { // Avatare haben auch mal guid, hier keine Icons erzeugen. if (links[i].children[0] && (links[i].children[0].tagName == "IMG" || links[i].children[0].tagName == "img")) continue; var guid = links[i].href.match(/https?:\/\/www\.geocaching\.com\/(profile|p)\/\?guid=([a-zA-Z0-9-]*)/); guid = guid[2]; var username = decode_innerHTML(links[i]); buildSendIcons(links[i], username, "per guid"); } } } } } catch(e) {gclh_error("Show mail and message icon",e);} // Remove banners (blue banners). if (settings_remove_banner) { try { // To activate the (x) button for a new banner, just change the following jq selector (use a comma and a new banner selector) $('div.blue-banner-content,div.banner').each(function( index ) { const bannerEl = $(this); const bannerTextSum = bannerEl.text().checksum(); if (settings_remove_banner_text_ids.find(link => link === bannerTextSum)) { $(bannerEl)[0].style.display = 'none'; } else { const closeElId = 'closeBanner' + index; // hack for bind event bannerEl.prepend(''); bannerEl.find('#' + closeElId).bind({ click: function() { settings_remove_banner_text_ids.push(bannerTextSum); setValue("settings_remove_banner_text_ids", JSON.stringify(settings_remove_banner_text_ids)); $(bannerEl)[0].style.display = 'none'; } }); } }); } catch(e) {gclh_error("Remove banner",e);} } // Improve cache description. if (is_page("cache_listing")) { try { // Activate fancybox for pictures in the description. function check_for_fancybox(waitCount) { if (typeof unsafeWindow.$ !== "undefined" && typeof unsafeWindow.$.fancybox !== "undefined") { unsafeWindow.$('.CachePageImages a[rel="lightbox"]').fancybox(); } else {waitCount++; if (waitCount <= 50) setTimeout(function(){check_for_fancybox(waitCount);}, 200);} } check_for_fancybox(0); // Deactivate external link warning. (Thanks to mustakorppi for the template: https://greasyfork.org/de/scripts/439287) if (settings_listing_hide_external_link_warning || settings_listing_links_new_tab) { $('.UserSuppliedContent a').each(function(){ if (settings_listing_hide_external_link_warning) { $(this)[0].addEventListener("click", function() { event.stopImmediatePropagation(); }, true); } if (settings_listing_links_new_tab) { $(this).attr('target', '_blank'); } }); } } catch(e) {gclh_error("Activate fancybox",e);} } // Link to bigger pictures for owner added images. if (settings_link_big_listing && is_page("cache_listing")) { try { var img = $('#ctl00_ContentBody_LongDescription, .CachePageImages').find('img[src*="geocaching.com/cache/large/"]'); var a = $('#ctl00_ContentBody_LongDescription, .CachePageImages').find('a[href*="geocaching.com/cache/large/"]'); for (var i = 0; i < img.length; i++) {img[i].src = img[i].src.replace("/large/", "/");} for (var i = 0; i < a.length; i++) {a[i].href = a[i].href.replace("/large/", "/");} } catch(e) {gclh_error("Link to bigger pictures for owner added images",e);} } // Decrypt hints. if (settings_decrypt_hint && !settings_hide_hint && is_page("cache_listing")) { try { if ($('#ctl00_ContentBody_EncryptionKey')[0] && $('#ctl00_ContentBody_lnkDH')[0]) { decrypt_hints(0); var decryptKey = $('#dk')[0]; if (decryptKey) decryptKey.parentNode.removeChild(decryptKey); } } catch(e) {gclh_error("Decrypt hints",e);} } // Hide hints. if (settings_hide_hint && is_page("cache_listing") && $('#dk')[0]) { try { // Replace hints by a link which shows the hints dynamically. decrypt_hints(0, true); // Remove hint description. var decryptKey = $('#dk')[0]; if (decryptKey) decryptKey.parentNode.removeChild(decryptKey); } catch(e) {gclh_error("Hide hints",e);} } function decrypt_hints(waitCount, hideHints) { $('#ctl00_ContentBody_lnkDH').click(); if ($('#ctl00_ContentBody_lnkDH')[0].getAttribute('title') != 'Decrypt') { if (hideHints) hide_hints(); } else {waitCount++; if (waitCount <= 50) setTimeout(function(){decrypt_hints(waitCount, hideHints);}, 200);} } function hide_hints() { var hint = $('#div_hint')[0]; var label = $('#ctl00_ContentBody_hints strong')[0]; if (hint && label && trim(hint.innerHTML).length > 0) { var code = "function hide_hint() {" + " var hint = document.getElementById('div_hint');" + " if (hint.style.display == 'none') {" + " hint.style.display = 'block';" + " if (document.getElementById('ctl00_ContentBody_lnkDH')) {" + " document.getElementById('ctl00_ContentBody_lnkDH').innerHTML = 'Hide'" + " }" + " } else {" + " hint.style.display = 'none';" + " if (document.getElementById('ctl00_ContentBody_lnkDH')) {" + " document.getElementById('ctl00_ContentBody_lnkDH').innerHTML = 'Show'" + " }" + " }" + " hint.innerHTML = convertROTStringWithBrackets(hint.innerHTML);" + " return false;" + "}"; injectPageScript(code, 'body'); if ($('#ctl00_ContentBody_lnkDH')[0]) { var link = $('#ctl00_ContentBody_lnkDH')[0]; link.setAttribute('onclick', 'hide_hint();'); link.setAttribute('title', 'Show/Hide ' + decode_innerHTML(label)); link.setAttribute('href', 'javascript:void(0);'); link.setAttribute('style', 'font-size: 12px;'); link.innerHTML = 'Show'; } hint.style.marginBottom = '1.5em'; hint.style.display = 'none'; } } // Improve inventory list in cache listing. if (is_page("cache_listing")) { try { // Trackable Namen kürzen, damit nicht umgebrochen wird, und Title setzen. var inventory = $('#ctl00_ContentBody_uxTravelBugList_uxInventoryLabel').closest('.CacheDetailNavigationWidget').find('.WidgetBody span'); for (var i = 0; i < inventory.length; i++) {noBreakInLine(inventory[i], 201, inventory[i].innerHTML);} } catch(e) {gclh_error("Improve inventory list",e);} } // Replace link to larger map in preview map in cache listing with the Browse Map. if (settings_larger_map_as_browse_map && is_page("cache_listing") && $('#uxLatLon')[0]) { try { var newstrPROStyle = 'View Larger Browse Map'; document.getElementById('ctl00_ContentBody_uxViewLargerMap').outerHTML = newstrPROStyle; } catch(e) {gclh_error("Replace link to larger map in preview map in cache listing with the Browse Map",e);} } // Show Google-Maps Link on Cache Listing Page. if (settings_show_google_maps && is_page("cache_listing") && $('#ctl00_ContentBody_uxViewLargerMap')[0] && $('#uxLatLon')[0] && $('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0]) { try { var ref_link = $('#ctl00_ContentBody_uxViewLargerMap')[0]; var box = ref_link.parentNode; box.appendChild(document.createElement("br")); var link = document.createElement("a"); link.setAttribute("class", "lnk"); link.setAttribute("target", "_blank"); link.setAttribute("title", "Show area on Google Maps"); var coords = toDec($('#uxLatLon')[0].innerHTML); var latlng = coords[0] + "," + coords[1]; // &ll sorgt für Zentrierung der Seite beim Marker auch wenn linke Sidebar aufklappt. Zoom 18 setzen, weil GC Map eigentlich nicht mehr kann. link.setAttribute("href", "https://maps.google.de/maps?q=" + latlng + "&ll=" + latlng + "&z=18"); var img = document.createElement("img"); img.setAttribute("src", "/images/silk/map_go.png"); link.appendChild(img); link.appendChild(document.createTextNode(" ")); var span = document.createElement("span"); span.appendChild(document.createTextNode("Show area on Google Maps")); link.appendChild(span); box.appendChild(link); } catch(e) {gclh_error("Show google maps link",e);} } // Hide spoilerwarning above the logs. if (settings_hide_spoilerwarning && is_page("cache_listing")) { try { if ($('.InformationWidget .NoBottomSpacing a[href*="/glossary.aspx#spoiler"]')[0]) { var sp = $('.InformationWidget .NoBottomSpacing a[href*="/glossary.aspx#spoiler"]')[0].closest('p'); if (sp) { sp.innerHTML = " "; sp.style.height = "0"; sp.className += " Clear"; } } } catch(e) {gclh_error("Hide spoilerwarning",e);} } // Hide warning message. if (settings_hide_warning_message) { if ($('.WarningMessage')[0]) { try { var content = '"' + $('.WarningMessage')[0].innerHTML + '"'; if (content == getValue("warningMessageContent")) { warnMessagePrepareMouseEvents(); } else { // Button in Warnmeldung aufbauen, um Meldung erstes Mal zu verbergen. var div = document.createElement("div"); div.setAttribute("class", "GoAwayWarningMessage"); div.setAttribute("title", "Go away message"); div.setAttribute("style", "float: right; width: 70px; color: rgb(255, 255, 255); box-sizing: border-box; border: 2px solid rgb(255, 255, 255); opacity: 0.7; cursor: pointer; border-radius: 3px; margin-right: 2px; margin-top: 2px; text-align: center;"); div.appendChild(document.createTextNode("Go away")); div.addEventListener("click", warnMessageHideAndSave, false); $('.WarningMessage')[0].parentNode.insertBefore(div, $('.WarningMessage')[0]); } } catch(e) {gclh_error("Hide warning message",e);} } } // Warnmeldung verbergen und Inhalt sichern. function warnMessageHideAndSave() { $('.WarningMessage').fadeOut(1000, "linear"); var content = '"' + $('.WarningMessage')[0].innerHTML + '"'; setValue("warningMessageContent", content); $('.GoAwayWarningMessage')[0].style.display = "none"; warnMessagePrepareMouseEvents(); } // Mouse Events vorbereiten für show/hide Warnmeldung. function warnMessagePrepareMouseEvents() { // Balken im rechten Headerbereich zur Aktivierung der Warnmeldung. var divShow = document.createElement("div"); divShow.setAttribute("class", "ShowWarningMessage"); divShow.setAttribute("style", "z-index: 1004; float: right; right: 0px; width: 6px; background-color: rgb(224, 183, 10); height: 65px; position: absolute;"); $('.WarningMessage')[0].parentNode.insertBefore(divShow, $('.WarningMessage')[0]); // Bereich für Mouseout Event, um Warnmeldung zu verbergen. Notwendig, weil eigentliche Warnmeldung nicht durchgängig da und zukünftiges Aussehen unklar. var divHide = document.createElement("div"); divHide.setAttribute("class", "HideWarningMessage"); divHide.setAttribute("style", "z-index: 1004; height: 110px; position: absolute; right: 0px; left: 0px;"); $('.WarningMessage')[0].parentNode.insertBefore(divHide, $('.WarningMessage')[0]); warnMessageMouseOut(); } // Show Warnmeldung. function warnMessageMouseOver() { $('.ShowWarningMessage')[0].style.display = "none"; $('.WarningMessage')[0].style.display = ""; $('.HideWarningMessage')[0].style.display = ""; $('.HideWarningMessage')[0].addEventListener("mouseout", warnMessageMouseOut, false); } // Hide Warnmeldung. function warnMessageMouseOut() { $('.WarningMessage')[0].style.display = "none"; $('.HideWarningMessage')[0].style.display = "none"; $('.ShowWarningMessage')[0].style.display = ""; $('.ShowWarningMessage')[0].addEventListener("mouseover", warnMessageMouseOver, false); } // Driving direction for every waypoint. if (settings_driving_direction_link && (is_page("cache_listing") || document.location.href.match(/\.com\/hide\/wptlist.aspx/))) { try { var tbl = getWaypointTable(); var length = tbl.find("tbody > tr").length; for (var i=0; i tr").eq(i*2); var name = row1st.find("td:eq(4)").text().trim(); var icon = row1st.find("td:eq(1) > img").attr('src'); var cellCoordinates = row1st.find("td:eq(5)"); var tmp_coords = toDec(cellCoordinates.text().trim()); if ((!settings_driving_direction_parking_area || icon.match(/pkg.jpg/g)) && typeof tmp_coords[0] !== 'undefined' && typeof tmp_coords[1] !== 'undefined') { if (getValue("home_lat", 0) != 0 && getValue("home_lng") != 0) { var link = "https://maps.google.com/maps?f=d&hl=en&saddr="+getValue("home_lat", 0)/10000000+","+getValue("home_lng", 0)/10000000+"%20(Home%20Location)&daddr="; row1st.find("td:last").append(''); } else { var link = document.location + "&#gclhpb#errhomecoord"; row1st.find("td:last").append(''); } } } } catch(e) {gclh_error("Driving direction for Waypoints",e);} } // Added elevation to every additional waypoint with shown coordinates. if (settings_show_elevation_of_waypoints && ((is_page("cache_listing") && !isMemberInPmoCache()) || is_page("map") || is_page("searchmap") )) { try { function formatElevation(elevation) { return ((elevation>0)?"+":"")+((settings_distance_units != "Imperial")?(Math.round(elevation) + "m"):(Math.round(elevation*3.28084) + "ft")); } elevationServicesData[1]['function'] = addElevationToWaypoints_GoogleElevation; elevationServicesData[2]['function'] = addElevationToWaypoints_OpenElevation; elevationServicesData[3]['function'] = addElevationToWaypoints_GeonamesElevation; function addElevationToWaypoints_GoogleElevation(responseDetails) { try { var context = responseDetails.context; json = JSON.parse(responseDetails.responseText); if ( json.status != "OK") { var mess = "\naddElevationToWaypoints_GoogleElevation():\n- Get elevations: retries: "+context.retries+"\n- json-status: "+json.status+"\n- json.error_message: "+json.error_message; gclh_log(mess); getElevations(context.retries+1,context.locations); return; } var elevations = []; for (var i=0; i/)) { if (responseDetails.responseText.match(/Service Unavailable/)) { console.error("GClh_ERROR (no header alert) - addElevationToWaypoints_GeonamesElevation() - " + document.location.href + ": Service Unavailable."); console.log(responseDetails); } else { console.error("GClh_ERROR (no header alert) - addElevationToWaypoints_GeonamesElevation() - " + document.location.href + ": Unknown error, see details."); console.log(responseDetails); } getElevations(context.retries+1,context.locations); } else { var json = JSON.parse(responseDetails.responseText); if (!json.geonames) { console.error("GClh_ERROR (no header alert) - addElevationToWaypoints_GeonamesElevation() - " + document.location.href + ": json.geonames is undefined."); console.log(responseDetails); getElevations(context.retries+1,context.locations); } else { var elevations = []; for (var i=0; i   Elevation: '); // Prepare cache listing - waypoint table. var tbl = getWaypointTable(); if (tbl.length > 0) { tbl.find("thead > tr > th:eq(5)").after('Elevation'); var length = tbl.find("tbody > tr").length; for (var i=0; i tr:eq("+(i*2+1)+") > td:eq(1)"); var colspan = cellNote.attr('colspan'); cellNote.attr('colspan',colspan+1); var row1st = tbl.find("tbody > tr").eq(i*2); var cellPrefix = row1st.find("td:eq(2)").text().trim(); classAttribute = "waypoint-elevation-na"; idAttribute = ""; for ( var j=0; j'); } } return locations; } var elevationServices = []; if (settings_primary_elevation_service > 0) { elevationServices.push(elevationServicesData[settings_primary_elevation_service]); } if (settings_secondary_elevation_service > 0) { elevationServices.push(elevationServicesData[settings_secondary_elevation_service]); } // This function can be re-entered. function getElevations(serviceIndex,locations) { if (serviceIndex >= elevationServices.length || elevationServices < 0) { $('.waypoint-elevation').each(function (index, value) { $(this).html('???'); }); return; } $('.waypoint-elevation').each(function (index, value) { $(this).html(''); }); $('.waypoint-elevation-na').each(function (index, value) { $(this).html('n/a'); }); var additionalListingIndex = 0; if (elevationServices[serviceIndex].name == "Geonames-Elevation") { var maxLocations = 20; var countLocations = 0; var lats = ""; var lngs = ""; for (var i=0; i 0 ) getElevations(0,locations); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){check_wpdata_elevation(waitCount);}, 100);} } check_wpdata_elevation(0); } } catch(e) {gclh_error("Add elevation",e);} } // Change new links for find caches to the old links. if (is_page("cache_listing") && settings_listing_old_links) { try { var links = $('#ctl00_ContentBody_bottomSection a[href*="/play/search?"]'); for (var i = 0; i < links.length; i++) { // Other caches hidden by this user. var match = links[i].href.match(/\/play\/search\?owner\[0\]=(.*?)&.*/); if (match && match[1]) {links[i].href = "/seek/nearest.aspx?u="+urlencode(urldecode(match[1])); continue;} // Other caches found by this user. var match = links[i].href.match(/\/play\/search\?fb=(.*?)&.*/); if (match && match[1]) {links[i].href = "/seek/nearest.aspx?ul="+urlencode(urldecode(match[1])); continue;} // Nearby caches of this type, that I haven't found. var match = links[i].href.match(/\/play\/search\?types=(.*?)&origin=(.*?),(.*?)&f=2&o=2/); if (match && match[1] && match[2] && match[3]) {links[i].href = "/seek/nearest.aspx?lat="+match[2]+"&lng="+match[3]+"&ex=1"+getCacheTx(match[1]); continue;} // Nearby caches of this type. var match = links[i].href.match(/\/play\/search\?types=(.*?)&origin=(.*?),(.*?)(&|$)/); if (match && match[1] && match[2] && match[3]) {links[i].href = "/seek/nearest.aspx?lat="+match[2]+"&lng="+match[3]+getCacheTx(match[1]); continue;} // All nearby caches, that I haven't found. var match = links[i].href.match(/\/play\/search\?origin=(.*?),(.*?)&f=2&o=2/); if (match && match[1] && match[2]) {links[i].href = "/seek/nearest.aspx?lat="+match[1]+"&lng="+match[2]+"&ex=1"; continue;} // All nearby caches. var match = links[i].href.match(/\/play\/search\?origin=(.*?),(.*?)(&|$)/); if (match && match[1] && match[2]) {links[i].href = "/seek/nearest.aspx?lat="+match[1]+"&lng="+match[2]; continue;} } } catch(e) {gclh_error("Change new links for find caches to the old links",e);} } // Set language in Driving Directions links for the cache coordinates and the waypoints. if (is_page("cache_listing") && $('#ctl00_ContentBody_lnkPrintDirectionsSimple')[0]) { $('#ctl00_ContentBody_lnkPrintDirectionsSimple')[0].href = $('#ctl00_ContentBody_lnkPrintDirectionsSimple')[0].href.replace('http://', 'https://'); $('a[href*="https://maps.google.com/maps?f=d&hl=en&saddr="]').each((_i, elem) => { elem.href = elem.href.replace('&hl=en', ''); }); } // Hide greenToTopButton. if (settings_hide_top_button) $("#topScroll").attr("id", "_topScroll").hide(); // Show additional cache info in old log page. if (document.location.href.match(/\.com\/seek\/log\.aspx\?(id|guid|ID|wp|LUID|PLogGuid|code)\=/) && settings_show_add_cache_info_in_log_page && $('.PostLogList > dd:nth-child(2)')[0]) { try { $('.PostLogList > dd:nth-child(2)')[0].append(createAreaACI()); buildContentACI($('#ctl00_ContentBody_LogBookPanel1_WaypointLink')[0].nextSibling.href); buildCssACI(); } catch(e) {gclh_error("Show additional cache info in old log page",e);} } // Show additional cache info in new log page. if (document.location.href.match(/\.com\/play\/geocache\/gc\w+\/log/) && settings_show_add_cache_info_in_log_page) { try { function waitForNewLogPageForACI(waitCount) { if ($('#logType .log-subheading')[0]) { $('#logType .log-subheading')[0].after(createAreaACI()); buildContentACI($('#logType .log-subheading')[0].href); buildCssACI(); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){waitForNewLogPageForACI(waitCount);}, 100);} } waitForNewLogPageForACI(0); } catch(e) {gclh_error("Show additional cache info in new log page",e);} } function buildCssACI(css) { if (!css) var css = ''; // Old logging page. if (document.location.href.match(/\.com\/seek\/log\.aspx\?(id|guid|ID|wp|LUID|PLogGuid|code)\=/)) var mt = '1px' // New logging page. else var mt = '4px' css += '#aci {margin-left: 4px; margin-right: 2px; margin-top: ' + mt + '; cursor: default; float: right;} '; css += '#aci svg {vertical-align: text-bottom;} '; css += '#aci img {vertical-align: sub;} '; appendCssStyle(css); } function createAreaACI() { var span = document.createElement('span'); span.id = 'aci'; return span; } function buildContentACI(url) { $.get(url, null, function(text){ // Add cache type icon and limit cachetitle var type = $(text).find('.cacheDetailsTitle a')[0].getAttribute("title"); var typeIcon = $(text).find('.activity-type-icon svg')[0]; var linkHeader = document.getElementsByClassName('subheader')[0]; if (type && typeIcon && linkHeader) { var cacheName = $('.subheader')[0].innerHTML; typeIcon.setAttribute("style", "vertical-align: sub; height: 19px; width: 19px;"); var typeIconSpan = document.createElement("span"); typeIconSpan.setAttribute("class", "gclh_TypeIcon"); typeIconSpan.setAttribute("style", "margin-right: 4px; margin-top: 3px; float: left;"); typeIconSpan.setAttribute("title", type); linkHeader.setAttribute("style", "white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"); linkHeader.setAttribute("title", cacheName); linkHeader.parentNode.insertBefore(typeIconSpan, linkHeader); document.getElementsByClassName('gclh_TypeIcon')[0].appendChild(typeIcon); } // Favorite points and favorite percent. var aci = ''; var favoritePoints = $(text).find('.favorite-value').html(); if (favoritePoints) { favoritePoints = favoritePoints.replace('.','').replace(',',''); favoritePoints = parseInt(favoritePoints); aci += separator(aci) + ''; aci += ''; aci += ' ' + favoritePoints + ''; aci += ''; aci += ''; } // Watcher. var watchNumber = $(text).find('#watchlistLinkMount'); if (watchNumber[0]) { watchNumber = watchNumber[0].getAttribute("data-watchcount"); aci += separator(aci) + ''; aci += ''; aci += ' ' + watchNumber + ''; aci += ''; } // Difficulty and Terrain var difficulty = $(text).find('#ctl00_ContentBody_uxLegendScale img'); var terrain = $(text).find('#ctl00_ContentBody_Localize12 img') if ((difficulty[0]) && (terrain[0])) { difficulty = difficulty[0].getAttribute("alt").split(" ")[0]; terrain = terrain[0].getAttribute("alt").split(" ")[0]; aci += separator(aci); aci += ''; aci += ''; aci += ' ' + difficulty + ' '; aci += ''; aci += ''; aci += ''; aci += ' ' + terrain + ''; aci += ''; } // Output and further load. if (aci != '') { $('#aci')[0].innerHTML = aci; let gccode; // Old logging page. // Beim Ändern eines Logs steht der GC Code nicht zur Verfügung, deshalb gibt es dort auch keinen Prozentsatz für die Favoriten. if (document.location.href.match(/\.com\/seek\/log\.aspx\?(id|guid|ID|wp|LUID|PLogGuid|code)\=/) && $('#uxNewLoggingBannerLink')[0]) { gccode = $('#uxNewLoggingBannerLink').attr('href').split('/').at(-2); // New logging page. } else if (document.location.href.match(/\.com\/play\/geocache\/gc\w+\/log/)) { gccode = window.location.href.split('/').at(-2); } if (favoritePoints && !gccode == '') getFavoriteScore(gccode, function(score) { $('.favorite_percent')[0].innerHTML = ' ' + score + '%'; }); // Variable length of cache name on new logging page. if (document.location.href.match(/\.com\/play\/geocache\/gc\w+\/log/)) { function setMaxwidthOfCacheName(waitCount) { var width = 621 - parseInt(window.getComputedStyle($('#aci')[0]).width); $('.subheader')[0].style.maxWidth = width+"px"; waitCount++; if (waitCount <= 100) setTimeout(function(){setMaxwidthOfCacheName(waitCount);}, 100); } setMaxwidthOfCacheName(0); } } }); } // Add copy to clipboard links to geocaches and trackables old log page for Log ID and Logtext. if ((document.location.href.match(/\.com\/seek\/log\.aspx\?(id|guid|ID|wp|LUID|PLogGuid|code)\=/) || document.location.href.match(/\.com\/track\/log\.aspx\?(id|wid|guid|ID|LUID|PLogGuid|code)\=/))) { try { if ($('.CoordInfoLink')[0] && $('#ctl00_ContentBody_LogBookPanel1_CoordInfoLinkControl1_uxCoordInfoCode')[0]) { addCopyToClipboardLink($('#ctl00_ContentBody_LogBookPanel1_CoordInfoLinkControl1_uxCoordInfoCode')[0], $('.CoordInfoLink')[0], "Log ID"); } if ($('.LogEdit')[0] && $('#ctl00_ContentBody_LogBookPanel1_LogText')[0]) { addCopyToClipboardLink(document.getElementById('ctl00_ContentBody_LogBookPanel1_LogText').innerText, $('.LogEdit')[0], "Logtext", 'padding: 4px 14px; position: relative; bottom: 5px;'); } } catch(e) {gclh_error("Copy to Clipboard on log page",e);} } // Show Smilies und Log Templates old log page. if ((document.location.href.match(/\.com\/seek\/log\.aspx\?(id|guid|ID|wp|LUID|PLogGuid|code)\=/) || document.location.href.match(/\.com\/track\/log\.aspx\?(id|wid|guid|ID|LUID|PLogGuid|code)\=/)) && $('#litDescrCharCount')[0] && $('#ctl00_ContentBody_LogBookPanel1_WaypointLink')[0] && $('#ctl00_ContentBody_LogBookPanel1_uxLogInfo')[0] && $('#uxDateVisited')[0]) { try { var [aGCTBName, aGCTBLink, aGCTBNameLink, aLogDate] = getGCTBInfo(); var aOwner = decode_innerHTML($('#ctl00_ContentBody_LogBookPanel1_WaypointLink')[0].nextSibling.nextSibling.nextSibling.nextSibling.nextSibling); insert_smilie_fkt("ctl00_ContentBody_LogBookPanel1_uxLogInfo"); insert_tpl_fkt(); var liste = ""; if (settings_show_bbcode) build_smilies(); build_tpls(); var box = $('#litDescrCharCount')[0]; box.innerHTML = liste; } catch(e) {gclh_error("Smilies and Log Templates old log page",e);} } // Show Smilies und Log Templates new log page. if (document.location.href.match(/\.com\/play\/geocache\/gc\w+\/log/) && $('#LogDate')[0] && $('#logContent')[0] && $('#LogText')[0] && $('#reportProblemInfo')[0]) { try { var [aGCTBName, aGCTBLink, aGCTBNameLink, aLogDate] = getGCTBInfo(true); var aOwner = decode_innerHTML($('.hidden-by a')[0]); aOwner = aOwner.match(/(.*)(" + n + " ";} } // Log Templates aufbauen. function build_tpls(newLogPage) { var texts = ""; var logicOld = ""; var logicNew = ""; for (var i = 0; i < anzTemplates; i++) { if (getValue("settings_log_template_name["+i+"]", "") != "") { texts += ""; logicOld += " - " + repApo(getValue("settings_log_template_name["+i+"]", "")) + "
    "; logicNew += ""; } } if (getValue("last_logtext", "") != "") { texts += ""; logicOld += " - [Last Cache-Log]
    "; logicNew += ""; } if (newLogPage) { liste += texts; liste += ""; } else liste += "

    Templates:

    " + texts + logicOld; } // Vorschau für Log, Log preview. if (document.location.href.match(/\.com\/play\/geocache\/gc\w+\/log/)) { try { var log_preview_wrapper = '
    ' + '
    ' + '' + '
    ' + '
    ' + '
    ' + '
    ' + '
    '; // Add divs for Markdown Editor $('textarea.log-text').before('
    '); $('textarea.log-text').after('
    '); $('#trackablesPanel').before(log_preview_wrapper); var $mdEditor = $("textarea.log-text").MarkdownDeep({ SafeMode :true, AllowInlineImages: false, ExtraMode: false, RequireHeaderClosingTag: true, disableShortCutKeys: true, DisabledBlockTypes: [ BLOCKTYPE_CONST.h4, BLOCKTYPE_CONST.h5, BLOCKTYPE_CONST.h6 ], help_location: "/guide/markdown.aspx", active_modal_class: "modal-open", active_modal_selector: "html", additionalPreviewFilter: SmileyConvert() }); $('#log-preview-button').click(function(){ $('#log-preview-content').toggle(); $('#log-previewPanel button').toggleClass('handle-open'); }); } catch(e) {gclh_error("Logpage Log Preview",e);} } // Replicate TB-Header to bottom if (document.location.href.match(/\.com\/play\/geocache\/gc\w+\/log/)) { try { var checkExistTBHeader = setInterval(function() { if ($('#tbHeader .trackables-header').length) { var visit_link = document.createElement("a"); visit_link.setAttribute("href", "javascript:void(0);"); visit_link.appendChild(document.createTextNode('Visit all')); visit_link.addEventListener("click", function(){ $('#tbHeader .btn-visit').trigger( "click" ); }); var drop_link = document.createElement("a"); drop_link.setAttribute("href", "javascript:void(0);"); drop_link.appendChild(document.createTextNode('Drop all')); drop_link.addEventListener("click", function(){ $('#tbHeader .btn-drop').trigger( "click" ); }); var clear_link = document.createElement("a"); clear_link.setAttribute("href", "javascript:void(0);"); clear_link.appendChild(document.createTextNode('Clear all')); clear_link.addEventListener("click", function(){ $('#tbHeader .btn-clear').trigger( "click" ); }); var li = document.createElement("li"); li.classList.add('tb_action_buttons'); li.appendChild(clear_link); li.appendChild(visit_link); li.appendChild(drop_link); $(".trackables-list").append(li); var css = ".tb_action_buttons{text-align:right;} " + ".tb_action_buttons a{margin-right: 12px; text-decoration:underline;}" + ".tb_action_buttons a:last-child{margin-right:0px;}" appendCssStyle(css); clearInterval(checkExistTBHeader); } }, 500); } catch(e) {gclh_error("Logpage Replicate TB-Header",e);} } // Maxlength of logtext and unsaved warning. if (((document.location.href.match(/\.com\/seek\/log\.aspx\?(id|guid|ID|wp|LUID|PLogGuid|code)\=/) || document.location.href.match(/\.com\/track\/log\.aspx\?(id|wid|guid|ID|LUID|PLogGuid|code)\=/)) && $('#litDescrCharCount')[0]) || document.location.href.match(/\.com\/play\/geocache\/gc\w+\/log/)) { try { var newLogpage = document.location.href.match(/\.com\/play\/geocache\/gc\w+\/log/); var changed = false; // Meldung bei ungespeichertem Log. window.onbeforeunload = function(e) { if (changed && settings_unsaved_log_message) { var mess = "You have changed a log and haven't saved it yet. Do you want to leave this page and lose your changes?"; e.returnValue = mess; return mess; } }; if ($('#ctl00_ContentBody_LogBookPanel1_btnSubmitLog')[0]) $('#ctl00_ContentBody_LogBookPanel1_btnSubmitLog')[0].addEventListener("click", function() {changed = false;}, false); // Keine Meldung beim Submit. if ($('#submitLog')[0]) $('#submitLog')[0].addEventListener("click", function() {changed = false;}, false); // Keine Meldung beim Submit. var counterelement = document.createElement('span'); function waitForLoadingLoggingPage(waitCount) { if (!document.getElementsByClassName('loading')[0]) { if (!newLogpage || (newLogpage && settings_improve_character_counter)) { var logfield = (!newLogpage ? $('#ctl00_ContentBody_LogBookPanel1_uxLogInfo')[0] : $('#LogText')[0]); var counterspan = document.createElement('p'); counterspan.id = "logtextcounter"; var wordsArr = $(logfield).val().replace(/\n/g, ' ').split(' '); var words = 0; for (let i=0; i"); counterelement.innerHTML = '' + $(logfield).val().replace(/\n/g, "\r\n").length + '/4000 (' + words + ' words)'; counterspan.appendChild(counterelement); if (!newLogpage) document.getElementById('litDescrCharCount').parentNode.appendChild(counterspan); else { document.querySelector('.btn-group-grow').insertBefore(counterspan, (document.querySelector('.btn-favorite') ? document.querySelector('.btn-favorite') : document.querySelector('.btn-problem'))); var observerNewLog = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (!document.querySelector('#logtextcounter')) document.querySelector('.btn-group-grow').insertBefore(counterspan, (document.querySelector('.btn-favorite') ? document.querySelector('.btn-favorite') : document.querySelector('.btn-problem'))); }); }); var target = document.querySelector('body'); var config = {attributes: true, childList: true, characterData: true, subtree: true}; observerNewLog.observe(target, config); } logfield.addEventListener("keyup", function() {limitedField(logfield, document.querySelector('#logtextcounter span'), 4000, true);}, false); logfield.addEventListener("change", function() {limitedField(logfield, document.querySelector('#logtextcounter span'), 4000, true);}, false); } } else {waitCount++; if (waitCount <= 200) setTimeout(function(){waitForLoadingLoggingPage(waitCount);}, 50);} } waitForLoadingLoggingPage(0); var css = '#logtextcounter {font-weight: normal !important;}'; if (newLogpage && settings_improve_character_counter) { css += 'span.character-counter {display: none !important;}'; css += '#logtextcounter {margin: 0 !important;}' css += '.btn-group-grow {flex: unset !important; display: flex; justify-content: space-between; width: 100%; align-items: center;}'; css += '.btn-problem {float: unset !important; margin-left: 0 !important;}' } appendCssStyle(css); } catch(e) {gclh_error("Maxlength of logtext and unsaved warning",e);} } // Autovisit Old Log Page. if (settings_autovisit && document.location.href.match(/\.com\/seek\/log\.aspx/) && !document.location.href.match(/\.com\/seek\/log\.aspx\?LUID=/) && !document.getElementById('ctl00_ContentBody_LogBookPanel1_CoordInfoLinkControl1_uxCoordInfoCode')) { try { var tbs = getTbsO(); if (tbs.length != 0) { for (var i = 0; i < tbs.length; i++) { var [tbC, tbN] = getTbO(tbs[i].parentNode); if (!tbC || !tbN) continue; var auto = document.createElement("input"); auto.setAttribute("type", "checkbox"); auto.setAttribute("id", "gclh_"+tbC); auto.setAttribute("value", tbN); auto.addEventListener("click", setAutoO, false); tbs[i].appendChild(auto); tbs[i].appendChild(document.createTextNode(" AutoVisit")); } $('#ctl00_ContentBody_LogBookPanel1_ddLogType')[0].addEventListener("input", buildAutosO, false); buildAutosO(true); window.addEventListener("load", function(){buildAutosO(true);}, false); } function buildAutosO(start) { var type = getTypeO(); var tbs = getTbsO(); for (var i = 0; i < tbs.length; i++) { var [tbC, tbN] = getTbO(tbs[i].parentNode); setAutoO(tbC, tbN, type, start, true); } if (unsafeWindow.setSelectedActions) unsafeWindow.setSelectedActions(); } function setAutoO(tbC, tbN, type, start, allTbs) { if (!type) var type = getTypeO(); if (!tbC || !tbN) var [tbC, tbN] = getTbO(this.parentNode.parentNode); var options = $('#gclh_'+tbC)[0].parentNode.getElementsByTagName('option'); var select = $('#gclh_'+tbC)[0].parentNode.getElementsByTagName('select'); var autos = $('#gclh_'+tbC)[0]; if (!type || !tbC || !tbN || !select[0] || options.length < 2 || !autos) return; if (start) { if (getValue("autovisit_"+tbC, settings_autovisit_default)) autos.checked = true; else autos.checked = false; } if (options.length == 2 || (options.length == 3 && select[0].selectedIndex != 1)) { if (autos.checked == true) { if (type == 2 || type == 10 || type == 11) select[0].selectedIndex = options.length - 1; else select[0].selectedIndex = 0; } else { if (allTbs != true && (type == 2 || type == 10 || type == 11)) select[0].selectedIndex = 0; } } setValue("autovisit_"+tbC, (autos.checked ? true:false)); } function getTypeO() {return $('#ctl00_ContentBody_LogBookPanel1_ddLogType')[0].value;} function getTbsO() {return $('#tblTravelBugs tbody tr td select').closest('td');} function getTbO(tb) {return [$(tb).find('td a')[0].innerHTML, $(tb).find('td select option')[0].value];} } catch(e) {gclh_error("Autovisit Old",e);} } // Autovisit New Log Page. if (settings_autovisit && document.location.href.match(/\.com\/play\/geocache\/gc\w+\/log/i)) { try { function getTbs() {return $('#tbList .trackables-list li:not(.tb_action_buttons)');} function getType() {return $('.log-types').val();} // returns the log type. function getTb(tb) {return $(tb).find('.stats dd')[1].innerHTML;}; // returns the tb code. function getTbType(tb) { let r = $(tb).find('input[type="radio"]'); for (let i=0; i<3; i++) { if (r[i].checked) return r[i].value; } } function buildAutos() { let tbs = getTbs(); if (tbs.length > 0) { for (let i=0; i 1) { var tbs = getTbs(); if (tbs.length > 0) { for (let i=0; i
    '); $(tbs[i]).find('.actions.radio-toggle-group').appendTo('#gclh_action_list_'+tbC+''); let html = '
    ' + ' ' + ' ' + '
    '; $('#gclh_action_list_'+tbC).append(html); } // Save TB in autovisit if it new. if (getValue("autovisit_"+tbC, "new") === "new") { setValue("autovisit_"+tbC, settings_autovisit_default); } // Save autovisit status onchange $(tbs[i]).find('.gclh_autovisit input').each(function() { this.addEventListener('change', function(evt) { setValue(evt.target.name, (evt.target.value==1 ? true : false)); buildAutos(); }) }); } // Set Autovisit. buildAutos(); // Change autovisit if the logtype changed $('select.log-types').bind('change', buildAutos); waitCount++; if (waitCount <= 100) setTimeout(function(){waitForContent(waitCount);}, 100); } } else {waitCount++; if (waitCount <= 100) setTimeout(function(){waitForContent(waitCount);}, 100);} } waitForContent(0); } catch(e) {gclh_error("Autovisit New",e);} } // Default Log Type and Log Signature Old Log Page. // Cache: if (document.location.href.match(/\.com\/seek\/log\.aspx\?(id|guid|ID|PLogGuid|wp)\=/) && $('#ctl00_ContentBody_LogBookPanel1_ddLogType')[0] && $('#ctl00_ContentBody_LogBookPanel1_lbConfirm').length == 0) { try { // Logtype. if (!document.location.href.match(/\&LogType\=/) && !document.location.href.match(/PLogGuid/)) { var cache_type = document.getElementById("ctl00_ContentBody_LogBookPanel1_WaypointLink").nextSibling.childNodes[0].title; var select_val = "-1"; if (cache_type.match(/event/i)) { select_val = settings_default_logtype_event; } else if ($('.PostLogList').find('a[href*="https://www.geocaching.com/profile/?guid="], a[href*="https://www.geocaching.com/p/?guid="]').text().trim() == global_me.trim()) { select_val = settings_default_logtype_owner; } else select_val = settings_default_logtype; var select = document.getElementById('ctl00_ContentBody_LogBookPanel1_ddLogType'); var childs = select.children; if (select.value == "-1") { for (var i = 0; i < childs.length; i++) { if (childs[i].value == select_val) select.selectedIndex = i; } } // Bei Events wird nach dem Event Datum von GS automatisch der Logtype "Attended" gesetzt, sofern ein "Attended" noch nicht vorhanden ist. // Das Log Datum steht dann auf dem aktuellen Datum und nicht auf dem Event Datum, was richtig wäre. Das Log Datum ist nicht eingabebereit. // Unsere Default Einstellung settings_default_logtype_event zieht für diesen Fall nie. Der Fehler tritt auch ohne den GClh auf. Es handelt // sich hier also um einen Bug auf der Webseite, der aber wohl kaum noch berichtigt wird. if (select.value == "10") { var logdate = $("#uxDateVisited"); var logdate_format = logdate.attr("userdateformat"); var logdate_date = new Date($("#ctl00_ContentBody_LogBookPanel1_EventDate").val()); var logdate_text = $.datepicker.formatDate(logdate_format, logdate_date); logdate.attr("value", logdate_text); } } // Signature. var logtext = document.getElementById('ctl00_ContentBody_LogBookPanel1_uxLogInfo').value; var signature = getValue("settings_log_signature", ""); // Cursorposition gegebenenfalls hinter Draft ermitteln. document.getElementById('ctl00_ContentBody_LogBookPanel1_uxLogInfo').innerHTML += ""; var initial_cursor_position = document.getElementById('ctl00_ContentBody_LogBookPanel1_uxLogInfo').selectionEnd; // Draft. if (document.location.href.match(/\.com\/seek\/log\.aspx\?PLogGuid\=/)) { if (settings_log_signature_on_fieldnotes && !logtext.includes(signature.replace(/^\s*/, ''))) { document.getElementById('ctl00_ContentBody_LogBookPanel1_uxLogInfo').innerHTML += signature; } // Kein Draft. } else { if (!logtext.includes(signature)) { document.getElementById('ctl00_ContentBody_LogBookPanel1_uxLogInfo').innerHTML += signature; } } replacePlaceholder(); document.getElementById('ctl00_ContentBody_LogBookPanel1_uxLogInfo').selectionEnd = initial_cursor_position; // Auch im Log Preview zur Anzeige bringen. document.getElementById('ctl00_ContentBody_LogBookPanel1_uxLogInfo').dispatchEvent(new KeyboardEvent('keyup', {'keyCode': 32})); } catch(e) {gclh_error("Default Log-Type and Signature Old Log Page (CACHE)",e);} } // TB: if (document.location.href.match(/\.com\/track\/log\.aspx/) && $('#ctl00_ContentBody_LogBookPanel1_ddLogType')[0]) { try { // Logtype. if (settings_default_tb_logtype != "-1" && !document.location.href.match(/\&LogType\=/)) { var select = document.getElementById('ctl00_ContentBody_LogBookPanel1_ddLogType'); var childs = select.children; for (var i = 0; i < childs.length; i++) { if (childs[i].value == settings_default_tb_logtype) select.selectedIndex = i; } } // Signature. if ($('#ctl00_ContentBody_LogBookPanel1_uxLogInfo')[0] && $('#ctl00_ContentBody_LogBookPanel1_uxLogInfo')[0].innerHTML == "") $('#ctl00_ContentBody_LogBookPanel1_uxLogInfo')[0].innerHTML = getValue("settings_tb_signature", ""); replacePlaceholder(); document.getElementById('ctl00_ContentBody_LogBookPanel1_uxLogInfo').selectionEnd = 0; // Auch im Log Preview zur Anzeige bringen. document.getElementById('ctl00_ContentBody_LogBookPanel1_uxLogInfo').dispatchEvent(new KeyboardEvent('keyup', {'keyCode': 32})); } catch(e) {gclh_error("Default Log-Type and Signature (TB)",e);} } // Log Signature New Log Page. if (document.location.href.match(/\.com\/play\/geocache\/gc\w+\/log/)) { try { checkLogType(0); function checkLogType(waitCount) { // Drafts ohne Signatur. if (document.location.href.match(/log\?d\=/) && document.getElementById('LogText').value != "" && !settings_log_signature_on_fieldnotes) { // Auch im Log Preview zur Anzeige bringen. document.getElementById('LogText').dispatchEvent(new KeyboardEvent('keyup', {'keyCode': 32})); } // Kein Draft oder Draft mit Signatur. if ((!document.location.href.match(/log\?d\=/)) || // Kein Draft (document.location.href.match(/log\?d\=/) && document.getElementById('LogText').value != "" && settings_log_signature_on_fieldnotes)) { // Draft var initial_cursor_position = document.getElementById('LogText').selectionEnd; var logtext = document.getElementById('LogText').value; var signature = getValue("settings_log_signature", ""); if (!logtext.includes(signature.replace(/^\s*/, ''))) { document.getElementById('LogText').innerHTML = signature; } replacePlaceholder(true); if (document.location.href.match(/log\?d\=/)) { // Draft // 2 Zeilen sinngemäß von DieBatzen ausgeliehen, um "<" und ">" richtig darzustellen. var textarea = document.createElement('textarea'); var value = $(''); $(log).find('.gclh_logText').after('
    '); $(log).find('.note-text')[0].style.display = 'none'; showInMarkdown($(log).find('.gclh_logText'), resizebar = false, toolbar = false); $('.mdd_preview').removeClass('mdd_preview'); } // Back up log texts for Markdown. // Die Logtexte stehen nicht immer in guter Qualität zur Verfügung, weil GS scheinbar manuell an den Logtexten rumbastelt, beispielsweise // wenn der more Button gedrückt wurde. Manchmal gibt es sichtbare "
    " oder unsichtbare Steuerzeichen, die die Markdown Verarbeitung nicht // behandeln kann. Das passiert insbesonder wenn Markdown Elemente im Text vorhanden sind. Deshalb werden die Logtexte hier in ihrem // Anfangszustand gesichert, um immer wieder darauf zuzugreifen. var logId = 0; function backupLogtextMarkdownAF(log) { if (!settings_dashboard_show_logs_in_markdown || $(log).attr('logId') || !$(log).find('.note-text')[0]) return; if (!$('#gclh_logs')[0]) $('#ActivityFeed').append(''); logId++; var logIdLocal = logId; var logText = decode_innerHTML($(log).find('.note-text')[0]); $('#gclh_logs ul').append('
  • ' + logText + '
  • '); $(log).attr('logId', logIdLocal); } // Copy to clipboard button for log text in Latest Activity list. function buildCopyLogtextToClipboard(log) { if (!$(log).find('.gclh_copyLogToClipboard')[0] && $(log).find('.note-text')[0]) { $(log).find('.meta-data').after(''); var logText = decode_innerHTML($(log).find('.note-text')[0]).replace(/
    /g,'\n'); addCopyToClipboardLink(logText, $(log).find('.gclh_copyToClipboard')[0], "Log"); } } // Hide TB Activity function hideTBActivity(log) { if (settings_dashboard_hide_tb_activity && $(log).find('.label-text a')[0].href.match(/coord.info\/TB\w+/ig)) { $(log).addClass('gclh_hidden_log'); checkDay($(log).parent()); } } // Removes the Date for Days Without Logs function checkDay(container) { let unfilterd = $(container).find('.activity-item'); let filtered = Array.from(unfilterd).filter(li => $(li).hasClass('gclh_hidden_log')); if (unfilterd.length <= filtered.length) { $(container).parents('li:not(.activity-item)').addClass('gclh_hidden_day'); } // The Date of the current Date is displayed outside the list of days if ($('.activity-groups > li:first').hasClass('gclh_hidden_day')) { let firstDay = $('.activity-groups > li:not(.gclh_hidden_day)')[0]; $('div > .activity-block-header h2')[0].innerHTML = $(firstDay).find('h2').html(); $(firstDay).find('.activity-block-header')[0].style.display = 'none'; } } if (settings_dashboard_hide_tb_activity) { css += '.gclh_hidden_day, .gclh_hidden_log {display: none !important;}'; } // Common functions for features in Latest Activity list. function buildWaitAF(log, waitCount) { buildLinksAF(log); buildCacheTypeIconAF(log); buildLogtextMarkdownAF(log); buildCopyLogtextToClipboard(log); waitCount++; if (waitCount <= 500) setTimeout(function(){buildWaitAF(log, waitCount);}, 10); } function buildEventMoreAF(log) { if (!$(log).find('.activity-details').hasClass('gclh_event')) { $(log).find('.activity-details')[0].addEventListener("click", function(){buildWaitAF($(this).closest('.activity-item'), 0);}, false); $($(log).find('.activity-details')[0]).addClass('gclh_event'); } } function processLogsAF(waitCount) { if ($('#ActivityFeed .activity-item').length > 0) { for (i=0; i<$('#ActivityFeed .activity-item').length; i++) { buildCacheTypeIconAF($('#ActivityFeed .activity-item')[i]); if ($($('#ActivityFeed .activity-item')[i]).find('.activity-type-icon > a')[0].href.match(serverParameters["user:info"].referenceCode)) { buildEventMoreAF($('#ActivityFeed .activity-item')[i]); } backupLogtextMarkdownAF($($('#ActivityFeed .activity-item')[i])); hideTBActivity($($('#ActivityFeed .activity-item')[i])); } } waitCount++; if (waitCount <= 500) setTimeout(function(){processLogsAF(waitCount);}, 10); } function buildEventQtipAF(waitCount) { if ($('#ActivityFeed .btn-settings')[0] && $('#ActivityFeed .btn-settings').attr('data-hasqtip') && $('#qtip-' + $('#ActivityFeed .btn-settings').attr('data-hasqtip') + '-content')[0] && !$( $('#qtip-' + $('#ActivityFeed .btn-settings').attr('data-hasqtip') + '-content')[0] ).hasClass('gclh_event')) { var qtip = $('#qtip-' + $('#ActivityFeed .btn-settings').attr('data-hasqtip') + '-content'); qtip[0].addEventListener("click", function(){startAF();}, false); $(qtip[0]).addClass('gclh_event'); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){buildEventQtipAF(waitCount);}, 50);} } function buildEventLatestActivityAF(waitCount) { if ($('#ActivityFeed .btn-settings')[0] && !$($('#ActivityFeed .btn-settings')[0]).hasClass('gclh_event')) { $('#ActivityFeed .btn-settings')[0].addEventListener("click", function(){buildEventQtipAF(0);}, false); $($('#ActivityFeed .btn-settings')[0]).addClass('gclh_event'); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){buildEventLatestActivityAF(waitCount);}, 50);} } function buildEventLatestActivityPanelAF(waitCount) { if ($('#ActivityFeed .panel-header')[0] && !$($('#ActivityFeed .panel-header')[0]).hasClass('gclh_event')) { $('#ActivityFeed .panel-header')[0].addEventListener("click", function(){startAF();}, false); $($('#ActivityFeed .panel-header')[0]).addClass('gclh_event'); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){buildEventLatestActivityPanelAF(waitCount);}, 50);} } function startAF() { buildEventLatestActivityPanelAF(0); buildEventLatestActivityAF(0); processLogsAF(0); } if (settings_show_edit_links_for_logs || settings_show_cache_type_icons_in_dashboard || settings_dashboard_hide_tb_activity) { startAF(); } // Show unpublished hides. if (settings_showUnpublishedHides) { var panel = '
    '; panel += '
    '; panel += '

    Unpublished Hides

    '; panel += ' '; panel += ' '; panel += ' '; panel += '
    '; panel += '
    '; panel += '
    '; panel += '
    '; panel += '
    '; panel += '
    '; $('.sidebar-right').append(panel); if (!getValue('unpublishedCaches_visible', false)) { $('#gclh_unpublishedCaches .panel-header').removeClass('isActive'); $('#gclh_unpublishedCaches .panel-body').fadeOut(0); } $('#gclh_unpublishedCaches .panel-header').bind('click', function() { if (getValue('unpublishedCaches_visible', true)) { $('#gclh_unpublishedCaches .panel-header').removeClass('isActive'); $('#gclh_unpublishedCaches .panel-body').fadeOut(300); setValue('unpublishedCaches_visible', false); }else { $('#gclh_unpublishedCaches .panel-header').addClass('isActive'); $('#gclh_unpublishedCaches .panel-body').fadeIn(300); setValue('unpublishedCaches_visible', true); } }); // If the link to unpublished hides is shown in dashboard, there are some. if ($('a.bold[href="/account/dashboard/unpublishedcaches"]')[0]) { // Build the area to list the unpublished caches and events. function buildListArea() { if ($('#gclh_unpublishedCaches_list')[0]) return; var list = '
        '; $('#gclh_unpublishedCaches_body').html(list); } // Build the list of unpublished caches. function buildCachesList(caches) { buildListArea(); if (settings_set_showUnpublishedHides_sort) { if (settings_showUnpublishedHides_sort == 'abc') caches.sort(abc); else if (settings_showUnpublishedHides_sort == 'gcNew') caches.sort(gcNew); else if (settings_showUnpublishedHides_sort == 'gcOld') caches.sort(gcOld); } var list = ''; for (let i=0; i'; list += ' '; list += ' '; list += '
        '; list += '

        ' + name + '

        '; list += '
        '; list += '
        '; list += ' '; list += ' '; list += ' '; list += '
        '; list += '
        ' + d + '
        '; list += '
        '; list += ' '; list += ' '; list += ' '; list += '
        '; list += '
        ' + t + '
        '; list += '
        '; list += ' '; list += ' '; list += ' '; list += '
        '; list += '
        ' + size + '
        '; list += '
        '; list += '
        ' + gccode + '
        '; list += '
        '; list += '
        '; list += '
        '; list += ''; } $('#gclh_unpublishedCaches_cachesList').html(list); if ($('#gclh_unpublishedCaches_eventsList li')[0]) { $('#gclh_unpublishedCaches_cachesList li:last')[0].setAttribute('style', 'border-bottom: 1px solid #e4e4e4 !important;'); } } // Build the list of unpublished events. function buildEventsList(events) { buildListArea(); var list = ''; for (let i=0; i'; list += ' '; list += ' '; list += '
        '; list += '

        ' + name + '

        '; list += '
        '; list += '
        ' + gccode + '
        '; list += '
        '; list += '
        ' + startDate + '
        '; list += '
        ' + startTime + '
        '; list += '
        '; list += '
        '; list += '
        '; list += ''; } $('#gclh_unpublishedCaches_eventsList').html(list); if ($('#gclh_unpublishedCaches_cachesList li')[0]) { $('#gclh_unpublishedCaches_eventsList li:last')[0].setAttribute('style', 'border-top: 1px solid #e4e4e4 !important;'); } } // Get a list of unpublished caches via api. $.ajax({ type: "GET", cache: false, url: '/api/proxy/web/v1/cacheowner/geocaches/unpublished?skip=0&take=100', success: function(response) { if (response.data.length > 0) buildCachesList(response.data); } }); // Get a list of unpublished events via api. $.ajax({ type: "GET", cache: false, url: '/api/proxy/web/v1/cacheowner/events/unpublished?skip=0&take=100', success: function(response) { if (response.data.length > 0) buildEventsList(response.data); } }); } else { var dnfHtml = '
        '; dnfHtml += ' '; dnfHtml += '

        You don\'t have any unpublished hides.

        '; dnfHtml += '
        '; $('#gclh_unpublishedCaches_body').html(dnfHtml); } css += '#gclh_unpublishedCaches_body {min-height: unset;}'; css += '#gclh_unpublishedCaches_body dt {margin: 0 3px 0 0; padding: 0;}'; css += '#gclh_unpublishedCaches_body .left-separator {margin: 0 4px 0 -4px; padding: 0;}'; css += '#gclh_unpublishedCaches_eventsList .left-separator {margin: 0 8px 0 0px; padding: 0;}'; css += '#gclh_unpublishedCaches_body dl dd {margin: 0 8px 0 0; padding: 0;}'; css += '#gclh_unpublishedCaches_body dl dd:last-child {margin-right: 0;}'; css += '#gclh_unpublishedCaches_cachesList, #gclh_unpublishedCaches_eventsList {padding: 0; margin: 0;}'; } appendCssStyle(css); } catch(e) {gclh_error("Improve new dashboard",e);} } // Improve Owner Dashboard. if (is_page('owner_dashboard')) { try { // Functions for CO Dashboard Main Page. // Set a link to the cachetypes. function setLinksToCacheTypes(waitCount) { if ($('.gclh_cacheTypeLinks')[0]) return; // Returns if the links have already been created. if ($('.owned-geocache-types')[0]) { var linkToList = 'https://www.geocaching.com/seek/nearest.aspx?u=' + global_me + '&tx='; var cacheTypes = { 'Traditional Cache' : linkToList + '32bc9333-5e52-4957-b0f6-5a2c8fc7b257', 'Multi-Cache' : linkToList + 'a5f6d0ad-d2f2-4011-8c14-940a9ebf3c74', 'Mystery Cache' : linkToList + '40861821-1835-4e11-b666-8d41064d03fe', 'Letterbox Cache' : linkToList + '4bdd8fb2-d7bc-453f-a9c5-968563b15d24', 'Wherigo Cache' : linkToList + '0544fa55-772d-4e5c-96a9-36a51ebcf5c9', 'Earth Cache' : linkToList + 'c66f5cf3-9523-4549-b8dd-759cd2f18db8', 'Virtual Cache' : linkToList + '294d4360-ac86-4c83-84dd-8113ef678d7e', 'Webcam Cache' : linkToList + '31d2ae3c-c358-4b5f-8dcd-2185bf472d3d', 'Event Cache' : linkToList + '69eb8534-b718-4b35-ae3c-a856a55b0874', 'CITO Event' : linkToList + '57150806-bc1a-42d6-9cf0-538d171a2d22', 'Community Celebration Event Cache' : linkToList + '3ea6533d-bb52-42fe-b2d2-79a3424d4728', 'Lab Cache' : 'https://labs.geocaching.com/builder/adventures' } let html = ''; html += $('.owned-geocache-total').html() + ''; $('.owned-geocache-total').html(html); $('.owned-geocache-types ul li').each(function() { let ariaLabel = $(this).attr('aria-label'); let html = ''; html += this.innerHTML + ''; $(this).html(html); }); } else {waitCount++; if (waitCount <= 1000) setTimeout(function(){setLinksToCacheTypes(waitCount);}, 100);} } // Set link to own Profil. function setLinkToOwnProfil(waitCount) { if ($('ul.latest-activity-list')[0]) { $('.info .username').html('' + $('.username').html() + ''); } else {waitCount++; if (waitCount <= 1000) setTimeout(function(){setLinkToOwnProfil(waitCount);}, 100);} } // Build VIP, Mail, Message icons. function waitForLatestActivityList(waitCount) { if (global_running) return; if (waitCount > 0 && $('ul.latest-activity-list li')[0]) { if (global_running) return; global_running = true; if (settings_show_vip_list) buildVipVupMailMessage(); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){waitForLatestActivityList(waitCount);}, 100);} } function buildVipVupMailMessage() { // Add Event Listener for "Load more" button. if ($('.latest-activity-load')[0] && !$('.gclh_eventListener')[0]) { $('.latest-activity-load')[0].addEventListener('click', function() { function waitForLatestActivityPart2(waitCount) { if ($('.latest-activity-loaded')[0]) { waitForLatestActivityList(0); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){waitForLatestActivityPart2(waitCount);}, 100);} } waitForLatestActivityPart2(0); }); $('.latest-activity-load').addClass('gclh_eventListener'); } // Build Vip, Vup, Mail. var links = $('a[href*="https://www.geocaching.com/p/default.aspx?u="] span.finder-username').closest('a'); for (var i = 0; i < links.length; i++) { if ($(links[i]).closest('.activity-item').find('.gclh_name')[0]) continue; var user = $(links[i]).find('.finder-username')[0]; if ($('.mobile-log-item')[0]) { $(user).after(''); $(user).appendTo($(links[i]).find('.gclh_name')); } else { $(links[i]).after(''); } var item = $(user).closest('.activity-item'); var GCTBName = $(item).find('h3 a').html().trim(); var GCTBCode = $(item).find('.log-meta li')[0].childNodes[1].data; global_name = GCTBName; global_code = '('+GCTBCode+')'; global_link = '(https://coord.info/'+GCTBCode+')'; var iconPlace = $(links[i]).closest('.activity-item').find('.gclh_name')[0]; gclh_build_vipvupmail(iconPlace, user.innerHTML); } global_running = false; } // Show favorites percentage function favPercent(waitCount) { // Function to load the fav score. function showFavPerc() { // Check if all scores are loaded. function checkForLoaded() { if (loaded == $('.geocache-table tbody tr').length) { $('#gclh_loadFavPerc_loading').hide(); } } // Hide heart and show loading-spinner. $('#gclh_loadFavPerc').hide(); $('#gclh_loadFavPerc_loading').show(); let loaded = 0; // Load the fav score $('.geocache-table tbody tr').each((i, elem) => { let id = $(elem).find('.geocache-details span').html().gcCodeToID(); let favs = $(elem).find('.favorites-display').html(); if (favs == 0) { $(elem).find('.favorites-display').html(favs + ' (0%)'); loaded++; checkForLoaded(); } else if ($(elem).find('.favorites-display .gclh_favScore')[0]) { loaded++; checkForLoaded(); } else { $.ajax({ url: '/seek/nearest.aspx/FavoriteScore', type: 'POST', contentType: "application/json; charset=utf-8", data: JSON.stringify({dto: {data: id, ut: 2, p: favs}}), dataType: 'json', success: function (result) { $(elem).find('.favorites-display').html(favs + ' (' + result.d.score + '%)'); loaded++; checkForLoaded(); } }); } }); } function loadMore() { if ($('#gclh_loadFavPerc')[0].style.display == 'none') { $('#gclh_loadFavPerc_loading').show(); function waitForNewCaches(waitCount) { let allCaches = $('.geocache-table tbody tr').length; let loadedCaches = $('.gclh_favScore').length; if (allCaches != loadedCaches) showFavPerc(); else {waitCount++; if (waitCount <= 100) setTimeout(function(){waitForNewCaches(waitCount);}, 100);} } waitForNewCaches(0); } } if (!settings_show_button_fav_proz_cod) return; if ($('.geocache-table tbody tr')[0]) { if ($('#gclh_loadFavPerc')[0]) return; let html = ''; html += ''; if ($('.map-controls')[0]) $('.map-controls').prepend(html); else $('.section-controls').append('
        '+html+'
        '); $('#gclh_loadFavPerc')[0].addEventListener('click', showFavPerc); // Add Event Listener for Changes (Oberserver does not work). $('.section-controls #gcsel-4JnpBxk').bind('change', loadMore); $('.gc-button').bind('click', loadMore); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){favPercent(waitCount);}, 100);} } function processAllCODashboard() { // Published and archivied caches excluding events. if (document.location.pathname.match(/play\/owner\/(archived|published)\/?$/)) { favPercent(0); // Main Page } else if (document.location.pathname.match(/play\/owner\/?$/)) { setLinksToCacheTypes(0); setLinkToOwnProfil(0); waitForLatestActivityList(0); } } // Build mutation observer. function buildObserverCODashboard() { var observerCODashboard = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { processAllCODashboard(); }); }); var target = document.querySelector('#app-root div'); var config = {attributes: true, childList: true, characterData: true}; observerCODashboard.observe(target, config); } // Check if mutation observer can be build. function checkForBuildObserverCODashboard(waitCount) { if ($('#app-root div div')[0]) { if ($('.gclh_buildObserverCODashboard')[0]) return; $('#app-root').addClass('gclh_buildObserverCODashboard'); buildObserverCODashboard(); } else {waitCount++; if (waitCount <= 200) setTimeout(function(){checkForBuildObserverCODashboard(waitCount);}, 50);} } checkForBuildObserverCODashboard(0); window.addEventListener("resize", processAllCODashboard); processAllCODashboard(); // CSS for Cache Owner Dashboard. var css = ''; // Set a link to the cachetypes. css += '.owned-geocache-total, .owned-geocache-types li a {padding: 0 !important}' css += '.owned-geocache-types li a, .gclh_cacheTypeLinks {display:flex; align-items:center; width: 100%; color:#4a4a4a; text-decoration:none; padding:4px 0;}'; css += '.owned-geocache-types li a:hover, .owned-geocache-total a:hover {font-weight:bold; color:#02874d; text-decoration:underline;}'; css += '.owned-geocache-total a {display:flex; align-items:center; color:#4a4a4a; text-decoration: none; justify-content:space-between; padding:12px 16px;}'; // Set link to own Profil. css += '.username a {color:#4a4a4a; text-decoration:none;}'; css += '.username a:hover {color:#02874d; text-decoration:underline;}'; // Build VIP, Mail, Message icons. if (settings_show_vip_list) { css += '.gclh_name {white-space: nowrap; display: flex; align-items: center;}'; css += '.gclh_name a {margin-right: 5px;}'; css += '.mobile-log-item-wrapper .gclh_name span {margin-right: 5px;}'; css += '.log-item .gclh_name {margin-left: 5px; margin-top: -3px; padding-bottom: 2px; line-height: 1;}'; css += '.log-item .finder-username, .log-item .finder-type, .log-item .finder-find-count {line-height: 1.3 !important;}'; css += '.mobile-log-item-wrapper .gclh_name a:focus:not(:nth-child(1)), .log-item .gclh_name a:focus {box-shadow: none;}'; css += '.latest-activity .mobile-log-item-wrapper {margin-top: -8px !important; padding: 0 8px !important;}'; } // Compact Layout if (settings_compact_layout_cod) { css += '.widget {z-index: 1;}'; css += '.widget > div, .widget > ul, .widget > ul > li, .widget > ul span, .widget > div span, .mobile-log-item-wrapper .log-item-meta {padding: 0 !important; margin: 0 !important;}'; css += '.widget .widget-title a, .widget ul a, .widget > span {padding: 5px 10px !important;}'; css += '.widget li, .widget li a {height: 30.8px; line-height: 1.3;}'; css += '.widget ul a svg {padding: 0 5px 0 0 !important; margin: 0 !important; height: 24px !important; width: 29px !important;}'; css += '.page-header.cod {margin-bottom: 12px !important; font-size: 20px !important;}'; css += '.quick-filters .quick-filters-header {padding: 0 12px !important;}'; css += '.latest-activity {margin-top: 12px !important;}'; css += '.latest-activity h2 {padding: 5px 10px !important;}'; css += '.quick-filters .quick-filters-header button {height:36px !important; width:36px !important;}'; css += '.quick-filters .quick-filters-header .scroll-left span,'; css += '.quick-filters .quick-filters-header .scroll-right span {height:24px !important; width:24px !important;}'; css += '.quick-filters .quick-filters-header button svg {height:12px !important; width:12p !important;}'; } appendCssStyle(css); } catch(e) {gclh_error("Improve Owner Dashboard",e);} } // Show thumbnails. if (settings_show_thumbnails) { try { // my: Großes Bild; at: Kleines Bild; Man gibt an, wo sich beide berühren. Es scheint so, dass zuerst horizontal und dann vertikal benannt werden muss. function placeToolTip(element, stop) { $('a.gclh_thumb:hover span').position({ my: "center bottom", at: "center top", of: "a.gclh_thumb:hover", collision: "flipfit flipfit" }); if (!stop) { $('a.gclh_thumb:hover span img').load(function() { placeToolTip(element, true); }); } } function buildThumb(href, title, showName, topSp) { var hrefLarge = (href.match(/\/large\//) ? href : href.replace(/\/cache\//,"/cache/large/")); links[i].classList.add("gclh_thumb"); links[i].href = hrefLarge.replace(/\/large\//,"/"); links[i].onmouseover = placeToolTip; var html = ''; if (showName) html += '
        '+title; html += '#top##bot#'; if (settings_imgcaption_on_top) html = html.replace("#top#",title).replace("#bot#",""); else html = html.replace("#top#","").replace("#bot#",title); links[i].innerHTML = html; if (topSp && settings_spoiler_strings != "" && title.match(regexp)) { var div = document.createElement("div"); div.innerHTML = "Spoiler warning"; div.setAttribute("style", "transform: rotate(-30grad); width: 130px; position: relative; top: "+topSp+"; left: -5px; font-size: 11px; line-height: 0;"); links[i].childNodes[0].src = urlImages+"gclh_logo.png"; links[i].childNodes[0].style.opacity = "0.05"; if (showName) links[i].childNodes[3].remove(); else links[i].childNodes[1].remove(); links[i].parentNode.appendChild(div); } } var regexp = new RegExp(settings_spoiler_strings, "i"); var css = ""; // Cache Listing. if (is_page("cache_listing") && !isMemberInPmoCache()) { // Logs. if (settings_load_logs_with_gclh) { var newImTpl = "" + "${Name} " + "#top##bot#"; if (settings_imgcaption_on_top) newImTpl = newImTpl.replace('#top#', '${Name}').replace('#bot#', ''); else newImTpl = newImTpl.replace('#top#', '').replace('#bot#', '${Name}'); var code = "function gclh_updateTmpl(waitCount) {" + " if (typeof $ !== 'undefined' && typeof $.template !== 'undefined') {" + " delete $.template['tmplCacheLogImages'];" + " $.template(\"tmplCacheLogImages\",\""+newImTpl+"\");" + " } else {waitCount++; if (waitCount <= 50) setTimeout(function(){gclh_updateTmpl(waitCount);}, 200);}" + "}" + "gclh_updateTmpl(0);" + placeToolTip.toString(); injectPageScript(code, "body"); } // Listing. css += ".CachePageImages li {margin-bottom: 12px; background: unset; padding-left: 0px;}"; var links = $('.CachePageImages').find('a[href*="img.geocaching.com/cache/"]'); for (var i = 0; i < links.length; i++) { buildThumb(links[i].href, links[i].innerHTML, true, "-70px"); } // Galerien Public Profile, Cache, TB. } else if ((is_page("publicProfile") && $('#ctl00_ContentBody_ProfilePanel1_lnkGallery.Active')[0]) || document.location.href.match(/\.com\/(seek\/gallery\.aspx?|track\/gallery\.aspx?)/)) { var links = $('.Table.GalleryTable').find('a[href*="img.geocaching.com/track/"], a[href*="img.geocaching.com/cache/"]'); for (var i = 0; i < links.length; i++) { buildThumb(links[i].href, links[i].nextElementSibling.innerHTML, false, (document.location.href.match(/\.com\/seek\/gallery\.aspx?/) ? "-90px" : false)); } // TB Listing. } else if (document.location.href.match(/\.com\/track\/details\.aspx?/)) { css += "a.gclh_thumb img {margin-bottom: unset !important; margin-right: unset;}"; var links = $('.imagelist, table.Table .log_images').find('a[href*="img.geocaching.com/track/"]'); for (var i = 0; i < links.length; i++) { buildThumb(links[i].href, links[i].children[0].alt, (links[i].href.match(/log/) ? false : true), false); } } // Public Profile. Show bigger avatar image while hovering with the mouse. if (is_page("publicProfile") && settings_public_profile_avatar_show_thumbnail && $('div.profile-image-wrapper')[0]) { var img = document.createElement('img'); img.src = $('div.profile-image-wrapper')[0].style.backgroundImage.replace(/url\(('|")/, '').replace(/('|")\)/, ''); img.setAttribute("style", "margin-bottom: 0px; height: 94px; width: 94px;"); var a = document.createElement('a'); a.className = "profile-image-wrapper"; a.setAttribute("style", "position: absolute; top: unset; left: unset; margin-top: -69px; margin-left: 80px; z-index: 1;"); a.appendChild(img); $('div.profile-image-wrapper')[0].parentNode.parentNode.insertBefore(a, $('div.profile-image-wrapper')[0].parentNode); $('div.profile-image-wrapper').remove(); avatarThumbnail($('a.profile-image-wrapper')[0]); a.href = $('a.profile-image-wrapper .gclh_max')[0].src; } css += "a.gclh_thumb:hover {" + " white-space: unset;" + " position: relative;}" + "a.gclh_thumb {" + " overflow: visible !important;" + " display: unset !important;" + " max-width: none !important;}" + "a.gclh_thumb span {" + " white-space: unset !important;" + " visibility: hidden;" + " position: absolute;" + " top: -310px;" + " left: 0px;" + " padding: 2px;" + " text-decoration: none;" + " text-align: left;" + " vertical-align: top;}" + "a.gclh_thumb:hover span {" + " visibility: visible;" + " z-index: 100;" + " border: 1px solid #8c9e65;" + " background-color: #dfe1d2;" + " text-decoration: none !important;}" + "a.gclh_thumb:hover img {margin-bottom: -4px;}" + "a.gclh_thumb img {" + " margin-bottom: -4px;" + " height: 75px;}" + ".gclh_max {" + " height: unset !important;" + " vertical-align: unset !important;" + " margin-right: 0 !important;" + " max-height: " + settings_hover_image_max_size + "px;" + " max-width: " + settings_hover_image_max_size + "px;}"; appendCssStyle(css); } catch(e) {gclh_error("Show Thumbnails",e);} } function avatarThumbnail(link) { var thumb = link.children[0]; var img = document.createElement('img'); img.src = thumb.src.replace(/img\.geocaching\.com\/user\/(avatar|display|square250)/, "s3.amazonaws.com/gs-geo-images"); img.className = "gclh_max"; img.setAttribute("style", "display: unset;"); var span = document.createElement('span'); span.appendChild(img); link.className += " gclh_thumb"; link.onmouseover = placeToolTip; link.appendChild(span); } function showBiggerAvatarsLink() { addButtonOverLogs(showBiggerAvatars, "gclh_show_bigger_avatars", true, "Show bigger avatars", "Bigger avatars", "Show bigger avatar images while hovering with the mouse"); } function showBiggerAvatars() { try { if ($('#gclh_show_bigger_avatars.working')[0]) return; $('#gclh_show_bigger_avatars').addClass("working"); $('#gclh_show_bigger_avatars input')[0].setAttribute('disabled', ''); setTimeout(function() { var links = document.getElementsByClassName("logOwnerAvatar"); for (var i = 0; i < links.length; i++) { if (links[i].children[0] && links[i].children[0].children[0] && !links[i].children[0].children[1]) { links[i].children[0].children[0].setAttribute("style", "margin-bottom: 0px; height: 48px;"); avatarThumbnail(links[i].children[0]); } } $('#gclh_show_bigger_avatars').removeClass("working"); $('#gclh_show_bigger_avatars input')[0].removeAttribute('disabled'); }, 100); } catch(e) {gclh_error("showBiggerAvatars",e);} } // Show gallery images in 2 instead of 4 cols. if (settings_show_big_gallery && (is_page("publicProfile") || document.location.href.match(/\.com\/(seek\/gallery\.aspx?|track\/gallery\.aspx?)/))) { try { appendCssStyle("table.GalleryTable .imageLink {max-width: unset; max-height: unset;}"); var links = document.getElementsByTagName("a"); var tds = new Array(); // Make images bigger. for (var i = 0; i < links.length; i++) { if (links[i].href.match(/^https?:\/\/img\.geocaching\.com\/(cache|track)\//) && links[i].childNodes[1] && links[i].childNodes[1].tagName == 'IMG') { var thumb = links[i].childNodes[1]; thumb.style.width = "300px"; thumb.style.height = "auto"; thumb.src = thumb.src.replace(/thumb\//, ""); tds.push(thumb.parentNode.parentNode); } } // Change from 4 Cols to 2. if ((document.location.href.match(/\.com\/(seek\/gallery\.aspx?|track\/gallery\.aspx?)/) && tds.length > 1 && $('#ctl00_ContentBody_GalleryItems_DataListGallery')[0]) || (is_page("publicProfile") && tds.length > 1 && $('#ctl00_ContentBody_ProfilePanel1_UserGallery_DataListGallery')[0])) { var tbody = document.createElement("tbody"); var tr = document.createElement("tr"); var x = 0; for (var i = 0; i < tds.length; i++) { if (x == 0) { tr.appendChild(tds[i]); x++; } else { tr.appendChild(tds[i]); tbody.appendChild(tr); tr = document.createElement("tr"); x = 0; } } if (x != 0) { // Einzelnes Bild übrig. tr.appendChild(document.createElement("td")); tbody.appendChild(tr); } if (is_page("publicProfile")) var dataListId = "ctl00_ContentBody_ProfilePanel1_UserGallery_DataListGallery"; else var dataListId = "ctl00_ContentBody_GalleryItems_DataListGallery"; document.getElementById(dataListId).removeChild(document.getElementById(dataListId).firstChild); document.getElementById(dataListId).appendChild(tbody); } } catch(e) {gclh_error("Show gallery images in 2 instead of 4 cols",e);} } // Improve Search Map, improve new map. if (is_page('searchmap')) { try { // Map control and display of found caches at corrected coordinates. if ((settings_use_gclh_layercontrol && settings_use_gclh_layercontrol_on_search_map) || settings_show_found_caches_at_corrected_coords_but) { unsafeWindow.MapSettings = { 'Map': null }; // Add proxy to get map instance and cache data. unsafeWindow.React.useState = new Proxy(unsafeWindow.React.useState, { apply: (target, thisArg, argArray) => { let useState = target.apply(thisArg, argArray); if (useState && useState[0]) { getMapInstance(useState); if (settings_show_found_caches_at_corrected_coords_but) processCaches(useState); } return useState; } }); } // Get map instance. const getMapInstance = (state) => { if (unsafeWindow.MapSettings.Map !== null) return; // Leaflet maps. if (state[0]._mapPane) { unsafeWindow.MapSettings.Map = state[0]; } // Google maps. if (state[0].__gm) { unsafeWindow.MapSettings.Map = state[0]; } } // Refresh map. const redrawMap = () => { if (unsafeWindow.MapSettings.Map._mapPane) { // Leaflet maps. unsafeWindow.MapSettings.Map.fitBounds(unsafeWindow.MapSettings.Map.getBounds()); // Clear cache selection. unsafeWindow.MapSettings.Map.fireEvent('click'); } else if (unsafeWindow.MapSettings.Map.__gm) { // Google maps. // To force a map redraw, select the 1st cache from the list, then trigger a click into the map. // ("map.fitBounds(map.getBounds())" would do the same but zooms out one level afterwards, reason unknown.) $('.geocache-item-details-container').first().click(); // Clear cache selection. google.maps.event.trigger(unsafeWindow.MapSettings.Map, 'click'); } } // Process cache data. const processCaches = (state) => { // Ensure that last selected cache marker is reset to original coords. if (!isActive && state[0].postedCoordinatesSave) { state[0].postedCoordinates = state[0].postedCoordinatesSave; delete state[0].postedCoordinatesSave; return; } // Nothing to be done. if (!isActive && !resetToPostedCoords) return; // Move caches to corrected position or reset to original coords. if (state[0].results && state[0].results[0]) { let caches = state[0].results; let gc = null; for (let i = 0; i < caches.length; i++) { gc = caches[i]; // If cache has corrected coords, process it. if (gc.userCorrectedCoordinates) { // Reset to original coords. if (resetToPostedCoords) { gc.postedCoordinates = gc.postedCoordinatesSave; delete gc.postedCoordinatesSave; continue; } if (gc.postedCoordinatesSave) { // If coords are already corrected we're finished. return; } else { // Store original coords for reset. gc.postedCoordinatesSave = gc.postedCoordinates; } // Set corrected coords. gc.postedCoordinates = gc.userCorrectedCoordinates; } } if (resetToPostedCoords) resetToPostedCoords = false; return; } // Keep selected cache marker at corrected position (otherwise it jumps to original coords). if (state[0].userCorrectedCoordinates && !state[0].postedCoordinatesSave) { state[0].postedCoordinatesSave = state[0].postedCoordinates; state[0].postedCoordinates = state[0].userCorrectedCoordinates; } } // Button for corrected coordinates. const addCorrectedCoordsButton = () => { waitForElementThenRun(".map-setting-controls", () => { // Clear current map instance to get a new one automatically. unsafeWindow.MapSettings.Map = null; // Add button, but only once. if ($("#gclh_corrected_coords")[0]) return; const li = '
      • ' + '' + '
      • '; $('.map-setting-controls>ul').prepend(li); // When changing map layers preserve current button state. if (isActive) { $('#gclh_corrected_coords').prop('title', 'Show found caches at original coordinates').css('background-color', 'rgb(230, 247, 239)'); } // Toggle button for corrected coordinates. $("#gclh_corrected_coords").bind("click", () => { if (!isActive) { isActive = true; setValue('showCorrectedCoords', isActive); $('#gclh_corrected_coords').prop('title', 'Show found caches at original coordinates').css('background-color', 'rgb(230, 247, 239)'); } else { isActive = false; setValue('showCorrectedCoords', isActive); resetToPostedCoords = true; $('#gclh_corrected_coords').prop('title', 'Show found caches at corrected coordinates').css('background-color', 'rgb(255, 255, 255)'); } redrawMap(); }); }); } // Add layer control. if (settings_use_gclh_layercontrol && settings_use_gclh_layercontrol_on_search_map) { addLayersOnMap(); } // Add button to toggle display of found caches between original and corrected coordinates. if (settings_show_found_caches_at_corrected_coords_but) { var isActive = getValue('showCorrectedCoords', false); var resetToPostedCoords = false; addCorrectedCoordsButton(); } // Re-add corrected coordinates button when necessary. // (For GS layer control, a map layer change between Leaflet maps removes all control buttons whereas GM keeps them.) if (settings_show_found_caches_at_corrected_coords_but && !settings_use_gclh_layercontrol && !settings_use_gclh_layercontrol_on_search_map) { waitForElementThenRun('button.layer-control', () => { const addClickEventToLayerControl = () => { // On click to layer control start observing as long as layer control is open. $('button.layer-control').bind('click', function clickFunc() { const cb = (_, observer) => { // As soon as layer control is closed add the button and stop observing. if (!$('button.layer-control.is-open')[0]) { addCorrectedCoordsButton(); observer.disconnect(); // Remove click event from (possibly deleted) layer control. $('button.layer-control').unbind('click', clickFunc); // Re-add click event to (possibly new) layer control. setTimeout(() => { addClickEventToLayerControl(); }, 2000); } } const target = $('.map-controls')[0]; const config = { childList: true, subtree: true }; const observer = new MutationObserver(cb); observer.observe(target, config); }); } addClickEventToLayerControl(); }); } // After go back from cache details to cache list, scroll to last position. var global_scrollTop = 0; var global_newScrollTop = 0; function scrollInCacheList() { // Cache list: Scroll to last position, if we come from back button in cache details. if ($('#geocache-list')[0] && global_newScrollTop != 0) { document.querySelector('#geocache-list').scrollTo({top: global_newScrollTop, behavior: 'smooth'}); // Das Scrollen funktionierte nicht immer, vermutlich weil es zu lange dauert bis die Caches gelistet sind bzw. // die Platzhalter dafür aufgebaut sind. Durch das verzögerte Zurücksetzen wird das Scrollen nun mehrfach durchgeführt. setTimeout(function(){global_newScrollTop = 0;}, 250); } // Cache list: Notice scrolling. Only if we are on the first part of the lists of the caches. if ($('#geocache-list')[0] && !$('#geocache-list.gclh-scroll')[0]) { $('#geocache-list').addClass('gclh-scroll'); $('#geocache-list')[0].addEventListener('scroll', function(e) { if (!$('#geocache-list-pagination')[0] || $('#geocache-list-pagination .active a')[0].innerHTML == '1') { global_scrollTop = $('#geocache-list').scrollTop(); } else { global_scrollTop = 0; } }); } // Search map: Set click event to "Search this area" button to clear noticed scrolling if caches on map have changed. if ($('#clear-map-control')[0] && !$('#clear-map-control.gclh-scroll')[0]) { $('#clear-map-control').addClass('gclh-scroll'); $('#clear-map-control')[0].addEventListener('click', function() {global_scrollTop = 0;}); } // Cache details: Set click event to back button in cache details. if ($('.cache-preview-header')[0] && $('.search-bar-back-cta')[0] && !$('.search-bar-back-cta.gclh-scroll')[0]) { $('.search-bar-back-cta').addClass('gclh-scroll'); $('.search-bar-back-cta')[0].addEventListener('mousedown', function() {global_newScrollTop = global_scrollTop;}); } // Cache details: Set click event to back button in BML cache details. if ($('.cache-preview-header')[0] && $('.dismiss-list-cache-button')[0] && !$('.dismiss-list-cache-button.gclh-scroll')[0]) { $('.dismiss-list-cache-button').addClass('gclh-scroll'); $('.dismiss-list-cache-button')[0].addEventListener('mousedown', function() {global_newScrollTop = global_scrollTop;}); } } // Virtually hit "Search this area" after dragging the map or zooming, if not BML and not link from matrix. var isGclhMatrix = document.location.href.match(/#GClhMatrix/i); var latHighG = false; var latLowG = false; var lngHighG = false; var lngLowG = false; var firstRun = true; const ONE_MINUTE_MS = 60*1000; function searchThisArea(waitCount) { // For the first run. if ($('.leaflet-gl-layer.mapboxgl-map')[0] || $('div.gm-style')[0]) { // Leaflet or GM if (!$('.loading-container.show')[0] && !$('li.active svg.my-lists-toggle-icon')[0] && ($('#clear-map-control')[0] || firstRun) && !isGclhMatrix && settings_searchmap_autoupdate_after_dragging) { // Delay, so that the last values of a movement are used. setTimeout(function() { if ($('.loading-container.show')[0]) return; // Determine whether a new search is necessary, because we have not yet searched of a part of the map area. var pxHeight = window.innerHeight; var pxWidth = window.innerWidth; var lat = parseFloat(getURLParam('lat')); var lng = parseFloat(getURLParam('lng')); var zoom = parseInt(getURLParam('zoom')); var metersPerPx = 156543.03392 * Math.cos(lat * Math.PI / 180) / Math.pow(2, zoom); var latMeterDistance = metersPerPx * pxHeight; var lngMeterDistance = metersPerPx * pxWidth; var latHalfDezDistance = latMeterDistance / 1850 / 60 / 2; var lngHalfDezDistance = lngMeterDistance / (1850 * Math.cos(lat * Math.PI / 180)) / 60 / 2; var latHigh = (lat + latHalfDezDistance).toFixed(4); var latLow = (lat - latHalfDezDistance).toFixed(4); var lngHigh = (lng + lngHalfDezDistance).toFixed(4); var lngLow = (lng - lngHalfDezDistance).toFixed(4); if (latHighG == false || latHigh > latHighG || latLow < latLowG || lngHigh > lngHighG || lngLow < lngLowG) { latHighG = latHigh; latLowG = latLow; lngHighG = lngHigh; lngLowG = lngLow; // ensure that no more than 10 searches per minute are performed (enforce GS limit) if (!firstRun) { // make times persistent across reloads or search map in action on multiple tabs // (otherwise GS nag message may still occur) let times = JSON.parse(GM_getValue("search_this_area_times", "[]")); // 9 searches max to be on the safe side ... if (times.length < 9) { // double-click necessary, otherwise single zoom out doesn't show caches (issue is on GS) $('#clear-map-control').click().click(); times.push(Date.now()); GM_setValue("search_this_area_times", JSON.stringify(times)); } else { let t = Date.now(); // check 1min limit if ((t - times[0]) > ONE_MINUTE_MS) { // double-click necessary, otherwise single zoom out doesn't show caches (issue is on GS) $('#clear-map-control').click().click(); // remove first and append current timestamp times.splice(0, 1); times.push(t); GM_setValue("search_this_area_times", JSON.stringify(times)); } else { // search limit reached, add message, but only once if ($('body.gclh-waiting-msg').length === 0) { // add marker to body $('body').addClass('gclh-waiting-msg'); // time to wait for next search var wait = Math.ceil((ONE_MINUTE_MS-(t-times[0]))/1000); // update message every second function countdown(waitTime) { if (waitTime < 1) { // waiting time is over // hide message $('#gclh-waiting-msg').remove(); $('div.loading-container').css('display', 'none').removeClass('show'); $('body').removeClass('gclh-waiting-msg'); } else { // show message (keep next line in countdown, otherwise message gets hidden when switching map source during waiting time) $('div.loading-container').css('display', 'flex').addClass('show'); // update message $('#gclh-waiting-msg').remove(); $('.loading-display').append('Too many searches per minute, please try again in ' + waitTime + ' s.'); setTimeout(function() {countdown(--waitTime);}, 1000); } } countdown(wait); } } } } firstRun = false; } }, 400); } } else {waitCount++; if (waitCount <= 200) setTimeout(function(){searchThisArea(waitCount);}, 50);} } // Preserve zoom parameter in URLs. // (on page load zoom parameter in URL is ignored and zoom level defaults to 14) let use_zoom_from_url = true; function setZoom() { if (use_zoom_from_url && unsafeWindow.MapSettings && unsafeWindow.MapSettings.Map) { // Only once on page load. use_zoom_from_url = false; const urlSearchParams = new URLSearchParams(window.location.search), zoom = urlSearchParams.has('zoom') ? Number(urlSearchParams.get('zoom')) : 14; if (zoom !== 14) { unsafeWindow.MapSettings.Map.setZoom(zoom); } } } // Each map movement or zoom change alters the URL by triggering 'window.history.pushState', therefore we add custom calls inside. // (for reference: https://stackoverflow.com/a/64927639) window.history.pushState = new Proxy(window.history.pushState, { apply: (target, thisArg, argArray) => { setZoom(); searchThisArea(0); return target.apply(thisArg, argArray); } }); // Set link to owner. function setLinkToOwner() { if ($('.geocache-owner')[0] && $('.cache-metadata-code')[0]) { if ($('#' + $('.cache-metadata-code')[0].innerHTML + '_owner')[0]) return; var owner = ($('.geocache-owner-name span a')[0] ? $('.geocache-owner-name span a').html() : $('.geocache-owner-name span').html()); var html = '' + owner + ''; $('.geocache-owner-name span').html(html); } } // Add VIP, VUP and mail icon to owner. function addVipVupMailToOwner() { 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]) { global_name = $('.gclh-cache-link')[0].childNodes[1].data; global_code = $('.cache-metadata-code')[0].innerHTML; global_link = 'https://coord.info/' + global_code; } 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"); } } } } // Compact layout on detail screen. var global_cache_disabled = false; var global_cache_premium = false; var cache_details_premium = ''; var cache_list_premium = ''; var enhancement_premium = ''; function compactLayoutWait(waitCount) { if ($('#geocache-list')[0]) { compactLayout(); } else { waitCount++; if (waitCount <= 100) setTimeout(function(){compactLayoutWait(waitCount);}, 50); } } function compactLayout() { if (settings_searchmap_compact_layout) { // Filter if (document.querySelector('#search-filters') && document.querySelector('.text-field')) { document.querySelector('.text-field').setAttribute('class', 'chip-field-input'); } if ($('.search-filters-attributes .promo-filters .label span strong')[0]) { $('.search-filters-attributes .promo-filters .label span')[0].innerHTML = $('.search-filters-attributes .promo-filters .label span strong')[0].innerHTML; } // Cache details. if (document.querySelector('.cache-preview-header')) { if ($('.more-info-link')[0]) document.querySelector('.more-info-link').getElementsByTagName('span')[1].style = 'display: none;'; var buttons = document.querySelectorAll('.cache-preview-action-menu ul li'); for (let i=0; i'); $('.cache-metadata .vertical-spacer').remove(); } if (global_cache_premium == true && !$('.gclh_cache_details_premium')[0]) { regroupCacheDataSearchmap($('.cache-preview-header')[0], 'dot', '', '.cache-metadata:last', cache_details_premium); global_cache_premium = false; } if ($('.header-top-left')[0] && $('.header-top-left h1')[0] && $('.status-and-type')[0] && $('.status-and-type')[0].childNodes && $('.more-info-link')[0]) { if (!$('.header-top-left .gclh-cache-link')[0]) { var cacheTypeChildNode = $('.status-and-type')[0].childNodes.length - 1; if (cacheTypeChildNode >= 0 && $('.status-and-type')[0].childNodes[cacheTypeChildNode]) { var cacheType = $('.status-and-type')[0].childNodes[cacheTypeChildNode].data; var cacheSymbol = convertCachetypeToCachesymbol(cacheType); if (cacheSymbol != '') { if (global_cache_disabled == true) { global_cache_disabled = false; cacheSymbol += '_disabled'; setStrikeDisabledInDetails(); } $('.header-top-left h1')[0].innerHTML = '' + $('.header-top-left h1')[0].innerHTML + ''; $('.status-and-type')[0].style.display = 'none'; } } } } $('.cache-preview-activities .avatar-img').each(function() { $(this)[0].alt = ''; }); } // Cache list. if ($('#geocache-list')[0]) { $('.geocache-list-container li').each(function () { if ($(this).find('.geocache-item-info .geocache-item-code')[0]) { regroupCacheDataSearchmap(this, '|', '.geocache-item-info .geocache-item-code', '.geocache-item-data'); $(this).find('.geocache-item-info')[0].style.display = 'none'; } // (Das ursprüngliche Löschen der Favoriten verursachte den weißen Bildschirm. Nun wird nur noch geclont.) if ($(this).find('.geocache-item-info .geocache-item-favorites')[0] && !$(this).find('.geocache-item-data .geocache-item-favorites')[0]) { regroupCacheDataSearchmap(this, '|', '', '.geocache-item-data', $(this).find('.geocache-item-info .geocache-item-favorites').clone()); } if ($(this).find('.geocache-item-premium')[0] && !$(this).find('.gclh_cache_list_premium')[0]) { regroupCacheDataSearchmap(this, '|', '', '.geocache-item-data', cache_list_premium); } if (!$(this).find('.gclh_click_event')[0] && $(this).find('.geocache-item')[0]) { $(this).find('.geocache-item').addClass('gclh_click_event'); $(this).find('.geocache-item')[0].addEventListener('click', function() { if ($(this).hasClass('geocache-item-disabled')) global_cache_disabled = true; else global_cache_disabled = false; if ($(this).hasClass('geocache-item-premium')) global_cache_premium = true; else global_cache_premium = false; }); } }); if ($('#geocache-list')[0]) { if ($('.dismiss-active-list-button')[0]) { $('#geocache-list')[0].setAttribute("style", "margin-bottom: 60px !important;"); } else { $('#geocache-list')[0].setAttribute("style", "margin-bottom: 68px !important;"); } } } } } // Regroup cache data in cache list and cache details for compact layout. // (Diese Ersetzungen sind nicht sauber. Eigentlich sollten die Originale nur ausgeblendet werden und nicht gelöscht werden.) // (Das ursprüngliche Löschen der Favoriten verursachte den weißen Bildschirm. Nun wird nur noch geclont.) function regroupCacheDataSearchmap(cache, separator, from, to, build) { if (separator == '|') $(cache).find(to).append('|'); else if (separator == 'dot') $(cache).find(to).append(''); if (from == '') $(cache).find(to).append(build); else $(cache).find(to).append($(cache).find(from).remove().get().reverse()); } // Set name of disabled caches in cache details as disabled, strikethrough. function setStrikeDisabledInDetails() { if (!$('.header-top-left h1').hasClass('gclh_disabled')) { $('.header-top-left h1').addClass('gclh_disabled'); if (settings_searchmap_disabled && settings_searchmap_disabled_strikethrough) $('.header-top-left h1').addClass('gclh_strikethrough'); } } // Set name of disabled caches in cache list strike through in special color. function setStrikeDisabledInList() { if (settings_searchmap_disabled && $('#geocache-list')[0]) { $('.geocache-item-disabled').each(function() { if (!$(this).find('.gclh_disabled')[0]) { $(this).find('.geocache-item-name').addClass('gclh_disabled'); if (settings_searchmap_disabled_strikethrough) $(this).find('.geocache-item-name').addClass('gclh_strikethrough'); } }); } } // Show hint automatically and scroll up to top after "Description & Hint" was clicked. function showHint() { // Show hint automatically. if (settings_searchmap_show_hint && $('.cache-hint-toggle')[0] && !$('.cache-hint-toggle.gclh-show-hint')[0]) { // Create a mousedown event because GS uses this and not an onClick event. var clickEvent = document.createEvent('MouseEvents'); clickEvent.initEvent('mousedown', true, true); $('.cache-hint-toggle')[0].dispatchEvent(clickEvent); $('.cache-hint-toggle').addClass('gclh-show-hint'); } } // Show button to collapse activity. function collapseActivity() { if ($('.cache-preview-activities > header')[0] && $('.cache-preview-activities > ul')[0]) { if (!$('.cache-preview-activities .opener')[0]) { $('.cache-preview-activities > header').append(''); $('.cache-preview-activities > header')[0].addEventListener('click', function() { if (getValue('show_box_searchmap_activity', true)) { $('.cache-preview-activities').addClass('isHide'); setValue('show_box_searchmap_activity', false); } else { $('.cache-preview-activities').removeClass('isHide'); setValue('show_box_searchmap_activity', true); } }); } if (!getValue('show_box_searchmap_activity', true)) { $('.cache-preview-activities').addClass('isHide'); } } } // Build map control buttons. function buildMapControlButtons() { if (!$('.map-setting-controls ul')[0]) return; // Relocate browse button to other buttons. if (settings_relocate_other_map_buttons && !$('#gclh_browse_map')[0] && $('#browse-map-cta')[0]) { $('.map-setting-controls ul li:first').before('
      • '); $('#gclh_browse_map')[0].addEventListener("click", function() { $('#browse-map-cta')[0].click(); }, false); } // Add links to Google, OSM, Flopp's, GeoHack and Komoot Map. if (!$('#gclh_geoservices_control')[0] && (settings_add_link_google_maps_on_gc_map || settings_add_link_osm_on_gc_map || settings_add_link_flopps_on_gc_map || settings_add_link_geohack_on_gc_map || settings_add_link_komoot_on_gc_map)) { initGeoServiceControl(); } } var sidebar_enhancements_buffer = {} var sidebar_enhancements_favi_buffer = {} var sidebar_enhancements_addToList_buffer = {} var sidebar_enhancements_date_buffer = {} function showSearchmapSidebarEnhancements(){ if (!settings_show_enhanced_map_popup) return true; var locations = []; // Location for the Cache // Check if the sidebar displays a cache. if (!document.querySelector('.cache-preview-attributes')) return true; // Remove all Copy GC Codes (because otherwise they will be duplicated on selecting other cache). $('.cache-preview-header .cache-metadata span.ctoc_link').each(function(){ removeElement(this); }); // Add it again. $('.cache-preview-header .cache-metadata .cache-metadata-code').each(function(){ addCopyToClipboardLink(this, null, "GC Code", "margin-right: 3px;"); }); // Remove old Favi-Score. $('.favi_score_percent').each(function(){ removeElement(this); }); $('.add_to_list_count').each(function(){removeElement(this);}); // Just to be sure we are starting from scratch. removeElement(document.querySelector('#searchmap_sidebar_enhancements')); new_gc_code = document.querySelector('.cache-preview-header .cache-metadata .cache-metadata-code').innerHTML; if (sidebar_enhancements_buffer[new_gc_code]) { // We already have the code in our buffer, no need to reload everything. insertAfter(sidebar_enhancements_buffer[new_gc_code], (document.getElementsByClassName("geocache-owner")[0] || document.getElementsByClassName("gclhOwner")[0])); if ($('.favorites-text')[0] && sidebar_enhancements_favi_buffer[new_gc_code]) { $('.favorites-text')[0].innerHTML = $('.favorites-text')[0].innerHTML + sidebar_enhancements_favi_buffer[new_gc_code]; } if ($('.cache-preview-action-menu ul li.add-to-list')[0] && sidebar_enhancements_addToList_buffer[new_gc_code]) { $('.add_to_list_count').each(function(){removeElement(this);}); $('.cache-preview-action-menu ul li.add-to-list')[0].append(sidebar_enhancements_addToList_buffer[new_gc_code]); } if (($('.gclhOwner') || $('.geocache-placed-date')) && !$('.gclh_weekday')[0] && sidebar_enhancements_date_buffer[new_gc_code]) { let root = $('.gclhOwner') || $('.geocache-placed-date'); $(root).append(sidebar_enhancements_date_buffer[new_gc_code]); } if ($('#searchmap_sidebar_enhancements .gclh_enhancement_premium')[0] && !$('.gclh_cache_details_premium')[0]) { regroupCacheDataSearchmap($('.cache-preview-header')[0], 'dot', '', '.cache-metadata:last', cache_details_premium); } if ($('#searchmap_sidebar_enhancements .gclh_enhancement_disabled')[0] && $('.gclh_cache_type use')[0] && !$('.gclh_cache_type use')[0].getAttribute('xlink:href').match('_disabled')) { $('.gclh_cache_type use')[0].setAttribute('xlink:href', $('.gclh_cache_type use')[0].getAttribute('xlink:href') + '_disabled'); setStrikeDisabledInDetails(); } // VIP, VUP icons have to be rebuilt, something could have changed in the meantime. addVipVupMailToOwner(); return true; } var searchmap_sidebar_enhancements_code = document.querySelector('#searchmap_sidebar_enhancements .gccode'); if (searchmap_sidebar_enhancements_code) { // Element already present, so compare the two GC Codes, to see if we need to update. if (new_gc_code == searchmap_sidebar_enhancements_code.innerHTML) { return true; } else { removeElement(document.querySelector('#searchmap_sidebar_enhancements')); } } var searchmap_sidebar_enhancements = document.createElement("div"); searchmap_sidebar_enhancements.setAttribute("id", "searchmap_sidebar_enhancements"); var searchmap_sidebar_enhancements_code = document.createElement("div"); searchmap_sidebar_enhancements_code.className = "gccode"; searchmap_sidebar_enhancements_code.innerHTML = new_gc_code; var searchmap_sidebar_enhancements_loading = document.createElement("div"); searchmap_sidebar_enhancements_loading.className = "searchmap_loading_container"; searchmap_sidebar_enhancements_loading.innerHTML = ' Loading additional Data ...'; searchmap_sidebar_enhancements.appendChild(searchmap_sidebar_enhancements_code); searchmap_sidebar_enhancements.appendChild(searchmap_sidebar_enhancements_loading); // Just to be sure we are starting from scratch. removeElement(document.querySelector('#searchmap_sidebar_enhancements')); insertAfter(searchmap_sidebar_enhancements, (document.getElementsByClassName("geocache-owner")[0] || document.getElementsByClassName("gclhOwner")[0])); $.get('https://www.geocaching.com/geocache/'+new_gc_code, null, function(text){ var local_gc_code = $(text).find('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode').html(); var premium_only = false; if ($(text).find('p.Warning.NoBottomSpacing').html() != null) premium_only = true; // Get the last logs. initalLogs_from_cachepage = text.substr(text.indexOf('initialLogs = {"status')+13, text.indexOf('} };') - text.indexOf('initialLogs = {"status') - 10); var initalLogs = JSON.parse(initalLogs_from_cachepage); var last_logs = document.createElement("div"); last_logs.setAttribute("style", "display: block ruby;"); var last_logs_to_show = settings_show_latest_logs_symbols_count_map; var lateLogs = new Array(); for (var i = 0; i < initalLogs['data'].length; i++) { if (last_logs_to_show == i) break; var lateLog = new Object(); lateLog['user'] = initalLogs['data'][i].UserName; lateLog['src'] = '/images/logtypes/' + initalLogs['data'][i].LogTypeImage; lateLog['type'] = initalLogs['data'][i].LogType; lateLog['date'] = initalLogs['data'][i].Visited; lateLog['log'] = initalLogs['data'][i].LogText; lateLogs[i] = lateLog; } if (lateLogs.length > 0) { var div = document.createElement("div"); div.id = "gclh_latest_logs"; div.setAttribute("style", "padding-right: 0; padding-top: 5px; padding-bottom: 5px; display: flex;"); var span = document.createElement("span"); span.setAttribute("style", "white-space: nowrap; margin-right: 5px; margin-top: -1px;"); span.appendChild(document.createTextNode('Latest logs:')); div.appendChild(span); var inner_div = document.createElement("div"); inner_div.setAttribute("style", "display: flex; flex-wrap: wrap;"); div.appendChild(inner_div); for (var i = 0; i < lateLogs.length; i++) { var div_log_wrapper = document.createElement("div"); div_log_wrapper.className = "gclh_latest_log"; var img = document.createElement("img"); img.src = lateLogs[i]['src']; img.setAttribute("style", "padding-left: 2px; float:left; margin-top: 2px;"); var log_text = document.createElement("span"); log_text.title = ""; log_text.innerHTML = " " + lateLogs[i]['user'] + " - " + lateLogs[i]['date'] + "
        " + lateLogs[i]['log']; div_log_wrapper.appendChild(img); div_log_wrapper.appendChild(log_text); inner_div.appendChild(div_log_wrapper); } last_logs.appendChild(div); } // Get all type of logs and their count. var all_logs = $(text).find('.LogTotals')[0].innerHTML.replace(/alt="(.*?)"/g, "alt=\"...\""); // Get the number of trackables in the cache. var trachables = 0; $(text).find('.CacheDetailNavigationWidget').each(function(){ tb_text = $(this).html(); if (tb_text.indexOf('ctl00_ContentBody_uxTravelBugList_uxInventoryLabel') !== -1) { // There are two Container with .CacheDetailNavigationWidget so we are only processing the // one that contains the TB informations. trachables = (tb_text.match(/
      • /g)||[]).length; } }); // Get the place, where the cache was placed. if ($(text).find('#ctl00_ContentBody_Location a')[0]) var place = $(text).find('#ctl00_ContentBody_Location a')[0].innerHTML; else var place = $(text).find('#ctl00_ContentBody_Location')[0].innerHTML.replace(/(.*?)\s/,''); // Put all together. var new_text = 'Logs:' + all_logs.replace(/ /g, " ") + '
        '; new_text += $(last_logs).prop('outerHTML'); new_text += '
        '; if (settings_show_country_in_place) new_text += '' + place + ' | '; else new_text += '' + place.replace(/(,.*)/,'') + ' | '; if (settings_show_elevation_of_waypoints) { new_text += ''; } if (premium_only) { new_text += ' ' + enhancement_premium + ' | '; if (!$('.gclh_cache_details_premium')[0]) { regroupCacheDataSearchmap($('.cache-preview-header')[0], 'dot', '', '.cache-metadata:last', cache_details_premium); } } if ($(text).find('#ctl00_ContentBody_disabledMessage')[0]) { new_text += ''; if ($('.gclh_cache_type use')[0] && !$('.gclh_cache_type use')[0].getAttribute('xlink:href').match('_disabled')) { $('.gclh_cache_type use')[0].setAttribute('xlink:href', $('.gclh_cache_type use')[0].getAttribute('xlink:href') + '_disabled'); setStrikeDisabledInDetails(); } } new_text += ' ' + trachables + ''; // Get link to image gallery and image count. var a = $(text).find('.CacheDetailNavigation ul li').find('a[href*="/seek/gallery.aspx?guid="]'); if (a) { var galleryLink = a[0].href; var imgCount = a[0].innerHTML.match(/(\s*)\((\d+)\)/); if (galleryLink && imgCount && imgCount[2]) { if (imgCount[2] == "0") new_text += ' | '; else new_text += ' | '; new_text += ' ' + imgCount[2] + ''; } } // Get personal cache note. if ($(text).find('#srOnlyCacheNote')[0]) { if (!$(text).find('#srOnlyCacheNote')[0].innerHTML || $(text).find('#srOnlyCacheNote')[0].innerHTML == '') { new_text += ' | '; } else { new_text += ' | ' + $(text).find('#srOnlyCacheNote').html().replace(/\n/gi,'
        ') + '
        '; } } new_text += '
        '; // Get coordinates. var coords = $(text).find('#uxLatLon')[0].innerHTML; var original_coords = ""; var original_coords_span = ""; var corrected = ""; if (text.match(/"isUserDefined":true/gm)) { var original_coords = text.match(/oldLatLngDisplay":"(N|S).*(E|W).*?'"/gm); original_coords = String(original_coords[0]); original_coords = original_coords.replace("oldLatLngDisplay\":\"",""); original_coords = original_coords.replace("\"",""); original_coords = original_coords.replace(new RegExp('\'', 'g'),''); original_coords_span = '  ( ' + original_coords + ' )'; corrected = "corrected "; } if (settings_show_enhanced_map_coords) { new_text += '

        ' + coords + '' + original_coords_span + '

        '; } // Create Element and insert everything. if (!(document.getElementsByClassName("geocache-owner")[0] || document.getElementsByClassName("gclhOwner")[0])) return; var text_element = document.createElement("div"); text_element.innerHTML = new_text; searchmap_sidebar_enhancements.appendChild(text_element); searchmap_sidebar_enhancements_loading.setAttribute("style", "display: none;"); // Just to be sure we are starting from scratch. removeElement(document.querySelector('#searchmap_sidebar_enhancements')); insertAfter(searchmap_sidebar_enhancements, (document.getElementsByClassName("geocache-owner")[0] || document.getElementsByClassName("gclhOwner")[0])); // Add Copy to Clipboard Links. if (settings_show_enhanced_map_coords) { if (original_coords != "") { addCopyToClipboardLink(original_coords, $('span.coordinates.original .anker')[0], "original Coordinates"); } addCopyToClipboardLink(coords, $('span.coordinates.current')[0], corrected+"Coordinates"); } // Get favorite score. getFavoriteScore(local_gc_code, function(score) { if ($('.favorites-text')[0]) { $('.favi_score_percent').each(function(){ removeElement(this); }); $('.favorites-text')[0].innerHTML = $('.favorites-text')[0].innerHTML + ' ('+score+'%)'; sidebar_enhancements_favi_buffer[local_gc_code] = ' ('+score+'%)'; } }); // Get elevations. if (settings_show_elevation_of_waypoints) { var coords_for_elevation = toDec(coords); locations.push(coords_for_elevation[0]+","+coords_for_elevation[1]); if (locations && locations.length == 1) getElevations(0,locations); } sidebar_enhancements_buffer[local_gc_code] = searchmap_sidebar_enhancements; // Get count and names of own bookmarklists. if ($('.cache-preview-action-menu ul li.add-to-list')[0]) { var [ownBMLsCount, ownBMLsText, ownBMLsList] = getOwnBMLs(text); sidebar_enhancements_addToList_buffer[local_gc_code] = $('(' + ownBMLsCount + ')')[0]; $('.add_to_list_count').each(function(){removeElement(this);}); $('.cache-preview-action-menu ul li.add-to-list')[0].append(sidebar_enhancements_addToList_buffer[local_gc_code]); } // Show Weekday for Events. if (settings_show_eventday && text.match(/eventCacheData/) && !$('.gclh_weekday')[0]) { var matchDate = text.match(/new Date\((\d{4}), (\d{2})-1, (\d{2})/); if (matchDate != null) { var date = new Date(matchDate[1], matchDate[2]-1, matchDate[3]); if (date != "Invalid Date") { sidebar_enhancements_date_buffer[new_gc_code] = ` (${date.getWeekday()})`; let root = $('.gclhOwner') || $('.geocache-placed-date'); $(root).append(sidebar_enhancements_date_buffer[new_gc_code]); } } } }); } // Get favorite score. function getFavScoreSearchmapSidebarEnhancements(anker_element, userToken, gccode) { $.ajax({ type: "POST", cache: false, url: '/datastore/favorites.svc/score?u=' + userToken, success: function (scoreResult) { var score = 0; if (scoreResult) score = scoreResult; if (score > 100) score = 100; if ($(anker_element)[0]) { $('.favi_score_percent').each(function(){ removeElement(this); }); $(anker_element)[0].innerHTML = $(anker_element)[0].innerHTML + ' ('+score+'%)'; sidebar_enhancements_favi_buffer[gccode] = ' ('+score+'%)'; } } }); } // Hide sidebar. let runHideSidebar = true; function hideSidebar() { // Run only once. if (!settings_map_hide_sidebar || !runHideSidebar) return; runHideSidebar = false; // Close the sidebar. function clickToClose(wc) { // The sidebar is still closed from the start, so wait. if (!$('.sidebar-toggle')[0] || $('body').hasClass('sidebar-is-closed')) { wc++; if (wc <= 25) setTimeout(function() { clickToClose(wc); }, 200); // The sidebar is now open. } else { $('div#sidebar-group>button.sidebar-toggle').click(); } } clickToClose(0); } // Default filters. let runSetFilter = true; let cache_types = [2,3,4,5,6,8,11,137,1858]; // Check if filters are to set. var filtersAreToSet = false; if (!settings_map_hide_found || !settings_map_hide_hidden) { filtersAreToSet = true; } else { for (let i=0; i 7) return; // Check if there isn't already an input in search field of detail screen. // (Das betrifft auch eine Umschaltung von My Lists auf Search. Auch hier dürfen keine Defaults gesetzt werden.) if ($('#gc-search-typeahead-input')[0] && !$('#gc-search-typeahead-input').attr('value') == "") return; // Don't display the filter screen during the default settings are running. $('body').addClass('default_settings_running'); // Some filters have to be clicked twice, otherwise the selection isn't reliable. function doubleClick(sel) { $(sel).click().click(); } // Wait for filter screen. function waitForFilter(waitCount) { if ($('#gc-search-filters')[0] && $('#found-status-filter .gc-radio-control-container:nth-child(1) label')[0] && $('#cache-owner-filter .gc-radio-control-container:nth-child(1) label')[0] && $('.gc-location-typeahead .inner-wrapper')[0]) { // Set location "Home Location" to prevent zoom out, if there isn't already a location. if (!$('.gc-location-typeahead .inner-wrapper button.chip')[0]) { if ($('.filter-group-header:first').hasClass('collapsed')) { var collapsed = true; $('.filter-group-header:first').click(); } else var collapsed = false; $('.gc-location-typeahead .inner-wrapper').click(); $('.gc-autocomplete-menu li').click(); if (collapsed == true) { $('.filter-group-header:first').click(); } } // Hide found caches. if (!settings_map_hide_found) { doubleClick('#found-status-filter .gc-radio-control-container:nth-child(1) label'); } // Hide owned caches. if (!settings_map_hide_hidden) { doubleClick('#cache-owner-filter .gc-radio-control-container:nth-child(1) label'); } // Hide cache types. $('input[value="2"][id*="cache-type"]').parents('.filter-container').find('button.gc-selection-toggle').click(); for (let i=0; i'); } if (settings_map_show_btn_hide_header) addHideHeaderButton(); if (settings_searchmap_show_btn_save_as_pq) addCreatePQButton(); // Hide header by default. if (!runHideHeader && settings_hide_map_header && settings_map_show_btn_hide_header && $('.geocache-action-bar.sidebar-control')[0]) { runHideHeader = true; toggelHeader(); } } } // Processing all steps. function processAllSearchMap() { setFilter(); scrollInCacheList(); improveAddtolistPopup(); setLinkToOwner(); // Has to be run before compactLayout. compactLayout(); addVipVupMailToOwner(); // Has to be run after compactLayout. setStrikeDisabledInList(); showHint(); collapseActivity(); showSearchmapSidebarEnhancements(); buildMapControlButtons(); setFilter(); geocacheActionBar(); // "Save as PQ" and "Hide Header". // Prepare keydown F2 and Ctrl+s in filter screen. prepareKeydownF2InFilterScreen(); } // Observer callback for body and checking existence of sidebar. var cb_body = function() { processAllSearchMap(); if ($('div#sidebar')[0] && !$('.gclh_sidebar_observer')[0]) { $('div#sidebar').addClass('gclh_sidebar_observer'); var target_sidebar = $('div#sidebar')[0]; var config_sidebar = { childList: true, subtree: true }; observer_sidebar.observe(target_sidebar, config_sidebar); } } // Observer callback for sidebar. var cb_sidebar = function() { if (!$('div#sidebar')[0]) return; observer_sidebar.disconnect(); processAllSearchMap(); var target_sidebar = $('div#sidebar')[0]; var config_sidebar = { childList: true, subtree: true }; observer_sidebar.observe(target_sidebar, config_sidebar); } // Create observer instances linked to callback functions. var observer_body = new MutationObserver(cb_body); var observer_sidebar = new MutationObserver(cb_sidebar); // ATTENTION: the order matters here var target_body = $('body')[0]; var config_body = { childList: true, attributes: true }; observer_body.observe(target_body, config_body); processAllSearchMap(); compactLayoutWait(0); var css = ''; // Hide button search this area and icon loading, if not link from matrix. if (!isGclhMatrix && settings_searchmap_autoupdate_after_dragging) { css += '#clear-map-control, .loading-container {display: none;}'; } // Set link to owner. css += '.geocache-owner-name a:hover, .gclhOwner a:hover {color: #02874d !important;}'; css += '.geocache-owner-name a, .gclhOwner a {color: #4a4a4a !important; text-decoration: none !important;}'; if (settings_searchmap_compact_layout) { css += '#gc-search-typeahead-form, #gc-search-typeahead-form .gc-search-typeahead-submit, #gc-search-typeahead-form .inner-wrapper, .search-bar.v3, #search-term-input {height: 34px !important;}'; css += '.search-bar.v3 .gc-filter-toggle {height: 35.5px !important;}'; css += '#gc-search-typeahead-form .gc-autocomplete .inner-wrapper {box-shadow: 0 0 0 0.9px #9b9b9b !important;}'; css += '.gc-filter-toggle-icon {height: 18px !important; width: 18px !important;}'; css += '.geocache-item-name {font-size: 14px !important;}'; css += 'a:focus, button:focus {outline: unset !important;}'; css += '.search-bar-inner {margin-right: 10px !important;}'; css += '.search-bar, .cache-preview-header, .cache-preview-attributes, .cache-preview-action-menu, .cache-open-text-cta, .cache-preview-description, .cache-preview-activities .view-all-row, .cache-preview-activities header {padding: 5px 12px !important;}'; css += '.sidebar-control .checkbox {margin-right: 2px;}'; css += '#sidebar div:nth-child(1).sidebar-control.sidebar-search-container > div {padding: 5px 13px 6px 12px; gap: 4px;}'; css += '#sidebar .sidebar-control.sidebar-search-container > div {padding: 0px 13px 3px 12px; gap: 4px;}'; // Cache list and cache details. css += '.header-top {display: none !important;}'; css += '.search-bar-back-cta {height: 24px; width: 24px; padding: 6px 0px; margin-left: -2px;}'; css += '.search-bar-back-cta svg {height: 24px; width: 24px;}'; css += '.search-term-input, .search-term-form button, .cache-preview-activities .view-all-row {font-size: 14px !important; height: 35px !important;}'; css += '.search-term-form svg {padding-top: 4px;}'; css += '.cache-detail-preview:not(.list-cache) {height: calc(100% - 22px) !important; margin-top: -24px;}'; css += '.geocache-action-bar {padding: 0 12px 5px !important;}'; css += '.geocache-list-container ul li, .LazyLoad.is-visible {height: 48px !important;}'; css += '.geocache-item {padding: 6px 10px !important;}'; css += '.geocache-item-data span {margin-right: 2px;}'; css += '.geocache-item-data span img, .cache-metadata span img {vertical-align: bottom; height: 14px; opacity: 0.8;}'; css += '.geocache-item-details {margin: 0 6px !important;}'; css += '.geocache-item-icon {flex: 0 0 36px !important; height: 36px !important;}'; css += '.geocache-item {height: 36px !important;}'; css += '.geocache-item-name {height: 21px; color: #4a4a4a;}'; css += '.geocache-item-data {height: 16px;}'; if (settings_searchmap_disabled) css += '.geocache-item-status-icon {height: 18px; width: 18px;}'; css += '.cache-preview-activities h2 {margin: 0;}'; css += '.cache-preview-activities header {margin: 0; color: #4a4a4a;}'; css += '.cache-preview-activities ul {margin: 0; padding: 0;}'; css += '.gclh-cache-link {display: flex;}'; css += '.gclh_cache_type {flex: 0 0 24px; height: 24px; width: 24px; margin-left: -2px; margin-right: 8px; margin-top: -1px;}'; css += '.cache-preview-header h1 {font-size: 16px !important; margin-top: 0px;}'; if (settings_searchmap_disabled) css += '.cache-preview-header .more-info {top: 0px !important;}'; else css += '.cache-preview-header .more-info {top: 8px !important;}'; css += '.cache-preview-header .more-info-link {width: 52px; min-width: unset;}'; css += '.cache-preview-header .gclh-cache-link {text-decoration: none; color: #4a4a4a;}'; css += '.cache-preview-header .gclh-cache-link:hover {color: #02874d !important;}'; css += '.cache-preview-header > p.cache-metadata {margin-top: -3px; margin-bottom: 2px;}'; css += '.cache-preview-header .arrow-icon {height: 40px !important; width: 40px !important;}'; css += '.cache-preview-action-menu ul {margin-bottom: -4px;}'; css += '.cache-preview-action-menu .log-geocache, .cache-preview-action-menu .log-geocache:visited {margin-bottom: 6px !important; padding: 8px !important;}'; css += '.cache-preview-action-menu .action-icon {margin: 0;}'; css += '.cache-preview-action-menu ul li button span, .cache-preview-action-menu ul li a span {display: none; !important;}'; css += '.add_to_list_count {font-size: 12px; color: #4a4a4a; position: absolute; margin-top: 9px; margin-left: -5px; cursor: default;}'; css += '.cache-preview-attributes, .cache-open-text-cta {margin-bottom: 5px !important;}'; css += '.cache-preview-attributes > ul {font-size: 12px; margin-bottom: 0 !important;}'; css += '.favorites-points {border-top: 1px solid #e4e4e4; margin-top: 5px;}'; css += '.cache-preview-attributes .favorites-icon {height: 24px !important; width: 24px !important;}'; css += '.cache-preview-attributes .attribute-val {color: #4a4a4a;}'; css += '.cache-preview-attributes .attribute-label {color: #777777;}'; css += '.gclhOwner {color: #9b9b9b;}'; css += '.cache-preview-attributes .geocache-owner {font-size: 12px !important; margin-top: 0px !important; padding-top: 4px !important;}'; css += '.cache-preview-attributes .geocache-owner-name, .cache-preview-attributes .geocache-placed-date {display: none !important;}'; css += '.cache-open-text-cta {font-size: 14px; color: #4a4a4a;}'; css += '.cache-open-text-cta span, .cache-preview-activities h2 {font-size: 14px !important;}'; css += '.cache-open-text-cta:hover, .cache-preview-activities header:hover, .cache-activity-log .username:hover {color: #02874d !important; text-decoration: none !important;}'; css += '.cache-open-text-cta span {margin-right: -2px; margin-left: -2px;}'; css += '.cache-preview-activities {margin-bottom: 1px !important;}'; css += '.cache-preview-activities > header {padding: unset;}'; css += '.cache-preview-activities .button.primary {padding: 8px;}'; css += '.cache-activity-log {padding: 5px 12px !important;}'; css += '.cache-activity-log header {padding: 0px !important;}'; css += '.cache-activity-log .username {font-size: 12px !important; padding-bottom: 2px;}'; css += '.cache-preview-description h2 {margin-bottom: 6px;}'; css += '.cache-preview-description .close-cta-row {top: 0px; right: 5px;}'; css += '#geocache-list-pagination {padding: 5px 0 0 0 !important;}'; css += '#geocache-list .label {padding: 8px 24px !important; border-top: 1px solid #e4e4e4 !important; font-size: 12px !important;}'; css += '#sidebar footer {padding: 2px 0;}'; css += '#sidebar.has-selected-caches footer {margin-top: unset; padding: 12px 0;}'; css += '#add-to-list-control {padding: 22px 0 24px 0;}'; css += '#add-to-list-menu {padding: 0px !important; border-top: unset !important; margin-bottom: 5px !important;}'; css += '#add-to-list-menu button {padding: 6px 24px !important; margin-right: 16px !important;}'; css += '.existing-list {margin-bottom: 0 !important;}'; css += '.geocache-item-stats svg {margin-top: -2px;}'; // Change cursor from not allowed to default. css += '.gc-button.gc-button-disabled {cursor: default;}'; // BML. css += '.list-cache-navigation.has-label {padding: 5px 0 6px !important;}'; css += '.mode-toggle-container {padding: 5px 14px 5px 12px !important;} .mode-toggle {padding: 6px !important;}'; css += '.dismiss-list-cache-button {margin: 2px !important;}'; css += '.dismiss-active-list-button-label {height: 34px !important; margin-right: 5px;}'; css += '.dismiss-active-list-button-icon svg {height: 24px !important; width: 24px !important; margin-left: 6px; display: flex;}'; css += '.dismiss-list-cache-button svg {height: 24px !important; width: 24px !important; margin-left: 4px; display: flex; color: #4a4a4a !important;}'; css += '.list-hub {padding-bottom: 0px !important; overflow: auto !important; margin-bottom: 22px;}'; css += '.list-hub ul li {height: 48px !important;}'; css += '.list-hub ul li + li {border-top: 1px solid #e4e4e4;}'; css += '.list-details {padding: 6px 10px !important; border: none !important;}'; css += '.list-details-left, .list-details-right {height: 36px !important; margin: 0px !important;}'; css += '.list-details-left .list-name, .list-details-right .list-counts {padding-bottom: 2px !important;}'; css += '.list-details-left .list-name {overflow: hidden; text-overflow: ellipsis; max-width: 285px;}'; css += '.geocache-list-container.lom-ld-flag-padding {padding-bottom: 0px !important;}'; css += '.geocache-list-container .pagination-label {padding: 0 0 5px 0 !important;}'; css += '.cache-detail-preview.list-cache {height: calc(100% + 24px) !important;}'; css += '.cache-detail-preview.list-cache > div {padding: 0px !important}'; css += '.cache-detail-preview.list-cache .dismiss-active-list-button {padding: 5px 8px 5px 0px !important}'; css += '#map-chip {display: none !important;}'; // Filter css += 'body.default_settings_running .gc-filter-modal {z-index: -1 !important;}'; css += '#search-filter-type .type-label.focused, .search-filters-attributes ul.wonders .focused label {outline: unset !important;}'; css += '#search-filters-controls {padding: 0px 10px 5px 10px !important;}'; css += '#search-filters-controls .gc-button {padding: 0px 10px; margin-right: 10px !important; border: 1px solid #9b9b9b; border-radius: 4px;}'; css += '#search-filters-controls .gc-button:hover {border-color: #02874d; color: #02874d; text-decoration: none;}'; css += '#search-filters-controls .control-apply {width: unset !important; padding-right: 11px !important; margin-right: 2px !important;}'; css += '#search-filters-content {margin-top: 16px !important; color: #4a4a4a; font-size: 14px;}'; css += '.search-filters-block {padding: 6px 14px 4px 14px !important; margin: 0px !important;}'; css += '.search-filters-attributes .toggle-filter button.toggle-handle span {display: none;}'; css += '.search-filters-attributes {padding-top: 4px !important;}'; css += '.search-filters-text .search-filters-number {padding: 6px 0px 0px 0px !important;}'; css += '.search-filters-block > div {padding: 0px 10px 0px 10px; margin: 0px !important;}'; css += '.search-filters-attributes .promo-filters .toggle-filter, .search-filters-status .trinary-control:nth-child(1), .search-filters-text .text-filter:nth-child(1) {padding-top: 4px !important;}'; css += '.search-filters-attributes .promo-filters .checkbox-toggle-controls-container:nth-child(3) {padding-top: 6px !important;}'; css += '.search-filters-attributes .toggle-filter, #search-filter-type, .search-filters-attributes .promo-filters, .search-filters-attributes .trinary-control, .search-filters-attributes .text-filter, #search-filter-difficulty, #search-filter-terrain, #search-filter-size, .search-filters-status .trinary-control, .search-filters-text .text-filter {padding-top: 10px !important;}'; css += '.search-filters-block > div > div, .search-filters-block > div > ul, .search-filters-block > div > span, .search-filters-block > div > label {margin: 0px !important;}'; css += '.search-filters-block .gc-radio-control {padding-bottom: 2px;}'; css += '.search-filters-block .gc-radio-control:hover i {box-shadow: 0 0 0 3px #e4e4e4;}'; css += '.search-filters-block .label-text-field, .search-filters-block .text-filter .label, .search-filters-block .gc-form-label {margin: 0px !important; padding-bottom: 2px !important;}'; css += '.search-filters-block .input-set label span {margin: 0px !important; padding-bottom: 2px !important; padding-top: 4px !important;}'; css += '.trinary-control {width: unset !important}'; css += '.search-filters-block .chip-field-container {min-height: unset; padding: 0px; width: 100%;}'; css += '.gc-date-filter select, .gc-date-filter input {height: 30px; margin-top: 0px; padding: 0 0 0 4px !important;}'; css += '.gc-date-filter svg {bottom: 5px !important; height: 20px !important;}'; css += '.gc-labeled-select .gc-select select:active, .gc-labeled-select .gc-select select:focus {border-color: unset !important; box-shadow: unset !important;}'; css += '.gc-labeled-select .gc-select select + svg {top: 6px !important;}'; css += '.search-filters-block .chip-field-input {height: 30px; margin-top: 0px; font-size: 14px; padding-left: 4px;}'; css += '.search-filters-block .chip {margin-bottom: 0px;}'; css += '.search-filters-block .user-typeahead-list-item {font-size: 14px;}'; css += '.search-filters-block .label.min, .search-filters-block .label.max {font-size: 14px;}'; css += '.search-filters-block .rc-slider-handle:focus {box-shadow: 0 0 0 0px;}'; css += '#search-filter-type ul label, .search-filters-attributes ul.wonders label {padding: 3px 10px !important;}'; css += '#search-filter-size li label {line-height: 30px !important;}'; css += '.search-filters-block .number-filter .label {text-transform: none !important;}'; css += '.search-filters-block .number-filter input, .search-filters-block .number-filter input:focus {height: 30px; font-size: 14px; padding-left: 4px; box-shadow: 0 0 0 0px !important;}'; // Pop up by right mouse click to a cache in the map. css += '.leaflet-popup-content {margin: 5px 8px !important;}'; css += '.cache-action-log-geocache, .cache-action-add-to-list, .cache-action-download-gpx, .cache-action-open-cache {padding: 5px 0 !important;}'; // No compact layout. } else { css += '.geocache-list-container ul li, .LazyLoad.is-visible {height: 84px !important}'; } // The checkboxes in the cache list are no longer one below the other on the right edge. (GS Bug) css += '.geocache-item-details-container {width: calc(100% - 18px);}'; // No unsuitably field border if field focused. css += '#main a:focus {outline: none !important;}'; // Adapt the width of the pop up by right mouse click to a cache in the map. css += '.leaflet-popup.context-menu.geocache-context-menu.leaflet-zoom-animated {width: auto !important; min-width: 300px;}';; css += '.leaflet-popup-content {width: auto !important;}'; // Show button to collapse activity. css += '.cache-preview-activities > header {display: flex; flex-flow: row wrap; justify-content: space-between; align-items: center; cursor: pointer;}'; css += '.cache-preview-activities .opener {height: 22px; width: 22px; transition: all .3s ease; transform-origin: 50% 50%;}'; css += '.cache-preview-activities.isHide .opener {transform: rotate(180deg);}'; css += '.cache-preview-activities.isHide > ul {display: none;}'; // Show name of disabled caches strike through in special color. css += '.gclh_disabled, .gclh_disabled a {color: #' + settings_searchmap_disabled_color + ' !important;}'; css += '.gclh_disabled.gclh_strikethrough, .gclh_disabled.gclh_strikethrough a {text-decoration: line-through;}'; // Build map control buttons. css += '.map-control {margin-bottom: 10px !important;}'; css += '.map-control svg {vertical-align: middle;}'; css += '.map-controls section button, .map-controls .zoom-controls {margin-bottom: 10px; margin-top: 0px !important;}'; css += '#browse-map-cta {right: 10px;}'; if (settings_relocate_other_map_buttons) css += '#browse-map-cta {display: none !important;}'; else css += '#gclh_layers {top: 52px;}'; // Sidebar Enhancements. if (settings_show_enhanced_map_popup) { css += '.cache-preview-attributes .geocache-owner {margin-bottom: 3px;}'; } if (settings_searchmap_compact_layout) { css += '#searchmap_sidebar_enhancements {border-top: 1px solid #e4e4e4; font-size: 12px; padding: 5px 0 0;}'; } else { css += '#searchmap_sidebar_enhancements {border-top: 1px solid #e4e4e4; font-size: 12px; margin-top: 12px; padding: 12px 0 0;}'; } css += '#searchmap_sidebar_enhancements .gccode {display: none;}'; css += '.premium_only img, .icon-sm {width: 14px; height: 14px; opacity: 0.8;}'; css += '#gclh_third_line img, #gclh_third_line svg {vertical-align: middle !important;}'; css += '#gclh_latest_logs, #gclh_third_line {position: relative;}'; css += 'div.gclh_latest_log span, span.gclh_cache_note span {display: none; position: absolute; left: 0px; width: 95%; padding: 5px; text-decoration:none; text-align:left; vertical-align:top; color: #000000; word-break: break-word;}'; css += 'div.gclh_latest_log:hover span, span.gclh_cache_note:hover span {font-size: 13px; display: block; top: 100%; border: 1px solid #8c9e65; background-color:#dfe1d2; z-index:10000;}'; css += 'div.gclh_latest_log:hover img, span.gclh_cache_note:hover svg {opacity: 0.5;}'; css += 'div.gclh_latest_log:hover span img {opacity: 1;}'; css += '#searchmap_sidebar_enhancements {color: #4a4a4a;}'; css += '#searchmap_sidebar_enhancements span.title {color: #9b9b9b;}'; css += '#searchmap_sidebar_enhancements #gclh_latest_logs span {color: #9b9b9b;}'; css += '#searchmap_sidebar_enhancements #gclh_latest_logs .gclh_latest_log span {color: #000000}'; css += '#searchmap_sidebar_enhancements img {vertical-align: middle;}'; css += '#searchmap_sidebar_enhancements svg {vertical-align: middle;}'; css += '#searchmap_sidebar_enhancements .ctoc_link img {height: 14px;}'; 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;}'; css += 'div.sidebar-control:nth-child(3) .search-bar {padding-top: 1px !important; height: 40px !important;}'; css += '.geocache-action-bar {padding: 5px 12px !important;}'; css += '#gclh_action_bar span, #gclh_action_bar a {margin-top: 2px;}'; // Save as PQ. css += '.gclh_PQHead {display: flex;}'; css += '#gclh_saveAsPQ {color: #4a4a4a; font-weight: bold; text-decoration: none; font-size: 12px;}'; css += '#gclh_saveAsPQ:hover {color: #02874d !important;}'; css += '#gclh_saveAsPQ img {vertical-align: middle;}'; // Hide header. css += '.hideHeaderLink, .set_defaults {font-size: 12px; display: flex; gap: 0.5em;}'; // Add to List pop up. if (settings_searchmap_improve_add_to_list) { css += '.existing-list .gc-button:focus {box-shadow: none;}'; css += '.existing-list .gc-button {height: 22px;}'; } appendCssStyle(css); } catch(e) {gclh_error("Improve Search Map",e);} } // Improve Browse Map, improve old map. if (is_page("map")) { try { function checkBrowseMap(waitCount) { if ($('.leaflet-container')[0] || $('.Map.Google')[0]) { var css = ''; // Display Google-Maps warning, wenn Leaflet-Map nicht aktiv ist. googleMapsWarningOnBrowseMap(); // Add layers, control to map and set default layers. if (settings_use_gclh_layercontrol && settings_use_gclh_layercontrol_on_browse_map && getValue("gclhLeafletMapActive")) { addLayersOnMap(); } else { // Buttons auch ohne GClh halbwegs ausrichten. (GC Layer sind ok, GME ist etwas verrutscht, geht aber.) css += '.leaflet-control-layers-list {right: 0px; top: 0px; height: inherit; display: none; position: absolute !important; border-radius: 7px; box-shadow: 0 1px 7px rgba(0,0,0,0.4); background-color: white; white-space: nowrap; padding: 6px;}'; if (is_page('map')) { // Damit auch mehr als 2 Buttons handlebar. css += '.leaflet-control-layers + .leaflet-control {position: unset; right: unset;} .leaflet-control {clear: left}'; } } // Hide Map Header. hideHeaderOnBrowseMap(); // Change map parameter and add homezone to map. changeParameterAddHomezoneOnBrowseMap(); // Add links to Google, OSM, Flopp's, GeoHack and Komoot Map on Browse Map. if (settings_add_link_google_maps_on_gc_map || settings_add_link_osm_on_gc_map || settings_add_link_flopps_on_gc_map || settings_add_link_geohack_on_gc_map || settings_add_link_komoot_on_gc_map) { addLinksOnBrowseMap(); } // Relocate button search geocaches on Browse Map. if (settings_relocate_other_map_buttons) { relocateButtonOnBrowseMap(); } // Hide found/hidden Caches on Map. Add Buttons for hiding/showing all Caches. Nicht bei Screen Map Preferences. if (!$('#uxGoogleMapsSelect')[0]) { hideCachesOnBrowseMap(); } // Save as PQ and set defaults for Browse Map. saveAsPQOnBrowseMap(); // Display more informations on Browse Map pop up for a cache. if (settings_show_enhanced_map_popup && getValue("gclhLeafletMapActive")) { cachePopupOnBrowseMap(); } // Improve clickability on list names of add to list pop up. css += '.add-list li button {width: 100%; text-align: left;} .pop-modal .status {width: initial;}'; appendCssStyle(css); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){checkBrowseMap(waitCount);}, 100);} } checkBrowseMap(0); } catch(e) {gclh_error("Improve Browse Map",e);} } // Display Google-Maps warning, wenn Leaflet-Map nicht aktiv ist. function googleMapsWarningOnBrowseMap() { try { // Wenn Leaflet-Map aktiv, alles ok, Kz aktiv merken. if ($('.leaflet-container')[0]) setValue("gclhLeafletMapActive", true); // Wenn Screen "Set Map Preferences", Leaflet-Map wird nicht kommen, also nichts tun. else if ($('.container')[0]); // Wenn Leaflet-Map Kz aktiv und Screen "Set Map Preferences" nicht angezeigt wird, dann ist Google aktiv. else { // Prüfen, ob zuvor Leaflet-Map aktiv war, Status sich also geändert hat, dann Meldung ausgeben, neuen Status "nicht aktiv" merken. if (getValue("gclhLeafletMapActive", true)) { setValue("gclhLeafletMapActive", false); var mess = "Please note, that GC little helper II only supports the Leaflet-Map. You are using the Google-Map.\n\n" + "You can change the map in the left sidebar with the button \"Set Map Preferences\"."; alert(mess); } } } catch(e) {gclh_error("Display Google-Maps warning",e);} } // Add layers, control to map and set default layers. function addLayersOnMap() { try { //>> Issue 2016 // [Browse Map] Map overlay "Hillshadow" doesn't work. Issue: https://github.com/2Abendsegler/GClh/issues/2016 // The "Hillshadow" service is no longer available. We have removed the feature. We'll keep an eye on it, maybe the service will be reactivated, // then we'll reinstall it. The adjustments in the script are marked with "Issue 2016". settings_show_hillshadow = false; //<< Issue 2016 // Auswahl nur bestimmter Layer. var map_layers = new Object(); var new_settings_map_layers = new Array(); // Sind weniger als 2 Layer im Config ausgewählt, werden alle Layer verwendet. // (Ist nur ein Layer im Config ausgewählt, wäre er nicht klickbar, weil es sich um einen Radio Button handelt.) if (settings_map_layers == "" || settings_map_layers.length < 2) { for (name in all_map_layers) { new_settings_map_layers.push(name); if (new_settings_map_layers.length >= 20) break; } } else { new_settings_map_layers = settings_map_layers; } for (var i = 0; i < new_settings_map_layers.length; i++) { map_layers[new_settings_map_layers[i]] = all_map_layers[new_settings_map_layers[i]]; } // Layer Control aufbauen. function addLayerControl() { injectPageScriptFunction(function(map_layers, map_overlays, settings_map_default_layer, settings_show_hillshadow, settings_sort_map_layers) { window["GCLittleHelper_MapLayerHelper"] = function(map_layers, map_overlays, settings_map_default_layer, settings_show_hillshadow, settings_sort_map_layers) { if (!window.MapSettings.Map) { setTimeout(function() {window["GCLittleHelper_MapLayerHelper"](map_layers, map_overlays, settings_map_default_layer, settings_show_hillshadow, settings_sort_map_layers);}, 10); } else { var layerControl = new window.L.Control.Layers(); var layerToAdd = null; var defaultLayer = null; // Map layer sort (Chrome doesn't respect the key order in objects, FF does). let keys = Object.keys(map_layers); if (settings_sort_map_layers) keys = keys.sort(); for (let i = 0; i < keys.length; i++) { let name = keys[i]; layerToAdd = new L.tileLayer(map_layers[name].tileUrl, map_layers[name]); layerControl.addBaseLayer(layerToAdd, name); if (name == settings_map_default_layer) defaultLayer = layerToAdd; else if (defaultLayer == null) defaultLayer = layerToAdd; } //>> Issue 2016 //for (name in map_overlays) { // layerToAdd = new L.tileLayer(map_overlays[name].tileUrl, map_overlays[name]); // layerControl.addOverlay(layerToAdd, name); //} //<< Issue 2016 window.MapSettings.Map.addControl(layerControl); layerControl._container.className += " gclh_layers gclh_used"; window.MapSettings.Map.addLayer(defaultLayer); if (settings_show_hillshadow) $('.leaflet-control-layers.gclh_layers .leaflet-control-layers-overlays').find('label input').first().click(); document.querySelector('.leaflet-control-layers.gclh_layers').id = "gclh_layers"; var side = document.querySelector('.leaflet-control-layers'); var div = document.createElement("div"); div.setAttribute("class", "gclh_dummy gclh_used"); var aTag = document.createElement("a"); aTag.setAttribute("class", "leaflet-control-layers dummy_for_gme gclh_dummy gclh_used"); div.appendChild(aTag); side.parentNode.insertBefore(div, side); if (document.location.pathname.match(/^\/map/)) { // Defekte Layer entfernen. (GCVote verursacht hier gelegentlich einen Abbruch, weil der dort verwendete localStorageCache scheinbar unvollständige Layer belebt.) try { for (layerId in window.MapSettings.Map._layers) { if (window.MapSettings.Map._layers[layerId]._url !== -1) { window.MapSettings.Map.removeLayer(window.MapSettings.Map._layers[layerId]); } } } catch(e) {}; } if (document.location.pathname.match(/^\/play\/map/)) { setTimeout(() => { // Remove default GS map tiles. document.querySelector('.mapboxgl-canvas').remove(); // Adapt layout of gclh map layer control to GS controls. document.querySelector('.leaflet-control-layers-toggle').setAttribute('style', 'width: 39px; height: 39px;'); document.querySelector('#gclh_layers').setAttribute('style', 'border: 1px solid rgb(0, 178, 101);'); // Ensure that map selection area is on top of map control buttons. document.querySelector('.leaflet-top.leaflet-right').setAttribute('style', 'z-index:1020;'); // Hide GME dummy. document.querySelector('.dummy_for_gme').setAttribute('style', 'display:none'); }, 0); } } }; window["GCLittleHelper_MapLayerHelper"](map_layers, map_overlays, settings_map_default_layer, settings_show_hillshadow, settings_sort_map_layers); }, "(" + JSON.stringify(map_layers) + "," + JSON.stringify(map_overlays) + ",'" + settings_map_default_layer + "'," + settings_show_hillshadow + "," + settings_sort_map_layers + ")"); } // Layer Defaults setzen. function setDefaultsInLayer() { var defaultLayer = ""; for (name in map_layers) { if (name == settings_map_default_layer) defaultLayer = name; else if (defaultLayer == "") defaultLayer = name; } var labels = $('.leaflet-control-layers.gclh_layers.gclh_used .leaflet-control-layers-base').find('label'); if (labels) { if (is_page("map")) { for (var i=0; i 1) { if (i == 0) labels[i+1].children[0].click(); else labels[i-1].children[0].click(); } labels[i].children[0].click(); break; } } } if (is_page("searchmap")) { // In Search map the list items do have an additional div element as 1st child // (whereas list items in Browse map don't). for (var i=0; i 1) { if (i == 0) labels[i+1].children[0].children[0].click(); else labels[i-1].children[0].children[0].click(); } labels[i].children[0].children[0].click(); break; } } } } var hs = ".gclh_layers.gclh_used .leaflet-control-layers-overlays"; if ($(hs).find('label input')[0]) { if ((settings_show_hillshadow == true && $(hs).find('label input')[0].checked != true) || (settings_show_hillshadow != true && $(hs).find('label input')[0].checked == true)) { $(hs).find('label input').first().click(); } } } // Layer Controls überwachen. function loopAtLayerControls(waitCount) { if ($('.leaflet-control-layers').length != 0) { var somethingDone = 0; if ($('.leaflet-control-layers:not(".gclh_used")').find('img[title*="GCVote"]').length != 0) { somethingDone++; $('.leaflet-control-layers:not(".gclh_used")').find('img[title*="GCVote"]').closest('.leaflet-control-layers').addClass('gclh_used'); } if ($('#gclh_geoservices_control.leaflet-control-layers:not(".gclh_used")').length != 0) { somethingDone++; $('#gclh_geoservices_control.leaflet-control-layers:not(".gclh_used")').addClass('gclh_used'); } if ($('#gclh_search_map.leaflet-control-layers:not(".gclh_used")').length != 0) { somethingDone++; $('#gclh_search_map.leaflet-control-layers:not(".gclh_used")').addClass('gclh_used'); } if (somethingDone == 0) { if ($('.leaflet-control-layers:not(".gclh_used"):not(".gclh_layers")').length != 0) { somethingDone++; $('.leaflet-control-layers:not(".gclh_used"):not(".gclh_layers")').remove(); } } if (somethingDone != 0) setDefaultsInLayer(); } waitCount++; if (waitCount <= 200) setTimeout(function(){loopAtLayerControls(waitCount);}, 50); } addLayerControl(); if (is_page('map')) loopAtLayerControls(0); if (is_page('searchmap')) { setDefaultsInLayer(); // Remove default GS layer control. (function removeGSLayerControl(waitCount = 0) { if ($('.layer-control')[0]) { $('.layer-control').parent().remove(); return; } if (++waitCount <= 200) setTimeout(function() { removeGSLayerControl(waitCount); }, 50); })(); } var css = ''; css += '.leaflet-control-layers-expanded .leaflet-control-layers-list {display: block !important;}'; css += '#gclh_layers .leaflet-control-layers-list {right: 0px; top: 0px; height: inherit; display: none; position: absolute !important; border-radius: 7px; box-shadow: 0 1px 7px rgba(0,0,0,0.4); background-color: white; white-space: nowrap; padding: 6px;}'; css += '#gclh_layers, #gclh_layers .leaflet-control-layers-list {z-index: 1020;}'; css += '#gclh_layers .leaflet-control-layers-base label, #gclh_layers .leaflet-control-layers-overlays label {padding: 0px 6px;}'; css += '#gclh_layers .leaflet-control-layers-base label:hover, #gclh_layers .leaflet-control-layers-overlays label:hover {background-color: #e6f7ef;}'; // Prevent the buttons from flashing. css += '.leaflet-control-layers.gclh_used:not(#gclh_geoservices_control) {display: inherit;}'; css += '.leaflet-control-layers:not(.gclh_used) {display: none;}'; if (is_page('map')) { // Damit auch mehr als 2 Buttons handlebar. css += '.leaflet-control-layers + .leaflet-control {position: unset; right: unset;} .leaflet-control {clear: left}'; } appendCssStyle(css); } catch(e) {gclh_error("Add layers, control to map and set default layers",e);} } // Hide Map Header. function hideHeaderOnBrowseMap() { try { function checkMapLeaflet(waitCount) { if ($('.leaflet-container')[0]) { if (settings_hide_map_header) hide_map_header(); var sidebar = $('#searchtabs')[0]; var link = document.createElement("a"); link.appendChild(document.createTextNode("Hide/Show Header")); link.href = "#"; link.addEventListener("click", hide_map_header, false); // Link in Sidebar rechts orientieren wegen möglichem GC Tour script. link.setAttribute("style", "float: right; padding-right: 3px;"); sidebar.appendChild(link); // Link in Sidebar komplett anzeigen und auch nicht mehr überblenden, auch nicht durch GME. appendCssStyle("#searchtabs {height: 63px !important; margin-top: 6px !important;} #searchtabs li a {padding: 0.625em 0.5em !important;}"); } else {waitCount++; if (waitCount <= 50) setTimeout(function(){checkMapLeaflet(waitCount);}, 100);} } if (settings_map_show_btn_hide_header) checkMapLeaflet(0); gclh_GetGcAccessToken( function(r) { all_map_layers["Geocaching"].accessToken = r.access_token; }); } catch(e) {gclh_error("Hide Map Header",e);} } // Change map parameter and add homezone to map. function changeParameterAddHomezoneOnBrowseMap() { try { function changeMap() { if (settings_map_hide_sidebar) { if (document.getElementById("searchtabs").parentNode.style.left != "-355px") { var links = document.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { if (links[i].className.match(/ToggleSidebar/)) { links[i].click(); break; } } } function hideSidebarRest(waitCount) { if ($('.groundspeak-control-findmylocation')[0] && $('.leaflet-control-scale')[0] && $('.leaflet-control-zoom')[0]) { // Wenn externe Kartenfilter vorhanden, dann gibt es keinen Balken zur Sidebar. if (document.location.href.match(/&asq=/)) var styleLeft = "15px"; else var styleLeft = "30px"; $('.groundspeak-control-findmylocation')[0].style.left = styleLeft; $('.leaflet-control-scale')[0].style.left = styleLeft; $('.leaflet-control-zoom')[0].style.left = styleLeft; } else {waitCount++; if (waitCount <= 50) setTimeout(function(){hideSidebarRest(waitCount);}, 200);} } hideSidebarRest(0); } function addHomeZoneMap(unsafeWindow, home_lat, home_lng, settings_homezone_radius, settings_homezone_color, settings_homezone_opacity) { settings_homezone_color = settings_homezone_color.replace("##", "#"); if (unsafeWindow == "none") unsafeWindow = window; if (typeof home_lat == "undefined" || typeof home_lng == "undefined" || home_lat == null || home_lng == null) return; var opacity = settings_homezone_opacity / 100; var opacity2 = opacity + 0.1; var latlng = new unsafeWindow.L.LatLng((home_lat / 10000000), (home_lng / 10000000)); var options = { color: settings_homezone_color, weight: 1, opacity: opacity2, fillOpacity: opacity, clickable: false }; var circle = new unsafeWindow.L.Circle(latlng, settings_homezone_radius * 1000, options); unsafeWindow.MapSettings.Map.addLayer(circle); } // Only build the circles when the map is ready. function checkForAddHomeZoneMap(waitCount) { if ($('.groundspeak-control-findmylocation')[0] && $('.leaflet-control-scale')[0]) { if (settings_show_homezone) { if (browser === "chrome" || browser === "firefox") { injectPageScriptFunction(addHomeZoneMap, "('" + "none" + "', " + getValue("home_lat") + ", " + getValue("home_lng") + ", " + settings_homezone_radius + ", '#" + settings_homezone_color + "', " + settings_homezone_opacity + ")"); } else addHomeZoneMap(unsafeWindow, getValue("home_lat"), getValue("home_lng"), settings_homezone_radius, "#" + settings_homezone_color, settings_homezone_opacity); for (var i in settings_multi_homezone) { var curHz = settings_multi_homezone[i]; if (browser === "chrome" || browser === "firefox") { injectPageScriptFunction(addHomeZoneMap, "('" + "none" + "', " + curHz.lat + ", " + curHz.lng + ", " + curHz.radius + ", '#" + curHz.color + "', " + curHz.opacity + ")"); } else addHomeZoneMap(unsafeWindow, curHz.lat, curHz.lng, curHz.radius, "#" + curHz.color, curHz.opacity); } } } else {waitCount++; if (waitCount <= 25) setTimeout(function(){checkForAddHomeZoneMap(waitCount);}, 200);} } checkForAddHomeZoneMap(0); } isMapLoad(changeMap); appendCssStyle(".leaflet-control-layers-base {min-width: 135px;} .add-list li {padding: 2px 0} .add-list li button {font-size: 14px; margin-bottom: 0px;}"); } catch(e) {gclh_error("Change map parameter and add homezone to map",e);} } // Add links to Google, OSM, Flopp's and GeoHack Map on Browse Map. function addLinksOnBrowseMap() { try { function attachGeoServiceControl(waitCount) { // Prüfen, ob Layers schon vorhanden sind, erst dann den Button hinzufügen. if ($('.leaflet-control-layers-base').find('input.leaflet-control-layers-selector')[0]) { initGeoServiceControl(); } else {waitCount++; if (waitCount <= 50) setTimeout(function(){attachGeoServiceControl(waitCount);}, 100);} } attachGeoServiceControl(0); } catch(e) {gclh_error("Add links to Google, OSM, Flopp's und GeoHack Map on GC Map",e);} } // Common Geoservice functions. function initGeoServiceControl() { if (is_page('map')) { $('.leaflet-top.leaflet-right').append('
        '); } else { $('.map-setting-controls ul li:first').before('
      • '); } $('#gclh_geoservices_control').append(''); $("#gclh_geoservices_control").append('
        '); $("#gclh_geoservices_list").append('Go to ...'); if (settings_add_link_google_maps_on_gc_map) $("#gclh_geoservices_list").append('Google Maps'); if (settings_add_link_osm_on_gc_map) $("#gclh_geoservices_list").append('Openstreetmap'); if (settings_add_link_flopps_on_gc_map) $("#gclh_geoservices_list").append('Flopp\'s Map'); if (settings_add_link_geohack_on_gc_map) $("#gclh_geoservices_list").append('GeoHack'); if (settings_add_link_komoot_on_gc_map) $("#gclh_geoservices_list").append('Komoot'); $("#gclh_geoservice_googlemaps").click(function() {callGeoService(urlGoogleMaps, settings_switch_to_google_maps_in_same_tab);}); $("#gclh_geoservice_osm").click(function() {callGeoService(urlOSM, settings_switch_to_osm_in_same_tab);}); $("#gclh_geoservice_flopps").click(function() {callGeoService(urlFlopps, settings_switch_to_flopps_in_same_tab);}); $("#gclh_geoservice_geohack").click(function() {callGeoService(urlGeoHack, settings_switch_to_geohack_in_same_tab);}); $("#gclh_geoservice_komoot").click(function() {callGeoService(urlKomoot, settings_switch_to_komoot_in_same_tab);}); var css = ''; css += '.gclh-leaflet-control.browsemap {width: 28px; height: 28px; border: unset; position: unset; right: unset; margin-top: 16px; margin-right: 16px; float: right; clear: left; border-radius: 7px; box-shadow: 0 1px 7px rgba(0,0,0,0.4); background: #f8f8f9; pointer-events: auto;}'; css += '.gclh-leaflet-control {z-index: 1019; cursor: default; align-items: center; background-color: white; border: 1px solid #00b265; border-radius: 4px; color: #00b265; display: flex; height: 40px; justify-content: center; outline: none; overflow: hidden; padding: 4px; width: 40px;}'; css += '.gclh-leaflet-control > a {background-image: url("/images/silk/map_go.png"); background-size: 18px; opacity: 0.8; background-repeat: no-repeat; background-position: 50% 50%; height: 40px; width: 40px;}'; css += '.browsemap .gclh-leaflet-list {z-index: 1019; right: 68px; top: 16px;}'; css += '.gclh-leaflet-list {display: none; position: absolute; right: 0px; top: 50px; min-width: 135px; border-radius: inherit; box-shadow: 0 1px 7px rgba(0,0,0,0.4); background-color: inherit; padding: 6px;}'; css += '.gclh-leaflet-list > b {display: table; padding: 2px 6px 6px 6px; font-size: 15px; color: #000000; cursor: default; }'; css += '.gclh-leaflet-list > a {display: table; padding: 2px 6px; font-size: 13px; color: #000000; cursor: pointer; min-width: 135px; text-align: left;}'; css += '.gclh-leaflet-control:hover .gclh-leaflet-list {display: block;}'; css += '.gclh-leaflet-list a:hover {background-color: #e6f7ef; text-decoration: none;}'; appendCssStyle(css, null, 'gclh_geoservices_css'); } function getMapCooords() { // Mögliche url Zusammensetzungen Browse Map, Beispiele: https://www.geocaching.com/map ... // 1. /default.aspx?lat=50.889233&lng=13.386967#?ll=50.89091,13.39551&z=14 // /default.aspx?lat=50.889233&lng=13.386967#clist?ll=50.89172,13.36779&z=14 // /default.aspx?lat=50.889233&lng=13.386967#pq?ll=50.89204,13.36667&z=14 // /default.aspx?lat=50.889233&lng=13.386967#search?ll=50.89426,13.35955&z=14 // 2. /?ll=50.89093,13.38437#?ll=50.89524,13.35912&z=14 // 3. /#?ll=50.95397,6.9713&z=15 if (is_page('map')) { var matches = document.location.href.match(/\\?ll=(-?[0-9.]*),(-?[0-9.]*)&z=([0-9.]*)/); // Beispiel 1., 2. und 3. hinten var matchesMarker = document.location.href.match(/\\?lat=(-?[0-9.]*)&lng=(-?[0-9.]*)/); // Beispiel 1. vorne if (matchesMarker == null) { var matchesMarker = document.location.href.match(/\\?ll=(-?[0-9.]*),(-?[0-9.]*)#/); // Beispiel 2. vorne if (matchesMarker == null) { var matchesMarker = matches; // Beispiel 3. } } } else { var matchesMarker = document.location.href.match(/\\?lat=(-?[0-9.]*)&lng=(-?[0-9.]*)&zoom=([0-9.]*)/); var matches = []; matches = matchesMarker; } var coords = null; if (matches != null && matchesMarker != null) { coords = new Object(); coords.zoom = matches[3]; coords.zoomMinus1 = matches[3]-1; coords.lat = matches[1]; coords.lon = matches[2]; coords.markerLat = matchesMarker[1]; coords.markerLon = matchesMarker[2]; var latd = coords.lat; var lond = coords.lon; sign = latd > 0 ? 1 : -1; coords.latOrient = latd > 0 ? 'N' : 'S'; latd *= sign; coords.latDeg = Math.floor(latd); coords.latMin = Math.floor((latd - coords.latDeg) * 60); coords.latSec = Math.floor((latd - coords.latDeg - coords.latMin / 60) * 3600); sign = lond > 0 ? 1 : -1; coords.lonOrient = lond > 0 ? 'E' : 'W'; lond *= sign; coords.lonDeg = Math.floor(lond); coords.lonMin = Math.floor((lond - coords.lonDeg) * 60); coords.lonSec = Math.floor((lond - coords.lonDeg - coords.lonMin / 60) * 3600); } return coords; } function replaceData(str, coords) { re = new RegExp("\{[a-zA-Z0-9]+\}", "g"); var replacements = str.match(re); if (replacements != null) { for (var i=0; i'); $('#gclh_search_map').append($('#search-map-cta').remove().get().reverse()); $('#gclh_search_map a')[0].childNodes[2].remove(); var css = ''; css += '.leaflet-top.leaflet-right {top: unset;}'; css += '.map-cta {opacity: 0.8; background-color: rgb(248, 248, 249); width: 36px; height: 36px; border: unset; box-shadow: unset; line-height: unset; padding: unset; position: unset;}'; css += '#gclh_search_map, #gclh_search_map > a {z-index: 1018;}'; css += '#gclh_search_map svg {margin: 0; padding: 9px 7px 6px 7px; color: #02874d;}'; css += '.map-cta:hover {background-color: #e6f7ef;}'; appendCssStyle(css); } } else {waitCount++; if (waitCount <= 100) setTimeout(function(){relocatingSearchMapButton(waitCount);}, 100);} } relocatingSearchMapButton(0); } catch(e) {gclh_error("Relocate button search geocaches on Browse Map",e);} } // Hide found/hidden Caches on Map. Add Buttons for hiding/showing all Caches. function hideCachesOnBrowseMap() { try { $('#LegendRed ul')[0].innerHTML += ''; if ($('#Legend6')[0]) { $('#Legend6')[0].addEventListener("click", function() {$('#Legend3653').click(); $('#Legend1304').click();}, false); $('#Legend6')[0].title = $('#Legend6')[0].title + " / Community Celebration Event"; } if ($('#Legend2')[0]) $('#Legend2')[0].addEventListener("click", function() {$('#Legend9').click();}, false); function hideFoundCaches() { // Kartenfilter bei externen Filtern (beispielsweise aus play/search) nicht verändern. if (document.location.href.match(/&asq=/)) return; var button = unsafeWindow.document.getElementById("m_myCaches").childNodes[1]; if (button) button.click(); } if (settings_map_hide_found) isMapLoad(hideFoundCaches); function hideHiddenCaches() { if (document.location.href.match(/&asq=/)) return; var button = unsafeWindow.document.getElementById("m_myCaches").childNodes[3]; if (button) button.click(); } if (settings_map_hide_hidden) isMapLoad(hideHiddenCaches); function removeDNFSmileys() { if (document.location.href.match(/&asq=/)) return; var button = unsafeWindow.document.getElementById("m_myCaches").childNodes[5]; if (button) button.click(); } if (settings_map_hide_dnfs) isMapLoad(removeDNFSmileys); function getAllCachetypeButtons() { return ['Legend2', 'Legend9', 'Legend3', 'Legend6', 'Legend13', 'Legend453', 'Legend7005', 'Legend1304', 'Legend137', 'Legend4', 'Legend11', 'Legend8', 'Legend5', 'Legend1858']; } function hideAllCacheTypes() { var cacheTypes = getAllCachetypeButtons(); cacheTypes.forEach(hideCacheType); } function hideCacheType(item) { if (document.getElementById(item).className.indexOf('ct_untoggled') === -1) document.getElementById(item).click(); } function showCacheType(item) { if (document.getElementById(item).className.indexOf('ct_untoggled') !== -1) document.getElementById(item).click(); } function showAllCacheTypes() { var cacheTypes = getAllCachetypeButtons(); cacheTypes.forEach(showCacheType); } var ul = document.getElementById("m_cacheTypes"); var li = document.createElement("li"); var a = document.createElement('a'); a.appendChild(document.createTextNode("Hide all Cachetypes")); a.title = "Hide all Caches"; a.href = "#"; li.appendChild(a); ul.appendChild(li); li.onclick = function() {hideAllCacheTypes();}; li = document.createElement("li"); a = document.createElement('a'); a.appendChild(document.createTextNode("Show all Cachetypes")); a.title = "Show all Caches"; a.href = "#"; li.appendChild(a); ul.appendChild(li); li.onclick = function() {showAllCacheTypes();}; // Apply Cache Type Filter. function hideCacheTypes() { if (document.location.href.match(/&asq=/)) return; // Cache Types auf hidden setzen. if (settings_map_hide_2 && $('#Legend2')[0]) {$('#Legend2')[0].click(); $('#Legend2')[0].setAttribute("class", "ct_toggle ct2 ct_untoggled");} if (settings_map_hide_9 && $('#Legend9')[0]) {$('#Legend9')[0].click(); $('#Legend9')[0].setAttribute("class", "ct_toggle ct9 ct_untoggled");} if (settings_map_hide_5 && $('#Legend5')[0]) {$('#Legend5')[0].click(); $('#Legend5')[0].setAttribute("class", "ct_toggle ct5 ct_untoggled");} if (settings_map_hide_3 && $('#Legend3')[0]) {$('#Legend3')[0].click(); $('#Legend3')[0].setAttribute("class", "ct_toggle ct3 ct_untoggled");} if (settings_map_hide_6 && $('#Legend6')[0]) {$('#Legend6')[0].click(); $('#Legend6')[0].setAttribute("class", "ct_toggle ct6 ct_untoggled");} if (settings_map_hide_453 && $('#Legend453')[0]) {$('#Legend453')[0].click(); $('#Legend453')[0].setAttribute("class", "ct_toggle ct453 ct_untoggled");} if (settings_map_hide_7005 && $('#Legend7005')[0]) {$('#Legend7005')[0].click(); $('#Legend7005')[0].setAttribute("class", "ct_toggle ct7005 ct_untoggled");} if (settings_map_hide_13 && $('#Legend13')[0]) {$('#Legend13')[0].click(); $('#Legend13')[0].setAttribute("class", "ct_toggle ct13 ct_untoggled");} if (settings_map_hide_1304 && $('#Legend1304')[0]) {$('#Legend1304')[0].click(); $('#Legend1304')[0].setAttribute("class", "ct_toggle ct1304 ct_untoggled");} if (settings_map_hide_4 && $('#Legend4')[0]) {$('#Legend4')[0].click(); $('#Legend4')[0].setAttribute("class", "ct_toggle ct4 ct_untoggled");} if (settings_map_hide_11 && $('#Legend11')[0]) {$('#Legend11')[0].click(); $('#Legend11')[0].setAttribute("class", "ct_toggle ct11 ct_untoggled");} if (settings_map_hide_137 && $('#Legend137')[0]) {$('#Legend137')[0].click(); $('#Legend137')[0].setAttribute("class", "ct_toggle ct137 ct_untoggled");} if (settings_map_hide_8 && $('#Legend8')[0]) {$('#Legend8')[0].click(); $('#Legend8')[0].setAttribute("class", "ct_toggle ct8 ct_untoggled");} if (settings_map_hide_1858 && $('#Legend1858')[0]) {$('#Legend1858')[0].click(); $('#Legend1858')[0].setAttribute("class", "ct_toggle ct1858 ct_untoggled");} // Gesamte Reihen zu den Cache Types auf hidden setzen. if (settings_map_hide_2) $('#LegendGreen')[0].childNodes[0].setAttribute("class", "a_cat_displayed cat_untoggled"); if (settings_map_hide_3) $('#LegendYellow')[0].childNodes[0].setAttribute("class", "a_cat_displayed cat_untoggled"); if (settings_map_hide_6 && settings_map_hide_453 && settings_map_hide_7005 && settings_map_hide_13) $('#LegendRed')[0].childNodes[0].setAttribute("class", "a_cat_displayed cat_untoggled"); if (settings_map_hide_4 && settings_map_hide_11 && settings_map_hide_137) $('#chkLegendWhite')[0].childNodes[0].setAttribute("class", "a_cat_displayed cat_untoggled"); if (settings_map_hide_8 && settings_map_hide_5 && settings_map_hide_1858) $('#chkLegendBlue')[0].childNodes[0].setAttribute("class", "a_cat_displayed cat_untoggled"); } isMapLoad(hideCacheTypes); } catch(e) {gclh_error("Hide found/hidden Caches / Cache Types on Map",e);} } // Save as PQ and set defaults for Browse Map. function saveAsPQOnBrowseMap() { setValue('settings_save_as_pq_set_defaults', false); try { function waitForSavePQ(waitCount) { if ($('.pq-dl')[0] && $('#lnk_savepq')[0]) { $('.pq-dl').append('
         | Set defaults
        '); $('.pq-dl .gclh_toggle-handle')[0].onclick = function() { $('.pq-dl .gclh_toggle-handle').toggleClass('on'); setValue('set_switch_browsemap_set_defaults', $('.pq-dl .gclh_toggle-handle.on')[0] ? true:false); }; $('#lnk_savepq')[0].onclick = function() { setValue('settings_save_as_pq_set_defaults', $('.pq-dl .gclh_toggle-handle.on')[0] ? true:false); }; if ($('.gclh_toggle-handle')[0] && getValue('set_switch_browsemap_set_defaults', false) == true) {$('.gclh_toggle-handle').addClass('on');} } else {waitCount++; if (waitCount <= 100) setTimeout(function(){waitForSavePQ(waitCount);}, 50);} } waitForSavePQ(0) var css = '.pq-dl {margin-top: 1em; margin-bottom: 0 !important; display: flex; cursor: default;}'; css += '.set_defaults {margin-right: 6px;}'; appendCssStyle(css); } catch(e) {gclh_error("Save as PQ and set defaults for Browse Map",e);} } // Display more informations on Browse Map pop up for a cache. function cachePopupOnBrowseMap() { try { var template = $("#cacheDetailsTemplate").html().trim(); // {{=gc}} will be replaced by the GC-Code, so the div is unique var new_template = ''; new_template += ''; var pos = template.lastIndexOf(''); template = template.substring(0,pos) + new_template + ''; // Add section for weekday for events. template = template.replace('{{=hidden}}', '{{=hidden}}'); // Insert new template $("#cacheDetailsTemplate").html(template); // Select the target node. var target = document.querySelector('.leaflet-popup-pane'); if (settings_show_enhanced_map_coords) var css = "div.popup_additional_info {min-height: 82px;}"; else var css = "div.popup_additional_info {min-height: 64px;}"; css += "div.popup_additional_info .loading_container{display: flex; justify-content: center; align-items: center;}" css += "div.popup_additional_info .loading_container img{margin-right:5px;}" css += "div.popup_additional_info span.favi_points svg, div.popup_additional_info span.tackables svg{position: relative;top: 4px;}"; css += ".leaflet-popup-content-wrapper, .leaflet-popup-close-button {margin: 16px 3px 0px 13px;}"; css += ".gclh_ctoc img {width: 14px; padding: 3px 1px 0 0; float: right;}"; css += "div.gclh_latest_log, span.gclh_cache_note {margin-top:5px;}"; css += "div.gclh_latest_log:hover, span.gclh_cache_note:hover {position: relative;}"; css += "div.gclh_latest_log span, span.gclh_cache_note span {display: none; position: absolute; left: 0px; width: 500px; padding: 5px; text-decoration:none; text-align:left; vertical-align:top; color: #000000; word-break: break-word;}"; 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); // Create an observer instance. var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { gccode = $('#gmCacheInfo .code').html(); if (gccode == null) return; // Listing coordinates of all caches in additional pop up. var locations = []; // Count of caches (map-items) in additional pop up. var countMapItems = $('.map-item').length; // New pop up. This can contain more than one cache (if 2 or more are close together) // so we have to load informations for all caches. $('#gmCacheInfo .map-item').each(function () { gccode = $(this).find('.code').html(); if ($('#already_loading_' + gccode)[0]) return; $(this).find('dl dt')[0].innerHTML = ""; if (browser == 'firefox') { $(this).find('h4 a')[0].title = decode_innerHTML($(this).find('h4 a')[0]).replace(//,'').replace(/<\/strike>/,''); $(this).find('dl dd')[0].childNodes[0].innerHTML = '' + $(this).find('dl dd')[0].childNodes[0].innerHTML + ''; } // Add hidden Div, so we can know, that we are already loading data. $(this).find('#popup_additional_info_' + gccode).append('
        '); // Get index of map items. var indexMapItems = $(this).find('#popup_additional_info_' + gccode).closest('.map-item')[0].className.match(/map-item-row-(\d+)/); var indexMapItems = indexMapItems[1] -1; $.get('https://www.geocaching.com/geocache/'+gccode, null, function(text){ // We need to retriev the gc_code from the loaded page, because in the // meantime the global variable gc_code could (and will be ;-)) changed. var local_gc_code = $(text).find('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode').html(); var premium_only = false; if ($(text).find('p.Warning.NoBottomSpacing').html() != null) { premium_only = true; } // Get the last logs. initalLogs_from_cachepage = text.substr(text.indexOf('initialLogs = {"status')+13, text.indexOf('} };') - text.indexOf('initialLogs = {"status') - 10); var initalLogs = JSON.parse(initalLogs_from_cachepage); var last_logs = document.createElement("div"); var last_logs_to_show = settings_show_latest_logs_symbols_count_map; var lateLogs = new Array(); for (var i = 0; i < initalLogs['data'].length; i++) { if (last_logs_to_show == i) break; var lateLog = new Object(); lateLog['user'] = initalLogs['data'][i].UserName; lateLog['src'] = '/images/logtypes/' + initalLogs['data'][i].LogTypeImage; lateLog['type'] = initalLogs['data'][i].LogType; lateLog['date'] = initalLogs['data'][i].Visited; lateLog['log'] = initalLogs['data'][i].LogText; lateLogs[i] = lateLog; } if (lateLogs.length > 0) { var div = document.createElement("div"); div.id = "gclh_latest_logs"; div.setAttribute("style", "padding-right: 0; display: flex;"); var span = document.createElement("span"); span.setAttribute("style", "white-space: nowrap; margin-right: 5px; margin-top: 5px;"); span.appendChild(document.createTextNode('Latest logs:')); div.appendChild(span); var inner_div = document.createElement("div"); inner_div.setAttribute("style", "display: flex; flex-wrap: wrap;"); div.appendChild(inner_div); for (var i = 0; i < lateLogs.length; i++) { var div_log_wrapper = document.createElement("div"); div_log_wrapper.className = "gclh_latest_log"; var img = document.createElement("img"); img.src = lateLogs[i]['src']; img.setAttribute("style", "padding-left: 2px; vertical-align: bottom; float:left;"); var log_text = document.createElement("span"); log_text.title = ""; log_text.innerHTML = " " + lateLogs[i]['user'] + " - " + lateLogs[i]['date'] + "
        " + lateLogs[i]['log']; div_log_wrapper.appendChild(img); div_log_wrapper.appendChild(log_text); inner_div.appendChild(div_log_wrapper); } last_logs.appendChild(div); } // Get all type of logs and their count. 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(){ tb_text = $(this).html(); if (tb_text.indexOf('ctl00_ContentBody_uxTravelBugList_uxInventoryLabel') !== -1) { // There are two Container with .CacheDetailNavigationWidget so we are only processing the // one that contains the TB informations. trachables = (tb_text.match(/
      • /g)||[]).length; } }); // Get the number of favorite points. var fav_points = $(text).find('.favorite-value').html(); if (fav_points == null) { // Couldn't get Number of Favorits. This happens with event caches for example. fav_points = 0; } else { fav_points = fav_points.replace('.',''); fav_points = fav_points.replace(',',''); fav_points = parseInt(fav_points); } // Set dummy favorite score. var fav_percent = ' '; // Get the place, where the cache was placed. if ($(text).find('#ctl00_ContentBody_Location a')[0]) var place = $(text).find('#ctl00_ContentBody_Location a')[0].innerHTML; else var place = $(text).find('#ctl00_ContentBody_Location')[0].innerHTML.replace(/(.*?)\s/,''); // Put all together. var new_text = 'Logs:' + all_logs + '
        '; new_text += $(last_logs).prop('outerHTML'); new_text += '
        '; if (settings_show_country_in_place) new_text += '' + place + ' | '; else new_text += '' + place.replace(/(,.*)/,'') + ' | '; if (settings_show_elevation_of_waypoints) { new_text += ''; } new_text += ' ' + fav_percent + ' | '; if (premium_only) { new_text += ' Premium Only Cache | '; } new_text += ' ' + trachables + ''; // Get link to image gallery and image count. var a = $(text).find('.CacheDetailNavigation ul li').find('a[href*="/seek/gallery.aspx?guid="]'); if (a) { var galleryLink = a[0].href; var imgCount = a[0].innerHTML.match(/(\s*)\((\d+)\)/); if (galleryLink && imgCount && imgCount[2]) { if (imgCount[2] == "0") new_text += ' | '; else new_text += ' | '; new_text += '' + imgCount[2] + ''; } } // Get personal cache note. if ($(text).find('#srOnlyCacheNote')[0]) { if (!$(text).find('#srOnlyCacheNote')[0].innerHTML || $(text).find('#srOnlyCacheNote')[0].innerHTML == '') { new_text += ' | '; } else { new_text += ' | ' + $(text).find('#srOnlyCacheNote').html().replace(/\n/gi,'
        ') + '
        '; } } new_text += '
        '; // Get coordinates. var coords = $(text).find('#uxLatLon')[0].innerHTML; var original_coords = ""; var original_coords_span = ""; var corrected = ""; if (text.match(/"isUserDefined":true/gm)) { var original_coords = text.match(/oldLatLngDisplay":"(N|S).*(E|W).*?'"/gm); original_coords = String(original_coords[0]); original_coords = original_coords.replace("oldLatLngDisplay\":\"",""); original_coords = original_coords.replace("\"",""); original_coords = original_coords.replace(new RegExp('\'', 'g'),''); original_coords_span = '  ( ' + original_coords + ' )'; corrected = "corrected "; } if (settings_show_enhanced_map_coords) { new_text += '' + coords + '' + original_coords_span + ''; } $('#popup_additional_info_' + local_gc_code).html(new_text); // Get count and names of own bookmarklists. if ($('#popup_additional_info_' + local_gc_code).closest('.map-item')[0]) { var item = $('#popup_additional_info_' + local_gc_code).closest('.map-item')[0]; if ( !$(item).find('#ownBMLsCount')[0] && $(item).find('.btn-add-to-list > span')[0] ) { var [ownBMLsCount, ownBMLsText, ownBMLsList] = getOwnBMLs(text); $(item).find('.btn-add-to-list')[0].after($(' (' + ownBMLsCount + ')')[0]); $(item).find('.btn-add-to-list > span')[0].setAttribute('title', ownBMLsText); $(item).find('#ownBMLsCount')[0].setAttribute('title', ownBMLsList); } } // Add Copy to Clipboard Links. if (settings_show_enhanced_map_coords) { if (original_coords != "") { addCopyToClipboardLink(original_coords, $('#popup_additional_info_' + local_gc_code + ' span.coordinates.original .anker')[0], "original Coordinates", 'vertical-align: bottom; margin-right: -6px;'); } addCopyToClipboardLink(coords, $('#popup_additional_info_' + local_gc_code + ' span.coordinates.current')[0], corrected+"Coordinates", 'vertical-align: bottom; margin-right: -6px;'); } // Get favorite score. getFavoriteScore(local_gc_code, function(score) { var id = '#popup_additional_info_' + local_gc_code + ' .favi_points'; if ($(id)[0] && $(id)[0].childNodes[1]) $(id)[0].childNodes[1].data = " "+score+"%"; }); // Get elevations. if (settings_show_elevation_of_waypoints) { var coords = toDec($(text).find('#uxLatLon')[0].innerHTML); locations.push(coords[0]+","+coords[1]); if (locations && locations.length == countMapItems) getElevations(0,locations); } // Show Weekday for Events. if (settings_show_eventday && text.match(/eventCacheData/)) { var matchDate = text.match(/new Date\((\d{4}), (\d{2})-1, (\d{2})/); if (matchDate != null) { var date = new Date(matchDate[1], matchDate[2]-1, matchDate[3]); if (date != "Invalid Date") { $('#gclh_weekday_'+local_gc_code).html(` (${date.getWeekday(short = true)})`); } } } }); // Improve Original Box Content. side = $(this).find('dl dd a'); guid = side.attr('href').substring(15,36+15); username = side.text(); buildSendIcons(side[0], username, "per guid", guid); 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;"); }); }); }); // Configuration of the observer. var config = { attributes: true, childList: true, characterData: true }; // Pass in the target node, as well as the observer options. observer.observe(target, config); } catch(e) {gclh_error("enhance cache pop up",e);} } // Leaflet Map für Trackables vergrößern und Zoom per Mausrad zulassen. if (document.location.href.match(/\.com\/track\/map/)) { try{ $('#map_canvas').append('
        '); appendCssStyle('#map_canvas {height: 450px;} .leaflet-bottom.leaflet-right {margin-right: 16px;}'); $('#map_canvas').resizable({minHeight: 300, maxHeight: 700}); var scriptText = "map.invalidateSize(); map.scrollWheelZoom.enable();"; injectPageScript(scriptText, 'head'); } catch(e) {gclh_error("tb_map_enhancement",e);} } // Improve cache matrix on statistics page and public profile page and handle cache search links in list or map. try { if ((settings_count_own_matrix || settings_count_own_matrix_show_next) && isOwnStatisticsPage()) { var own = true; } else if (settings_count_foreign_matrix && is_page("publicProfile") && $('#ctl00_ContentBody_lblUserProfile')[0] && !$('#ctl00_ContentBody_lblUserProfile')[0].innerHTML.match(": " + global_me)) { var own = false; } else var own = ""; if (own !== "") { // Matrix ermitteln. if (document.getElementById('ctl00_ContentBody_StatsDifficultyTerrainControl1_uxDifficultyTerrainTable')) { var table = document.getElementById('ctl00_ContentBody_StatsDifficultyTerrainControl1_uxDifficultyTerrainTable'); } else if (document.getElementById("ctl00_ContentBody_ProfilePanel1_StatsDifficultyTerrainControl1_uxDifficultyTerrainTable")) { var table = document.getElementById("ctl00_ContentBody_ProfilePanel1_StatsDifficultyTerrainControl1_uxDifficultyTerrainTable"); } if (table) { // Matrixerfüllung berechnen. var smallest = parseInt(table.getElementsByClassName("stats_cellfooter_grandtotal")[0].innerHTML); var count = 0; var cells = table.getElementsByTagName('td'); for (var i = 0; i < cells.length; i++) { var cell = cells[i]; if (cell.id.match(/^([1-9]{1})(_{1})([1-9]{1})$/)) { if (parseInt(cell.children[0].innerHTML) == smallest) count++; else if (parseInt(cell.children[0].innerHTML) < smallest) { smallest = parseInt(cell.children[0].innerHTML); count = 1; } } } // Matrixerfüllung ausgeben. if ((own == true && settings_count_own_matrix == true) || (own == false && settings_count_foreign_matrix == true)) { if (smallest > 0) var matrix = " (" + smallest + " complete and (" + (81 - count) + "/81))"; else var matrix = " (" + (81 - count) + "/81)"; if (document.getElementById('uxDifficultyTerrainHelp').previousSibling) { var side = document.getElementById('uxDifficultyTerrainHelp').previousSibling; side.nodeValue += matrix; } } // Nächste mögliche Matrix farblich kennzeichnen und Search Link und Title überall ergänzen. if (own == true && settings_count_own_matrix_show_next == true) { var from = smallest; var to = smallest - 1 + parseInt(settings_count_own_matrix_show_count_next); var color = "#" + settings_count_own_matrix_show_color_next; for (var i = 0; i < cells.length; i++) { var cell = cells[i]; if (cell.id.match(/^([1-9]{1})(_{1})([1-9]{1})$/)) { if (from <= parseInt(cell.children[0].innerHTML) && parseInt(cell.children[0].innerHTML) <= to) { cell.children[0].style.color = "black"; var diff = parseInt(cell.children[0].innerHTML) - from; cell.style.backgroundColor = color; cell.children[0].style.backgroundColor = 'unset'; if (diff == 1) cell.style.backgroundColor = cell.style.backgroundColor.replace(/rgb/i, "rgba").replace(/\)/, ",0.6)"); else if (diff == 2) cell.style.backgroundColor = cell.style.backgroundColor.replace(/rgb/i, "rgba").replace(/\)/, ",0.4)"); else if (diff == 3) cell.style.backgroundColor = cell.style.backgroundColor.replace(/rgb/i, "rgba").replace(/\)/, ",0.25)"); } if (settings_count_own_matrix_links_radius != 0) { cell.children[0].href += "&origin=" + DectoDeg(getValue("home_lat"), getValue("home_lng")) + "&radius=" + settings_count_own_matrix_links_radius + "km" + "&nfb[0]=" + global_me + "&o=2#GClhMatrix"; if (settings_count_own_matrix_links == "map") { var zoom = Math.round(24 - Math.log2(settings_count_own_matrix_links_radius * 1000)); var dt = cell.children[0].href.match(/d=(.*?)&t=(.*?)&/i); cell.children[0].href = 'https://www.geocaching.com/play/map?lat=' + (getValue("home_lat") / 10000000) + '&lng=' + (getValue("home_lng") / 10000000) + '&zoom=' + zoom + '&asc=true&sort=distance&ot=coords&r=' + settings_count_own_matrix_links_radius + '&d=' + dt[1] + '&t=' + dt[2] + '&hf=1&nfb=' + global_me + '#GClhMatrix'; cell.children[0].title += ", on map"; } else { cell.children[0].href += "#searchResultsTable"; cell.children[0].title += ", on list"; } cell.children[0].title += ", with radius " + settings_count_own_matrix_links_radius + " km from home"; cell.children[0].target = '_blank'; } } } } } } if ($('#ctl00_ContentBody_ProfilePanel1_lnkStatistics').length == 0 && isOwnStatisticsPage()) appendCssStyle("dl.ProfileDataList dt {float: left; clear: both; margin-right: 10px;}"); } catch(e) {gclh_error("Improve cache matrix",e);} // Improve own statistics page and own profile page with own log statistic. if (settings_log_statistic && isOwnStatisticsPage()) { try { getLogSt("cache", "/my/logs.aspx?s=1"); getLogSt("track", "/my/logs.aspx?s=2"); } catch(e) {gclh_error("Improve own log statistic",e);} } function getLogSt(type, url, manual) { var logsName = (type == "cache" ? "Cache":"Trackable") + " logs"; var logsId = "gclh_" + type + "_logs_"; var get_last = parseInt(getValue(logsId + "get_last"), 10); if (!get_last) get_last = 0; var reload_after = (settings_log_statistic_reload === "" ? "0" : parseInt(settings_log_statistic_reload, 10) * 60 * 60 * 1000); var time = new Date().getTime(); if ((reload_after != 0 && (get_last + reload_after) < time) || manual == true) { if (manual != true) setLogStHF(type, logsName, logsId, url); setLogStClear(type, logsName, logsId); setLogStAddWait(type, logsName, logsId); GM_xmlhttpRequest({ method: "GET", url: url, onload: function(response) { var logCount = new Array(); for (var i = 0; i < 101; i++) { var count = response.responseText.match(new RegExp("/images/logtypes/" + i + ".png", "g")); if (count) { // Das "?" in "(.*?)" bedeutet "nicht gierig", das heißt es wird das erste Vorkommen verwendet. var title = response.responseText.match('/images/logtypes/' + i + '.png"(.*?)title="(.*?)"'); if (title && title[2]) { if (type == "track") { if (i == 4) var lt = "<=3"; else if (i == 13) var lt = "<=5"; else if (i == 14) var lt = "<=10"; else if (i == 19) var lt = "<=2"; else if (i == 48) var lt = "<=48"; else if (i == 75) var lt = "<=75"; else var lt = ""; } else var lt = "<=" + i; var logType = new Object(); logType["src"] = "/images/logtypes/" + i + ".png"; logType["title"] = title[2]; logType["href"] = url + lt; logType["count"] = count.length; logType["no"] = i; logCount[logCount.length] = logType; } } } if (logCount.length > 0) setValue(logsId + "get_last", time); setValue(logsId + "count", JSON.stringify(logCount)); var now = new Date().getTime(); var generated = Math.ceil((now - time) / (60 * 1000)); // In Minuten. setLogStClear(type, logsName, logsId); setLogSt(type, logsName, logsId, generated); } }); } else if (reload_after == 0 && get_last == 0) { setLogStHF(type, logsName, logsId, url); setLogStDummy(type, logsName, logsId); } else { var generated = Math.ceil((time - get_last) / (60 * 1000)); // In Minuten. setLogStHF(type, logsName, logsId, url); setLogStClear(type, logsName, logsId); setLogSt(type, logsName, logsId, generated); } } function setLogStHF(type, logsName, logsId, url) { if ($('#ctl00_ContentBody_StatsChronologyControl1_YearlyBreakdown, #ctl00_ContentBody_ProfilePanel1_StatsChronologyControl1_YearlyBreakdown')[0]) { var side = $('#ctl00_ContentBody_StatsChronologyControl1_YearlyBreakdown, #ctl00_ContentBody_ProfilePanel1_StatsChronologyControl1_YearlyBreakdown')[0]; } if (side) { var div = document.createElement("div"); div.className = (type == "cache" ? "span-9":"span-9 last"); var html = ''; html += '

        Total ' + logsName + ':

        '; html += ''; html += ' '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' '; html += '
        Name ' + (settings_log_statistic_percentage ? " % " : " ") + ' Count
        Total ' + logsName + ':
        '; div.innerHTML = html; side.appendChild(div); $('#'+logsId+'reload')[0].addEventListener("click", function() {getLogSt(type, url, true);}, false); } } function setLogSt(type, logsName, logsId, generated) { var logCount = getValue(logsId + "count"); if (logCount) logCount = JSON.parse(logCount.replace(/, (?=,)/g, ",null")); if (logCount.length > 0 && $('#'+logsId+'body')[0]) { var side = $('#'+logsId+'body')[0]; logCount.sort(function(entryA, entryB) { if (entryA.count < entryB.count) return 1; if (entryA.count > entryB.count) return -1; return 0; }); var total = 0; logCount.forEach(function(entry) {total += entry.count;}); for (var i = 0; i < logCount.length; i++) { var tr = document.createElement("tr"); var html = ''; html += ''; html += ' '; html += ' '; html += ' ' + logCount[i]["title"] + ''; html += ' '; html += ''; html += ' ' + (settings_log_statistic_percentage ? (Math.round(logCount[i]["count"] * 100 * 100 / total) / 100).toFixed(2) : "") + ' '; html += ' ' + logCount[i]["count"] + ' '; tr.innerHTML = html; side.appendChild(tr); } if ($('#'+logsId+'total')[0]) $('#'+logsId+'total')[0].innerHTML = total; if ($('#'+logsId+'generated')[0]) { $('#'+logsId+'generated')[0].innerHTML = "Generated " + buildTimeString(generated) + " ago"; var reload_after = parseInt(settings_log_statistic_reload, 10) * 60; if (reload_after > 0) $('#'+logsId+'generated')[0].title = "Automated reload in " + buildTimeString(reload_after - generated); } if ($('#'+logsId+'reload')[0]) { $('#'+logsId+'reload')[0].innerHTML = "Reload"; $('#'+logsId+'reload')[0].title = "Reload " + logsName; } } else setLogStDummy(type, logsName, logsId); } function setLogStClear(type, logsName, logsId) { $('#'+logsId+'body').children().each(function() {this.remove();}); if ($('#'+logsId+'total')[0]) $('#'+logsId+'total')[0].innerHTML = ""; if ($('#'+logsId+'generated')[0]) $('#'+logsId+'generated')[0].innerHTML = $('#'+logsId+'generated')[0].title = ""; if ($('#'+logsId+'reload')[0]) $('#'+logsId+'reload')[0].innerHTML = $('#'+logsId+'reload')[0].title = ""; } function setLogStAddWait(type, logsName, logsId) { if ($('#'+logsId+'body')[0]) { var side = $('#'+logsId+'body')[0]; var load = document.createElement("span"); load.setAttribute("style", "line-height: 36px; margin-left: 5px;"); load.innerHTML = 'Loading Loading ' + logsName + ' ...'; side.appendChild(load); } } function setLogStDummy(type, logsName, logsId) { if ($('#'+logsId+'body')[0]) { var side = $('#'+logsId+'body')[0]; var dummy = document.createElement("span"); dummy.setAttribute("style", "margin-left: 5px;"); side.appendChild(dummy); } if ($('#'+logsId+'reload')[0]) { $('#'+logsId+'reload')[0].innerHTML = "Load"; $('#'+logsId+'reload')[0].title = "Load " + logsName; } } // Improve Finds for Each Day of the Year on own statistics page if (isOwnStatisticsPage()) { try { // Mark current date var today = new Date(); $('#'+(today.getMonth()+1)+'_'+today.getDate()).css("border","2px solid red"); } catch(e) {gclh_error("Improve Finds for Each Day of the Year",e);} } // Improve own statistic map page with links to caches for every country. if (settings_map_links_statistic && isOwnStatisticsPage() ) { try { var countriesList = $('#stats_tabs-maps .StatisticsWrapper'); for (var j = 0; j < countriesList.length; j++) { var indecator = $(countriesList[j]).find('#StatsFlagLists p span'); var tableItems = $(countriesList[j]).find('#StatsFlagLists table.Table tr'); for (var i = 0; i < tableItems.length; i++) { var name = tableItems[i].children[0].childNodes[1].textContent; if (name) { var parameter = undefined; var item = undefined; var countries = $.grep(country_id, function(e){return e.n == name;}); var states = $.grep(states_id, function(e){return e.n == name;}); // ambiguous matches of state (or country) name are not handled. Known cases: // Distrito Federal - Mexiko: Distrito Federal (state) / Brazil: Distrito Federal (state) // Limburg - Belgium: Limburg (state) / Netherlands: Limburg (state) if ( (countries && countries[0]) && !(states && states[0]) ) { parameter = "c"; item = countries; } else if ( !(countries && countries[0]) && (states && states[0]) ) { parameter = "r"; item = states; // case: country/state } else if ( (countries && countries[0]) && (states && states[0]) ) { // Known case: Georgia - United States/Georgia (state) and Georgia (country) if (indecator[0].getAttribute("id") == "ctl00_ContentBody_ProfilePanel1_USMapControl1_uxTotalCount") { parameter = "r"; item = states; } else { // Main rule: country first. // Known case: Luxembourg - Luxembourg (country) / Belgium: Luxembourg (state). parameter = "c"; item = countries; } } else { gclh_log("Improve own statistic map page: country and state name not found"); continue; } if (item && item[0]) { var a = document.createElement("a"); a.setAttribute("title", "Show caches you have found in " + item[0]["n"]); a.setAttribute("href", "/play/search?ot=4&"+parameter+"=" + item[0]["id"] + "&f=1&sort=FoundDate&asc=True#myListsLink"); a.setAttribute("style", "color: #3d76c5;"); a.innerHTML = tableItems[i].children[0].innerHTML; tableItems[i].children[0].innerHTML = ""; tableItems[i].children[0].appendChild(a); } } } } } catch(e) {gclh_error("Improve own statistic map page",e);} } // Improve statistic map page with total and percentage. if ((document.location.href.match(/\.com\/my\/statistics\.aspx/)) || (is_page("publicProfile") && $('#ctl00_ContentBody_ProfilePanel1_lnkStatistics.Active')[0])) { try { $('#stats_tabs-maps .StatisticsWrapper').each(function() { var total = 0; $(this).find('table tbody').each(function() { $(this).find('tr > td:nth-child(2) > strong').each(function() { total += JSON.parse($(this)[0].innerHTML.replace(/\s/g, '')); }); if (settings_map_percentage_statistic) { $(this).find('tr > td:nth-child(2) > strong').each(function() { var count = JSON.parse($(this)[0].innerHTML.replace(/\s/g, '')); var perc = (Math.round(count * 100 * 100 / total) / 100).toFixed(2); var td = document.createElement('td'); td.innerHTML = '' + perc + '%'; td.setAttribute('title', count + (count == 1 ? ' cache are ':' caches are ') + perc + '% of the total of ' + total + ' caches.'); $(this)[0].parentNode.parentNode.appendChild(td); }); } }); $(this)[0].previousElementSibling.innerHTML = total + ' ' + $(this)[0].previousElementSibling.innerHTML; }); } catch(e) {gclh_error("Improve statistic map page",e);} } // Post log from listing (inline). try { // iframe aufbauen und verbergen. if (settings_log_inline && is_page("cache_listing") && $('#ctl00_ContentBody_bottomSection')[0] && $('#ctl00_ContentBody_bottomSection')[0].children[0]) { var css = ""; var links = document.getElementsByTagName('a'); var menu = false; var watch = false; var gallery = false; for (var i = 0; i < links.length; i++) { if (links[i].href.match(/log\.aspx\?ID/) && !menu) { menu = links[i]; } else if (links[i].href.match(/gallery\.aspx/) && !gallery && links[i].parentNode.tagName.toLowerCase() == "li") { gallery = links[i]; } else if (links[i].href.match(/watchlist\.aspx/) && !watch) { watch = links[i]; } } var head = document.getElementById("ctl00_ContentBody_bottomSection").children[0]; function hide_iframe() { var frame = document.getElementById('gclhFrame'); if (frame.style.display == "") frame.style.display = "none"; else frame.style.display = ""; } if (head && menu) { var match = menu.href.match(/\?ID=(.*)/); if (match && match[1]) { var iframe = document.createElement("iframe"); iframe.setAttribute("id", "gclhFrame"); iframe.setAttribute("width", "100%"); iframe.setAttribute("height", "600px"); iframe.setAttribute("style", "border-top: 1px solid #b0b0b0; border-right: 0px; border-bottom: 1px solid #b0b0b0; border-left: 0px; overflow: auto; display: none;"); iframe.setAttribute("src", "/seek/log.aspx?ID=" + match[1] + "&gclh=small"); css += ".logItButton {background-image: url(/images/stockholm/16x16/comment_add.gif); background-repeat: no-repeat; margin-bottom: 20px;}"; css += ".logItButton:hover {background-color: aliceblue;}"; var span = document.createElement("span"); span.innerHTML = ''; span.addEventListener("click", hide_iframe, false); head.parentNode.insertBefore(span, head); head.parentNode.insertBefore(iframe, head); } var a = document.createElement("a"); a.setAttribute("href", "#gclhLogIt"); a.setAttribute("class", "lnk"); a.setAttribute("style", "padding:0px;"); a.innerHTML = " Log your visit (inline)"; a.addEventListener("click", hide_iframe, false); var li = document.createElement('li'); li.appendChild(a); var link = false; if (gallery) link = gallery; else link = watch; if (link) link.parentNode.parentNode.insertBefore(li, link.parentNode); if (css != '') appendCssStyle(css); } } // Im aufgebauten iframe, quasi nicht im Cache Listing. Nur auf old log page Veränderungen vornehmen. if (document.location.href.match(/\.com\/seek\/log\.aspx\?(.*)\&gclh\=small/)) hideForInlineLogging(); } catch(e) {gclh_error("Post log from listing (inline)",e);} // Post log from PMO-Listing as Basic Member (inline). try { // iframe aufbauen und verbergen. var css = ""; if (is_page("cache_listing") && $('.ul__cache-details.unstyled')[0]) { var idParameter = null; if (document.URL.match(/wp=[a-zA-Z0-9]*|guid=[a-zA-Z0-9-]*|id=[0-9]*/)) idParameter = document.URL.match(/wp=[a-zA-Z0-9]*|guid=[a-zA-Z0-9-]*|id=[0-9]*/)[0]; if (!idParameter | idParameter == "") idParameter = "wp=" + document.URL.match(/\/geocache\/([^_]*)/)[1]; var banner = $('.ul__cache-details.unstyled')[0].parentNode.nextSibling; css += "section header {min-width: unset !important;}"; var div = document.createElement("div"); div.setAttribute("style", "text-align: center;"); div.innerHTML = ' Log your visit'; banner.parentNode.insertBefore(div, banner); } if (settings_log_inline_pmo4basic && is_page("cache_listing") && $('.ul__cache-details.unstyled')[0]) { function hide_iframe() { var frame = document.getElementById('gclhFrame'); if (frame.style.display == "") frame.style.display = "none"; else frame.style.display = ""; } css += ".logItButton {background-image: url(/images/stockholm/16x16/comment_add.gif); background-repeat: no-repeat; margin-top: 20px; margin-bottom: 20px;}"; css += ".logItButton:hover {background-color: aliceblue;}"; var iframe = document.createElement("iframe"); iframe.setAttribute("id", "gclhFrame"); iframe.setAttribute("width", "100%"); iframe.setAttribute("height", "600px"); iframe.setAttribute("style", "margin-bottom: 50px; border-top: 1px solid #b0b0b0; border-right: 0px; border-bottom: 1px solid #b0b0b0; border-left: 0px; overflow: auto; display: none;"); iframe.setAttribute("src", "/seek/log.aspx?" + idParameter + "&gclh=small"); var div = document.createElement("div"); div.setAttribute("style", "text-align: center;"); var span = document.createElement("span"); span.innerHTML = ''; span.addEventListener("click", hide_iframe, false); div.appendChild(span); banner.parentNode.insertBefore(div, banner); banner.parentNode.insertBefore(iframe, banner); } if (css != '') appendCssStyle(css); // Im aufgebauten iframe, quasi nicht im Cache Listing. Nur auf old log page Veränderungen vornehmen. if (document.location.href.match(/\.com\/seek\/log\.aspx\?(.*)\&gclh\=small/)) hideForInlineLogging(true); } catch(e) {gclh_error("Post log from PMO-Listing as Basic Member (inline)",e);} // Hide for both inline loggings. function hideForInlineLogging(pmo) { if ($('html')[0]) $('html')[0].style.backgroundColor = "#FFFFFF"; if ($('header')[0]) $('header')[0].style.display = "none"; if ($('#ctl00_divBreadcrumbs')[0]) $('#ctl00_divBreadcrumbs')[0].style.display = "none"; if ($('.BottomSpacing')[0]) $('.BottomSpacing')[0].style.display = "none"; if ($('.BottomSpacing')[1]) $('.BottomSpacing')[1].style.display = "none"; if ($('#divAdvancedOptions')[0]) $('#divAdvancedOptions')[0].style.display = "none"; if ($('#ctl00_ContentBody_uxVistOtherListingLabel')[0]) $('#ctl00_ContentBody_uxVistOtherListingLabel')[0].style.display = "none"; if ($('#ctl00_ContentBody_uxVistOtherListingGC')[0]) $('#ctl00_ContentBody_uxVistOtherListingGC')[0].style.display = "none"; if ($('#ctl00_ContentBody_uxVisitOtherListingButton')[0]) $('#ctl00_ContentBody_uxVisitOtherListingButton')[0].style.display = "none"; if ($('#ctl00_divContentSide')[0]) $('#ctl00_divContentSide')[0].style.display = "none"; if ($('#UtilityNav')[0]) $('#UtilityNav')[0].style.display = "none"; if ($('footer')[0]) $('footer')[0].style.display = "none"; if ($('.container')[1]) $('.container')[1].style.display = "inline"; var links = document.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { if (!links[i].id.match(/(AllDroppedOff|AllVisited|AllClear)/i)) links[i].setAttribute("target", "_blank"); } var css = ""; if (pmo) css += "#Content, #Content .container, .span-20 {width: 780px;}"; else { css += "#Content, #Content .container, .span-20 {width: " + (parseInt(getValue("settings_new_width")) - 60) + "px;}"; if ($('#Navigation')[0]) $('#Navigation')[0].style.display = "none"; } css += ".PostLogList .Textarea {height: 175px;}"; appendCssStyle(css); } // Show amount of different coins in public profile. if (is_page("publicProfile") && $('#ctl00_ContentBody_ProfilePanel1_lnkCollectibles.Active')[0]) { try { function gclh_coin_stats(table_id) { var table = $('#'+table_id+' table'); var rows = table.find('tbody').first().find('tr'); var sums = new Object(); sums["tbs"] = sums["coins"] = sums["patches"] = sums["signal"] = sums["unknown"] = 0; var diff = new Object(); diff["tbs"] = diff["coins"] = diff["patches"] = diff["signal"] = diff["unknown"] = 0; for (var i = 0; i < (rows.length - 1); i++) { if (rows[i].innerHTML.match(/travel bug/i)) { diff["tbs"]++; sums["tbs"] += parseInt(rows[i].childNodes[5].innerHTML, 10); } else if (rows[i].innerHTML.match(/geocoin/i)) { diff["coins"]++; sums["coins"] += parseInt(rows[i].childNodes[5].innerHTML, 10); } else if (rows[i].innerHTML.match(/geopatch/i)) { diff["patches"]++; sums["patches"] += parseInt(rows[i].childNodes[5].innerHTML, 10); } else if (rows[i].innerHTML.match(/signal/i)) { diff["signal"]++; sums["signal"] += parseInt(rows[i].childNodes[5].innerHTML, 10); } else { diff["unknown"]++; sums["unknown"] += parseInt(rows[i].childNodes[5].innerHTML, 10); } } var tfoot = table.find('tfoot')[0]; var tr = document.createElement("tr"); var td = document.createElement("td"); var new_table = ""; td.colSpan = 3; new_table += ""; new_table += " "; new_table += " "; new_table += " "; new_table += " "; new_table += " "; new_table += " "; new_table += " "; new_table += " "; new_table += " "; new_table += " "; new_table += " "; new_table += " "; new_table += " "; new_table += " "; new_table += " "; if (sums["unknown"] > 0 || diff["unknown"] > 0) { new_table += " "; new_table += " "; new_table += " "; new_table += "
        SumDifferent
        Travel Bugs:" + sums["tbs"] + "" + diff["tbs"] + "
        Geocoins:" + sums["coins"] + "" + diff["coins"] + "
        Geopatches:" + sums["patches"] + "" + diff["patches"] + "
        Signal Tags:" + sums["signal"] + "" + diff["signal"] + "
        Unknown:" + sums["unknown"] + "" + diff["unknown"] + "
        "; } td.innerHTML = new_table; tr.appendChild(td); tfoot.appendChild(tr); } if ($('#ctl00_ContentBody_ProfilePanel1_dlCollectibles')[0]) gclh_coin_stats("ctl00_ContentBody_ProfilePanel1_dlCollectibles"); if ($('#ctl00_ContentBody_ProfilePanel1_dlCollectiblesOwned')[0]) gclh_coin_stats("ctl00_ContentBody_ProfilePanel1_dlCollectiblesOwned"); } catch(e) {gclh_error("Show Coin-Sums",e);} } // Show Coin Series in TB-Listing. if (document.location.href.match(/\.com\/track\/details\.aspx/)) { try { if ($('#ctl00_ContentBody_BugTypeImage')[0] && $('#ctl00_ContentBody_BugTypeImage')[0].alt && $('.BugDetailsList')[0]) { var dl = $('.BugDetailsList')[0]; var dt = document.createElement("dt"); var dd = document.createElement("dd"); dt.innerHTML = "Series:"; dd.innerHTML = $('#ctl00_ContentBody_BugTypeImage')[0].alt; dl.appendChild(dt); dl.appendChild(dd); } } catch(e) {gclh_error("Show Coin Series",e);} } // Copy TB Code in TB Listing to clipboard. if (document.location.href.match(/\.com\/track\/details\.aspx/) && $('.CoordInfoLink')[0] && $('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0]) { addCopyToClipboardLink($('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0], $('.CoordInfoLink')[0], "TB Code"); } // Improve favorites and profile lists page. if (document.location.href.match(/\.com\/my\/favorites\.aspx/) && $('table.Table tbody tr')[0]) { try { // Count favorite points. buildFavSum(); // No line-breaks in column location. if (settings_new_width >= 1000) appendCssStyle('table.Table tbody tr td:nth-child(4) {white-space: nowrap;}'); } catch(e) {gclh_error("Count favorite points",e);} } if (is_page("publicProfile") && $('#ctl00_ContentBody_ProfilePanel1_lnkLists.Active')[0] && $('table.Table tbody tr')[0]) { try { // Sum up FP and BM entries. $('#ctl00_ContentBody_ProfilePanel1_pnlBookmarks h3').each(function(i, e) { $(e).text($(e).text() + ' (' + $(e).next().find('tbody tr').length + ')'); }); // Count favorite points. buildFavSum(true); // No line-breaks in column location. if (settings_new_width >= 1000) appendCssStyle('table.Table tbody tr td:nth-child(3) {white-space: nowrap;}'); } catch(e) {gclh_error("Sum up FP and BM entries, count favorite points",e);} } function buildFavSum(pp) { function buildSL(tag) { var tr = document.createElement('tr'); var t = '<'+tag+' style="background-color: #DFE1D2; font-weight: normal; font-size: 1em;">'; if (pp) var html = t+''+t; else var html = t+''+t+''+t; for (src in stats) {html += ' '+stats[src];} html += 'Sum: '+count+''+t+''; tr.innerHTML = html; return tr; } var imgs = $('table.Table tbody').first().find('tr a:not([href*="mail"],[href*="message"])').find('img'); var stats = new Object(); var count = 0; for (var i = 0; i < imgs.length; i++) { if (imgs[i].src) { if (!stats[imgs[i].src]) stats[imgs[i].src] = 0; stats[imgs[i].src]++; count++; } } tr = buildSL("td", pp); $('table.Table tbody')[0].append(tr); tr = buildSL("th",pp); $('table.Table thead')[0].append(tr); } // Hide feedback icon. if (settings_hide_feedback_icon) { try { function hideFbIcon(waitCount) { if ($('#_hj_feedback_container')[0]) $('#_hj_feedback_container')[0].style.display = "none"; if ($('._hj-widget-container')[0]) $('._hj-widget-container')[0].style.display = "none"; waitCount++; if (waitCount <= 50) setTimeout(function(){hideFbIcon(waitCount);}, 200); } hideFbIcon(0); } catch(e) {gclh_error("Hide feedback icon",e);} } // Edit and Image Links to own caches in profile. if (document.location.href.match(/\.com\/my\/owned\.aspx/)) { try { var links = $('a'); for (var i = 0; i < links.length; i++) { if (links[i].href.match(/\/seek\/cache_details\.aspx\?/)) { if (!$(links[i]).find('img').length) { var match = links[i].href.match(/\/seek\/cache_details\.aspx\?guid=(.*)/); if (match[1]) { links[i].parentNode.innerHTML += " "; } } } } } catch(e) {gclh_error("Edit and Image Links to own caches in profile",e);} } // Improve owned caches list. if (document.location.href.match(/\.com\/my\/owned\.aspx/)) { try { function showActive() { for (var i = 0; i < links.length; i++) { var archived = links[i].classList.contains("OldWarning"); if (archived) links[i].parentNode.parentNode.setAttribute('style', 'display: none'); else links[i].parentNode.parentNode.removeAttribute('style'); } if (settings_show_button_for_hide_archived) { button.value = 'Show all'; button.onclick = showAll; } } function showAll() { for (var i = 0; i < links.length; i++) { var archived = links[i].classList.contains("OldWarning"); if (archived) links[i].parentNode.parentNode.removeAttribute('style'); } button.value = 'Show archived'; button.onclick = showArchived; } function showArchived() { for (var i = 0; i < links.length; i++) { var archived = links[i].classList.contains("OldWarning"); if (archived) links[i].parentNode.parentNode.removeAttribute('style'); else links[i].parentNode.parentNode.setAttribute('style', 'display: none'); } button.value = 'Show active'; button.onclick = showActive; } var links = $('#divContentMain tbody tr a.lnk'); var archivedCaches = 0; for (let i=0; i loaded) { if ($('tr')[loaded-1].children[2] && $('tr')[loaded-1].children[2].innerHTML.match(/(\S+)/)) var lastLog = loaded-1; else if ($('tr')[loaded-2].children[2] && $('tr')[loaded-2].children[2].innerHTML.match(/(\S+)/)) var lastLog = loaded-2; else var lastLog = ""; if (lastLog != "") var dateLastLog = ". Last date is " + $('tr')[lastLog].children[2].innerHTML.replace(/\s/g, ""); else var dateLastLog = ""; result.innerHTML = result.innerHTML + " (Only " + loaded + " logs loaded" + dateLastLog + ".)"; } } // Do not break the "View log" column. $('table.Table tr').find('td:last').css('white-space', 'nowrap'); } catch(e) {gclh_error("Stopped logs loading",e);} } } // Add selectable month and year in calendar of cache and trackable logs. function onChangeCalendarSelect(event) { const selectedYear = $("#selectYearEl").val(); const selectedMonth = $("#selectMonthEl").val(); const ONE_DAY = 1000 * 60 * 60 * 24; const GC_ERA_MS = new Date(2000, 0, 2).getTime(); const selectedDate = new Date(selectedYear, selectedMonth, 1); const difference_ms = Math.abs(selectedDate.getTime() - GC_ERA_MS); const daysFromGCEra = Math.round(difference_ms/ONE_DAY) + 1; __doPostBack('ctl00$ContentBody$MyCalendar', 'V'+daysFromGCEra); } function appendOptionalEl(selectEl, value, text, isSelected) { const optEl = document.createElement("option"); optEl.setAttribute("value", value); if (isSelected) optEl.setAttribute("selected", "selected"); const textNode = document.createTextNode(text); optEl.appendChild(textNode); selectEl.appendChild(optEl); } if (document.location.href.match(/\.com\/my\/geocaches\.aspx/) || document.location.href.match(/\.com\/my\/travelbugs\.aspx/)) { try { const selectYearEl = document.createElement("select"); selectYearEl.id = 'selectYearEl'; selectYearEl.onchange = onChangeCalendarSelect; const selectMonthEl = document.createElement("select"); selectMonthEl.id = 'selectMonthEl'; selectMonthEl.onchange = onChangeCalendarSelect; var calendarHeaderElements = $("#ctl00_ContentBody_MyCalendar").find("tbody tr:first td table tbody tr td:nth-child(2)"); if (calendarHeaderElements.length > 0) { var selectedCalendar = calendarHeaderElements.text().split(" "); var CURRENT_YEAR = selectedCalendar[0]; var CURRENT_MONTH = selectedCalendar[1]; calendarHeaderElements.empty(); calendarHeaderElements.append(selectYearEl); calendarHeaderElements.append(document.createTextNode(" ")); calendarHeaderElements.append(selectMonthEl); const LAST_YEAR = new Date().getFullYear(); for (var year = 2000; year <= LAST_YEAR; year++) { appendOptionalEl(selectYearEl, year, year, (year == CURRENT_YEAR)); } for (var month = 0; month < 12; month++) { var objDate = new Date(); objDate.setMonth(month); var locale = "en-us"; var monthText = objDate.toLocaleString(locale, { month: "long" }); appendOptionalEl(selectMonthEl, month, monthText, (monthText == CURRENT_MONTH)); } } appendCssStyle('select {color: #594a42;}'); } catch(e) {gclh_error("Add selectable month and year in calendar",e);} } // Show warning for not available images. if (settings_img_warning && is_page("cache_listing")) { try { // Images in listing. function checkImage(element, newUrl, oldUrl) { if (!element.src) return; var img = new Image(); img.onerror = function(){ var hlp = element.title + '\n\n'; element.title = hlp.trim() + element.src; element.src = newUrl; element.ondblclick = function(){ alert('Original image URL:\n\n' + oldUrl); }; }; img.src = element.src; } // Background image. function checkBGImage(element, newUrl) { var img = new Image(); if (element.background.length == 0) return; img.onerror = function(){ element.background = newUrl; }; img.src = element.background; } // Check images in listing. var a = $('#ctl00_ContentBody_ShortDescription img, #ctl00_ContentBody_LongDescription img'); for (var i = 0; i < a.length; i++) { checkImage(a[i], urlImagesSvg+'image_not_available.svg', a[i].src); } // Check background image. var a = $('body'); for (var i = 0; i < a.length; i++) { checkBGImage(a[i], urlImagesSvg+'image_not_available_background.svg'); } } catch(e) {gclh_error("Show warning for not available images",e);} } // Save home coords. if (document.location.href.match(/\.com\/account\/settings\/homelocation/)) { try { function saveHomeCoordsWait(waitCount) { if ($('#Query')[0] && $('#map-canvas')[0]) { // Handle current home coords. saveHomeCoords(); // Handle changed home coords. var observerBody = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { saveHomeCoords(); }); }); var target = document.querySelector('#map-canvas'); var config = { attributes: true, subtree: true }; observerBody.observe(target, config); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){saveHomeCoordsWait(waitCount);}, 100);} } saveHomeCoordsWait(0); } catch(e) {gclh_error('Save home coords',e);} } function saveHomeCoords() { var link = $('#Query')[0]; if (link) { var latlng = toDec(link.value); if (latlng) { if (getValue('home_lat', 0) != parseInt(latlng[0] * 10000000) || getValue('home_lng', 0) != parseInt(latlng[1] * 10000000)) { // Save home coords. setValue('home_lat', parseInt(latlng[0] * 10000000)); setValue('home_lng', parseInt(latlng[1] * 10000000)); // Set home coords in config, if opened. if ($('#settings_home_lat_lng')[0]) { $('#settings_home_lat_lng')[0].value = DectoDeg(getValue("home_lat"), getValue("home_lng")); } // Set home coords in links of linklist. setSpecialLinks(); } } } } // Save uid of own trackable from dashboard. if (is_page("profile") || is_page("dashboard")) { try { var link = $('a[href*="/track/search.aspx?o=1&uid="]')[0]; if (link) { var uid = link.href.match(/\/track\/search\.aspx\?o=1\&uid=(.*)/); if (uid && uid[1]) { if (getValue("uid", "") != uid[1]) setValue("uid", uid[1]); } } } catch(e) {gclh_error("Save uid of own trackable",e);} } // Add links to finds and hides on new profilpage. if (is_page("publicProfile") && $('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(1)')[0] && $('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(2)')[0]) { try { $('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(1)')[0].innerHTML = '' + $('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(1)')[0].innerHTML + ''; $('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(2)')[0].innerHTML = '' + $('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(2)')[0].innerHTML + ''; function deleteSpaceBeforeCounts(waitCount) { if ($('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(1)')[0].innerHTML.match(/\s/)) $('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(1)')[0].innerHTML = $('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(1)')[0].innerHTML.replace(/\s/, ''); if ($('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(2)')[0].innerHTML.match(/>\s/)) $('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(2)')[0].innerHTML = $('#ctl00_ProfileHead_ProfileHeader_divStats ul > li:nth-child(2)')[0].innerHTML.replace(/>\s/, '>'); waitCount++; if (waitCount <= 50) setTimeout(function(){deleteSpaceBeforeCounts(waitCount);}, 100); } deleteSpaceBeforeCounts(0); appendCssStyle('#ctl00_ProfileHead_ProfileHeader_divStats a:hover {color: #02874d;} #ctl00_ProfileHead_ProfileHeader_divStats a {color: #4a4a4a;} #ctl00_ProfileHead_ProfileHeader_divStats img {vertical-align: text-top;}'); } catch(e) {gclh_error("Add links to finds and hides on new profilpage",e);} } // Change new links to found/hide caches to the old link on profile page. if (settings_profile_old_links && is_page("publicProfile") && document.location.search.match(/tab=geocaches/)) { // All founds. if ($('.finds-col-header .minorDetails a')[0]) $('.finds-col-header .minorDetails a')[0].href = '/seek/nearest.aspx?ul='+urlencode($('#ctl00_ProfileHead_ProfileHeader_lblMemberName')[0].innerHTML); // All hides. if ($('.hides-col-header .minorDetails a')[0]) $('.hides-col-header .minorDetails a')[0].href = '/seek/nearest.aspx?u='+urlencode($('#ctl00_ProfileHead_ProfileHeader_lblMemberName')[0].innerHTML); $('.finds-col table tbody tr a, .hides-col table tbody tr a').each(function() { // Cache type founds. let match = /\/play\/search\?types=(\d+).*&sc=(False|True)&fb=([^&]+).*/gi.exec(this.href); if (match) { this.href = '/seek/nearest.aspx?ul=' + urlencode($('#ctl00_ProfileHead_ProfileHeader_lblMemberName')[0].innerHTML) + getCacheTx(match[1]); } // Cache type hides. match = /\/play\/search\?types=(\d+).*&sc=(False|True)&owner\[0\]=([^&]+).*/gi.exec(this.href); if (match) { this.href = '/seek/nearest.aspx?u=' + urlencode($('#ctl00_ProfileHead_ProfileHeader_lblMemberName')[0].innerHTML) + getCacheTx(match[1]); } }); } // Hide GC Avatar Option. if (settings_load_logs_with_gclh && document.location.href.match(/\.com\/account\/settings\/preferences/) && $('#ShowAvatarsInCacheLogs')[0]) { try { var check = $('#ShowAvatarsInCacheLogs')[0]; check.checked = !settings_hide_avatar; check.disabled = true; var head = check.parentNode; head.style.cursor = "unset"; head.style.opacity = "0.5"; var link = document.createElement("a"); link.setAttribute("href", "/my/default.aspx#GClhShowConfig#a#settings_hide_avatar"); link.appendChild(document.createTextNode("here")); var hinweis = document.createElement("span"); hinweis.setAttribute("class", "label"); hinweis.appendChild(document.createTextNode("You are using GC little helper II - you have to change this option ")); hinweis.appendChild(link); hinweis.appendChild(document.createTextNode(".")); head.appendChild(hinweis); var units = $("#DistanceUnits:checked").val(); if (units != settings_distance_units) { setValue('settings_distance_units', units); settings_distance_units = units; } } catch(e) {gclh_error("Hide GC Avatar Option",e);} } // Aufbau Links zum Aufruf von Config, Sync und Find Player (2. Schritt). Und Changelog im Profile. try { // (1. Schritt: Siehe function buildSpecialLinklistLinks.) // GClh Config, Sync und Find Player Aufrufe mit Zusatz #GClhShowConfig bzw. #GClhShowSync bzw. #GClhShowFindPlayer. // 2. Schritt derzeit im Link bei Settings, Preferences Avatar, teils in den Links aus der Linklist, mit rechter Maustaste aus Links neben // Avatar auf Profile Seite und teils F4 bei Aufruf Config. if (document.location.href.match(/#GClhShowConfig/)) { document.location.href = clearUrlAppendix(document.location.href, true); setTimeout(gclh_showConfig, 5); } if (document.location.href.match(/#GClhShowSync/)) { document.location.href = clearUrlAppendix(document.location.href, true); setTimeout(gclh_showSync, 5); } if (document.location.href.match(/#GClhShowFindPlayer/)) { document.location.href = clearUrlAppendix(document.location.href, true); setTimeout(createFindPlayerForm, 5); } // Old Dashboard (Profile), Dashboard Seite. if ((is_page('profile') && $('#ctl00_ContentBody_WidgetMiniProfile1_memberProfileLink')[0]) || (is_page("dashboard") && $('.bio-meta'))) { // Config, Sync und Changelog Links beim Avatar in Profile, Dashboard. var lnk_config = "GClh II Config"; var lnk_sync = " | GClh II Sync"; var lnk_changelog = " | Changelog"; if (is_page('profile')) $('#ctl00_ContentBody_WidgetMiniProfile1_memberProfileLink')[0].parentNode.innerHTML += " |
        " + lnk_config + lnk_sync + lnk_changelog; else $('.bio-meta')[0].innerHTML += lnk_config + lnk_sync + lnk_changelog; appendCssStyle(".bio-meta {font-size: 12px;} .bio-meta a:hover {color: #02874d;}"); $('#gclh_config_lnk')[0].addEventListener('click', gclh_showConfig, false); $('#gclh_sync_lnk')[0].addEventListener('click', gclh_showSync, false); // Linklist Ablistung rechts im Profile. if (document.getElementsByName("lnk_gclhconfig_profile")[0]) { document.getElementsByName("lnk_gclhconfig_profile")[0].href = "#GClhShowConfig"; document.getElementsByName("lnk_gclhconfig_profile")[0].addEventListener('click', gclh_showConfig, false); } if (document.getElementsByName("lnk_gclhsync_profile")[0]) { document.getElementsByName("lnk_gclhsync_profile")[0].href = "#GClhShowSync"; document.getElementsByName("lnk_gclhsync_profile")[0].addEventListener('click', gclh_showSync, false); } if (document.getElementsByName("lnk_findplayer_profile")[0]) { document.getElementsByName("lnk_findplayer_profile")[0].href = "#GClhShowFindPlayer"; document.getElementsByName("lnk_findplayer_profile")[0].addEventListener('click', createFindPlayerForm, false); } } } catch(e) {gclh_error("Aufbau Links zum Aufruf von Config, Sync und Find Player (2. Schritt)",e);} // Build link to config and sync in script manager menue. try { function configFromMenuCommand() { if (checkTaskAllowed('Config', false) == true) gclh_showConfig(); else document.location.href = defaultConfigLink; } function syncFromMenuCommand() { if (checkTaskAllowed('Sync', false) == true) gclh_showSync(); else document.location.href = defaultSyncLink; } if (settings_call_config_via_sriptmanager) GM_registerMenuCommand('configure', configFromMenuCommand); if (settings_call_sync_via_sriptmanager) GM_registerMenuCommand('synchronize', syncFromMenuCommand); } catch(e) {} // Ignore error. // Eingaben im Search Field verarbeiten. if (document.location.href.match(/\.com\/seek\/nearest\.aspx\?navi_search=/)) { try { var matches = document.location.href.match(/\?navi_search=(.*)/); if (matches && matches[1]) { $('#OriginText')[0].value = urldecode(matches[1]).replace(/%20/g, " "); function clickSearch() {$('#btnLocale')[0].click();} window.addEventListener("load", clickSearch, false); } } catch(e) {gclh_error("Eingaben im Search Field verarbeiten",e);} } // Append '&visitcount=1' to all geochecker.com links. if (settings_visitCount_geocheckerCom && is_page("cache_listing")) { try { $('#ctl00_ContentBody_LongDescription a[href^="https://www.geochecker.com/index.php?code="]').filter(':not([href*="visitcount=1"])').attr('href', function(i, str) { return str + '&visitcount=1'; }).attr('rel', 'noreferrer'); } catch(e) {gclh_error("Append '&visitcount=1' to all geochecker.com links",e);} } // Auto check checkbox on hide cache process. if (settings_hide_cache_approvals && document.location.href.match(/\.com\/hide\/(report|description|edit)\.aspx/)) { try { $("#ctl00_ContentBody_cbAgreement").prop('checked', true); $("#ctl00_ContentBody_chkUnderstand").prop('checked', true); $("#ctl00_ContentBody_chkDisclaimer").prop('checked', true); $("#ctl00_ContentBody_chkAgree").prop('checked', true); } catch(e) {gclh_error("Auto check checkbox on hide cache process",e);} } // Show length of hint, cachename and placed by on hide edit page. if (document.location.href.match(/\.com\/hide\/(report|description|edit)\.aspx/)) { try { var name = ($('#tbNickname')[0] ? $('#tbNickname')[0] : $('#ctl00_ContentBody_tbGeocacheName')[0]); var placedBy = ($('#tbPlacedBy')[0] ? $('#tbPlacedBy')[0] : $('#ctl00_ContentBody_tbPlacedBy')[0]); var hint = ($('#tbHints')[0] ? $('#tbHints')[0] : $('#tbHint')[0]) function createCounterElement(countername, textbox, maxLength) { var counterelement = document.createElement('span'); var counterspan = document.createElement('p'); counterspan.style = 'margin-bottom: 0px'; counterspan.id = countername; counterspan.innerHTML = "Length: "; counterelement.innerHTML = "" + $(textbox).val().replace(/\n/g, "\r\n").length + "/" + maxLength + ""; counterspan.appendChild(counterelement); textbox.parentNode.append(counterspan); } createCounterElement('nameCounter', name, 50); createCounterElement('placedByCounter', placedBy, 50); createCounterElement('hintCounter', hint, 250); name.addEventListener("keyup", function() {limitedField(name, document.querySelector('#nameCounter span'), 50);}, false); name.addEventListener("change", function() {limitedField(name, document.querySelector('#nameCounter span'), 50);}, false); placedBy.addEventListener("keyup", function() {limitedField(placedBy, document.querySelector('#placedByCounter span'), 50);}, false); placedBy.addEventListener("change", function() {limitedField(placedBy, document.querySelector('#placedByCounter span'), 50);}, false); hint.addEventListener("keyup", function() {limitedField(hint, document.querySelector('#hintCounter span'), 250);}, false); hint.addEventListener("change", function() {limitedField(hint, document.querySelector('#hintCounter span'), 250);}, false); var css = '#nameCounter, #placedByCounter, #hintCounter {text-align: right;}'; css += '#nameCounter, #placedByCounter {width: 400px;}'; appendCssStyle(css); } catch(e) {gclh_error("Show length of hint, cachename and placed by on hide edit page",e);} } // Improve Souvenirs. if ( is_page("souvenirs") || is_page("publicProfile") ) { try { var css = ''; css += '.gclhShow {margin-right: 4px;}'; css += '.gclhShow input {background-image: inherit;}'; css += '.gclhShow input.active {background-color: #a9a9a9cf;}'; css += '.gclhShow input:hover {cursor: pointer; background-color: aliceblue;}'; css += '.gclhShowCountry:not(.active), .gclhShowState:not(.active), .gclhShowOther:not(.active) {display: none;}'; css += '.ProfileSouvenirsList div {margin-left: 0 !important;}'; css += '.souvenir-gallery-list li {width: 175px !important;}'; appendCssStyle(css); var Souvenirs = $("#souvenirsList li"); var htmlFragment = " ("+Souvenirs.length+")"; $("#divContentMain > h2").append(htmlFragment); // private profile $("#ctl00_ContentBody_ProfilePanel1_pnlSouvenirs > h3").append(htmlFragment); // new public profile function checkSouvenirsDashboard(waitCount) { var SouvenirsDashboard = $("#souvenirsControlsContainer .sort-select-group"); if (SouvenirsDashboard.length) { function correctSouvenirName(name) { name = name.replace(/(^\s|\s$)/g,''); if (name == 'Åland Islands') name = 'Aland Islands'; if (name == 'Česká Republika') name = 'Czechia'; if (name == 'China (中国)') name = 'China'; if (name == 'Commonwealth of the Bahamas') name = 'Bahamas'; if (name == 'Deutschland') name = 'Germany'; if (name == 'Montenegro | Црна Гора | Crna Gora') name = 'Montenegro'; if (name == 'România') name = 'Romania'; if (name == 'Rzeczpospolita Polska') name = 'Poland'; if (name == 'Singapore (Republik Singapura)') name = 'Singapore'; if (name == 'Slovenská republika') name = 'Slovakia'; if (name == 'United States of America') name = 'United States'; if (name == 'Yukon') name = 'Yukon Territory'; return name; } function prepareSouvenirs() { $('#souvenirsList li').each(function() { var ident = ''; var name = $(this).find('a:first')[0].title; if (name) { name = correctSouvenirName(name); var country = $.grep(country_id, function(e){return e.n == name;}); if (country && country[0]) { ident = 'gclhShowCountry'; } else { var name = name.replace(/\sstate$/i,''); var state = $.grep(states_id, function(e){return e.n == name;}); if (state && state[0]) { ident = 'gclhShowState'; } else { ident = 'gclhShowOther'; } } $(this).addClass(ident+' active'); } }); $('.gclhShow input').each(function() { $(this)[0].disabled = ""; $(this)[0].style.opacity = "1"; }); } function showSouvenirs(button) { if ($(button).hasClass('active')) { $(button).removeClass('active'); $('#souvenirsList li.'+$(button)[0].id).each(function() {$(this).removeClass('active');}); } else { $(button).addClass('active'); $('#souvenirsList li.'+$(button)[0].id).each(function() {$(this).addClass('active');}); } var nr = $('#souvenirsList .active').length; if (nr == Souvenirs.length) $('#gclhNumberSouvenirs')[0].innerHTML = '(' + Souvenirs.length + ')'; else $('#gclhNumberSouvenirs')[0].innerHTML = '(' + nr + '/' + Souvenirs.length + ')'; } SouvenirsDashboard.append('  |  Show  '); SouvenirsDashboard.append(''); SouvenirsDashboard.append(''); prepareSouvenirs(); $("#gclhShowCountry").click(function() {showSouvenirs(this);}); $("#gclhShowState").click(function() {showSouvenirs(this);}); $("#gclhShowOther").click(function() {showSouvenirs(this);}); } else {waitCount++; if (waitCount <= 25) setTimeout(function(){checkSouvenirsDashboard(waitCount);}, 200);} } checkSouvenirsDashboard(0); } catch(e) {gclh_error("Improve Souvenirs",e);} } // Show smaller privacy buttons - has to run after Souveniers. if (settings_public_profile_smaller_privacy_btn && isOwnPublicProfile()) { try { let url = document.location.href; if (url.match(/tab=geocaches/i)) { if (!$('#ctl00_ContentBody_ProfilePanel1_geocachesPrivacyIcon')[0]) return; let link = $('#full-privacy-text a').attr('href'); let icon = $('#ctl00_ContentBody_ProfilePanel1_geocachesPrivacyIcon').attr('src'); $('#ctl00_ContentBody_ProfilePanel1_geocachesOwnerViewSettings').hide(); $('.finds-col-header h3').append(` `); $('.finds-col-header .minorDetails').html(' '+$('.finds-col-header .minorDetails').html()); $('#ctl00_ContentBody_ProfilePanel1_geocachesHideOwnerViewSettings').hide(); $('.hides-col-header h3').append(` `); $('.hides-col-header .minorDetails').html(' '+$('.hides-col-header .minorDetails').html()); } else if (url.match(/tab=trackables/i)) { if (!$('#ctl00_ContentBody_ProfilePanel1_trackablesOwnerViewSettings')[0]) return; let link = $('#ctl00_ContentBody_ProfilePanel1_trackablesOwnerViewSettings a').attr('href'); $('#ctl00_ContentBody_ProfilePanel1_trackablesOwnerViewSettings').hide(); $('h3').append(` `); } else if (url.match(/tab=souvenirs/i)) { if (!$('#ctl00_ContentBody_ProfilePanel1_souvenirsPrivacyIcon')[0]) return; let link = $('#ctl00_ContentBody_ProfilePanel1_souvenirsOwnerViewSettings a').attr('href'); let icon = $('#ctl00_ContentBody_ProfilePanel1_souvenirsPrivacyIcon').attr('src'); $('#ctl00_ContentBody_ProfilePanel1_souvenirsOwnerViewSettings').hide(); $('h3').append(` `); } else if (url.match(/tab=gallery/i)) { if (!$('#ctl00_ContentBody_ProfilePanel1_galleryPrivacyIcon')[0]) return; let link = $('#ctl00_ContentBody_ProfilePanel1_galleryOwnerViewSettings a').attr('href'); let icon = $('#ctl00_ContentBody_ProfilePanel1_galleryPrivacyIcon').attr('src'); $('#ctl00_ContentBody_ProfilePanel1_galleryOwnerViewSettings').hide(); $('h3').append(` `); } else if (url.match(/tab=stats/i)) { if (!$('#ctl00_ContentBody_ProfilePanel1_statisticsPrivacyIcon')[0]) return; let link = $('#ctl00_ContentBody_ProfilePanel1_statisticsOwnerViewSettings a').attr('href'); let icon = $('#ctl00_ContentBody_ProfilePanel1_statisticsPrivacyIcon').attr('src'); $('#ctl00_ContentBody_ProfilePanel1_statisticsOwnerViewSettings').hide(); $('h3').first().append(` `); } else if (!url.match(/tab=lists/i)) { // Profilinformationen if (!$('#ctl00_ContentBody_ProfilePanel1_profilePrivacyIcon')[0]) return; let link = $('#ctl00_ContentBody_ProfilePanel1_profileOwnerViewSettings a').attr('href'); let icon = $('#ctl00_ContentBody_ProfilePanel1_profilePrivacyIcon').attr('src'); $('#ctl00_ContentBody_ProfilePanel1_profileOwnerViewSettings').hide(); $('h3').append(` `); } let css = 'h3 {display:flex;}'; css += '.gclh_privacy {display: inline-flex;}'; css += '.gclh_privacy img {align-self: end;}'; css += '.minorDetails {align-self: center; padding-top: 4px;}'; appendCssStyle(css); } catch(e) {gclh_error("Replace privacy text links by icon link",e);} } // Improve view log and edit log page. if (document.location.href.match(/\.com\/(seek|track)\/log\.aspx\?/)) { // Improve alignment of icons. appendCssStyle('.logPanel h3 img {vertical-align: baseline;}'); } // Improve trackable search page. if (document.location.href.match(/\.com\/track\/travelbug\.aspx/)) { try { function waitForTrackablePage(waitCount) { if ($('#ctl00_ContentBody_txtTBCode')[0] && $('#ctl00_ContentBody_btnTBLookup')[0]) { // Place the cursor directly in the input field with the start of the page. $('#ctl00_ContentBody_txtTBCode')[0].focus(); // Enable the search to be started by pressing the Enter key. $('#ctl00_ContentBody_txtTBCode')[0].addEventListener("keyup", searchTrackable, false); function searchTrackable(e) { if (e.type == 'keyup' && e.keyCode == 13 && noSpecialKey(e) == true) { $('#ctl00_ContentBody_btnTBLookup')[0].click(); } } } else {waitCount++; if (waitCount <= 100) setTimeout(function(){waitForTrackablePage(waitCount);}, 100);} } waitForTrackablePage(0); } catch(e) {gclh_error("Improve trackable search page",e);} } // Improve notification list and notifications. if (document.location.href.match(/\.com\/notify\/(default|edit)\.aspx/) && settings_improve_notifications) { try { function disableAllFieldsNotif() { $('input,select').each(function(){ $(this)[0].setAttribute('disabled', ''); $(this)[0].style.opacity = '0.5'; }); } function enableAllFieldsNotif(all) { $('input,select').each(function(){ $(this)[0].removeAttribute('disabled', ''); if (all) $(this)[0].style.opacity = '1'; }); } function setValueNotif(c, sel) { if ($(c).find(sel)[0] && $(c).find(sel)[0].value != $(sel)[0].value) { $(sel)[0].value = $(c).find(sel)[0].value; } } function setSelectOptionNotif(c, sel) { if ($(c).find(sel)[0] && $(c).find(sel)[0].selectedIndex != $(sel)[0].selectedIndex) { $(sel+' option')[$(c).find(sel)[0].selectedIndex].selected = true; } } function successMessageNotif(mess) { $('#ctl00_ContentBody_divPremiumMemberText').before('

        ' + mess + '

        '); } function prepareCopyNotif(nid) { disableAllFieldsNotif(); $.get('https://www.geocaching.com/notify/edit.aspx?NID=' + nid, null, function(c){ // First call of the page. if (document.location.href.match(/#first/)) { // Set notification name to 10 blanks, so we can recognize the second call of the page. $('#ctl00_ContentBody_LogNotify_tbName')[0].value = ' '; // Select cachetype and trigger a reload of the page. if ($('#ctl00_ContentBody_LogNotify_ddTypeList')[0].selectedIndex == 0) { setSelectOptionNotif(c, '#ctl00_ContentBody_LogNotify_ddTypeList'); enableAllFieldsNotif(); $("#ctl00_ContentBody_LogNotify_ddTypeList").trigger("change"); } } else { // Set the log type fields. $('#ctl00_ContentBody_LogNotify_cblLogTypeList input').each(function(){ $(this)[0].removeAttribute('checked'); }); $(c).find('#ctl00_ContentBody_LogNotify_cblLogTypeList input[checked="checked"]').each(function(){ if ($(this)[0].value && $('#ctl00_ContentBody_LogNotify_cblLogTypeList input[value="'+$(this)[0].value+'"]')[0]) { $('#ctl00_ContentBody_LogNotify_cblLogTypeList input[value="'+$(this)[0].value+'"]')[0].checked = 'checked'; } }); // Second call of the page where all fields are copied. if ($('#ctl00_ContentBody_LogNotify_tbName')[0].value == ' ') { setValueNotif(c, '#ctl00_ContentBody_LogNotify_tbName'); setSelectOptionNotif(c, '#ctl00_ContentBody_LogNotify_LatLong\\:_selectNorthSouth'); setSelectOptionNotif(c, '#ctl00_ContentBody_LogNotify_LatLong\\:_selectEastWest'); setValueNotif(c, '#ctl00_ContentBody_LogNotify_LatLong__inputLatDegs'); setValueNotif(c, '#ctl00_ContentBody_LogNotify_LatLong__inputLatMins'); setValueNotif(c, '#ctl00_ContentBody_LogNotify_LatLong__inputLatSecs'); setValueNotif(c, '#ctl00_ContentBody_LogNotify_LatLong__inputLongDegs'); setValueNotif(c, '#ctl00_ContentBody_LogNotify_LatLong__inputLongMins'); setValueNotif(c, '#ctl00_ContentBody_LogNotify_LatLong__inputLongSecs'); setValueNotif(c, '#ctl00_ContentBody_LogNotify_tbDistance'); setSelectOptionNotif(c, '#ctl00_ContentBody_LogNotify_ddlAltEmails'); successMessageNotif('Input fields copied.'); } else { successMessageNotif('Log type fields copied.'); } enableAllFieldsNotif(true); processCoordsNotif(first = true, e = false, field = false); } }); } function getCoordsFromFieldsNotif(data) { var coords = ''; var sel = '#ctl00_ContentBody_LogNotify_LatLong\\:_selectNorthSouth'; coords += $(data).find(sel+' option')[$(data).find(sel)[0].selectedIndex].innerHTML; coords += $(data).find('#ctl00_ContentBody_LogNotify_LatLong__inputLatDegs')[0].value + ' '; coords += $(data).find('#ctl00_ContentBody_LogNotify_LatLong__inputLatMins')[0].value + ' '; var sel = '#ctl00_ContentBody_LogNotify_LatLong\\:_selectEastWest'; coords += $(data).find(sel+' option')[$(data).find(sel)[0].selectedIndex].innerHTML; coords += $(data).find('#ctl00_ContentBody_LogNotify_LatLong__inputLongDegs')[0].value + ' '; coords += $(data).find('#ctl00_ContentBody_LogNotify_LatLong__inputLongMins')[0].value; return coords; } function setCoordsToFieldsNotif(NS, LatD, LatM, EW, LongD, LongM) { $('#ctl00_ContentBody_LogNotify_LatLong\\:_selectNorthSouth option[value="' + (NS == 'N' ? '1':'-1') + '"]').attr('selected', true); $('#ctl00_ContentBody_LogNotify_LatLong__inputLatDegs').val(LatD); $('#ctl00_ContentBody_LogNotify_LatLong__inputLatDegs').trigger("change"); $('#ctl00_ContentBody_LogNotify_LatLong__inputLatMins').val(LatM); $('#ctl00_ContentBody_LogNotify_LatLong__inputLatMins').trigger("change"); $('#ctl00_ContentBody_LogNotify_LatLong\\:_selectEastWest option[value="' + (EW == 'E' ? '1':'-1') + '"]').attr('selected', true); $('#ctl00_ContentBody_LogNotify_LatLong__inputLongDegs').val(LongD); $('#ctl00_ContentBody_LogNotify_LatLong__inputLongDegs').trigger("change"); $('#ctl00_ContentBody_LogNotify_LatLong__inputLongMins').val(LongM); $('#ctl00_ContentBody_LogNotify_LatLong__inputLongMins').trigger("change"); } function processCoordsNotif(first, e, field) { setTimeout(function() { if (first || (e && (e.type == 'focusout' || e.type == 'change' || e.type == 'keydown' && e.keyCode == 13))) { // Set coords from standard fields to new field. if (first || field.id != 'gclh_degs_value') { if (window.getComputedStyle($('#ctl00_ContentBody_LogNotify_LatLong__requiredLatDeg')[0]).display != 'none' || window.getComputedStyle($('#ctl00_ContentBody_LogNotify_LatLong__validatorLatDegs')[0]).display != 'none' || window.getComputedStyle($('#ctl00_ContentBody_LogNotify_LatLong__requiredLatMins')[0]).display != 'none' || window.getComputedStyle($('#ctl00_ContentBody_LogNotify_LatLong__validatorLatMins')[0]).display != 'none' || window.getComputedStyle($('#ctl00_ContentBody_LogNotify_LatLong__requiredLongDeg')[0]).display != 'none' || window.getComputedStyle($('#ctl00_ContentBody_LogNotify_LatLong__validatorLongDegs')[0]).display != 'none' || window.getComputedStyle($('#ctl00_ContentBody_LogNotify_LatLong__requiredLongMins')[0]).display != 'none' || window.getComputedStyle($('#ctl00_ContentBody_LogNotify_LatLong__validatorLongMins')[0]).display != 'none') { $('#gclh_degs span')[0].innerHTML = 'The coordinates entered above are incorrect. Fields are marked.'; } else { var coords = getCoordsFromFieldsNotif($('table.LatLongTable tbody')[0]); if (!coords || coords == 'N E ') $('#gclh_degs_value')[0].value = ''; else $('#gclh_degs_value')[0].value = coords; $('#gclh_degs span')[0].innerHTML = ''; } // Set coords from new field to standard fields. } else { setCoordsToFieldsNotif('N', '', '', 'W', '', ''); $('#gclh_degs span')[0].innerHTML = ''; var m = $('#gclh_degs_value')[0].value.match(/^\s*(N|n|S|s)\s*(\d{1,3})(\s*°\s*|\s+)(\d{1,2}[\.,;]?\d{0,3})(\s*['`´]\s*|\s+)(E|e|W|w)\s*(\d{1,3})(\s*°\s*|\s+)(\d{1,2}[\.,;]?\d{0,3})(\s*['`´]\s*|\s*)$/); if (m && m.length == 11) { setCoordsToFieldsNotif(m[1].replace('n','N').replace('s','S'), m[2], m[4].replace(/(,|;)/,'.'), m[6].replace('e','E').replace('w','W'), m[7], m[9].replace(/(,|;)/,'.')); } else if ($('#gclh_degs_value')[0].value != '') { $('#gclh_degs span')[0].innerHTML = 'The coordinates entered are incorrect.'; } } } }, 50); } function getNIDFromLineListNotif(notif) { return $(notif).find('td a')[0].id; } function expandLinesListNotif() { $('table.Table tbody tr').each(function(){ let nid = getNIDFromLineListNotif(this); var item = $(this); $(item).find('td.gclh_icons').before(''); $.get('https://www.geocaching.com/notify/edit.aspx?NID=' + nid, null, function(c){ var coords = getCoordsFromFieldsNotif(c); $(item).find('.gclh_coords')[0].innerHTML = coords; $(item).find('.gclh_dist')[0].innerHTML = $(c).find('#ctl00_ContentBody_LogNotify_tbDistance')[0].value; $(item).find('.gclh_mail')[0].innerHTML = $(c).find('#ctl00_ContentBody_LogNotify_ddlAltEmails')[0]?.value || $(c).find('a[href="/account/settings/emailpreferences"]').parent().prev('dd').html().trim(); $(item).find('.gclh_mail').addClass('gclh_add_last'); }); }); } function setTitleCheckboxListNotif(a) { a.title = (a.children[0].src.match('checkbox_off') ? 'click to enable\n(right click to enable all with same name)' : 'click to disable\n(right click to disable all with same name)'); } function clickEnableCheckboxListNotif(nid, a) { if ($(a).closest('tr').hasClass('gclh_disabled')) return; var img = $(a).find('img')[0]; if (img.src.match('ajax-loader.gif')) return; img.src = urlImages + 'ajax-loader.gif'; $.get('https://www.geocaching.com/notify/default.aspx?did=' + nid, null, function(c){ img.src = $(c).find('a[href="?did='+nid+'"] img')[0].src; img.alt = $(c).find('a[href="?did='+nid+'"] img')[0].alt; setTitleCheckboxListNotif(a); }); } function clickEnableCheckboxWithSameNameListNotif(a) { if ($(a).closest('tr').hasClass('gclh_disabled')) return; var imgA = $(a).find('img')[0]; if (imgA.src.match('ajax-loader.gif')) return; var srcA = imgA.src; var nameA = $(a).closest('tr').find('td:nth-child(3) a strong')[0].innerText; $('table.Table tbody tr').each(function(){ var nidB = getNIDFromLineListNotif(this); var cbB = $(this).find('td a')[0]; var srcB = $(cbB).find('img')[0].src; var nameB = $(cbB).closest('tr').find('td:nth-child(3) a strong')[0].innerText; if (srcB == srcA && nameB == nameA) clickEnableCheckboxListNotif(nidB, cbB); }); } function enableIconAdditionalDataListNotif(waitCount) { if ($('table.Table tbody tr').length == $('table.Table tbody .gclh_add_last').length) { $('#gclh_more').removeClass('gclh_working'); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){enableIconAdditionalDataListNotif(waitCount);}, 100);} } function sortTableListNotif(table, item, item2) { var tb = table.tBodies[0]; var tr = Array.prototype.slice.call(tb.rows, 0); // Set sort class and sort direction. if (!$(item).hasClass('gclh_sort_cur')) { $(table).find('.gclh_sort_cur').removeClass('gclh_sort_cur'); $(item).addClass('gclh_sort_cur'); } else if ($(item).hasClass('gclh_sort_asc')) { $(item).removeClass('gclh_sort_asc'); $(item).addClass('gclh_sort_desc'); } else if ($(item).hasClass('gclh_sort_desc')) { $(item).removeClass('gclh_sort_desc'); $(item).addClass('gclh_sort_asc'); } if (!$(item).hasClass('gclh_sort_asc') && !$(item).hasClass('gclh_sort_desc')) { $(item).addClass('gclh_sort_asc'); } if ($(item).hasClass('gclh_sort_asc')) var dir = 1; else var dir = -1; // Do sort. tr = tr.sort(function (a, b) { // First sort criteria. if ($(item).hasClass('gclh_col_enable')) { var aa = $(a.cells[item.cellIndex]).find('a img')[0].alt; var bb = $(b.cells[item.cellIndex]).find('a img')[0].alt; } else if ($(item).hasClass('gclh_col_icon')) { var aa = a.cells[item.cellIndex+2].textContent.trim(); var bb = b.cells[item.cellIndex+2].textContent.trim(); } else { var aa = a.cells[item.cellIndex].textContent.trim(); var bb = b.cells[item.cellIndex].textContent.trim(); } // Second sort criteria. if (item2 != '') { aa += a.cells[item2.cellIndex].textContent.trim(); bb += b.cells[item2.cellIndex].textContent.trim(); } return dir * (aa .localeCompare(bb)); }); // Set zebra background in lines. for (i = 0; i < tr.length; i = i+2) { $(tr[i]).removeClass('AlternatingRow'); if (tr[i+1]) $(tr[i+1]).addClass('AlternatingRow'); } // Build new table in sorted order. for(i = 0; i < tr.length; ++i) tb.appendChild(tr[i]); } function processAdditionalDataListNotif() { $('table.Table thead th:last').append(''); $('#gclh_more')[0].addEventListener('click', function() { if ($('#gclh_more').hasClass('gclh_working')) return; $('#gclh_more').addClass('gclh_working'); if (!$('table.Table thead th.gclh_add')[0]) { $('table.Table thead th.gclh_icons').before('CoordinateskmSend to'); $('table .gclh_col_coords')[0].addEventListener('click', function() {sortTableListNotif($('table.Table')[0], this, $('table .gclh_col_name')[0])}); $('table .gclh_col_dist')[0].addEventListener('click', function() {sortTableListNotif($('table.Table')[0], this, $('table .gclh_col_name')[0])}); $('table .gclh_col_mail')[0].addEventListener('click', function() {sortTableListNotif($('table.Table')[0], this, $('table .gclh_col_name')[0])}); expandLinesListNotif(); } enableIconAdditionalDataListNotif(0); if ($('#gclh_more').hasClass('gclh_icon_rotate_top')) { $('#gclh_more')[0].title = 'Hide additional data'; $('table.Table').removeClass('gclh_hide_add'); $('#gclh_more').removeClass('gclh_icon_rotate_top'); } else { $('#gclh_more')[0].title = 'Show additional data'; $('table.Table').addClass('gclh_hide_add'); $('#gclh_more').addClass('gclh_icon_rotate_top'); } }, false); } function processHidePageInfoListNotif() { $('table.Table thead th:last').append(''); $('.BreadcrumbWidget, #divContentMain h2, #ctl00_ContentBody_divPremiumMemberText').addClass('gclh_info'); $('p img[src="/images/icons/16/checkbox_on.png"]').closest('p').addClass('gclh_info'); $('#gclh_info')[0].addEventListener('click', function() { if ($('#gclh_info').hasClass('gclh_icon_rotate_top')) { $('#gclh_info')[0].title = 'Hide page info'; $('#divContentMain').removeClass('gclh_hide_info'); $('#gclh_info').removeClass('gclh_icon_rotate_top'); setValue('set_switch_notification_show_page_info', true); } else { $('#gclh_info')[0].title = 'Show page info'; $('#divContentMain').addClass('gclh_hide_info'); $('#gclh_info').addClass('gclh_icon_rotate_top'); setValue('set_switch_notification_show_page_info', false); } }, false); if (!getValue('set_switch_notification_show_page_info', true)) $('#gclh_info')[0].click(); } function getObjectsFromLineListNotif(line) { let notif = $(line).closest('tr'); let nid = getNIDFromLineListNotif(notif); let delIcon = $(notif).find('a.gclh_delete'); let workIcon = $(notif).find('span.gclh_work'); let undoIcon = $(notif).find('a.gclh_undo'); return [notif, nid, delIcon, workIcon, undoIcon]; } function deactivateLinksInLineListNotif(notif) { notif.addClass('gclh_disabled'); $(notif).find('a:not(.gclh_delete, .gclh_undo)').each(function(){ $(this)[0].setAttribute('save_href', $(this)[0].href); $(this)[0].href = 'javascript:void(0);'; }); } function activateLinksInLineListNotif(notif) { notif.removeClass('gclh_disabled'); $(notif).find('a:not(.gclh_delete, .gclh_undo)').each(function(){ $(this)[0].href = $(this)[0].getAttribute('save_href'); }); } function openPopupForLineListNotif(nid, name) { var openPopup = window.open('https://www.geocaching.com/notify/edit.aspx?NID=' + nid + '&' + name, nid, 'width=240, height=100, top=0, left=10000'); // Eigentlich sollte bei einem einzigen Pop up nach einem Klick gar kein Pop up Blocker anspringen. Falls das Pop up nicht geöffnet werden // kann, sollte aber auf jeden Fall eine Nachricht erfolgen. if (openPopup == null) { alert('The pop up could not be opened. A pop up blocker may be running. To use this feature, pop ups must be allowed for this website.'); } else { return openPopup; } } function checkStatusPopupForLineListNotif(waitCount, openPopup, beforeIcon, afterIcon, notifToActivate) { if (typeof openPopup !== 'undefined' && openPopup !== false && openPopup.closed) { beforeIcon.addClass('gclh_hide_icon'); afterIcon.removeClass('gclh_hide_icon'); if (notifToActivate) { activateLinksInLineListNotif(notifToActivate); } } else {setTimeout(function(){checkStatusPopupForLineListNotif(waitCount, openPopup, beforeIcon, afterIcon, notifToActivate);}, 250);} } function improveLinesListNotif() { $('table.Table tbody tr').each(function(){ var nid = $(this).find('a[href*="edit.aspx?NID="]')[0].href.match(/NID=(\d*)/); if (nid && nid[1]) { nid = nid[1]; var cellIcons = $(this).find('a[href*="edit.aspx?NID="]').closest('td')[0]; var itemCeckbox = $(this).find('a[href="?did='+nid+'"]')[0]; var itemCachetype = $(this).find('img[src*="/images/WptTypes/sm/"]').closest('td')[0]; var itemName = $(this).find('td:nth-child(3)')[0]; var itemCacheTypeName = $(this).find('td:nth-child(4)')[0]; var itemEdit = $(this).find('a[href*="edit.aspx?NID="]')[0]; // Mark the icons cell. $(cellIcons).addClass('gclh_icons'); // Handle checkbox for enable a notification. itemCeckbox.setAttribute('id', nid); itemCeckbox.setAttribute('href', 'javascript:void(0);'); setTitleCheckboxListNotif(itemCeckbox); itemCeckbox.addEventListener('click', function() {clickEnableCheckboxListNotif(nid, this);}, false); itemCeckbox.oncontextmenu = function(){return false;}; $(itemCeckbox).bind('contextmenu.new', function() {clickEnableCheckboxWithSameNameListNotif(this);}); // Replace cache type icon. var iconNo = itemCachetype.innerHTML.match(/images\/WptTypes\/sm\/(.+)\.gif/); var icon = ''; if (iconNo && iconNo[1] && iconNo[1].match(/^\d+$/)) icon = iconNo[1]; else if (iconNo[1] == 'earthcache') icon = 137; else if (iconNo[1] == 'maze') icon = 1304; if (icon != '') { itemCachetype.innerHTML = ''; $(itemCachetype).append(''); } // Build an edit link for Name / Log types. var name = itemName.innerHTML; itemName.innerHTML = ''; $(itemName).append('' + name + ''); // Build span tag for cache type name. var name = itemCacheTypeName.innerHTML; itemCacheTypeName.innerHTML = ''; $(itemCacheTypeName).append('' + name + ''); // Change edit link to icon. itemEdit.innerHTML = ''; itemEdit.setAttribute('title', 'Edit notification'); $(itemEdit).addClass('gclh_icon'); $(itemEdit).append(''); $(itemEdit).closest('td')[0].setAttribute('style', 'white-space: nowrap;'); // Build copy icon behind the edit icon. $(itemEdit).after(''); // Build delete icon, work icon and undo icon behind the edit icon. var itemDelete = ''; var itemWork = ''; var itemUndo = ''; $(itemEdit).after(itemDelete + itemWork + itemUndo); $(this).find('.gclh_delete')[0].addEventListener("click", function() { var [notif, nid, delIcon, workIcon, undoIcon] = getObjectsFromLineListNotif(this); if (delIcon.hasClass('gclh_hide_icon')) return; delIcon.addClass('gclh_hide_icon'); workIcon.prop('title', 'Waiting for deletion'); workIcon.removeClass('gclh_hide_icon'); deactivateLinksInLineListNotif(notif); var openPopup = openPopupForLineListNotif(nid, 'GClhDelete'); checkStatusPopupForLineListNotif(0, openPopup, workIcon, undoIcon); }, false); $(this).find('.gclh_undo')[0].addEventListener("click", function() { var [notif, nid, delIcon, workIcon, undoIcon] = getObjectsFromLineListNotif(this); if (undoIcon.hasClass('gclh_hide_icon')) return; undoIcon.addClass('gclh_hide_icon'); workIcon.prop('title', 'Waiting for undo deletion'); workIcon.removeClass('gclh_hide_icon'); var openPopup = openPopupForLineListNotif(nid, 'GClhUndo'); checkStatusPopupForLineListNotif(0, openPopup, workIcon, delIcon, notif); }, false); } }); } let css = ''; css += 'table.Table thead th {white-space: nowrap}'; css += 'table.Table.gclh_hide_add th.gclh_add, table.Table.gclh_hide_add td.gclh_add {display: none;}'; css += '.gclh_name {color: #4a4a4a !important; text-decoration: none !important;}'; css += '.gclh_disabled td > a:not(.gclh_delete, .gclh_undo), .gclh_disabled td > span:not(.gclh_work), .gclh_disabled td > svg {opacity: 0.4;}'; css += '.gclh_disabled a:not(.gclh_delete, .gclh_undo) {cursor: default;}'; css += '.gclh_hide_icon {display: none;}'; css += '.gclh_icons {width: 80px;}'; css += '.gclh_icon svg, .gclh_icon img {height: 18px; width: 18px; padding: 4px; vertical-align: middle; color: #4a4a4a;}'; css += '.gclh_delete svg {height: 20px; width: 20px; margin-top: 1px;}'; css += '.gclh_undo svg {height: 16px; width: 16px; margin-right: 2px; margin-left: 2px;}'; css += '.gclh_work img {height: 11px; width: 18px; vertical-align: middle; padding-left: 5px; padding-right: 5px;}'; css += '.gclh_icon_add svg {height: 20px; width: 20px; padding: 3px;}'; css += '.gclh_icon_cachetype {height: 24px; width: 24px;}'; css += '.gclh_hide_info .gclh_info {display: none;}'; css += '.gclh_icon_rotate_top svg {transform: rotate(180deg);}'; css += '.gclh_sortable {cursor: pointer;}'; css += '.gclh_sortable span::after {color: #4a4a4a; content: " "; background-image: url(/plan/public/429af344f6d770066f9793d26c2739a7.svg); background-repeat: no-repeat; display: inline-block; visibility: hidden; height: 12px; width: 12px; vertical-align: middle;}'; css += '.gclh_sort_cur span::after {visibility: visible;}'; css += '.gclh_sort_desc span::after {transform: rotate(180deg);}'; css += '#gclh_degs span {position: absolute; margin-left: 4px; margin-top: 3.5px;}'; css += 'table.LatLongTable td {padding-left: 0px;}'; css += '.Checkbox label {top: 0px;}'; css += '.EditNotificationForm table {margin-bottom: 0px;}'; // Improve notification list page. if (document.location.href.match(/\.com\/notify\/default\.aspx/) && $('table.Table tbody tr')[0]) { // Build headline for the notification list. $('table.Table tbody').before('Name / Log typesCache type'); // Build 'create' icon. $('table.Table thead th:last').append(''); // Process load, hide, show additional data. processAdditionalDataListNotif(); // Process hide, show page info. processHidePageInfoListNotif(); // Improve the notification lines. improveLinesListNotif(); // Build table sort. $('table .gclh_col_enable')[0].addEventListener('click', function() {sortTableListNotif($('table.Table')[0], this, $('table .gclh_col_name')[0])}); $('table .gclh_col_icon')[0].addEventListener('click', function() {sortTableListNotif($('table.Table')[0], this, $('table .gclh_col_name')[0])}); $('table .gclh_col_name')[0].addEventListener('click', function() {sortTableListNotif($('table.Table')[0], this, $('table .gclh_col_cachetype')[0])}); $('table .gclh_col_cachetype')[0].addEventListener('click', function() {sortTableListNotif($('table.Table')[0], this, $('table .gclh_col_name')[0])}); } // Improve notification. if (document.location.href.match(/\.com\/notify\/edit\.aspx/)) { // Alignment, white space tuning. $('table.LatLongTable tbody tr td').each(function(){ if (this.innerHTML.match(/^(\s*)$/)) $(this).remove(); }); var sel = 'input[name="ctl00$ContentBody$LogNotify$LatLong:_currentLatLongFormat"]'; if ($(sel)[0] && $(sel)[0].nextSibling && $(sel)[0].nextSibling.data) $(sel)[0].nextSibling.data = ' '; if ($('#ctl00_ContentBody_LogNotify_cbEnable')[0]) $('#ctl00_ContentBody_LogNotify_cbEnable')[0].parentNode.parentNode.style.marginLeft = '0'; if ($('#ctl00_ContentBody_LogNotify_btnGo')[0]) $('#ctl00_ContentBody_LogNotify_btnGo')[0].parentNode.style.marginLeft = '0'; // Handle coordinates of a notification in one field. if ($('select[name="ctl00$ContentBody$LogNotify$LatLong"]"')[0].selectedIndex == 1) { var side = $('table.LatLongTable tbody select[id*="selectEastWest"]')[0].closest('tr'); $(side).after('Alternative input option:'); processCoordsNotif(first = true, e = false, field = false); $('#gclh_degs_value')[0].addEventListener('focusout', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#gclh_degs_value')[0].addEventListener('keydown', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong\\:_selectNorthSouth')[0].addEventListener('focusout', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong\\:_selectNorthSouth')[0].addEventListener('keydown', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong\\:_selectNorthSouth')[0].addEventListener('change', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong__inputLatDegs')[0].addEventListener('focusout', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong__inputLatDegs')[0].addEventListener('keydown', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong__inputLatMins')[0].addEventListener('focusout', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong__inputLatMins')[0].addEventListener('keydown', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong\\:_selectEastWest')[0].addEventListener('focusout', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong\\:_selectEastWest')[0].addEventListener('keydown', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong\\:_selectEastWest')[0].addEventListener('change', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong__inputLongDegs')[0].addEventListener('focusout', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong__inputLongDegs')[0].addEventListener('keydown', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong__inputLongMins')[0].addEventListener('focusout', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong__inputLongMins')[0].addEventListener('keydown', function(e) {processCoordsNotif(first = false, e, field = this);}, false); $('#ctl00_ContentBody_LogNotify_LatLong__requiredLatDeg, #ctl00_ContentBody_LogNotify_LatLong__validatorLatDegs, #ctl00_ContentBody_LogNotify_LatLong__requiredLatMins, #ctl00_ContentBody_LogNotify_LatLong__validatorLatMins, #ctl00_ContentBody_LogNotify_LatLong__requiredLongDeg, #ctl00_ContentBody_LogNotify_LatLong__validatorLongDegs, #ctl00_ContentBody_LogNotify_LatLong__requiredLongMins, #ctl00_ContentBody_LogNotify_LatLong__validatorLongMins').addClass('Warning'); } } // Get the notification to copy and prepare a copy of the notification. if (document.location.href.match(/\.com\/notify\/edit\.aspx\?CopyNID=(\d+)/)) { var nid = document.location.href.match(/\.com\/notify\/edit\.aspx\?CopyNID=(\d+)/); if (nid && nid[1]) { prepareCopyNotif(nid[1]); } } // Delete notification via popup. We are here in the popup. if (document.location.href.match(/\.com\/notify\/edit\.aspx\?NID=(\d+)&GClhDelete/)) { if ($('#ctl00_ContentBody_LogNotify_btnArchive')[0] && !$('#divContentMain p.Success')[0]) { $('#ctl00_ContentBody_LogNotify_btnArchive').click(); } else if ($('#divContentMain p.Success')[0]) { setTimeout(function() {window.close();},10); } } // Undo deletion of notification via popup. We are here in the popup. if (document.location.href.match(/\.com\/notify\/edit\.aspx\?NID=(\d+)&GClhUndo/)) { if ($('#ctl00_ContentBody_LogNotify_btnGo')[0] && !$('#divContentMain p.Success')[0]) { $('#ctl00_ContentBody_LogNotify_btnGo').click(); } else if ($('#divContentMain p.Success')[0]) { setTimeout(function() {window.close();},10); } } appendCssStyle(css); } catch(e) {gclh_error("Improve notifications",e);} } // Check for update. try { function checkForUpdate(manual) { function manualNegativInfo(newVersionFound) { if (manual == true && newVersionFound == false) { alert("Version " + scriptVersion + " of script GC little helper II \nis the latest and actual version.\n"); } } var newVersionFound = false; var next_check = parseInt(getValue("update_next_check"), 10); if (!next_check) next_check = 0; var time = new Date().getTime(); if (next_check < time || manual == true) { time += 1 * 60 * 60 * 1000; // 1 Stunde warten, bis zum nächsten Check. setValue('update_next_check', time.toString()); if (typeof GM_xmlhttpRequest === 'function') { // Prüfen der Version in Datei "last_version.txt" im master. GM_xmlhttpRequest({ method: "GET", url: urlLastVersion, onload: function(result) { try { var newLastVersion = result.responseText.replace(/\s/g, ""); if (result.status == 200 && newLastVersion && newLastVersion != scriptVersion) { // Prüfen der Version im Script im master. // (Zusätzlich notwendig, weil die raw.githubusercontent.com Inhalte zeitverzögert auf GitHub bereitgestellt werden.) GM_xmlhttpRequest({ method: "GET", url: urlScript, onload: function(result) { try { var newScriptVersion = result.responseText.match(/\/\/\s\@version(.*)/); if (result.status == 200 && newScriptVersion && newScriptVersion[1]) { newScriptVersion = newScriptVersion[1].replace(/\s/g, ""); // Nur weitermachen, wenn die Versionen aus Datei "last_version.txt" und Script vom master identisch sind, // es sich also nicht um den Fall von zeitverzögerten raw.githubusercontent.com Inhalten handelt. if (newLastVersion == newScriptVersion) { newVersionFound = true; var text = "Version " + newScriptVersion + " of script GC little helper II is available.\n" + "You are currently using version " + scriptVersion + ".\n\n" + "Click OK to update.\n\n" + "(After update, please refresh your page.)"; if (window.confirm(text)) { btnClose(); document.location.href = urlScript; } else { time += 7 * 60 * 60 * 1000; // 1+7 Stunden warten, bis zum nächsten Check. setValue('update_next_check', time.toString()); } } } manualNegativInfo(newVersionFound); } catch(e) {gclh_error("Check for update, onload ScriptVersion",e);} } }); } else manualNegativInfo(newVersionFound); } catch(e) {gclh_error("Check for update, onload LastVersion",e);} } }); } else manualNegativInfo(newVersionFound); } } checkForUpdate(false); } catch(e) {gclh_error("Check for update",e);} // Special days. if (is_page("cache_listing")) { try { var now = new Date(); var year = now.getYear() + 1900; var month = now.getMonth() + 1; var date = now.getDate(); // Ostern 2020. if ((date >= 10 && date <= 13 && month == 4 && year == 2020)) { $(".CacheDetailNavigation:first > ul:first").append('
      • '); } // Weihnachten 2023. if (month == 12 && year == 2023) { var max = 0; if ((date >= 5 && date <= 6) || (date >= 24 && date <= 26)) max = 100; if (max > 0) { function checkChristmasData(waitCount) { if ($('.gclh_latest_log').length > 0) { setTimeout(function() { var icons = $('#gclh_latest_logs').find('img[src*="/images/logtypes/2.png"]'); var count = 0; for (var i = 0; i < icons.length; i += 2) { var num = random(max, 1); if (num > 0 && num < 9) { icons[i].src = urlImages+"nicolaus_head_0" + num + ".png"; icons[i].style = "margin-top: -12px; vertical-align: sub;"; count++; if (count >= 2) break; } } }, 1000); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){checkChristmasData(waitCount);}, 100);} } checkChristmasData(0); } } } catch(e) {gclh_error("Special days",e);} } ///////////////////////////// // 6.2 GC - Functions ($$cap) (Functions for the geocaching webpages.) ///////////////////////////// // Leaflet init. function leafletInit() { try { if ( typeof L == "undefined" ) { if ( !$('#gclh_leafletjs').length ) { var newCSS = GM_getResourceText ("leafletcss"); GM_addStyle (newCSS); var newJS = GM_getResourceText("leafletjs"); injectPageScript(newJS, "body", 'gclh_leafletjs'); } } if ( L.version != "0.7.2" ) { console.error("Unexpected version of leaflet. Version 0.7.2 required, version "+L.version+" is loaded."); } } catch(e) {gclh_error("function leafletInit",e);} } // Searches for the owner's original username from the listing. function get_real_owner() { if ($('#ctl00_ContentBody_bottomSection')) { var links = $('#ctl00_ContentBody_bottomSection a[href*="/play/search?owner[0]="], #ctl00_ContentBody_bottomSection a[href*="/seek/nearest.aspx?u="]'); for (var i = 0; i < links.length; i++) { // Das "?" in "(.*?)" bedeutet "nicht gierig", das heißt es wird nur bis zum ersten Vorkommen des "&" verwendet. var match = links[i].href.match(/\/play\/search\?owner\[0\]=(.*?)&/); if (match) return urldecode(match[1]); var match = links[i].href.match(/\/seek\/nearest\.aspx\?u\=(.*)$/); if (match) return urldecode(match[1], true); } return false; } else return false; } // Hide header in map. function hide_map_header() { if ($('nav')[0].style.display != "none") { $('nav')[0].style.display = "none"; $('#Content')[0].style.top = 0; } else { $('nav')[0].style.display = "block"; $('#Content')[0].style.top = "80px"; } } // "Shorten" lines that are too long so that they do not wrap. function noBreakInLine(n_side, n_maxwidth, n_title) { if (n_side == "" || n_side == undefined || n_maxwidth == 0) return; n_side.setAttribute("style", "max-width: " + n_maxwidth + "px; display: inline-block; overflow: hidden; vertical-align: bottom; white-space: nowrap; text-overflow: ellipsis;"); if (n_title != "") n_side.setAttribute("title", n_title); } // Mail Icons, Message Icons. // Cache, TB, Aktiv User Infos ermitteln. function getGcTbUserInfo() { var g_gc = false; var g_tb = false; var g_code = ""; var g_name = ""; var g_link = ""; var g_founds = ""; var g_date = ""; var g_time = ""; var g_dateTime = ""; var g_activ_username = ""; if ((settings_show_mail || settings_show_message)) { // Cache Listing. if ($('#ctl00_ContentBody_CacheName')[0]) { g_gc = true; g_name = $('#ctl00_ContentBody_CacheName')[0].innerHTML; if ($('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0]) g_code = $('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0].innerHTML; // TB Listing. } else if ($('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0]) { g_tb = true; g_code = $('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')[0].innerHTML; if ($('#ctl00_ContentBody_lbHeading')[0]) g_name = $('#ctl00_ContentBody_lbHeading')[0].innerHTML; // Log view. } else if ($('#ctl00_ContentBody_LogBookPanel1_lbLogText')[0]) { // Cache. if ($('#ctl00_ContentBody_LogBookPanel1_lbLogText')[0].childNodes[4] && $('#ctl00_ContentBody_LogBookPanel1_lbLogText')[0].childNodes[4].href.match(/\/cache_details\.aspx\?guid=/)) { g_gc = true; g_name = $('#ctl00_ContentBody_LogBookPanel1_lbLogText')[0].childNodes[4].innerHTML; } // TB. if ($('#ctl00_ContentBody_LogBookPanel1_lbLogText')[0].childNodes[4] && $('#ctl00_ContentBody_LogBookPanel1_lbLogText')[0].childNodes[4].href.match(/\/track\/details\.aspx\?guid=/)) { g_tb = true; g_name = $('#ctl00_ContentBody_LogBookPanel1_lbLogText')[0].childNodes[4].innerHTML; } // Log post. } else if ($('#ctl00_ContentBody_LogBookPanel1_WaypointLink')[0]) { // Cache old log page. if ($('#ctl00_ContentBody_LogBookPanel1_WaypointLink')[0].parentNode.children[2] && $('#ctl00_ContentBody_LogBookPanel1_WaypointLink')[0].parentNode.children[2].href.match(/\/cache_details\.aspx\?guid=/)) { g_gc = true; g_name = $('#ctl00_ContentBody_LogBookPanel1_WaypointLink')[0].parentNode.children[2].innerHTML; } // TB. if ($('#ctl00_ContentBody_LogBookPanel1_WaypointLink')[0].parentNode.children[2] && $('#ctl00_ContentBody_LogBookPanel1_WaypointLink')[0].parentNode.children[2].href.match(/\/track\/details\.aspx\?guid=/)) { g_tb = true; g_name = $('#ctl00_ContentBody_LogBookPanel1_WaypointLink')[0].parentNode.children[2].innerHTML; } // Log post cache new log page. } else if ($('#logType a')[0] && $('#logType a')[0].innerHTML) { g_gc = true; g_name = $('#logType a')[0].innerHTML; } if (g_code != "") { g_link = "(https://coord.info/" + g_code + ")"; g_code = "(" + g_code + ")"; } g_founds = global_findCount; [g_date, g_time, g_dateTime] = getDateTime(); g_activ_username = global_me; } return [g_gc, g_tb, g_code, g_name, g_link, g_activ_username, g_founds, g_date, g_time, g_dateTime]; } // Message Icon, Mail Icon aufbauen. function buildSendIcons(b_side, b_username, b_art, guidSpecial) { if (b_art == "per guid") { // guid aus besonderen Proceduren (zB: post cache log new page). if (guidSpecial) guid = guidSpecial; if (guid == "" || guid == undefined) return; if (guid.match(/\#/)) return; // Keine Verarbeitung für Stat Bar. if (b_side.innerHTML.match(/https?:\/\/img\.geocaching\.com\/stats\/img\.aspx/)) return; } else { if (b_username == "") return; } if (b_side == "" || b_side == undefined || b_username == undefined || global_activ_username == "" || global_activ_username == undefined || b_username == global_activ_username) return; // Wenn Owner, dann echten Owner setzen und nicht gegebenenfalls abweichenden Owner aus Listing "A cache by". if (b_side.parentNode.id == "ctl00_ContentBody_mcd1") { var owner = get_real_owner(); b_username = owner; } // Wenn User "In the hands of ..." im TB Listing, prüfen ob aktiver Username dort enthalten ist und Mail, Message nicht erzeugen. var username_send = b_username; if (b_side.id == "ctl00_ContentBody_BugDetails_BugLocation") { if (b_username.match(global_activ_username)) return; b_username = ""; username_send = "user"; } // Message, Mail Template aufbauen. template_message = urlencode(buildSendTemplate()); template = urlencode(buildSendTemplate().replace(/#Receiver#/ig, b_username), convertPlus = false); // Message Icon erzeugen. if (settings_show_message && b_art == "per guid") { var mess_link = document.createElement("a"); var mess_img = document.createElement("img"); mess_img.setAttribute("class", "gclh_send"); mess_img.setAttribute("style", "margin-left: 0px; margin-right: 0px"); mess_img.setAttribute("title", "Send a message to " + username_send); mess_img.setAttribute("src", global_message_icon); mess_link.appendChild(mess_img); if (settings_message_icon_new_win) mess_link.setAttribute("target", "_blank"); mess_link.setAttribute("href", "/account/messagecenter?recipientId=" + guid + "&text=" + template_message); b_side.parentNode.insertBefore(mess_link, b_side.nextSibling); b_side.parentNode.insertBefore(document.createTextNode(" "), b_side.nextSibling); // "Message this owner" und Icon entfernen. $('#ctl00_ContentBody_mcd1').find(".message__owner").remove(); // Cache Listing $('.BugDetailsList').find(".message__owner").remove(); // TB Listing } // Mail Icon erzeugen. if (settings_show_mail) { var mail_link = document.createElement("a"); var mail_img = document.createElement("img"); mail_img.setAttribute("class", "gclh_send"); mail_img.setAttribute("style", "margin-left: 0px; margin-right: 0px"); mail_img.setAttribute("title", "Send a mail to " + username_send); mail_img.setAttribute("src", global_mail_icon); mail_link.appendChild(mail_img); if (settings_mail_icon_new_win) mail_link.setAttribute("target", "_blank"); if (b_art == "per guid") { mail_link.setAttribute("href", "/email/?guid=" + guid + "&text=" + template); b_side.parentNode.insertBefore(mail_link, b_side.nextSibling); b_side.parentNode.insertBefore(document.createTextNode(" "), b_side.nextSibling); } else { b_side.appendChild(document.createTextNode(" ")); mail_link.setAttribute("href", "/email/?u=" + urlencode(b_username, convertPlus = false) + "&text=" + template); b_side.appendChild(mail_link); b_side.appendChild(document.createTextNode(" ")); } } } // Message, Mail Template aufbauen, bis auf Empfänger. function buildSendTemplate() { var tpl = getValue("settings_mail_signature", ""); var trimIt = (tpl.length == tpl.trim().length); tpl = tpl.replace(/#Found-?(\d+)?#/ig, (_match, p1) => p1 ? global_founds+1 - p1 : global_founds+1).replace(/#Found_no-?(\d+)?#/ig, (_match, p1) => p1 ? global_founds - p1 : global_founds) tpl = tpl.replace(/#Me#/ig, global_activ_username).replace(/#Date#/ig, global_date).replace(/#Time#/ig, global_time).replace(/#DateTime#/ig, global_dateTime); tpl = tpl.replace(/#GCTBName#/ig, global_name).replace(/#GCTBCode#/ig, global_code).replace(/#GCTBLink#/ig, global_link); if (trimIt) tpl = tpl.trim(); return tpl; } // Zebra look: colorize or remove. function setLinesColorInZebra(para, lines, linesTogether) { if (lines.length == 0) return; var replaceSpec = /(AlternatingRow)(\s*)/g; var setSpec = "AlternatingRow"; // Wenn Einfärbung nicht stattfinden soll. if (para == false) setLinesColorNone(lines, replaceSpec); // Wenn Einfärbung stattfinden soll. else { if (is_page('lists')) { var hell = true; for (var i = 0; i < lines.length; i++) { if (hell == true) { hell = false; if ($(lines[i]).hasClass(setSpec)) $(lines[i]).removeClass(setSpec); if ($(lines[i]).hasClass('has-description') && lines[i+1]) { if ($(lines[i+1]).hasClass(setSpec)) $(lines[i+1]).removeClass(setSpec); i++; } } else { hell = true; if (!$(lines[i]).hasClass(setSpec)) $(lines[i]).addClass(setSpec); if ($(lines[i]).hasClass('has-description') && lines[i+1]) { if (!$(lines[i+1]).hasClass(setSpec)) $(lines[i+1]).addClass(setSpec); i++; } } } } else { // Zeilen im ersten Zeilenbereich gegebenenfalls auf hell zurücksetzen. for (var i = 0; i < lines.length; i += (2 * linesTogether)) { for (var j = 0; j < linesTogether; j++) { if (lines[i+j].className.match(replaceSpec)) { var newClass = lines[i+j].className.replace(replaceSpec, ""); lines[i+j].setAttribute("class", newClass); } } } // Zeilen im zweiten Zeilenbereich gegebenenfalls an erster Stelle auf dunkel setzen. for (var i = linesTogether; i < lines.length; i += (2 * linesTogether)) { for (var j = 0; j < linesTogether; j++) { if (lines[i+j].className.match(replaceSpec)); else { if (lines[i+j].getAttribute("class") == (undefined|null|"")) var oldClass = ""; else var oldClass = " " + lines[i+j].getAttribute("class"); lines[i+j].setAttribute("class", setSpec + oldClass); } } } } } } // User, Owner, Reviewer, VIPs: colorize or remove. function setLinesColorUser(paraStamm, tasks, lines, linesTogether, owner, bookmarklist) { if (lines.length == 0) return; var user = global_me; if (owner == undefined) var owner = ""; var vips = getValue("vips"); if (vips != false) { vips = vips.replace(/, (?=,)/g, ",null"); vips = JSON.parse(vips); } var setSpecUser = "TertiaryRow"; var setSpecOwner = "QuaternaryRow"; var setSpecReviewer = "QuinaryRow"; var setSpecVip = "SenaryRow"; var replaceSpecUser = /(TertiaryRow)(\s*)/g; var replaceSpecVip = /(SenaryRow)(\s*)/g; var para = new Array(); if (tasks.match("user")) para["user"] = getValue(paraStamm + "_user"); else para["user"] = ""; if (tasks.match("owner")) para["owner"] = getValue(paraStamm + "_owner"); else para["owner"] = ""; if (tasks.match("reviewer")) para["reviewer"] = getValue(paraStamm + "_reviewer"); else para["reviewer"] = ""; if (tasks.match("vip")) para["vip"] = getValue(paraStamm + "_vip"); else para["vip"] = ""; // Wenn Einfärbung für User nicht stattfinden soll, entfernen. if (para["user"] == false) setLinesColorNone(lines, replaceSpecUser); // Wenn Einfärbung stattfinden soll. if (para["user"] == true || para["owner"] == true || para["reviewer"] == true || para["vip"] == true) { for (var i = 0; i < lines.length; i += linesTogether) { var newClass = ""; var aTags = lines[i].getElementsByTagName("a"); var imgTags = lines[i].getElementsByTagName("img"); if (bookmarklist == 'new') var useTags = lines[i].getElementsByTagName("use"); // Cache, TB Listing. Anhand guid prüfen, ob Einfärbung für User oder Owner notwendig ist. if (para["user"] || para["owner"]) { for (var j = 0; j < aTags.length; j++) { if (aTags[j].href.match(/\/(profile|p)\/\?guid=/)) { if (decode_innerHTML(aTags[j]) == user && para["user"]) newClass = setSpecUser; else if (decode_innerHTML(aTags[j]) == owner && para["owner"]) newClass = setSpecOwner; break; } } // Bookmark Listen ALT. Anhand Found Icon prüfen, ob Einfärbung für User notwendig ist. // (Originallogs würden wegen src mit found noch hier reingehen -> para bookmarklist.) if (newClass == "" && para["user"] && bookmarklist == true) { for (var j = 0; j < imgTags.length; j++) { if (imgTags[j].src.match(/\/found\./)) { newClass = setSpecUser; break; } } } // Bookmark Listen NEU. Anhand xlink:href="#smiley" prüfen, ob Einfärbung für User notwendig ist. if (newClass == "" && para["user"] && bookmarklist == 'new' && useTags.length > 0) { for (var j = 0; j < useTags.length; j++) { if (useTags[j].getAttribute('xlink:href').match(/#smiley/)) { newClass = setSpecUser; break; } } } } // Cache, TB Listing. Anhand Admin Icon prüfen, ob Einfärbung für Reviewer notwendig ist. // (Logs von ehemaligen Reviewern werden nicht mehr eingefärbt. Besser wäre wohl Icons abzufragen.) if (newClass == "" && para["reviewer"]) { for (var j = 0; j < imgTags.length; j++) { if (imgTags[j].src.match(/\/icon_admin\./)) { newClass = setSpecReviewer; break; } } } // Cache, TB Listing. Anhand titles zum VIP Icon und guid der VIP prüfen, ob Einfärbung für VIP notwendig ist. VIP kann sich während Seitendarstellung ändern. if (newClass == "" && para["vip"] && vips) { // Farbe für VIP zurücksetzen. for (var j = 0; j < linesTogether; j++) { if (lines[i+j].className.match(replaceSpecVip)) { var replaceClass = lines[i+j].className.replace(replaceSpecVip, ""); lines[i+j].setAttribute("class", replaceClass); } } // Wenn VIP Icon gesetzt und guid in VIPS Area vorhanden, merken, dass Farbe für VIP gesetzt werden muss. for (var j = 0; j < imgTags.length; j++) { if (imgTags[j].title.match(/from VIP-List/)) { for (var k = 0; k < aTags.length; k++) { if (aTags[k].href.match(/\/(profile|p)\/\?guid=/)) { if (in_array(decode_innerHTML(aTags[k]), vips)) { newClass = setSpecVip; } break; } } break; } } } // Wenn Einfärbung notwendig ist. Prüfen, ob Einfärbung nicht vorhanden ist, gegebenenfalls dann an erster Stelle einbauen. if (newClass != "") { for (var j = 0; j < linesTogether; j++) { if (lines[i+j].className.match(newClass)); else { if (lines[i+j].getAttribute("class") == null) var oldClass = ""; else var oldClass = " " + lines[i+j].getAttribute("class"); lines[i+j].setAttribute("class", newClass + oldClass); if (bookmarklist == 'new' && $(lines[i+j]).hasClass('has-description') && lines[i+j+1]) { lines[i+j+1].setAttribute("class", newClass + oldClass); } } } } } } } // Remove specification for coloring line. function setLinesColorNone(lines, replSpez) { if (lines.length == 0) return; for (var i = 0; i < lines.length; i++) { if (lines[i].className.match(replSpez)) { var newClass = lines[i].className.replace(replSpez, ""); lines[i].setAttribute("class", newClass); } } } // Simulate installation counter. function instCount(declaredVersion) { var side = $('body')[0]; var div = document.createElement("div"); div.id = "gclh_simu"; div.setAttribute("style", "margin-top: -50px;"); var prop = ' style="border: none; visibility: hidden; width: 2px; height: 2px;" alt="">'; var code = ' $$002 code += '"; head.addEventListener("click", showHideBoxDashboard, false); $("nav.sidebar-links")[1].appendChild(head); var box = document.createElement("ul"); box.setAttribute("class", (getValue("show_box_dashboard_" + ident, true) == true ? "link-block gclh" : "link-block gclh isHide")); box.setAttribute("name", "box_" + ident); $("nav.sidebar-links")[1].appendChild(box); } function buildCopyOfBookmarks() { var bm_tmp = new Array(); for (var i = 0; i < bookmarks.length; i++) { bm_tmp[i] = new Object(); for (attr in bookmarks[i]) {bm_tmp[i][attr] = bookmarks[i][attr];} } return bm_tmp; } function buildBoxElementsLinklist(box) { for (var i = 0; i < settings_bookmarks_list.length; i++) { var x = settings_bookmarks_list[i]; if (typeof(x) == "undefined" || x == "" || typeof(x) == "object") continue; var a = document.createElement("a"); for (attr in bookmarks[x]) { if (attr == "custom" || attr == "title") continue; if (attr == "name" || attr == "id") a.setAttribute(attr, bookmarks[x][attr]+"_profile"); else a.setAttribute(attr, bookmarks[x][attr]); } a.appendChild(document.createTextNode(bookmarks[x]['title'])); var li = document.createElement("li"); li.appendChild(a); box.appendChild(li); } } function buildBoxElementsLinks(box, bm_tmp) { for (var i = 0; i < bm_tmp.length; i++) { if (bm_tmp[i]['origTitle'] == "(empty)" || bm_tmp[i]['href'] == "" || bm_tmp[i]['href'] == "#") continue; var a = document.createElement("a"); for (attr in bm_tmp[i]) { if (attr == "custom" || attr == "title" || attr == "origTitle") continue; if (attr == "name" || attr == "id") a.setAttribute(attr, bm_tmp[i][attr]+"_profile"); else a.setAttribute(attr, bm_tmp[i][attr]); } a.appendChild(document.createTextNode(bm_tmp[i]['origTitle'])); var li = document.createElement("li"); li.appendChild(a); box.appendChild(li); } } // Show, Hide box on dashboard. function showHideBoxDashboard() { if (!$(this.nextElementSibling)) return; var ident = this.getAttribute("name").replace("head_", ""); (this.className.match("isHide") ? setValue("show_box_dashboard_" + ident, true) : setValue("show_box_dashboard_" + ident, false)); (this.className.match("isHide") ? $(this.nextElementSibling).removeClass("isHide") : $(this.nextElementSibling).addClass("isHide")); (this.className.match("isHide") ? $(this).removeClass("isHide") : $(this).addClass("isHide")); } // Show/hide upvotes with "Order by", "Great story" and "Helpful". function showHideUpvotesLink() { addButtonOverLogs(showHideUpvotes, "gclh_show_hide_upvotes", true, "Hide upvotes", "", "Show/hide upvotes with \"Order by\", \"Great story\" and \"Helpful\""); setUpvotesButTitle(); } function showHideUpvotes() { if (isUpvoteActive == false || $('#gclh_show_hide_upvotes.working')[0]) return; $('#cache_logs_container').toggleClass('gclh_hide_upvotes'); if ($('#gclh_show_hide_upvotes')[0]) { $('#gclh_show_hide_upvotes input')[0].setAttribute('disabled', ''); $('#gclh_show_hide_upvotes').addClass("working"); setTimeout(function() { setUpvotesButTitle(); $('#gclh_show_hide_upvotes').removeClass("working"); $('#gclh_show_hide_upvotes input')[0].removeAttribute('disabled'); }, 100); } } function setUpvotesButTitle() { if ($('#gclh_show_hide_upvotes')[0] && $('#cache_logs_container')[0]) { if ($('#cache_logs_container').hasClass('gclh_hide_upvotes')) { $('#gclh_show_hide_upvotes')[0].children[0].value = 'Show upvotes'; } else { $('#gclh_show_hide_upvotes')[0].children[0].value = 'Hide upvotes'; } } } // Show who gave the cache a favorite. if (is_page("cache_listing") && settings_show_who_gave_favorite_but) var fav_guids = []; function addShowWhoGaveFavoriteButton() { addButtonOverLogs(showWhoGaveFavorite, "gclh_show_who_gave_favorite", true, "Show who favorited", "", "Show in logs who gave a favorite"); // disable button for caches with >500 favorites and add an explanation to the title const favs = Number($('.favorite-value').text().trim()); const maxFav = 500; if (favs > maxFav) { $('#gclh_show_who_gave_favorite').prop("title", "Unfortunately not available for caches\nwith more than " + maxFav + " favorites").addClass('working'); $('#gclh_show_who_gave_favorite input').prop("disabled", true); } // disable button for events and caches without favorites and add an explanation to the title if (isEventInCacheListing() || Number($('.favorite-value').text().trim()) === 0) { $('#gclh_show_who_gave_favorite').prop("title", "Cache doesn't have any favorites").addClass('working'); $('#gclh_show_who_gave_favorite input').prop("disabled", true); } } async function showWhoGaveFavorite() { // disable button (data only needs to be fetched once) $('#gclh_show_who_gave_favorite').addClass("working"); $('#gclh_show_who_gave_favorite input').prop("disabled", true).prop('value', 'Loading ...'); try { const t0 = Date.now(); // url of "Users Who Favorited This Cache" const url = 'https://www.geocaching.com/seek/cache_favorited.aspx?guid=' + unsafeWindow.guid; // get 1st page let dataForward = ''; let pageForward = await $.post(url, dataForward); storeGuidsOfUsersWhoFavorited(pageForward); // calculate number of forward/backward cycles const favs = Number($('.favorite-value').text().trim()); const nPages = Math.ceil(favs / 10); let numForwardBackward; if (nPages % 2 === 1) { numForwardBackward = (nPages - 1) / 2; } else { numForwardBackward = (nPages - 2) / 2; } // for numForwardBackward cycles, get 2 pages at the same time - one in forward and one in backward direction let dataBackward, pageBackward, promises; for (let i = 1; i <= numForwardBackward; i++) { if (i === 1) { // 2nd and last page in parallel // get form data of first page to retrieve next page dataForward = getFormData(pageForward, 'next'); // get form data of first page to retrieve last page dataBackward = getFormData(pageForward, 'last'); promises = []; promises.push($.post(url, dataForward)); promises.push($.post(url, dataBackward)); [pageForward, pageBackward] = await Promise.all(promises); storeGuidsOfUsersWhoFavorited(pageForward); storeGuidsOfUsersWhoFavorited(pageBackward); } else { // next(forward) and previous(backward) pages in parallel // get form data of forward page to retrieve next page dataForward = getFormData(pageForward, 'next'); // get form data of backward page to retrieve previous page dataBackward = getFormData(pageBackward, 'previous'); promises = []; promises.push($.post(url, dataForward)); promises.push($.post(url, dataBackward)); [pageForward, pageBackward] = await Promise.all(promises); storeGuidsOfUsersWhoFavorited(pageForward); storeGuidsOfUsersWhoFavorited(pageBackward); } } // for an even number of total pages, one page remains to get in next(forward) mode if (nPages % 2 === 0) { // get form data of forward page to retrieve next page dataForward = getFormData(pageForward, 'next'); pageForward = await $.post(url, dataForward); storeGuidsOfUsersWhoFavorited(pageForward); } let t1 = (Date.now() - t0) / 1000; $("#gclh_show_who_gave_favorite input").prop('value', 'Show who favorited'); $("#gclh_show_who_gave_favorite").prop('title', $("#gclh_show_who_gave_favorite").prop('title') + ' (took ' + t1.toFixed(1) + 's)'); // we're finished, now show filter link $('a#gclh_show_favorite_logs').parent().show(); showFavIcons(); } catch (e) { fav_guids = []; $("#gclh_show_who_gave_favorite input").prop('value', 'Show who favorited (error)'); gclh_error("showWhoGaveFavorite", e); } // Get form data of current page to retrieve following page. function getFormData(page, mode) { switch (mode) { case 'previous': mode = '03'; break; case 'next': mode = '04'; break; case 'last': mode = '05'; break; default: mode = '04'; } let aspNetHidden = $('div.aspNetHidden', page).first().find('input'), input; data = '__EVENTTARGET=' + encodeURIComponent('ctl00$ContentBody$pgrTop$ctl' + mode); data += '&__EVENTARGUMENT='; for (let i = 2; i < aspNetHidden.length; i++) { input = aspNetHidden[i]; data += '&' + input.name + '=' + encodeURIComponent(input.value); } data += '&navi_search='; return data; } // Store guids of users who gave a favorite. function storeGuidsOfUsersWhoFavorited(page) { let userInfo = $('table.Table>tbody>tr>td>a:nth-child(2)', page); for (let i = 0; i < userInfo.length; i++) { fav_guids.push(userInfo[i].search.split('=')[1]); } } } // Show fav icon in logs for users who gave a favorite. function showFavIcons() { // only if activated if (!settings_show_who_gave_favorite_but || !$('#gclh_show_who_gave_favorite.working')[0]) return; try { $('.logOwnerAvatar>a').each(function() { let guid = this.search.split('=')[1]; let hasFavorited = in_array(guid, fav_guids); if (hasFavorited) { let logImg = $(this).parent().parent().next().find('.LogType img'); if (logImg[0].src.split('/').pop() === '2.png') { // only show for finds, no other log types logImg.next().show(); } } }); } catch(e) { gclh_error("showFavIcons", e); } } // Show log counter. function showLogCounterLink() { addButtonOverLogs(showLogCounter, "gclh_show_log_counter", true, "Show log counter", "Log counter", "Show log counter for log type and total"); if (settings_show_log_counter_but && settings_show_log_counter) showLogCounter(); appendCssStyle(".gclh_logCounter {font-size: 10px !important; padding-left: 6px; font-style: italic;}"); } function showLogCounter() { try { if ($('#gclh_show_log_counter.working')[0]) return; $('#gclh_show_log_counter').addClass("working"); $('#gclh_show_log_counter input')[0].setAttribute('disabled', ''); setTimeout(function() { var logCounter = new Object(); logCounter["all"] = 0; 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+)/); // exclude Favorite logs filter if (matches && matches[2] && !logTypes[i].innerHTML.match('fave_fill_16.svg')) { logCounter[logTypes[i].childNodes[0].title] = parseInt(matches[2]); logCounter["all"] += parseInt(matches[2]); } } if (logCounter["all"] != 0) { var logs = $('#cache_logs_table2').find('tbody tr td').find('.LogType'); for (var i = 0; i < logs.length; i++) { var log = logs[i]; if (log && log.children[1] && log.children[0].children[0].title && logCounter[log.children[0].children[0].title]) { var logTyp = log.children[0].children[0].title; log.children[1].innerHTML = " Log " + logCounter[logTyp] + " / Total Log " + logCounter["all"]; logCounter[logTyp]--; logCounter["all"]--; } } } $('#gclh_show_log_counter').removeClass("working"); $('#gclh_show_log_counter input')[0].removeAttribute('disabled'); }, 100); } catch(e) {gclh_error("showLogCounter",e);} } // Show/Hide compact logs. function toggle_compact_logbook(){ if ($('#toggle_compact_logbook.working')[0]) return; $('#toggle_compact_logbook input')[0].setAttribute('disabled', ''); $('#toggle_compact_logbook').addClass("working"); setTimeout(function() { $('#cache_logs_container').toggleClass('compact_logbook'); if ($('#cache_logs_container').hasClass('compact_logbook')) { $('#toggle_compact_logbook')[0].children[0].value = 'Hide compact logs'; } else { $('#toggle_compact_logbook')[0].children[0].value = 'Show compact logs'; } $('#toggle_compact_logbook').removeClass("working"); $('#toggle_compact_logbook input')[0].removeAttribute('disabled'); }, 100); } // Add button over logs in cache listing. function addButtonOverLogs(func, id, right, txt, txtshort, title, adhere) { if (!$('#ctl00_ContentBody_uxLogbookLink')[0]) return; var span = document.createElement("span"); span.id = id; if (title != "") span.title = title; if (txtshort != "" && settings_new_width < 1040 && settings_show_all_logs_but && settings_show_compact_logbook_but && settings_show_who_gave_favorite_but && settings_show_log_counter_but && settings_show_bigger_avatars_but && settings_show_hide_upvotes_but) { var text = txtshort; } else { var text = txt; } span.innerHTML = ''; span.addEventListener("click", func, false); if (right) span.className = "gclh_rlol"; else span.className = "gclh_llol"; if ($('.gclh_llol').length == 0 && $('.gclh_rlol').length == 0) { if ($('#ctl00_ContentBody_uxLogbookLink')[0]) $('#ctl00_ContentBody_uxLogbookLink')[0].innerHTML = $('#ctl00_ContentBody_uxLogbookLink')[0].innerHTML.replace("View ", "").replace(" anzeigen", "").replace("Zobrazit l", "L"); if ($('#ctl00_ContentBody_uxGalleryImagesLink')[0]) $('#ctl00_ContentBody_uxGalleryImagesLink')[0].innerHTML = $('#ctl00_ContentBody_uxGalleryImagesLink')[0].innerHTML.replace("View the ", "").replace(" anzeigen", "").replace("Zobrazit f", "F"); var css = ""; css += ".gclh_llol {margin-right: 4px;} .gclh_rlol {float: right; margin-left: 4px;}"; css += ".gclh_llol input, .gclh_rlol input {padding-left: 4px; padding-right: 4px; cursor: pointer;}"; appendCssStyle(css); $('#ctl00_ContentBody_uxLogbookLink')[0].parentNode.style.width = "100%"; $('#ctl00_ContentBody_uxLogbookLink')[0].parentNode.style.margin = "0"; } if (adhere) adhere.append(span); else $('#ctl00_ContentBody_uxLogbookLink')[0].parentNode.append(span); } // Determine user, guid from the read old or new public profile. function getUserGuidFromProfile(respText) { var user = respText.match(/id="ctl00_(ProfileHead_ProfileHeader|ContentBody_ProfilePanel1)_lblMemberName">(.*?)<\/span>/); var guid = respText.match(/href="\/account\/messagecenter\?recipientId=([a-zA-Z0-9-]*)"/); if (user && user[1] && user[2]) { var span = document.createElement('span'); span.innerHTML = user[2]; var username = decode_innerHTML(span); if (guid && guid[1]) return [username, guid[1]]; else return [username, false]; } return [false, false]; } // Determine user from url. function getUrlUser() { var urluser = document.location.href.match(/\.com\/seek\/nearest\.aspx(.*)(\?ul|\?u|&ul|&u)=(.*)/); urluser = urldecode(urluser[3].replace(/&([A-Za-z0-9]+)=(.*)/, "")); urluser = urluser.replace(/&disable_redirect=/, ""); if (!urluser.match(/^#/)) urluser = urluser.replace(/#(.*)/, ""); return urluser; } // Alternative to event load on map. (Load event on map doesn't work always with open in new tab.) function isMapLoad(fkt) { if (waitCount == undefined) var waitCount = 0; if ($('.groundspeak-control-findmylocation')[0] && $('.leaflet-control-scale')[0]) fkt(); else {waitCount++; if (waitCount <= 50) setTimeout(function(){isMapLoad(fkt);}, 200);} } function insertAfter(newNode, referenceNode) { referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); } function removeElement(element) { if (element) element.parentNode.removeChild(element); } // Determine cache listing coordinates. function determineListingCoords(whichCoords) { var CorrCoords = ""; var OrgCoords = ""; var GCTourCoords = ""; if (unsafeWindow.mapLatLng.isUserDefined == true ) { OrgCoords = unsafeWindow.mapLatLng.oldLatLngDisplay.replace(new RegExp('\'', 'g'),''); } if ($('#uxLatLon')[0].innerHTML.match(/GCTour/)) { // Hier kann es gerade keinen update durch GC-internen Solution-Checker gegeben haben, sonst wäre "GCTour" nicht mehr vorhanden. var coords = $('#uxLatLon')[0].innerHTML.match(/([A-Z0-9°\.\s]*)([A-Za-z&;-\s]*)GCTour/); if (coords && coords[1]) { GCTourCoords = coords[1].replace(/° /g, '°').replace(/°/g, '° '); } var coords = $('#uxLatLon')[0].innerHTML.match(/GCTour<\/div>\s\W([A-Z0-9°\.\s]*)/); if (coords && coords[1]) { if (OrgCoords == "") { OrgCoords = coords[1].replace(/° /g, '°').replace(/°/g, '° '); } else { CorrCoords = coords[1].replace(/° /g, '°').replace(/°/g, '° '); } } } else { if (OrgCoords == "") { // Gerade wurde update durch GC-internen Solution-Checker durchgeführt. var uxLatLon = $('#uxLatLon')[0].innerHTML.replace(/(°|'|\s)/g, ""); if (is_page('unpublished_cache')) { OrgCoords = $('#uxLatLon')[0].innerHTML; } else { var oldLatLng = unsafeWindow.mapLatLng.oldLatLngDisplay.replace(/(°|'|\s)/g, ""); if (uxLatLon !== oldLatLng) { OrgCoords = unsafeWindow.mapLatLng.oldLatLngDisplay.replace(new RegExp('\'', 'g'),''); CorrCoords = $('#uxLatLon')[0].innerHTML; } else { OrgCoords = $('#uxLatLon')[0].innerHTML; } } } else { CorrCoords = $('#uxLatLon')[0].innerHTML; } } if (whichCoords == 'Corr') return CorrCoords; else if (whichCoords == 'Org') return OrgCoords; else if (whichCoords == 'GCTour') return GCTourCoords; else if (whichCoords == 'CorrOrg') return (CorrCoords !== "" ? CorrCoords : OrgCoords); else return ""; } // Get count and names of own bookmarklists. function getOwnBMLs(content) { var count = 0; var text = ''; var ary = []; var list = ''; $(content).find('ul.BookmarkList li').each(function() { if ( $(this).find('a[href*="/profile/?guid="], a[href*="/p/?guid="]')[0] && $(this).find('a[href*="/profile/?guid="], a[href*="/p/?guid="]')[0].innerHTML.match(global_me) && $(this).find('a[href*="/bookmarks/view.aspx?guid="], a[href*="/plan/lists/BM"]')[0] && $(this).find('a[href*="/bookmarks/view.aspx?guid="], a[href*="/plan/lists/BM"]')[0].innerHTML ) { if (!ary.includes($(this).find('a[href*="/bookmarks/view.aspx?guid="], a[href*="/plan/lists/BM"]')[0].innerHTML)) { count++; ary.push($(this).find('a[href*="/bookmarks/view.aspx?guid="], a[href*="/plan/lists/BM"]')[0].innerHTML); } } }); ary.sort(caseInsensitiveSort); for (var i = 0; i < ary.length; i++) { list += (list == '' ? '' : '\n') + ary[i]; } text = 'Currently available in ' + count + (count == 1 ? ' own list' : ' own lists'); return [count, text, list]; } // Build dropdown with caret-down icon and own specified dropdown entries for gclh stuff. // Implement css, symbol and icon for dropdown functionality. function buildDD(show, place, styles) { if (show == false || !$(place)[0]) return; // Implement css for dropdown functionality. if (!$('#gclh_dd-css')[0]) { var css = ' '; if (styles && styles != '') css += styles; if (css != ' ') appendCssStyle(css, place, 'gclh_dd-css'); } // Implement symbol caret-down for dropdown icon. if (!$('#gclh_dd-caret-down')[0]) { var symbol = $('#caret-down').clone(); symbol[0].id = 'gclh_dd-caret-down'; $('#caret-down').after(symbol); } // Implement dropdown icon. if (!$('#gclh_dd')[0] && $('#gclh_dd-caret-down')[0]) { var dd = document.createElement(($(place)[0].tagName == 'UL' ? 'li' : 'div')); dd.innerHTML = ''; dd.id = 'gclh_dd'; $(place).append(dd); } } // Implement dropdown menue and dropdown entry. function buildChildDD(show, id, className, clickFunction, value, title, menuFloatLeft, mouseoverFunction) { if (show == false || !$('#gclh_dd')[0] || !id || id == '' || !value || value == '' || !clickFunction || clickFunction == '') return; // Implement dropdown menue if not already available. if (!$('#gclh_dd .gclh_dd-menu')[0]) { $('#gclh_dd').append('
          '); // Mouseleave event to enable disabled childs. $('#gclh_dd')[0].addEventListener("mouseleave", function() { $('.gclh_dd-menu li.disabled').each(function() { $(this).removeClass('disabled'); }); }, false); } // Implement dropdown entry if not already available. if (!$('#'+id)[0]) { $('#gclh_dd .gclh_dd-menu ul').append('
        • ' + value + '
        • '); // Implement click event for child. $('#gclh_dd .gclh_dd-menu ul')[0].children[($('#gclh_dd .gclh_dd-menu ul li').length - 1)].addEventListener("click", function() { clickFunction(true, this); // Hide dropdown menue after functional click to an entry. hideDD(); }, false); // Implement mouseover event to prepare child before showing, if requested. if (mouseoverFunction && mouseoverFunction != '') { $('#gclh_dd')[0].addEventListener("mouseover", function() { mouseoverFunction(this); }, false); } // Make dropdown visible because dropdown entry is available. $('#gclh_dd .gclh_dd-icon').removeClass('gclh_dd-hidden'); // Set dropdown menue with entries on the left side. setMenuLeftDD(menuFloatLeft); } } // Set dropdown menu with entries on the left side. function setMenuLeftDD(menuFloatLeft) { if (menuFloatLeft) { if (!$('.gclh_dd-menu').hasClass('gclh_dd-left')) { $('.gclh_dd-menu').addClass('gclh_dd-left'); } var width = window.getComputedStyle($('.gclh_dd-menu')[0]).width.match(/(\d*\.*\d*)/); if (width && width[0]) { $('.gclh_dd-menu')[0].style.marginLeft = '-' + (parseInt(width[0]) - 32) + 'px'; } } } // Hide dropdown menue after functional click to an entry. function hideDD() { $('#gclh_dd .gclh_dd-menu').addClass('gclh_dd-hidden'); function removeHiddenClassDD(waitCount) { if (!$('#gclh_dd .gclh_dd-menu').is(":hover")) { $('#gclh_dd .gclh_dd-menu').removeClass('gclh_dd-hidden'); } else { waitCount++; if (waitCount <= 20) setTimeout(function(){removeHiddenClassDD(waitCount);}, 50); else $('#gclh_dd .gclh_dd-menu').removeClass('gclh_dd-hidden'); } } removeHiddenClassDD(0); } // Change the value in the dropdown menue entry. function changeValueDD(id, from, to) { if (id && id != '' && $('#'+id)[0] && from && from != '' && to) { // Get entry with id. var entryDD = $('#'+id)[0]; // Change value of entry. if (entryDD && entryDD.children[0] && entryDD.children[0].innerHTML) { entryDD.children[0].innerHTML = entryDD.children[0].innerHTML.replace(from, to); // Set dropdown menu with entries again on the left side. setMenuLeftDD($('.gclh_dd-menu.gclh_dd-left')[0]) } } } // Internal call of File API. function internalCallFileAPI(comeFrom, callBack) { if (!comeFrom || !$(comeFrom) || !callBack) return; // Check if File API is fully supported. if (window.File && window.FileReader && window.FileList && window.Blob) { } else { alert('The File APIs are not fully supported in your browser.'); return; } // Build internal call of File API. if (comeFrom && $(comeFrom).find('input')[0] == undefined) { // Build input for File API. $(comeFrom).append(''); // File selection, file reader and callback. $(comeFrom).find('.gclh_file_input')[0].addEventListener('change', function() { if (this.files[0]) { var file = this.files[0]; const reader = new FileReader(); reader.readAsText(file); reader.onload = function() { callBack(file, reader.result); }; } }); } // Click to file selection of File API. $(comeFrom).find('.gclh_file_input').click(); } // Callback from internal call of File API for adding Caches to a bookmark list. function addCachesBML(file, content) { var [gcText, gcCount] = getCachesFromContent(file, content); bulkUpdateBML(gcText, gcCount, file); } // Get caches from content like for example uploaded file content. function getCachesFromContent(contentFrom, content) { if (contentFrom == 'undefined' || content == 'undefined') return ['', 0]; var from = (contentFrom.name ? contentFrom.name : contentFrom); if (from.match(/\.gpx/i)) { var gcCodes = content.match(/GC[A-Z0-9]{1,6}<\/name>/ig); } else if (from.match(/\.loc/i)) { var gcCodes = content.match(/|$)/ig); } var gcText = ''; var gcCount = 0; if (gcCodes) { for (var i = 0; i < gcCodes.length; i++) { var gcCode = gcCodes[i].replace(/(|<\/name>|)/ig,''); if (gcText.match(gcCode)) continue; if (gcText == '') gcText = gcCode; else gcText += ',' + gcCode; gcCount++; } } return [gcText, gcCount]; } // Bulk update to BML with caches. function bulkUpdateBML(gcText, gcCount, contentFrom) { if (gcText == 'undefined' || gcCount == 'undefined' ) return; if (!contentFrom) var from = ''; else if (contentFrom.name) var from = ' from file ' + contentFrom.name + ''; else var from = ' from ' + contentFrom + ''; if (gcText == '' || gcCount == 0) { alert ('No GC Codes' + from.replace(/(|<\/b>)/g,'"')) return; } // Call add functionality of bookmark list page. function buildBulkUpdate() { let input = document.getElementById('bulk-input-field'); let nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set; nativeInputValueSetter.call(input, gcText); input.dispatchEvent(new Event('input', { bubbles: true })); $('#bulk-input-form').after('

          ' + gcCount + ' GC Codes' + from + '
          Please click "Add geocaches" if this seems to be ok.

          '); } function waitForBulkUpdate(waitCount) { if ($('button.bulk-add-toggle')[0] && !$('#bulk-input-form')[0] && !$('button.bulk-add-toggle.gclh_click')[0]) { $('button.bulk-add-toggle').click(); $('button.bulk-add-toggle').addClass('gclh_click'); } if ($('button.bulk-add-toggle')[0] && $('#bulk-input-form')[0] && $('#bulk-input-field')[0] && $('#bulk-input-form')[0]) { buildBulkUpdate(); return; } waitCount++; if (waitCount <= 100) { setTimeout(function(){waitForBulkUpdate(waitCount);}, 50); } else { var mess = "ERROR: Can not find the place for bulk updates. Probably changes on the bookmark list page are responsible for that.\nPlease contact the development team of the script with a new issue on this page: https://github.com/2Abendsegler/GClh/issues"; gclh_error("Upload caches from gpx file", {'message': '\n'+mess, 'stack': '' }); alert(mess); } } if ($('button.add-geocache-cta')[0]) $('button.add-geocache-cta').click(); waitForBulkUpdate(0); } // Set focus to a field. function setFocusToField(waitCount, field) { if ($(field)[0]) { $(field).focus(); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){setFocusToField(waitCount, field);}, 50);} } // Convert cache type to cache tx. function getCacheTx(type) { let tx; if (type == '2' ) tx = '&tx=32bc9333-5e52-4957-b0f6-5a2c8fc7b257'; // Tradi else if (type == '3' ) tx = '&tx=a5f6d0ad-d2f2-4011-8c14-940a9ebf3c74'; // Multi else if (type == '4' ) tx = '&tx=294d4360-ac86-4c83-84dd-8113ef678d7e'; // Virtual else if (type == '5' ) tx = '&tx=4bdd8fb2-d7bc-453f-a9c5-968563b15d24'; // Letterbox else if (type == '6' ) tx = '&tx=69eb8534-b718-4b35-ae3c-a856a55b0874'; // Event else if (type == '8' ) tx = '&tx=40861821-1835-4e11-b666-8d41064d03fe'; // Mystery else if (type == '9' ) tx = '&tx=2555690d-b2bc-4b55-b5ac-0cb704c0b768'; // APE else if (type == '11' ) tx = '&tx=31d2ae3c-c358-4b5f-8dcd-2185bf472d3d'; // WebCam else if (type == '12' ) tx = '&tx=8F6DD7BC-FF39-4997-BD2E-225A0D2ADF9D'; // Reverse else if (type == '13' ) tx = '&tx=57150806-bc1a-42d6-9cf0-538d171a2d22'; // Cito else if (type == '137' ) tx = '&tx=c66f5cf3-9523-4549-b8dd-759cd2f18db8'; // Earth Cache else if (type == '453' ) tx = '&tx=69eb8535-b718-4b35-ae3c-a856a55b0874'; // Mega else if (type == '1304') tx = '&tx=72e69af2-7986-4990-afd9-bc16cbbb4ce3'; // GPS Adventures Exhibit else if (type == '1858') tx = '&tx=0544fa55-772d-4e5c-96a9-36a51ebcf5c9'; // Wherigo else if (type == '3653') tx = '&tx=3ea6533d-bb52-42fe-b2d2-79a3424d4728'; // Community Celebration else if (type == '4738') tx = '&tx=bc2f3df2-1aab-4601-b2ff-b5091f6c02e3'; // Geocaching HQ Block Party else if (type == '3773') tx = '&tx=416f2494-dc17-4b6a-9bab-1a29dd292d8c'; // Geocaching HQ else if (type == '3774') tx = '&tx=af820035-787a-47af-b52b-becc8b0c0c88'; // Geocaching HQ Celebration else if (type == '7005') tx = '&tx=51420629-5739-4945-8bdd-ccfd434c0ead'; // Giga else tx = '&tx=9a79e6ce-3344-409c-bbe9-496530baf758'; // Alle Caches return tx; } // Prepare keydown F2 and Ctrl+s in filter screens of Search Map and search page. function prepareKeydownF2InFilterScreen() { if (settings_submit_log_button && $('button.gc-filter-toggle')[0] && !$('.set_clickevent_to_filter_button')[0]) { $('button.gc-filter-toggle').addClass('set_clickevent_to_filter_button'); $('button.gc-filter-toggle')[0].addEventListener('click', function() { function waitForFilterScreen(waitCount) { if ($('.gc-button-primary')[0]) { function keydownF2InFilterScreen(e) { if (e.keyCode == 113 && noSpecialKey(e)) { $('.gc-button-primary').click(); } if (e.keyCode == 83 && e.ctrlKey == true && e.altKey == false && e.shiftKey == false) { e.preventDefault(); $('.gc-button-primary').click(); } } window.addEventListener('keydown', keydownF2InFilterScreen, true); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){waitForFilterScreen(waitCount);}, 50);} } waitForFilterScreen(0); }, false); } } // Count of logs displayed when starting the listing. function countOfLogsInListing() { var logsCountSign = ' 0' + settings_show_all_logs_count; var logsCount = parseInt(logsCountSign); if (logsCount < 30) logsCount = 30; else if (logsCount > 500) logsCount = 500; else if (logsCount%2 != 0) logsCount += 1; return logsCount; } // Output field separator. function separator(output) { if (output == '') return ''; else return ' | '; } // Get favorite score and use in custom function. function getFavoriteScore(gccode, func) { $.ajax({ type: "GET", cache: false, url: '/api/proxy/web/v1/geocache/'+gccode+'/favoritepoints/score', success: function(scoreResult) { var score = 0; if (scoreResult) score = scoreResult; if (score > 100) score = 100; func(score); } }); } // Show text in Markdown. // If HTML code is also to be processed, SafeMode must not be used. // If toolbar (class mdd_toolbar) or resizebar (class mdd_resizebar) is not built, it must be noted here. function showInMarkdown(side, SafeMode = true, toolbar = true, resizebar = true) { var md = side.MarkdownDeep({ SafeMode: SafeMode, toolbar: toolbar, resizebar: resizebar, AllowInlineImages: false, ExtraMode: false, RequireHeaderClosingTag: true, disableShortCutKeys: true, DisabledBlockTypes: [ BLOCKTYPE_CONST.h4, BLOCKTYPE_CONST.h5, BLOCKTYPE_CONST.h6 ], help_location: "/guide/markdown.aspx", active_modal_class: "modal-open", active_modal_selector: "html", additionalPreviewFilter: SmileyConvert() }); } //////////////////////////////////////// // 6.3 GC - User defined searchs ($$cap) (User defined searchs on the geocaching webpages.) //////////////////////////////////////// function create_config_css_search() { var css = ""; css += ".btn-context {"; css += " border: 0;"; css += " height: 40px;"; css += " margin-top: -4px;"; css += " text-indent: -9999px;"; css += " width: 30px;"; css += " margin-left: -8px;"; css += " margin-right: 10px;}"; css += ".btn-user {"; css += " background-color: transparent;"; css += " background-image: none;"; css += " border-color: #fff;"; css += " border-radius: 3px;"; css += " clear: both;"; css += " color: #fff;"; css += " margin-top: 0px;}"; css += ".filters-toggle {"; css += " display: inline-flex;}"; css += ".btn-user-active, .btn-user:hover, .btn-user:active {"; css += " background-color: #00b265;"; css += " border-color: #00b265;}"; css += ".btn-iconsvg {"; css += " -webkit-appearance: none;"; css += " width: unset !important;}"; css += ".btn-iconsvg svg {"; css += " width: 22px;"; css += " height: 22px;"; css += " margin-right: 3px;}"; css += ".add-list li {"; css += " padding: 2px 0;}"; css += ".add-list {"; css += " padding-bottom: 5px;}"; appendCssStyle(css); } function saveFilterSet() {setValue("settings_search_data", JSON.stringify(settings_search_data));} function actionOpen(id) { for (var i = 0; i < settings_search_data.length; i++) { if (settings_search_data[i].id == id) { document.location.href = settings_search_data[i].url; break; } } } function actionRename(id, name) { for (var i = 0; i < settings_search_data.length; i++) { if (settings_search_data[i].id == id) { settings_search_data[i].name = name; saveFilterSet(); break; } } } function actionUpdate(id, page) { for (var i = 0; i < settings_search_data.length; i++) { if (settings_search_data[i].id == id) { settings_search_data[i].url = page.split("#")[0]; settings_search_data[i].url = settings_search_data[i].url.replace(/&MfsId=(\d+)/, "") + "&MfsId=" + settings_search_data[i].id; saveFilterSet(); break; } } } function actionNew(name, page) { // Find latest id. var i = settings_search_data.length; var id = -1; for (var i = 0; i < settings_search_data.length; i++) { if (id < settings_search_data[i].id) id = settings_search_data[i].id; } settings_search_data[i] = {}; settings_search_data[i].id = id+1; settings_search_data[i].name = name; settings_search_data[i].url = page.split("#")[0]; settings_search_data[i].url = settings_search_data[i].url.replace(/&MfsId=(\d+)/, "") + "&MfsId=" + settings_search_data[i].id; saveFilterSet(); } function actionSearchDelete(id) { var tmp = []; for (var i = 0; i < settings_search_data.length; i++) { if (settings_search_data[i].id != id) tmp[tmp.length] = settings_search_data[i]; } settings_search_data = tmp; saveFilterSet(); } function updateUI() { if ($("#searchContextMenu").length == 0) { var html = ""; html += '
          '; html += ''; html += '
            '; $("#ctxMenu").html(html); $('#btn-save').click(function() { var name = $("#nameSearch").val(); if (name == "") { alert("Insert name!"); $("#nameSearch").css('background-color', '#ffc9c9'); return; } else { actionNew(name, document.location.href); $("#nameSearch").css('background-color', '#ffffff'); } hideCtxMenu(); }); $('#btn-rename').click(function() { var id = $(this).data('id'); var name = $("#filter-name-rename").val(); actionRename(id, name); updateUI(); }); $('#btn-update').click(function() { var id = $(this).data('id'); var update = (document.location.href.indexOf("?")>=0?true:false); if (update) { actionUpdate(id, document.location.href); hideCtxMenu(); } }); } $("#filter-edit").hide(); if ($(".results").length != 0) $("#filter-new").show(); var html = ""; if (settings_search_data.length) { settings_search_data.sort(function(a, b){return a.name.toUpperCase()>b.name.toUpperCase();}); } for (var i = 0; i < settings_search_data.length; i++) { html += '
          • '; var id = 'data-id="'+settings_search_data[i].id+'"'; var t = (settings_search_data[i].url == document.location.href.split("#")[0])?true:false; html += ''; html += '
            '; html += '
            '; html += '
          • '; } $("#filterlist").html(html); $('.action-open').click(function() { var id = $(this).data('id'); actionOpen(id); }); $('.action-delete').click(function() { var id = $(this).data('id'); actionSearchDelete(id); updateUI(); }); $('.action-rename').click(function() { var id = $(this).data('id'); $('#filter-new').hide(); $('#filter-edit').show(); $('#btn-rename').data('id', id); $('#btn-update').data('id', id); var update = (document.location.href.indexOf("?")>=0?true:false); if (update) $('#div-btn-update').show(); else $('#div-btn-update').hide(); $("#filter-name-rename").val("n/a"); for (var i = 0; i < settings_search_data.length; i++) { if (settings_search_data[i].id == id) { $("#filter-name-rename").val(settings_search_data[i].name); $('#filterName').text(settings_search_data[i].name); break; } } }); } function hideCtxMenu() { $('#ctxMenu').hide(); $('#filterCtxMenu').removeClass('btn-user-active'); } //--> #2170 #2055 Temporäre Deaktivierung des "Manage Filter Sets" Buttons bis die Funktionalität wieder hergestellt ist. settings_search_enable_user_defined = false; //<-- #2170 #2055 if (settings_search_enable_user_defined && is_page("find_cache")) { try { if (!($(".results").length || settings_search_data.length)) { } else { function waitForSearchForm(waitCount) { if ($("#gc-search-form")[0]) { $("#gc-search-form").append(''); $("#gc-search-form").append(''); $('#filterCtxMenu').click(function(e) { e.preventDefault(); var element = $('#ctxMenu'); if (element.css('display') == 'none') { updateUI(); element.show(); $(this).addClass('btn-user-active'); } else { element.hide(); $(this).removeClass('btn-user-active'); } }); var currentFilter = ""; for (var i = 0; i < settings_search_data.length; i++) { if (settings_search_data[i].url == document.location.href.split("#")[0]) { currentFilter = "Current Filter Set: "+settings_search_data[i].name; } } $(".button-group-dynamic").append(''+currentFilter+''); // Close the dialog div if a mouse click outside. $(document).mouseup(function(e) { var container = $('#ctxMenu'); if (container.css('display') != 'none') { if (!container.is(e.target) && !($('#filterCtxMenu').is(e.target)) && // If the target of the click isn't the container... container.has(e.target).length === 0) { // ... nor a descendant of the container container.hide(); $('#filterCtxMenu').removeClass('btn-user-active'); } } return false; }); // Prepare keydown F2 and Ctrl+s in filter screen of search page. prepareKeydownF2InFilterScreen(); } else {waitCount++; if (waitCount <= 100) setTimeout(function(){waitForSearchForm(waitCount);}, 100);} } waitForSearchForm(0); } } catch(e) {gclh_error("User defined search",e);} } /////////////////////////////// // 6.4 GC - Find Player ($$cap) (Find Player on the geocaching webpages.) /////////////////////////////// // Create and hide the "Find Player" Form. function createFindPlayerForm() { btnClose(); if (checkTaskAllowed("Find Player", true) == false) return; if ($('#bg_shadow')[0]) { if ($('#bg_shadow')[0].style.display == "none") $('#bg_shadow')[0].style.display = ""; } else buildBgShadow(); if ($('#findplayer_overlay')[0] &&$('#findplayer_overlay')[0].style.display == "none") $('#findplayer_overlay')[0].style.display = ""; else { // Overlay erstellen var html = ""; html += "

            Find Player

            "; html += "
            "; html += ""; html += ""; html += " "; html += " "; html += "
            "; var side = $('body')[0]; var div = document.createElement("div"); div.setAttribute("id", "findplayer_overlay"); div.setAttribute("style", "z-index: 9999"); div.setAttribute("align", "center"); div.innerHTML = html; div.appendChild(document.createTextNode("")); side.appendChild(div); $('#btn_close1')[0].addEventListener("click", btnClose, false); $('#findplayer_overlay input[type=submit], #btn_close1').click(function() {if ($(this)[0]) animateClick(this);}); } // Damit Linklist zuklappt. if ($('.hover.open')[0]) $('.hover.open')[0].className = ""; $('#findplayer_field')[0].focus(); } ////////////////////////////// // 6.5 Config ($$cap) (GClh Config on the geocaching webpages.) // 6.5.1 Config - Main ($$cap) (GClh Config on the geocaching webpages.) ////////////////////////////// function checkboxy(setting_id, label) { // Hier werden auch gegebenenfalls "Clone" von Parametern verarbeitet. (Siehe Erläuterung weiter unten bei "setEvForDouPara".) var setting_idX = setting_id; setting_id = setting_idX.replace(/(X[0-9]*)/, ""); return ""; } function show_help(text) { return "?" + text.replace(/"; } function create_coloring_css() { var css = ''; // Background css += ".settings_overlay, #findplayer_overlay, #save_overlay {"; css += " background-color: #" + settings_color_bg + ";"; css += " border: 1.5px solid #" + settings_color_bo + ";}"; css += "#findplayer_overlay {border: 1.5px solid #" + settings_color_bo + " !important;}"; css += ".gclh_thanks_table {border: 2px solid #" + settings_color_bg + ";}"; // Helptext css += "a.gclh_info span {"; css += " background-color: #" + settings_color_ht + ";"; css += " border: 1px solid #" + settings_color_bo + ";"; css += " box-shadow: 1px 1px 3px 0px rgb(119, 133, 85);}"; // Input fields css += ".gclh_content input[type='text'], .gclh_content input[type='text']:focus, .gclh_content input[type='text']:active, .gclh_content textarea, .gclh_content select, .gclh_content button, .gclh_content pre, #findplayer_field {"; css += " background-color: #" + settings_color_if + ";"; css += " border: 1.5px solid #" + settings_color_bo + ";}"; css += "#navi_search {"; css += " background-color: #" + (settings_color_navi_search ? settings_color_if : "D8CD9D") + ";"; css += " border: 1.5px solid #" + (settings_color_navi_search ? settings_color_bo : "778555") + ";}"; // Buttons hover css += ".gclh_content button:hover, .gclh_content input[type='button']:hover, .gclh_rc_form input[type='button']:hover, #findplayer_overlay input[type='button']:hover, #findplayer_overlay input[type='submit']:hover {"; css += " background-color: #" + settings_color_bh + ";"; css += " box-shadow: 1px 1px 2px 1px rgb(119, 133, 85);}"; // Buttons css += ".gclh_content button, .gclh_content input[type='button'], .gclh_rc_form input[type='button'], #findplayer_overlay input[type='button'], #findplayer_overlay input[type='submit'] {"; css += " background-color: #" + settings_color_bu + ";"; css += " border: 1.5px solid #" + settings_color_bo + ";"; css += " box-shadow: 1px 1px 2px 0px rgb(119, 133, 85);}"; // Linklist right column. css += ".gclh_linklist_right {border: 1.5px solid #" + settings_color_bo + ";}"; // Headlines. css += ".gclh_headline {background-color: #" + settings_color_bo + "; display: block;}"; // Other areas. css += ".gclh_rc_area, .gclh_thanks_area {border: 1px solid #" + settings_color_bo + ";}"; // New parameter with version. css += ".gclh_new_para10 {background-color: #" + settings_color_nv + ";}"; css += ".gclh_new_para06 {background-color: #" + settings_color_nv + "99;}"; css += ".gclh_new_para03 {background-color: #" + settings_color_nv + "47;}"; return css; } var t_reqChl = "This option requires \"Change header layout\"."; var t_reqChlSLoT = "This option requires \"Change header layout\" and \"Show Linklist on top\"."; var prem = " "; var dt_display = [ ["greater than or equal to",">="], ["equal to","="], ["less than or equal to","<="] ]; var dt_score = [ ["1","1"], ["1.5","1.5"], ["2","2"], ["2.5","2.5"], ["3","3"], ["3.5","3.5"], ["4","4"], ["4.5","4.5"], ["5","5"] ]; var onlyBrowseMap = ' ' + browse_map_icon + ''; var onlySearchMap = ' ' + search_map_icon + ''; var onlyBrowseMapBehindIcon = '' + browse_map_icon + ''; function gclh_createSelectOptionCode(id, data, selectedValue) { var html = ""; html += ''; return html; } // Configuration Menü. function gclh_showConfig() { btnClose(false); if (checkTaskAllowed('Config', true) == false) return; window.scroll(0, 0); if ($('#bg_shadow')[0]) { if ($('#bg_shadow')[0].style.display == "none") $('#bg_shadow')[0].style.display = ""; } else buildBgShadow(); if (settings_make_config_main_areas_hideable && !document.location.href.match(/#a#/i)) { var prepareHideable = ''+expand_icon.replace(/#id#/, "lnk_gclh_config_#id#")+''; } else var prepareHideable = ""; if ($('#settings_overlay')[0] && $('#settings_overlay')[0].style.display == "none") { $('#gclh_config_content_thanks').hide(); $('#gclh_config_content1').show(); $('#gclh_config_content3').show(); $('#settings_overlay')[0].style.display = ""; } else { var div = document.createElement("div"); div.setAttribute("id", "settings_overlay"); div.setAttribute("class", "settings_overlay"); var html = ""; html += "

            GC little helper II Configurator v" + scriptVersion + "

            "; html += "
            "; html += "
            "; html += ""; html += " " + ""; html += "Help | "; html += "FAQ | "; html += "Bug & New Feature | "; html += "Changelog | "; html += "Update | "; html += "Reset | "; html += "Thanks | "; html += "About"; html += "
            "; html += "
            "; html += "
            "; html += "" + show_help("This option should help you to come back to an efficient configuration set, after some experimental or other motivated changes. This option load a reasonable standard configuration and overwrite your configuration data in parts.

            The following data are not overwrited: Home coordinates; homezone circle and multi homezone circles; date format; log templates; cache log, TB log and other signatures; friends data; links in Linklist and differing description and custom links.
            Dynamic data, like for example autovisits for named trackables, are not overwrited too.

            After reset, choose button \"Close\" and go to GClh II Config to skim over the set of data.") + "
            "; html += "" + show_help("This option reorganize the configuration set. Unused parameters of older script versions are deleted. And the dynamic data like the autovisit settings for every TB, the seen friends data of founds and hides, the DropBox token and the hidden banners are deleted too. Especially the VIPs, VUPs and Linklist settings are not deleted of course.

            After reset, choose button \"Close\".") + "

            "; html += "" + show_help("This option could help you with problems around your home coordinates, like for example with your main homezone, with nearest lists or with your home coordinates itself. Your home coordinates are not deleted at GC, but only in GClh II Config.

            After reset, you have to go to the account settings page of GC to the area \"Home Location\", so that GC little helper II can save your home coordinates again automatically. You have only to go to this page, you have nothing to do at this page, GC little helper II save your home coordinates automatically.
            Or you enter your home coordinates manually in GClh II Config.

            At last, choose button \"Close\"."); html += " (After reset, go to Home Location )" + "
            "; html += "" + show_help("This option could help you with problems with your own trackables lists, which based on an special id, the uid. The uid are not deleted at GC, but only in GClh II Config.

            After reset, you have to go to your dashboard, so that GC little helper II can save your uid again automatically. You have only to go to this page, you have nothing to do at this page, GC little helper II save the uid automatically.

            At last, choose button \"Close\"."); html += " (After reset, go to Dashboard )" + "

            "; html += "
            "; html += " "; html += "
            "; html += "
            ";
                        html += "
            "; html += "
            "; html += "
            "; html += "
            "; html += "There are numerous persons who have shaped and advanced the tool with their time and their know-how. Many thanks to all of you!

            "; html += ""; html += " "; html += " "; html += " "; html += " "; //--> $$006 // Bezeichnung: GC Name Abw. GitHub Name ProjM DevL Dev BugR Separator html += thanksLineBuild("2Abendsegler", "", true, true, true, true, false); html += thanksLineBuild("capoaira", "", false, true, true, true, false); html += thanksLineBuild("Ruko2010", "", false, true, true, true, true ); // Rangliste Development von hier https://github.com/2Abendsegler/GClh/graphs/contributors. html += thanksLineBuild("CachingFoX", "", false, false, true, true, false); html += thanksLineBuild("Die Batzen", "DieBatzen", false, false, true, true, false); html += thanksLineBuild("Herr Ma", "", false, false, true, true, false); html += thanksLineBuild("Dratenik", "", false, false, true, false, false); html += thanksLineBuild("ChristianGK", "ChristianGK-GC", false, false, true, true, false); html += thanksLineBuild("DrakMrak", "", false, false, true, false, false); html += thanksLineBuild("radlerandi", "", false, false, true, false, false); html += thanksLineBuild("Nicole1338", "", false, false, true, false, false); html += thanksLineBuild("CastParo", "LittleJohn-DD", false, false, true, true, false); html += thanksLineBuild("ramirez_", "ramirezhr", false, false, true, false, false); html += thanksLineBuild("king-ton", "", false, false, true, false, false); html += thanksLineBuild("dontpänic", "haarspalter", false, false, true, false, false); html += thanksLineBuild("Bananeweizen", "", false, false, true, false, false); html += thanksLineBuild("sunhillduo", "Yannick-XY", false, false, true, false, false); html += thanksLineBuild("ColleIsarco", "", false, false, true, true, false); html += thanksLineBuild("Pzi", "PetziAt", false, false, true, false, false); html += thanksLineBuild("", "sdennler", false, false, true, false, false); html += thanksLineBuild("ztNFny", "", false, false, true, true, false); html += thanksLineBuild("FoxFil", "", false, false, true, true, true); // Bug Reporting alphabetisch. html += thanksLineBuild("", "allyourcodearebelongtous", false, false, false, true, false); html += thanksLineBuild("", "AndyPuma", false, false, false, true, false); html += thanksLineBuild("", "anvanlaer", false, false, false, true, false); html += thanksLineBuild("arbor95", "", false, false, false, true, false); html += thanksLineBuild("Arnos99", "", false, false, false, true, false); html += thanksLineBuild("barnold", "barnoldGEOC", false, false, false, true, false); html += thanksLineBuild("bogmen", "Bogmen", false, false, false, true, false); html += thanksLineBuild("BlueEagle23", "", false, false, false, true, false); html += thanksLineBuild("Cappa-d", "", false, false, false, true, false); html += thanksLineBuild("Chrono81", "", false, false, false, true, false); html += thanksLineBuild("dennistreysa", "", false, false, false, true, false); html += thanksLineBuild("Die C-SAU Bande", "UJstr", false, false, false, true, false); html += thanksLineBuild("Donnerknispel", "", false, false, false, true, false); html += thanksLineBuild("", "gboye", false, false, false, true, false); html += thanksLineBuild("", "jet2mike", false, false, false, true, false); html += thanksLineBuild("Jipem", "", false, false, false, true, false); html += thanksLineBuild("joemadder", "", false, false, false, true, false); html += thanksLineBuild("lostinthegarden", "Gitve3jf", false, false, false, true, false); html += thanksLineBuild("Lineflyer", "", false, false, false, true, false); html += thanksLineBuild("Magpie42", "MagpieFourtyTwo", false, false, false, true, false); html += thanksLineBuild("☺Mitchsa & firefly70", "Mitchsa", false, false, false, true, false); html += thanksLineBuild("muddypuddles", "MuddyPuddles", false, false, false, true, false); html += thanksLineBuild("MrZaibot", "", false, false, false, true, false); html += thanksLineBuild("PHIL", "gcPhil", false, false, false, true, false); html += thanksLineBuild("Pontiac_CZ", "PontiacCZ", false, false, false, true, false); html += thanksLineBuild("reodor09", "", false, false, false, true, false); html += thanksLineBuild("RoRo", "RolandRosenfeld", false, false, false, true, false); html += thanksLineBuild("stepborc", "", false, false, false, true, false); html += thanksLineBuild("TiBaWe", "", false, false, false, true, false); html += thanksLineBuild("Tungstène", "Tungstene", false, false, false, true, false); html += thanksLineBuild("V60", "V60GC", false, false, false, true, false); html += thanksLineBuild("vylda", "", false, false, false, true, false); html += thanksLineBuild("winkamol", "", false, false, false, true, false); var thanksLastUpdate = "18.04.2024"; //<-- $$006 html += " "; html += "
            Project ManagementDevelopment LeadDevelopmentBug Reporting" + show_help("Bugs reported to the issue system on GitHub.") + "
            "; html += "Last update: " + thanksLastUpdate + " "; html += "
            "; html += "
            "; html += "
            "; html += "
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","global")+"

            "; html += "
            "; html += "" + show_help("Your home coordinates are automatically updated if you change them on the geocaching page. You can also enter it here manually. These coordinates are used to show your home zone on the map and also for various links to find nearby caches.") + "
            "; html += checkboxy('settings_set_default_langu', 'Set default language '); html += "" + show_help("Here you can set the default language for the geocaching pages. In the case that apps change the language on the geocaching pages, the default language is automatically set again.") + "
            "; html += " " + "Page width px" + show_help("With this option you can expand the page width on the geocaching pages. The default value on the geocaching pages is 950 pixels.") + "
            "; html += checkboxy('settings_submit_log_button', 'Activate F2 key to finish certain operations') + show_help("With this option you are able to finish certain operations by pressing the F2 key or by pressing the Ctrl and s keys together, instead of scrolling to the button and pressing the button with the mouse.

            Supported operations:
            - Logging: Post new cache log
            - Logging: Post changed cache log
            - Logging: Post new TB log
            - Logging: Post changed TB log
            - Cache listing: Save Personal Cache Note
            - Pocket Query: Save Pocket Query
            - Search Map: Apply filters
            - Search caches: Apply filters
            - Hide a cache: Complete process
            - Create a bookmark for a cache (old bookmark process)") + "
            "; html += "
            Header Layout" + "
            "; html += checkboxy('settings_change_header_layout', "Change header layout") + show_help("This allows you to redesign the header layout on the geocaching pages.") + "
            "; html += "   " + checkboxy('settings_show_smaller_gc_link', 'Show smaller GC logo top left') + "
            "; html += "     " + checkboxy('settings_remove_logo', 'Remove GC logo top left') + show_help("With this option you can remove the GC logo top left on GC pages. This feature is not fully integrated in the diverse possibilities of the header layout and the navigation menus.") + "
            "; html += "   " + checkboxy('settings_remove_message_in_header', 'Remove message center icon top right') + show_help("With this option you can remove the message center icon top right on GC pages. You will not be informed longer about new messages.") + "
            "; html += "   " + checkboxy('settings_gc_tour_is_working', 'Reserve place for GC Tour icon') + show_help("If the script GC Tour is running, you can reserve a place top left on GC pages for the GC Tour icon.") + "
            "; html += "   " + checkboxy('settings_fixed_header_layout', 'Arrange header layout on content') + show_help("With this option you can arrange the header width on the width of the content of GC pages. This is an easy feature with some restrictions, like for example the available place, especially for horizontal navigation menues.

            This feature is available on GC pages in the oldest design like for example cache and TB listings, pocket queries, nearest lists, old dashboards (profiles), statistics, watchlists and drafts, to name just a few.

            On map page and on pages in the newer and newest design it is not available, partly because the content on these pages are not yet in an accurate width, like the newer search cache page or the message center page. Also this feature is not fully integrated in the diverse possibilities of the header layout and the navigation menus. But we hope the friends of this specific header design can deal with it.") + "
            "; html += checkboxy('settings_bookmarks_on_top', "Show Linklist on top") + show_help("Show the Linklist on the top of GC pages, beside the other links. You can configure the links in the Linklist at the end of this configuration page.") + "
            "; html += checkboxy('settings_upgrade_button_header_remove', 'Remove Upgrade button (basic members)') + "
            "; html += "
            User Related Layout" + "
            "; var content_settings_show_vip_list = "The VIPs (Very Important Persons) feature consist of
            - the user related icon on numerous pages,
            - the VIP lists in the cache and event listings and
            - the VIP list in the dashboard.

            You can add any user on numerous pages to your VIP lists by clicking the little VIP icon beside the user. If it is green, this person is a VIP.

            The VIP lists in the cache and event listings are lists, displayed at the right side in the cache and event listings. The main VIP list only shows VIPs and the logs of VIPs, which already posted a log to this listing. So, you are able to see which of your VIPs already found this cache.

            On your dashboard page there is an overview list of all your VIPs."; html += checkboxy('settings_show_vip_list', 'Process VIPs') + show_help(content_settings_show_vip_list + "

            You can adjust details about this feature in the Listing and Dashboard topics.") + "
            "; var content_settings_process_vup = "The VUPs (Very Unimportant Persons) feature consist of
            - the user related icon on numerous pages,
            - the restrict display of content from this user in the cache and event listings and
            - the VUP list in the dashboard.

            You can add any user on numerous pages to your VUP list by clicking the little VUP icon beside the user. If it is red, this person is a VUP.

            In the logs of VUPs in the cache and event listings will only shown \"censored\" instead of the log text.

            On your dashboard page there is an overview of all your VUPs."; html += "  " + checkboxy('settings_process_vup', 'Process VUPs') + show_help(content_settings_process_vup + "

            You can adjust details about this feature in the Listing and Dashboard topics.") + "
            "; html += checkboxy('settings_show_mail', 'Show mail link beside user') + show_help("With this option there will be an small mail icon beside every user on numerous pages. With this icon you get directly to the mail form to mail to this user. If you click it for example when you are in a listing, the cachename or GC code can be inserted into the mail form about placeholders in the mail / message form template.") + "
            "; html += "  " + checkboxy('settings_mail_icon_new_win', 'Open mail form in new browser tab') + "
            "; html += checkboxy('settings_show_message', 'Show message link beside user') + "
            "; html += "  " + checkboxy('settings_message_icon_new_win', 'Open message form in new browser tab') + "
            "; html += "
            Hiding" + "
            "; html += checkboxy('settings_hide_advert_link', 'Hide link to advertisement instructions') + "
            "; html += checkboxy('settings_hide_facebook', 'Hide login procedures via Facebook, Google, Apple') + "
            "; html += checkboxy('settings_hide_socialshare', 'Hide social sharing via Facebook, Twitter (X)') + "
            "; html += checkboxy('settings_hide_feedback_icon', 'Hide feedbacks and surveys') + show_help('With this option you can hide for example the green feedback icon bottom right on a page or the survey about the purpose of the visit of the cache owner dashboard page.') + "
            "; html += checkboxy('settings_hide_warning_message', 'Hide warning message') + show_help("With this option you can choose the possibility to hide a potential warning message of the masters of the GC pages.

            One example is the down time warning message which comes from time to time and is placed unnecessarily a lot of days at the top of pages. You can hide it except for a small line in the top right side of the pages. You can activate the warning message again if your mouse goes to this area.

            If the warning message is deleted of the masters, this small area is deleted too.") + "
            "; html += checkboxy('settings_remove_banner', 'Hide a blue banner (added close button to each of them)') + show_help("With blue banners below the page header, new page layouts or new features are pointed out. If you don't want that, you don't have the option to hide the annoying banner. This parameter adds a button to decide which banners to hide. If the parameter is deactivated, the hidden banners are deleted again.") + "
            "; html += "
            List Layout" + "
            "; html += ""; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += "
            Show lines inlists" + show_help("Lists are all common lists but not the TB listings and not the cache or event listings.") + "cache listingsTB listingsin color
            for zebra" + show_help("With this options you can color every second line in the specified lists in the specified \"alternating\" color.") + "
            for you" + show_help("With this options you can color your logs respectively your founds in the specified lists in the specified color.") + "
            for owners
            for reviewers
            for VIPs
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","config") + "" + show_help("This topic contains the settings for the current page itself, the GClh II Config or short Config.") + "

            "; html += "
            "; html += checkboxy('settings_f4_call_gclh_config', 'Call via F4 key') + show_help("This option allows you to access the GClh II Config (this page) by pressing the F4 key on your keyboard from any GC page.") + "
            "; html += checkboxy('settings_call_config_via_sriptmanager', 'Call via the script manager') + show_help("This option creates a link to the GClh II Config in the menu of the script manager (Tampermonkey, Violentmonkey ...). With a click on the icon of the script manager you get to the menu of the script manager. The link to the GClh II Config is then located below the GC little helper II. The link is available on any GC page.") + "
            "; html += checkboxy('settings_f2_save_gclh_config', 'Save via F2 key') + show_help("This option allows you to save the GClh II Config (this page) by pressing the F2 key or by pressing the Ctrl and s keys together on your keyboard instead of scrolling down and selecting the Save button.") + "
            "; html += checkboxy('settings_esc_close_gclh_config', 'Close via ESC key') + show_help("This option allows you to close the GClh II Config (this page) by pressing the ESC key on your keyboard instead of scrolling down and selecting the Close button.") + "
            "; html += checkboxy('settings_show_save_message', 'Show info message when data are saved') + "
            "; html += checkboxy('settings_sort_default_bookmarks', 'Sort the default links for the Linklist') + show_help("This option allows you to sort the default links for the Linklist by description. You can configure these default links for use in your Linklist at the bottom of this GClh II Config.

            Changing this option will only take effect after saving.") + "
            "; html += checkboxy('settings_make_config_main_areas_hideable', 'Make the main areas hideable') + show_help("With this option you can show and hide the main areas in the GClh II Config (this page) with a left mouse click. With a right click you can show and hide all main areas in the GClh II Config.

            Changing this option will only take effect after saving.") + "
            "; html += "
            Color Scheme" + show_help("With these parameters the color scheme of the GClh II screens and fields can be adjusted. The settings affect the screens of the GClh II Config, with the main, reset and thanks screens, as well as the GClh II Sync screen and the GClh II Find player screen.

            To change a color, click on a color code. With the small buttons behind the color codes you can go back to the default color. With the preview buttons you can view and try out the settings for the colors before you save your own color scheme. In the first line there are ready-made color schemes.

            The settings also have an effect on the search field in the header of the geocaching pages, provided this feature is activated.

            Within the GClh II Config main screen there is also the color scheme for the versions, in which the last three versions are highlighted in color. The last version is given the color. For the previous two, the intensity of the color is reduced.") + "
            "; html += ""; html += ""; var c = ""; html += c.replace(/#1/g, 'Coloring background').replace(/#2/g, 'bg').replace(/#3/, settings_color_bg); html += c.replace(/#1/g, 'Coloring help texts').replace(/#2/g, 'ht').replace(/#3/, settings_color_ht); html += c.replace(/#1/g, 'Coloring input fields').replace(/#2/g, 'if').replace(/#3/, settings_color_if); html += c.replace(/#1/g, 'Coloring buttons with mouse' + show_help("The color of the buttons can be set here, in case the mouse is over it.")).replace(/#2/g, 'bh').replace(/#3/, settings_color_bh); html += c.replace(/#1/g, 'Coloring buttons').replace(/#2/g, 'bu').replace(/#3/, settings_color_bu); html += c.replace(/#1/g, 'Coloring frame of fields, screens').replace(/#2/g, 'bo').replace(/#3/, settings_color_bo); html += c.replace(/#1/g, 'Coloring new versions').replace(/#2/g, 'nv').replace(/#3/, settings_color_nv); html += "
            Color Schemes 
            #1  
            "; html += checkboxy('settings_color_navi_search', 'Coloring also search field in page header') + "
            "; html += checkboxy('settings_hide_colored_versions', 'Hide color scheme of the versions') + show_help("With this option the color representation of the versions and the version numbers in the GClh II Config (this page) can be selected.

            Changing this option will only take effect after saving.") + "
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","sync") + "" + show_help("This topic contains the settings for the GClh II Sync or short Sync.") + "

            "; html += "
            "; html += checkboxy('settings_f10_call_gclh_sync', 'Call via F10 key') + show_help("This option allows you to access the GClh II Sync by pressing the F10 key on your keyboard from any GC page.") + "
            "; html += checkboxy('settings_call_sync_via_sriptmanager', 'Call via the script manager') + show_help("This option creates a link to the GClh II Sync in the menu of the script manager (Tampermonkey, Violentmonkey ...). With a click on the icon of the script manager you get to the menu of the script manager. The link to the GClh II Sync is then located below the GC little helper II. The link is available on any GC page.") + "
            "; html += checkboxy('settings_show_save_messageX0', 'Show info message when data are imported') + "
            "; html += checkboxy('settings_sync_autoImport', 'Automatic synchronization with your Dropbox') + show_help("With this option you can automatically synchronize the data every 10 hours via the GClh II Sync from your Dropbox. That means uploading the data from your Dropbox to the GClh II Sync.") + "
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","pq")+"" + prem + "

            "; html += "
            "; html += checkboxy('settings_show_create_pq_from_pq_splitter', "Show feature to create PQs on Project-GC's PQ Splitter page") + show_help("On the Project-GC page there is a feature to split caches in pocket queries into packets of 1000 and 500 caches. For this purpose, lists with entries with publish date from and publish date to are generated. Thank you for this feature!

            With the help of the GC little helper II feature, the entries in these lists can be used to create corresponding pocket queries automatically. Deactivate this option if you do not want this feature to be displayed on the Project-GC page.") + "
            "; html += "
            List of Pocket Queries
            "; html += checkboxy('settings_fixed_pq_header', 'Show fixed header and footer') + show_help("Convenient for large list of pocket queries. With this option, you get a permanent view of the headers (weekday information) and footer (the number of running / remaining PQs) even if your list of pocket quieries is larger than your monitor.") + "
            " html += checkboxy('settings_compact_layout_list_of_pqs', 'Show compact layout') + "
            "; html += "   " + checkboxy('settings_both_tabs_list_of_pqs_one_page', 'Show both tabs of one page') + show_help("Show the both tabs \"Active Pocket Queries\" and \"Pocket Queries Ready for Download\" together of one page.") + "
            "; html += "
            Pocket Query
            "; html += checkboxy('settings_pq_warning', "Show a message in case of wrong settings") + show_help("Show a message if one or more options are in conflict. This helps to avoid pocket queries without results.") + "
            "; html += checkboxy('settings_pq_previewmap','Show preview map for coordinates from origin') + " "; html += ''+ "
            "; html += "
            Default Values for a New Pocket Query
            "; html += checkboxy('settings_pq_set_cachestotal', "Set number of caches to ") + "
            "; html += checkboxy('settings_pq_option_ihaventfound', "Enable option \"I haven't found\"") + "
            "; html += checkboxy('settings_pq_option_idontown', "Enable option \"I don't own\"") + "
            "; html += checkboxy('settings_pq_option_ignorelist', "Enable option \"Are not on my ignore list\"") + "
            "; html += checkboxy('settings_pq_option_isenabled', "Enable option \"Is Enabled\"") + "
            "; html += checkboxy('settings_pq_option_filename', "Enable option \"Include pocket query name in download file name\"") + "
            "; html += checkboxy('settings_pq_set_difficulty', "Set difficulity ") + gclh_createSelectOptionCode("settings_pq_difficulty", dt_display, settings_pq_difficulty) + ' ' + gclh_createSelectOptionCode("settings_pq_difficulty_score", dt_score, settings_pq_difficulty_score) + "
            "; html += checkboxy('settings_pq_set_terrain', "Set terrain ") + gclh_createSelectOptionCode("settings_pq_terrain", dt_display, settings_pq_terrain) + ' ' + gclh_createSelectOptionCode("settings_pq_terrain_score", dt_score, settings_pq_terrain_score) + "
            "; html += checkboxy('settings_pq_automatically_day', "Generate pocket query today") + show_help("The server time is used to determine the day of the week for the creation of the pocket query.") + "
            "; html += "
            Pocket Query Caches List
            "; var content_settings_show_log_it = checkboxy('settings_show_log_it', 'Show \"Log it\" icon in PQ, nearest and recently viewed caches list') + show_help("The GC little helper II \"Log it\" icon is displayed beside cache titles in a pocket query caches list, in a nearest caches list and in a recently viewed caches list. If you click it, you will be redirected directly to the log form.

            You can use it too as basic member to log premium member only (PMO) caches.") + "
            "; html += content_settings_show_log_it; html += checkboxy('settings_compact_layout_pqs', 'Show compact layout') + "
            "; html += "   " + checkboxy('settings_fav_proz_pqs', 'Show favorites percentage') + "
            "; var content_settings_open_tabs = "   " + checkboxy('settings_open_tabs_pqs', 'Show a button to open selected caches in new browser tabs') + show_help("This option displays a button to open selected caches in new browser tabs. The feature is available in a pocket query caches list and in a nearest caches list if the compact layout feature for the pocket query caches list respectively the compact layout for the nearest caches list is activated.

            If you have only two or three caches to open, you can also open the listings manually. However, if you want to do this for a full page with for example twenty caches, this feature can be helpful.") + "
            "; html += content_settings_open_tabs; html += "
            "; html += "

            "+prepareHideable.replace("#id#","nearestlist")+"

            "; html += "
            "; html += checkboxy('settings_redirect_to_map', 'Redirect cache search lists to map display') + show_help("If you enable this option, you will be automatically redirected from the older cache search lists (nearest lists) to map display. This is only possible in search lists with a link to the map display.

            Please note that a display of the search list is no longer possible, because it is always redirected to the map display.") + "
            "; html += checkboxy('settings_show_nearestuser_profil_link', 'Show profile link at search lists for caches created or found by user') + show_help("This option adds an link to the public user profile, when you are searching for caches created or found by a certain user.") + "
            "; html += content_settings_show_log_it.replace("show_log_it","show_log_itX0"); html += checkboxy('settings_compact_layout_nearest', 'Show compact layout') + "
            "; html += "   " + checkboxy('settings_fav_proz_nearest', 'Show favorites percentage') + "
            "; html += content_settings_open_tabs.replace('settings_open_tabs_pqs','settings_open_tabs_nearest'); html += "
            "; html += "

            "+prepareHideable.replace("#id#","recview")+"

            "; html += "
            "; html += content_settings_show_log_it.replace("show_log_it","show_log_itX1"); html += checkboxy('settings_compact_layout_recviewed', 'Show compact layout') + "
            "; html += "   " + checkboxy('settings_fav_proz_recviewed', 'Show favorites percentage') + "
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","bm")+"" + prem + "

            "; html += "
            "; html += checkboxy('settings_lists_compact_layout', 'Show compact layout') + show_help("With this option the list of bookmark lists, the bookmark lists, the favorites list and the ignore list is displayed in compact layout.") + "
            "; var content_status_line = "If the name of disabled and archived caches are specially represented and the identifier of premium member only caches are shown in an own column, the cache status line above the cache name is hidden."; html += checkboxy('settings_lists_disabled', 'Show name of disabled caches ') + checkboxy('settings_lists_disabled_strikethrough', 'strike through, in color '); html += ""; html += "" + show_help(content_status_line) + "
            "; html += checkboxy('settings_lists_archived', 'Show name of archived caches ') + checkboxy('settings_lists_archived_strikethrough', 'strike through, in color '); html += ""; html += "" + show_help(content_status_line) + "
            "; html += checkboxy('settings_lists_icons_visible', 'Set visibility of cache type icons and log status icons') + show_help("The cache type icon and the log status icon are sometimes slightly invisible and sometimes visible, if the cache is disabled or archived. With this and the following options, you can set it consistently, if the cache is disabled or archived.") + "
            "; html += "   " + checkboxy('settings_lists_cache_type_icons_visible', 'Make the cache type icon visible when the cache is disabled or archived') + "
            "; html += "   " + checkboxy('settings_lists_log_status_icons_visible', 'Make the cache status icon visible when the cache is disabled or archived') + "
            "; html += checkboxy('settings_lists_premium_column', 'Set identifier of premium member only caches in own column') + show_help(content_status_line) + "
            "; html += checkboxy('settings_lists_found_column_bml', 'Set found smiley in own column') + show_help("Only in bookmark lists, not in favorites list and ignore list.") + "
            "; html += checkboxy('settings_lists_show_log_it', 'Show \"Log it\" icon') + show_help("The GC little helper II \"Log it\" icon is displayed beside cache titles. If you click it, you will be redirected directly to the log form. It is only available in bookmark lists, not in favorites list and ignore list.

            You can use it too as basic member to log premium member only (PMO) caches.") + "
            "; html += checkboxy('settings_lists_back_to_top', 'Hide \"Back to top\" icon') + "
            "; html += checkboxy('settings_lists_show_dd', 'Show dropdown menu with additional stuff') + show_help("Add an icon with dropdown menu in own and foreign bookmark lists, in the favorites list and in the ignore list with additional GC little helper II functionality.") + "
            "; html += "   " + checkboxy('settings_lists_hide_desc', 'Show/hide cache descriptions') + show_help("Add an entry in the dropdown menu to show and hide the cache descriptions.") + "
            "; html += "   " + checkboxy('settings_lists_upload_file', 'Upload caches from file') + show_help("Add an entry in the dropdown menu to upload caches from a file into the bookmark list.

            The caches in .gpx and .loc files are expected in the standard scheme of such files.

            The caches in other files are expected with an usual separator like for example a blank, a komma or an other usual sign.") + "
            "; html += "   " + checkboxy('settings_lists_open_tabs', 'Open selected caches in new browser tabs') + show_help("This feature add an entry in the dropdown menu to open selected caches in new browser tabs. The feature is available in own and foreign bookmark lists and in the ignore list.

            If you have only two or three caches to open, you can also open the listings manually. However, if you want to do this for a full page with for example twenty caches, this feature can be helpful.") + "
            "; html += checkboxy('settings_bm_changed_and_go', 'After change of old bookmark go to bookmark list automatically') + show_help("With this option you can switch to the bookmark list automatically after a change of a bookmark (old form). The confirmation page of this change will skip.") + "
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","friends")+"

            "; html += "
            "; html += checkboxy('settings_automatic_friend_reset', 'Reset difference counter on friends list automatically') + show_help("If you enable this option, the difference counter at friends list will automatically reset if you have seen the difference and if the day changed.") + "
            "; html += checkboxy('settings_friendlist_summary', 'Show summary for new finds/hides in friends list') + show_help("With this option you can show a summary of all new finds/hides of your friends on the friends list page") + "
            "; html += "   " + checkboxy('settings_friendlist_summary_viponly', 'Show summary only for friends in VIP list') + "
            "; html += checkboxy('settings_show_vup_friends', 'Show VUP icons on friends list') + show_help("With this option you can choose if VUP icons are shown addional on friends list or not. If you deactivate this option and a friend is a VUP, then the VIP icon is replaced by the VUP icon anyway.
            (VUP: Very unimportant person)
            (VIP: Very important person)") + "
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","hide")+"

            "; html += "
            "; html += checkboxy('settings_hide_cache_approvals', 'Auto set approval in hide cache process') + show_help("This option activates the checkbox for approval the \"terms of use agreement\" and the \"geocache hiding guidelines\" in the hide cache process.") + "
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","others")+"

            "; html += "
            "; html += checkboxy('settings_search_enable_user_defined', 'Enable user defined filter sets for geocache searchs') + show_help("This features enables you to store favorites filter settings in the geocache search and call them quickly.") + prem + "
            "; html += checkboxy('settings_show_sums_in_watchlist', 'Show number of caches in your watchlist') + show_help("With this option the number of caches and the number of selected caches in the categories \"All\", \"Archived\" and \"Deactivated\", corresponding to the select buttons, are shown in your watchlist at the end of the list.") + "
            "; html += checkboxy('settings_hide_archived_in_owned', 'Hide archived caches in owned list') + "
            "; html += checkboxy('settings_show_button_for_hide_archived', 'Show button to display all, active or archived caches in owned list') + show_help('With this option a button is shown in owned caches list to display all caches, only active caches or only archived caches in the owned caches list.') + "
            "; html += checkboxy('settings_compact_layout_cod', 'Show compact layout on your cache owner dashboard') + "
            "; html += checkboxy('settings_show_button_fav_proz_cod', 'Show button to show the favorite percentage of your hidden caches') + show_help("Only for published and archived caches, not for events and unpublished caches.") + "
            "; html += checkboxy('settings_show_compact_certitude_information', 'Show information overview on Certitude\'s solution page') + show_help("Show a compact information overview and a Copy to Clipboard button after successfully passing a Certitude page.") + "
            "; html += checkboxy('settings_anonymous_on_certitude', 'Do not get listed on Certitude\'s solvers rank page') + show_help("Always activate the \"Stay anonymous\" checkbox. If the solution is correct, the nickname will not be listed in the ranking.") + "
            "; html += newParameterOn2; html += checkboxy('settings_improve_notifications', 'Improve notification list and notifications') + "
            "; html += newParameterVersionSetzen('0.15') + newParameterOff; html += "
            "; html += "

            "+prepareHideable.replace("#id#","maps")+"

            "; html += "
            "; html += checkboxy('settings_relocate_other_map_buttons', 'Relocate the buttons \"Search\" and \"Browse geocaches\" to the other buttons') + "
            "; html += checkboxy('settings_searchmap_autoupdate_after_dragging', 'Automatic search for new caches after dragging or zooming') + onlySearchMap + "
            "; html += checkboxy('settings_searchmap_compact_layout', 'Show compact layout on cache detail screen') + show_help("If compact layout is enabled and the name of disabled caches are specially represented, the cache status line above the cache name is hidden.") + onlySearchMap + "
            "; html += checkboxy('settings_searchmap_disabled', 'Show name of disabled caches ') + checkboxy('settings_searchmap_disabled_strikethrough', 'strike through, in color '); html += ""; html += ""; html += show_help("If compact layout is enabled and the name of disabled caches are specially represented, the cache status line above the cache name is hidden.") + onlySearchMap + '
            '; html += checkboxy('settings_searchmap_show_hint', 'Show hint of cache automatically on cache detail screen') + onlySearchMap + "
            "; html += checkboxy('settings_searchmap_show_btn_save_as_pq', 'Show button "Save as Pocket Query"') + show_help("Adds a button in the sidebar of the Search Map to save the actual map view as a pocket query (like on the Browse Map).
            Note that not all filters on the map are also available on Pocket Query.") + onlySearchMap + "
            "; html += "   " + checkboxy('settings_save_as_pq_set_all', 'Set filter values "All"') + show_help("If filter values \"All\" are set and the map parameter \"Set defaults\" is enabled, the default values are still prevented from asserting themselves. Otherwise, the defaults prevail. This makes it possible, for example, to see caches found and not found on the map, this is \"All\". So you can see on the map whether you have been around here before. At the same time, however, a default value for \"I haven't found\" may be set in the PQ. After all, the caches found are of little interest in the PQ. That might sound complicated, but it can be valuable if you understand it because you don't have to make any more changes to the map's filter before generating the PQ.") + "
            "; html += checkboxy('settings_map_show_btn_hide_header', 'Show button "Hide Header"') + '
            ' html += checkboxy('settings_show_eventdayX0', 'Show weekday of an event') + show_help("With this option the day of the week will be displayed next to the event date.") + "
            "; html += newParameterOn1; html += checkboxy('settings_show_found_caches_at_corrected_coords_but', 'Show button to display found caches at corrected coordinates') + show_help("With this option you can show a button to display found caches at corrected coordinates. The button toggles the state between corrected and original coordinates. The last state is always preserved.") + onlySearchMap + "
            "; html += checkboxy('settings_searchmap_improve_add_to_list', 'Show compact layout in \"Add to list\" pop up to bookmark a cache') + onlySearchMap + prem + "
            "; html += "    " + "Maximum height of pop up px" + show_help("With this option you can choose the maximum height of the \"Add to list\" pop up to bookmark a cache from 130 up to 520 pixel. The default is 130 pixel, similar to the standard.") + "
            "; html += newParameterVersionSetzen('0.14') + newParameterOff; html += "
            Homezone Circles" + onlyBrowseMap + "
            "; html += checkboxy('settings_show_homezone', 'Show homezone circles') + show_help("This option allows to draw homezone circles around coordinates on the map.") + "
            "; html += "
            "; html += ""; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; // Template. var hztp = ""; hztp += " "; hztp += " "; hztp += " "; hztp += " "; hztp += " "; // Homezone circle. var newHzEl = $('').append($(hztp)); newHzEl.find('tr').attr('class', 'homezone_element'); newHzEl.find('.radius').attr('id', 'settings_homezone_radius'); newHzEl.find('.color').attr('id', 'settings_homezone_color'); newHzEl.find('.opacity').attr('id', 'settings_homezone_opacity'); newHzEl.find('.coords').attr('disabled', ''); newHzEl.find('.coords').attr('class', 'gclh_form coords disabled'); newHzEl.find('.remove').attr('title', ''); newHzEl.find('.remove').attr('disabled', ''); newHzEl.find('.remove').attr('class', 'remove disabled'); html += newHzEl.html(); // Multi homezone circles. for (var i in settings_multi_homezone) { var hzel = settings_multi_homezone[i]; var newHzEl = $('').append($(hztp)); newHzEl.find('.radius').attr('value', hzel.radius); newHzEl.find('.color').attr('value', hzel.color); newHzEl.find('.opacity').attr('value', hzel.opacity); newHzEl.find('.coords').attr('value', DectoDeg(hzel.lat, hzel.lng)); html += newHzEl.html(); } html += " "; html += " "; html += "
            RadiusColor" + show_help("Default color is \"0000FF\".") + "Opacity" + show_help("Higher number is darker.
            Default opacity is \"10\".") + "
            Coordinates
            km %
            "; html += "
            Hide Map Elements
            "; html += checkboxy('settings_map_hide_sidebar', 'Hide sidebar by default') + "
            "; html += checkboxy('settings_hide_map_header', 'Hide header by default') + show_help("Note that you can only hide the header by default if you have activated the setting Show button \"Hide Header\".") + "
            "; html += checkboxy('settings_map_hide_found', 'Hide found caches by default') + prem + "
            "; html += checkboxy('settings_map_hide_hidden', 'Hide own caches by default') + prem + "
            "; html += checkboxy('settings_map_hide_dnfs', 'Hide DNF smileys by default') + onlyBrowseMap + prem + "
            "; html += " " + "Hide cache types by default " + prem + "
            "; var imgStyle = "style='padding-top: 4px; vertical-align: bottom;'"; var imageBaseUrl = "/map/images/mapicons/"; html += "   " + checkboxy('settings_map_hide_2', "") + "
            "; html += "   " + checkboxy('settings_map_hide_3', "") + "
            "; html += "   " + checkboxy('settings_map_hide_6', ""); html += "   " + checkboxy('settings_map_hide_13', "") + onlyBrowseMapBehindIcon; html += "   " + checkboxy('settings_map_hide_453', "") + onlyBrowseMapBehindIcon; html += "   " + checkboxy('settings_map_hide_7005', "") + onlyBrowseMapBehindIcon + "
            "; html += "   " + checkboxy('settings_map_hide_137', ""); html += "   " + checkboxy('settings_map_hide_4', ""); html += "   " + checkboxy('settings_map_hide_11', "") + "
            "; html += "   " + checkboxy('settings_map_hide_8', ""); html += "   " + checkboxy('settings_map_hide_5', ""); html += "   " + checkboxy('settings_map_hide_1858', "") + "
            "; html += "
            Layers in Map" + show_help("Here you can select the map layers which should be added into the map layers menu of the maps. With this option you can reduce the long list to the map layers you really need. If the right list of map layers is empty, all will be displayed. If you use other scripts like \"Geocaching Map Enhancements\", GC little helper II will overwrite its layercontrol. With this option you can disable GC little helper II map layers to use the map layers for example from \"Geocaching Map Enhancements\" or also from \"geocaching.com\".

            It is important, that GC little helper II run at first, particularly in front of other map layer used scripts like \"Geocaching Map Enhancements\".") + "
            "; html += checkboxy('settings_use_gclh_layercontrol', 'Replace map layers') + "
            "; html += "
            "; html += newParameterOn1; html += checkboxy('settings_use_gclh_layercontrol_on_browse_map', 'Replace map layers in Browse Map') + onlyBrowseMap + "
            "; html += checkboxy('settings_use_gclh_layercontrol_on_search_map', 'Replace map layers in Search Map') + onlySearchMap + "
            "; html += newParameterVersionSetzen('0.14') + newParameterOff; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += "


            Default layer   " + (settings_map_default_layer ? settings_map_default_layer:"not available") +""; html += " " + show_help("Here you can select the map source you want to use as default in the map. Mark a layer from the right list and push the button \"Set default layer\"."); html += "
            "; //>> Issue 2016 //html += checkboxy('settings_show_hillshadow', 'Show hillshadow by default') + show_help("If you want 3D-like-Shadow to be displayed by default, activate this feature.") + "
            "; //<< Issue 2016 html += "
            "; html += checkboxy('settings_sort_map_layers', 'Sort map layers in map') + "
            "; html += "
            "; html += "
            Google Maps Page
            "; html += checkboxy('settings_hide_left_sidebar_on_google_maps', 'Hide left sidebar on Google Maps by default') + "
            "; html += checkboxy('settings_add_link_gc_map_on_google_maps', 'Add link to Browse Map on Google Maps') + show_help("With this option an icon is placed on the Google Maps page to link to the same area in Browse Map.") + "
            "; html += "   " + checkboxy('settings_switch_from_google_maps_to_gc_map_in_same_tab', 'Switch in same browser tab') + "
            "; html += checkboxy('settings_add_link_new_gc_map_on_google_maps', 'Add link to Search Map on Google Maps') + show_help("With this option an icon is placed on the Google Maps page to link to the same area in Search Map.") + "
            "; html += "   " + checkboxy('settings_switch_from_google_maps_to_new_gc_map_in_same_tab', 'Switch in same browser tab') + "
            "; html += checkboxy('settings_add_link_google_maps_on_gc_map', 'Add link to Google Maps on Browse and Search Map') + show_help("With this option an icon is placed on the Browse Map and on the Search Map page to link to the same area in Google Maps.") + "
            "; html += "   " + checkboxy('settings_switch_to_google_maps_in_same_tab', 'Switch in same browser tab') + "
            "; html += newParameterOn2; html += checkboxy('settings_add_links_google_maps_on_google_search', 'Add link to Google Maps on maps of the Google Search Results pages') + show_help("Since March 2024 Google Maps not being linked from Google Search Results pages in the European Union. With this option some of these links to Google Maps will be restored, so that the links to GC Maps on Google Maps can be used again. In particular, the links and buttons on the maps on the Google Search Results pages have been restored, so that the maps are clickable again.

            It is only relevant for the Member States of the European Union (EU) and for the Member States in the Europäischen Wirtschaftsraum (EWS) respectively for the Google Search Results pages with their top level domains. You can find details on googles support page here: https://support.google.com/websearch/thread/261655134") + "
            "; html += newParameterVersionSetzen('0.15') + newParameterOff; html += "
            Openstreetmap Page
            "; html += checkboxy('settings_add_link_gc_map_on_osm', 'Add link to Browse Map on Openstreetmap') + show_help("With this option an icon is placed on the Openstreetmap page to link to the same area in Browse Map.") + "
            "; html += "   " + checkboxy('settings_switch_from_osm_to_gc_map_in_same_tab', 'Switch in same browser tab') + "
            "; html += checkboxy('settings_add_link_new_gc_map_on_osm', 'Add link to Search Map on Openstreetmap') + show_help("With this option an icon is placed on the Openstreetmap page to link to the same area in Search Map.") + "
            "; html += "   " + checkboxy('settings_switch_from_osm_to_new_gc_map_in_same_tab', 'Switch in same browser tab') + "
            "; html += checkboxy('settings_add_link_osm_on_gc_map', 'Add link to Openstreetmap on Browse and Search Map') + show_help("With this option an icon is placed on the Browse Map and on the Search Map page to link to the same area in Openstreetmap.") + "
            "; html += "   " + checkboxy('settings_switch_to_osm_in_same_tab', 'Switch in same browser tab') + "
            "; html += "
            Flopp's Map Page
            "; html += checkboxy('settings_add_link_flopps_on_gc_map', 'Add link to Flopp\'s Map on Browse and Search Map') + show_help("With this option an icon is placed on the Browse Map and on the Search Map page to link to the same area in Flopp\'s Map.") + "
            "; html += "   " + checkboxy('settings_switch_to_flopps_in_same_tab', 'Switch in same browser tab') + "
            "; html += "
            GeoHack Page
            "; html += checkboxy('settings_add_link_geohack_on_gc_map', 'Add link to GeoHack on Browse and Search Map') + show_help("With this option an icon is placed on the Browse Map and on the Search Map page to link to the same area in GeoHack.") + "
            "; html += "   " + checkboxy('settings_switch_to_geohack_in_same_tab', 'Switch in same browser tab') + "
            "; html += newParameterOn2; html += "
            Komoot Page
            "; html += checkboxy('settings_add_link_komoot_on_gc_map', 'Add link to Komoot on Browse and Search Map') + show_help("With this option an icon is placed on the Browse Map and on the Search Map page to link to the same area in Komoot.") + "
            "; html += "   " + checkboxy('settings_switch_to_komoot_in_same_tab', 'Switch in same browser tab') + "
            "; html += newParameterVersionSetzen('0.15') + newParameterOff; html += "
            Enhanced Cache Data" + "
            "; html += checkboxy('settings_show_enhanced_map_popup', 'Show enhanced cache data') + show_help("With this option, additional cache data will be shown in the pop up on the Browse Map and in the cache detail screen on the left side of the Search Map. Additional cache data are for example the latest log symbols, the elevation data, the favorites in percentage, the number of the trackables, the personal cache note and further data.") + "
            "; html += "    " + "Show the latest log icons" + show_help("With this option, the choosen count of the latest logs icons is shown. If you move the mouse over a log icon, the log text is displayed in a pop up.") + "
            "; html += "   " + checkboxy('settings_show_country_in_place', 'Show country as part of the place') + show_help("With this option the place of the cache is displayed with state and country separated by a comma or only with state. In the latter case the complete place is displayed if you hover with the mouse over the field.

            You can use this also to prevent the line from being broken.") + "
            "; html += "   " + checkboxy('settings_show_enhanced_map_coords', 'Show the cache coordinates') + "
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","profile")+"

            "; html += "
            "; html += newParameterOn3; html += checkboxy('settings_public_profile_avatar_show_thumbnail', 'Show bigger avatar image while hovering with the mouse') + show_help("This option requires \"Show thumbnails of images\".") + "
            "; html += newParameterVersionSetzen('0.12') + newParameterOff; html += newParameterOn1; html += checkboxy('settings_public_profile_smaller_privacy_btn', 'Show smaller privacy buttons') + show_help("Replace the text and links for privacy with a clickable icon button.") + "
            "; html += newParameterVersionSetzen('0.14') + newParameterOff; html += "
            Geocaches
            "; html += checkboxy('settings_profile_old_links', 'Use old links to finds and hides caches') + show_help("The links to finds and hides caches in the public profile run through the new search. With this option you can use the old search again.") + "
            "; html += "
            Trackables
            "; html += checkboxy('settings_faster_profile_trackables', 'Load trackables faster without images') + show_help("With this option you can stop the load on the trackable pages after the necessary data are loaded. You disclaim of the lengthy load of the images of the trackables. This procedure is much faster as load all data, because every image is loaded separate and not in a bigger bundle like it is for the non image data.") + "
            "; html += "
            Gallery
            "; var content_settings_show_thumbnails = checkboxy('settings_show_thumbnails', 'Show thumbnails of images') + show_help("With this option the images are displayed as thumbnails to have a preview. If you hover with your mouse over a thumbnail, you can see the big one.

            This works in cache and TB logs, in the cache and TB image galleries and in the public profile image gallery.

            And after pressing button \"Show bigger avatars\" in cache listing, it also works for the avatars in the displayed logs in cache listing.

            And if you activate \"Show bigger avatar image while hovering with the mouse\", it also works for avatars in public profiles.") + "  Max size of big image px
            "; html += content_settings_show_thumbnails.replace("show_thumbnails", "show_thumbnailsX1").replace("max_size", "max_sizeX1"); html += "  " + checkboxy('settings_imgcaption_on_topX1', 'Show caption on top'); var content_geothumbs = " (Alternative Geothumbs" + show_help("A great alternative to the GC little helper II bigger image functionality with \"Show thumbnails of images\" and \"Show bigger images in gallery\", provides the script Geothumbs (Geocaching Thumbnails).

            The script works like GC little helper II with Firefox, Google Chrome and Opera via Tampermonkey script.

            If you use Geothumbs, you have to uncheck both GC little helper II bigger image functionality \"Show thumbnails of images\" and \"Show bigger images in gallery\".") + ")
            " + "
            "; html += content_geothumbs; html += checkboxy('settings_show_big_gallery', 'Show bigger images in gallery') + show_help("With this option the images in the galleries of caches, TBs and public profiles are displayed bigger and not in 4 columns, but in 2 columns.

            It runs not together with \"Show thumbnails of images\"."); html += "
            Statistic" + prem + "
            "; html += checkboxy('settings_count_own_matrix', 'Calculate your cache matrix') + show_help("With this option the count of found difficulty and terrain combinations and the count of complete matrixes are calculated and shown above the cache matrix on your statistic page.") + "
            "; html += checkboxy('settings_count_foreign_matrix', 'Calculate other users cache matrix') + show_help("With this option the count of found difficulty and terrain combinations and the count of complete matrixes are calculated and shown above the cache matrix on other users statistic page.") + "
            "; html += checkboxy('settings_count_own_matrix_show_next', 'Mark D/T combinations for your next possible cache matrix') + show_help("With this option the necessary difficulty and terrain combinations to reach the next possible complete matrixes are marked in your cache matrix on your statistic page.") + "
            "; html += "    " + "Highlight next matrixes in color "; html += "" + show_help("With this option you can choose the count and the color of highlighted next possible complete matrixes in your cache matrix on your statistic page.") + "
            "; html += "    " + "Generate cache search links with radius km" + show_help("With this option cache search links with the inserted radius in km are generated for all difficulty and terrain combinations. With a radius of 0 km there are no links generated. The default radius is 25 km.") + "
            "; html += "    " + "Show the searched caches in a " + "
            "; html += checkboxy('settings_log_statistic', 'Calculate number of cache and trackable logs for each logtype') + show_help("With this option, you can build a statistic for your own cache and trackable logs for each logtype on your own statistic pages.") + "
            "; html += "  " + checkboxy('settings_log_statistic_percentage', 'Show percentage column') + "
            "; html += "    " + "Automated load/reload after hours" + show_help("Choose no hours, if you want to load/reload only manual.") + "
            "; html += checkboxy('settings_map_links_statistic', 'Show links to found caches for every country on statistic map') + show_help("With this option, you can improve your own statistic maps page for you with links to caches you have found for every country.") + "
            "; html += checkboxy('settings_map_percentage_statistic', 'Show percentage of found caches for every country on statistic map') + "
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","db")+"

            "; html += "
            "; html += checkboxy('settings_bookmarks_show', "Show Linklist on your dashboard") + show_help("Show the Linklist at the sidebar on your dashboard. You can configure the links in the Linklist at the end of this configuration page.") + "
            "; html += checkboxy('settings_show_mail_in_allmyvips', 'Show mail link beside user in "All my VIPs/VUPs" list on your dashboard') + show_help("With this option there will be an small mail icon beside every user in the list with all your VIPs (All my VIPs) on your dashboard page. With this icon you get directly to the mail page to mail to this user.
            (VIP: Very important person)

            If VUP processing is activated, this also applies to your VUPs (All my VUPs).
            (VUP: Very unimportant person)") + "
            "; html += "
            New Dashboard Only
            "; html += checkboxy('settings_show_default_links', 'Show all default links on your dashboard') + show_help("Show all the default links for the Linklist sorted at the sidebar on your dashboard.") + "
            "; html += checkboxy('settings_show_tb_inv', 'Show trackables inventory on your dashboard') + show_help("With this option a maximum of ten trackables of your trackables inventory is shown on your new dashboard. (On old dashboard it is GC standard to show it.)") + "
            "; html += checkboxy('settings_but_search_map', 'Show buttons "Search" and "Map" on your dashboard') + "
            "; html += "   " + checkboxy('settings_but_search_map_new_tab', 'Open links in new browser tab') + "
            "; html += checkboxy('settings_compact_layout_new_dashboard', 'Show compact layout on your dashboard') + "
            "; html += checkboxy('settings_embedded_smartlink_ignorelist', 'Show link to ignore list in sidebar section Lists') + show_help("Embedded a link in the section Lists to your Ignore List into the sidebar of the new dashboard.") + "
            "; html += checkboxy('settings_showUnpublishedHides', 'Show unpublished caches on your dashboard') + "
            "; html += "   " + checkboxy('settings_set_showUnpublishedHides_sort', 'Sort unpublished caches on your dashboard') + " "; html += "
            "; html += checkboxy('settings_show_cache_type_icons_in_dashboard', 'Show cache/TB type in front of log type in Latest Activity list') + "
            "; html += checkboxy('settings_show_edit_links_for_logs', 'Show edit links for your own logs') + show_help("With this option direct edit links are shown in your own logs on your dashboard. If you choose such a link, you are immediately in edit mode in your log.") + "
            "; html += newParameterOn3; html += checkboxy('settings_dashboard_show_logs_in_markdown', 'Show log text in Markdown as it is in cache listing') + "
            "; html += newParameterVersionSetzen('0.12') + newParameterOff; html += newParameterOn2; html += checkboxy('settings_dashboard_hide_tb_activity', 'Hide all TB/Coin logs in the Latest Activity') + "
            "; html += newParameterVersionSetzen('0.15') + newParameterOff; html += "
            Old Dashboard Only
            "; html += checkboxy('settings_hide_visits_in_profile', 'Hide TB/Coin visits on your dashboard') + "
            "; var content_settings_logit_for_basic_in_pmo = checkboxy('settings_logit_for_basic_in_pmo', 'Log PMO caches by standard \"Log It\" icon (for basic members)') + show_help("With this option basic members are able to choose the standard \"Log It\" icon to call the logging screen for premium member only (PMO) caches. The tool tipp blocked not longer this call. You can have the same result by using the right mouse across the \"Log It\" icon and then new tab.
            The \"Log It\" icon is besides the caches for example in the \"Recently viewed caches list\" and next to the caches on your old dashboard.") + "
            "; html += content_settings_logit_for_basic_in_pmo; html += "
            "; html += "

            "+prepareHideable.replace("#id#","listing")+"

            "; html += "
            "; html += "
            Listing Header" + "
            "; html += checkboxy('settings_cache_type_icon_visible', 'Set cache type icon always visible') + show_help("With this option, the cache type icon is always displayed complete, even if the cache is deactivated or archived.") + "
            "; html += checkboxy('settings_log_status_icon_visible', 'Set log status icon always visible') + show_help("With this option, the log status icon is always displayed complete, even if the cache is deactivated or archived. The log status icon is located above the cache type icons and indicates for example if a cache was found, if there is a personal note or if there are corrected coordinates.") + "
            "; html += checkboxy('settings_strike_archived', 'Strike through title of archived and disabled caches') + "
            "; html += checkboxy('settings_show_real_owner', 'Show real owner name') + show_help("If this option is enabled, the alias that an owner used to publish the cache is replaced with the real owner name.") + "
            "; html += checkboxy('settings_show_eventday', 'Show weekday of an event') + show_help("With this option the day of the week will be displayed next to the event date.") + "
            "; html += newParameterOn1; html += checkboxy('settings_show_eventtime_with_24_hours', 'Show event time in 24 hours format') + show_help("The start time and end time of an event are generated on the website using the language in which you are signed in. In English, the preferred language when using the GClh, but also in some other languages, the start time and end time of an event is shown in 12 hour format with AM and PM. If you want to change it to a 24 hour format, you can activate this parameter.") + "
            "; html += newParameterVersionSetzen('0.14') + newParameterOff; html += checkboxy('settings_show_latest_logs_symbols', 'Show the '); html += " latest logs symbols at the top" + show_help("With this option, the choosen count of the latest logs symbols is shown at the top of the cache listing.") + "
            "; html += checkboxy('settings_show_fav_percentage', 'Show percentage of favorite points') + show_help("This option loads the favorite stats of a cache in the backround and display the percentage under the amount of favorites a cache got.") + "
            "; html += checkboxy('settings_show_log_totals', 'Show the log totals icons at the top') + "
            "; html += checkboxy('settings_log_inline_pmo4basic', 'Log cache from listing for PMO (for basic members)') + show_help("With this option you can select, if inline logs should appear for premium member only (PMO) caches althought you are a basic member.

            If you're using an ad-blocking add-on, such as uBlock, the embedded screen may not be allowed. To turn this off, you have to add \"www.geocaching.com\/geocache\/GC*\" to the whitelist, or something similar, of your add-on.") + "
            "; html += "
            Location" + "
            "; html += " " + "Highlight user changed coordinates with " + checkboxy('settings_highlight_usercoords', 'red textcolor ') + checkboxy('settings_highlight_usercoords_bb', 'underline ') + checkboxy('settings_highlight_usercoords_it', 'italic') + "
            "; html += checkboxy('settings_show_elevation_of_waypoints', 'Show elevations for listing coordinates and additional waypoints') + show_help("Shows the elevation of the listing coordinates and of every additional waypoint. Select the order of the elevation service or deactivate it. Queries to the Google Elevation service are limited. Hover of the elevation data of a waypoint shows a tooltip with the used service.") + "
            "; html += "    " + "Measure unit can be set in preferences" + "
            "; html += "   " + "First service "; html += "  " + "Second service
            "; html += checkboxy('settings_show_link_to_browse_map', 'Show link to Browse Map') + show_help("With this option, a link called \"Map this Location\" is shown under the listing coordinates.") + "
            "; html += "
            Disclaimer" + "
            "; html += checkboxy('settings_hide_disclaimer', 'Hide disclaimer') + "
            "; html += "
            Personal Cache Note" + prem + "
            "; html += " " + "Personal cache note minimum size px" + "
            "; html += checkboxy('settings_adapt_height_cache_notes', 'Adapt the height of the personal cache note edit field') + show_help("The height of the personal cache note edit field will be expand to show the complete note.") + "
            "; html += checkboxy('settings_hide_empty_cache_notes', 'Hide personal cache notes if empty') + show_help("You can hide the personal cache notes if they are empty. There will be a link to show them to add a note.") + "
            "; html += checkboxy('settings_hide_cache_notes', 'Hide personal cache notes completely') + show_help("You can hide the personal cache notes completely, if you don't want to use them.") + "
            "; html += checkboxy('settings_change_font_cache_notes', 'Change font of personal cache notes to monospace') + "
            "; html += "
            Cache Detail Navigation (right sidebar)" + "
            "; html += checkboxy('settings_log_inline', 'Log cache from listing (inline)') + show_help("With the inline log you can open a log form inside the listing, without loading a new page.

            If you're using an ad-blocking add-on, such as uBlock, the embedded screen may not be allowed. To turn this off, you have to add \"www.geocaching.com\/geocache\/GC*\" to the whitelist, or something similar, of your add-on.") + "
            "; html += checkboxy('settings_prevent_watchclick_popup', 'Prevent pop up when clicking on "Watch" or "Stop Watching"') + "
            "; html += checkboxy('settings_improve_add_to_list', 'Show compact layout in \"Add to list\" pop up to bookmark a cache') + prem + "
            "; html += "    " + "Maximum height of pop up px" + show_help("With this option you can choose the maximum height of the \"Add to list\" pop up to bookmark a cache from 100 up to 520 pixel. The default is 205 pixel, similar to the standard.") + "
            "; html += checkboxy('settings_show_remove_ignoring_link', 'Show \"Stop Ignoring\", if cache is already ignored') + show_help("This option replace the \"Ignore\" link description with the \"Stop Ignoring\" link description in the cache listing, if the cache is already ignored.") + prem + "
            "; html += "  " + checkboxy('settings_use_one_click_ignoring', 'One click ignoring/restoring') + show_help("With this option you will be able to ignore respectively restore a cache in cache listing with only one click.") + "
            "; html += checkboxy('settings_show_flopps_link', 'Show Flopp\'s Map links in sidebar and under the "Additional Waypoints"') + "
            "; html += "  " + checkboxy('settings_show_radius_on_flopps', 'Show radius around caches on Flopp\'s Map') + "
            "; html += checkboxy('settings_show_brouter_link', 'Show BRouter links in sidebar and under the "Additional Waypoints"') + "
            "; html += checkboxy('settings_show_gpsvisualizer_link', 'Show GPSVisualizer links in sidebar and under the "Additional Waypoints"') + "
            "; html += "  " + checkboxy('settings_show_gpsvisualizer_gcsymbols', 'Use geocaching icons on GPSVisualizer map') + show_help("Instead of default icons, geocaching icons are used. If the URL is too long, disable this option.") + "
            "; html += "  " + checkboxy('settings_show_gpsvisualizer_typedesc', 'Transfer type of the waypoint as description') + show_help("Transfer for every waypoint the type as text in the description. If the URL is too long, disable this option.") + "
            "; html += checkboxy('settings_show_openrouteservice_link', 'Show Openrouteservice links in sidebar and under the "Add. Waypoints"') + "
            "; html += "  " + checkboxy('settings_show_openrouteservice_home', 'Use home coordinates as start point') + show_help("You can use your home coordinates, here in the GClh II Config, as start point and first waypoint for the route calculation.") + "
            "; html += "   " + "Medium for locomotion " + "
            "; html += checkboxy('settings_show_copydata_menu', 'Show "Copy Data to Clipboard" menu in sidebar') + show_help("Shows a menu to copy various cache data to the clipboard.") + "
            "; var help = "This feature allows you not only to copy something to the clipboard after clearing the clipboard, but also to add " + "something to the clipboard without clearing it. This is how you can collect things on the clipboard.

            " + "You can use it for example to collect GC codes with the feature \"Add Bulk GC codes\" on the \"My Lists\" page."; html += "  " + checkboxy('settings_show_copydata_plus', 'Activate adding to Clipboard') + show_help(help) + "
            "; html += "      " + 'Separator between addings '; html += ""; html += show_help("Here you can enter a separator to use between the addings. The default value is a line feed.") + '
            '; // Own entries in copy data to clipboard menu (copy data own stuff, cdos). var ph = "Possible placeholders:
              #GCName# : GC name
              #GCCode# : GC code
              #GCLink# : GC link
              #GCNameLink# : GC name as a link
              #GCType# : GC type (short form)
            " + "  #Owner# : Username of the owner
              #Diff# : Difficulty
              #Terr# : Terrain
              #Size# : Size of the cache box
              #Favo# : Favorites
              #FavoPerc# : Favorites percentage
            " + "  #Elevation# : Elevation
              #Coords# : Shown coordinates
              #Hints# : Additional hints
              #GCNote# : User note
              #Founds# : Number of found logs
              #Attended# : Number of attended logs
              #FoundsPlus# : Number of found, attended or webcam photo taken logs
              #WillAttend# : Number of will attend logs
              #DNFs# : Number of DNF logs
            " + "  #Date# : Actual date
              #Time# : Actual time in format hh:mm
              #DateTime# : Actual date actual time
              #yyyy# : Current year
              #mm# : Current month
              #dd# : Current day
            " + "(Upper and lower case is not required in the placeholders name.)"; var header = "Show own copy data entries" + show_help("With the checkbox and the two input fields, you can generate entries in the menu \"Copy data to Clipbord\".

            With the checkbox you can activate or deactivate an entry. The first input field contains the name that is displayed in the menu \"Copy data to Clipbord\" for an entry. The second input field contains the content that is copied to the clipboard if you click to an entry in the menu \"Copy data to Clipbord\". You can use different placeholders in the second input field.") + "   " + "( Possible placeholders" + show_help(ph) + ")
            "; var titleName = 'Name of entry in menu \"Copy data to Clipbord\".'; var titleValue = 'Data in the clipboard when clicking on entry in menu \"Copy data to Clipbord\".'; html += openCff('cdos', header, titleName, titleValue, 'settings_show_copydata_menu'); // First entry from non array. var cdosData = buildDataCff(settings_show_copydata_own_stuff_show, repApo(settings_show_copydata_own_stuff_name), settings_show_copydata_own_stuff_value); var idNr = 1; html += buildEntryCff('cdos', cdosData, idNr, 'settings_show_copydata_own_stuff', false); // Further entries from array. for (var i in settings_show_copydata_own_stuff) { settings_show_copydata_own_stuff[i].name = repApo(settings_show_copydata_own_stuff[i].name); var cdosData = settings_show_copydata_own_stuff[i]; idNr++; html += buildEntryCff('cdos', cdosData, idNr, false, false); } html += closeCff('cdos'); cssCff('cdos', '14', '200', '460', '54'); html += "
            Overview Map (right sidebar)" + "
            "; html += checkboxy('settings_map_overview_build', 'Show cache location in overview map') + show_help("With this option there will be an additional map top right in the cache listing as an overview of the cache location.") + "
            "; html += '    Map layer '; html += "  " + "Map zoom " + show_help("With this option you can choose the zoom value to start in the map. \"1\" is the hole world and \"19\" is the maximal enlargement. Default is \"11\".") + "
            "; html += "  " + checkboxy('settings_map_overview_browse_map_icon', 'Show icon with link to Browse Map in overview map') + "
            "; html += "     " + checkboxy('settings_map_overview_browse_map_icon_new_tab', 'Open link in new browser tab') + "
            "; html += "  " + checkboxy('settings_map_overview_search_map_icon', 'Show icon with link to Search Map in overview map') + "
            "; html += "     " + checkboxy('settings_map_overview_search_map_icon_new_tab', 'Open link in new browser tab') + "
            "; html += "
            VIP-Lists (right sidebar)" + "
            "; html += checkboxy('settings_show_vip_listX0', 'Process VIPs') + show_help(content_settings_show_vip_list + "

            You can adjust details about this feature also in the Dashboard topic.") + "
            "; html += "  " + checkboxy('settings_show_owner_vip_list', 'Show owner in VIP list') + show_help("If you enable this option, the owner is a VIP for the cache, so you can see, what happened with the cache (disable, maint, enable, ...). Then the owner is shown not only in VIP list but also in VIP logs.")+ "
            "; html += "  " + checkboxy('settings_show_reviewer_as_vip', 'Show reviewer/publisher in VIP list') + show_help("If you enable this option, the reviewer or publisher of the cache is a VIP for the cache.") + "
            "; html += newParameterOn3; html += "  " + checkboxy('settings_show_lackey_as_vip', 'Show lackey in VIP list') + show_help("If you enable this option, lackeys which logged the cache are VIPs for the cache. Behind the logs of lackeys are primarily employees of Groundspeak who cache. In addition, administrative logs can also be performed by these lackeys. Administrative user of Groundspeak may also be flagged as lackeys. An example of the latter are the logs for archiving older events.") + "
            "; html += newParameterVersionSetzen('0.12') + newParameterOff; html += "  " + checkboxy('settings_show_long_vip', 'Show long VIP list (one row per log)') + show_help("This is another type of displaying the VIP list. If you disable this option you get the short list, one row per VIP and the logs as icons beside the VIP. If you enable this option, there is a row for every log.") + "
            "; html += "  " + checkboxy('settings_vip_show_nofound', 'Show a list of VIPs who have not found the cache') + "
            "; html += "  " + checkboxy('settings_make_vip_lists_hideable', 'Make VIP lists in listing hideable') + show_help("With this option you can hide and show the VIP lists \"VIP-List\" and \"VIP-List not found\" in cache listing with one click.") + "
            "; html += "  " + checkboxy('settings_show_mail_in_viplist', 'Show mail link beside user in "VIP-List" in listing') + "
            "; html += "  " + checkboxy('settings_process_vupX0', 'Process VUPs') + show_help(content_settings_process_vup + "

            You can adjust details about this feature also in the Dashboard topic.") + "
            "; html += "     " + checkboxy('settings_vup_hide_avatar', 'Also hide name, avatar and counter from log') + "
            "; html += "       " + checkboxy('settings_vup_hide_log', 'Hide complete log') + "
            "; html += "
            Cache Description" + "
            "; html += checkboxy('settings_img_warning', 'Show warning for unavailable images') + show_help("With this option the images in the cache listing will be checked for existence before trying to load it. If an image is unreachable or dosen't exists, a placeholder is shown. The mouse over the placeholder will shown the image link. A mouse click to the placeholder will open the link in a new tab.") + "
            "; html += checkboxy('settings_visitCount_geocheckerCom', 'Show statistic on geochecker.com pages') + show_help("This option adds '&visitCount=1' to all geochecker.com links. This will show some statistics on geochecker.com page like the count of page visits and the count of right and wrong attempts.") + "
            "; html += checkboxy('settings_listing_hide_external_link_warning', 'Hide external link warning message') + show_help("With this option you can hide the warning message for external links in the cache listing description. The warning message is a security feature and is intended to inform you that the external link has not been reviewed by the operator of the website.") + "
            "; html += checkboxy('settings_listing_links_new_tab', 'Open links in cache description in a new tab') + "
            "; html += "
            Additional Hints" + "
            "; html += checkboxy('settings_decrypt_hint', 'Decrypt hints') + show_help("This option decrypt the hints on cache listing and print page and remove also the description of the decryption.") + "
            "; html += checkboxy('settings_hide_hint', 'Hide the additional hints behind a link') + show_help("This option hides the hints behind a link. You have to click it to display the hints (already decrypted). This option remove also the description of the decryption.") + "
            "; html += "
            Additional Waypoints" + "
            "; html += checkboxy('settings_driving_direction_link', 'Show link to Google driving direction for every waypoint') + show_help("Shows for every waypoint in the waypoint list a link to Google driving direction from home location to coordinates of the waypoint.") + "
            "; html += "  " + checkboxy('settings_driving_direction_parking_area', 'Only for parking area waypoints') + "
            "; html += checkboxy('settings_show_elevation_of_waypointsX0', 'Show elevations for listing coordinates and additional waypoints') + show_help("Shows the elevation of the listing coordinates and of every additional waypoint. Select the order of the elevation service or deactivate it. Queries to the Google Elevation service are limited. Hover of the elevation data of a waypoint shows a tooltip with the used service.") + "
            "; html += "    " + "Measure unit can be set in preferences" + "
            "; html += "   " + "First service "; html += "  " + "Second service
            "; html += "
            Owner Images" + "
            "; html += checkboxy('settings_link_big_listing', 'Replace image links in cache listing to bigger image') + show_help("With this option the links of owner images in the cache listing points to the bigger, original image.") + "
            "; html += content_settings_show_thumbnails; html += "  " + checkboxy('settings_imgcaption_on_top', 'Show caption on top'); html += content_geothumbs; html += "    " + "Spoiler filter " + show_help("If one of these words is found in the caption of the image, there will be no real thumbnail. It is to prevent seeing spoilers. Words have to be divided by |. If the field is empty, no checking is done. Default is \"spoiler|hinweis\".") + "
            "; html += "
            Links to Find Caches" + "
            "; html += checkboxy('settings_listing_old_links', 'Use old links to find caches') + show_help("The links to find caches run through the new search. With this option you can use the old search.") + "
            "; html += "
            Map Preview" + "
            "; html += checkboxy('settings_larger_map_as_browse_map', 'Replace link to larger map with the Browse Map') + "
            "; html += checkboxy('settings_show_google_maps', 'Show link to Google Maps') + show_help("This option shows a link at the top of the second map in the listing. With this link you get directly to Google Maps in the area, where the cache is.") + "
            "; html += "
            Logs Header" + "
            "; html += checkboxy('settings_add_search_in_logs_func', 'Add "Search in logs" feature') + "
            "; html += checkboxy('settings_show_all_logs_but', 'Show button \"Show all logs\" above the logs') + "
            "; html += checkboxy('settings_show_compact_logbook_but', 'Show button \"Show compact logs\" above the logs') + "
            "; html += newParameterOn3; html += checkboxy('settings_show_who_gave_favorite_but', 'Show button \"Show who favorited\" above the logs') + show_help("With this option you can choose to show a button \"Show who favorited\" above the logs. Pressing this button will add a favorite icon to the logs of users who gave a favorite. Additionally, a filter for those logs will be added above the logs.

            For performance reasons this functionality must be restricted to caches with 500 favorites or less.") + "
            "; html += newParameterVersionSetzen(0.12) + newParameterOff; html += checkboxy('settings_show_log_counter_but', 'Show button \"Show log counter\" above the logs') + "
            "; html += "  " + checkboxy('settings_show_log_counter', 'Show log counter when opening cache listing') + "
            "; html += checkboxy('settings_show_bigger_avatars_but', 'Show button \"Show bigger avatars\" above the logs') + "
            "; var content_upvotes_help = show_help("With this option you can show/hide the whole upvotes feature consist of the logs sort button \"Order by\" above the logs and the buttons \"Great story\" and \"Helpful\" in the logs."); html += checkboxy('settings_show_hide_upvotes_but', 'Show button \"Hide upvotes\" above the logs') + content_upvotes_help + "
            "; html += checkboxy('settings_hide_spoilerwarning', 'Hide spoiler warning') + "
            "; var content_settings_hide_upvotes = checkboxy('settings_hide_upvotes', 'Hide upvotes elements "Order by", "Great story" and "Helpful"') + content_upvotes_help + "
            "; html += content_settings_hide_upvotes; var content_settings_smaller_upvotes_icons = checkboxy('settings_smaller_upvotes_icons', 'Make upvotes elements "Order by", "Great story" and "Helpful" smaller') + show_help("This option makes the upvotes elements \"Order by\", \"Great story\" and \"Helpful\" smaller, as is the case with other elements.") + "
            "; html += content_settings_smaller_upvotes_icons; var content_settings_no_wiggle_upvotes_click = checkboxy('settings_no_wiggle_upvotes_click', 'No wiggle on click to upvotes elements "Order by", "Great story" and ...') + show_help("With this option you can prevent the page wiggle if you click to the upvotes elements \"Order by\", \"Great story\" and \"Helpful\".") + "
            "; html += content_settings_no_wiggle_upvotes_click; html += checkboxy('settings_hide_top_button', 'Hide the green "To Top" button') + show_help("Hide the green \"To Top\" button, which appears if you are reading logs.") + "
            "; html += "
            Logs" + "
            "; html += checkboxy('settings_load_logs_with_gclh', 'Load logs with GClh II') + show_help("This option should be enabled.

            You just should disable it, if you have problems with loading the logs.

            If this option is disabled, there are no VIP-, VUP-, mail-, message- and top icons, no line colors and no mouse activated big images at the logs. Also the VIP and VUP lists, hide avatars, log filter and log search won't work.") + "
            "; html += checkboxy('settings_show_all_logs', 'Show at least ') + " logs" + show_help("With this option you can choose how many logs should be shown at least if you start with the listing. The default and the minimum are 30 logs. The maximum are 500 logs, because of performance reasons.

            (If you want to list more then 500 logs, you can use the button \"Show all logs\" above the logs section in the listing. And if you go to the end of the listed logs, the logs will be dynamically loaded there anyway.)") + "
            "; html += checkboxy('settings_hide_avatar', 'Hide avatars in logs') + show_help("This option hides the avatars in logs. This prevents loading the hundreds of images. You have to change the option here, because GC little helper II overrides the log-load-logic of GC, so the avatar option of GC doesn't work with GC little helper II.") + "
            "; html += checkboxy('settings_hide_found_count', 'Hide found count') + "
            "; html += content_settings_show_thumbnails.replace("show_thumbnails", "show_thumbnailsX0").replace("max_size", "max_sizeX0"); html += "  " + checkboxy('settings_imgcaption_on_topX0', 'Show caption on top'); html += content_geothumbs; html += "    " + "Spoiler filter " + show_help("If one of these words is found in the caption of the image, there will be no real thumbnail. It is to prevent seeing spoilers. Words have to be divided by |. If the field is empty, no checking is done. Default is \"spoiler|hinweis\".") + "
            "; html += content_settings_hide_upvotes.replace("settings_hide_upvotes", "settings_hide_upvotesX0"); html += content_settings_smaller_upvotes_icons.replace("settings_smaller_upvotes_icons", "settings_smaller_upvotes_iconsX0"); html += content_settings_no_wiggle_upvotes_click.replace("settings_no_wiggle_upvotes_click", "settings_no_wiggle_upvotes_clickX0"); html += "
            "; html += "

            "+prepareHideable.replace("#id#","draft")+"

            "; html += "
            "; html += checkboxy('settings_modify_new_drafts_page', 'Change the look and functionality of draft items') + "
            "; html += "  " + checkboxy('settings_drafts_cache_link', 'Use cache name as link to the cache listing') + "
            "; html += "     " + checkboxy('settings_drafts_cache_link_new_tab', 'Open link in new browser tab') + "
            "; html += "  " + checkboxy('settings_drafts_color_visited_link', 'Color a visited link') + "
            "; html += "  " + checkboxy('settings_drafts_old_log_form', 'Use old-fashioned log form to log a draft') + show_help("If you enable this option, you always get the old log form instead of the new one to log drafts related logs.

            Please look also the parameter \"Use old-fashioned log form to log non drafts related logs\" in the \"Log\" area.") + "
            "; html += "  " + checkboxy('settings_drafts_log_icons', 'Show logtype icon instead of text') + "
            "; var content_settings_after_sending_log = 'After sending a new log using the new log form, the listing will appear. After sending a new log using the old log form, the view log page will appear.

            '; var content_settings_after_sending_draft_related_log1 = checkboxy('settings_drafts_go_automatic_back', 'After sending a draft related log, automatic go back to drafts') + show_help(content_settings_after_sending_log + 'If it was a draft related log, you can enable this option to automatic go back to the drafts page.') + "
            "; var content_settings_after_sending_draft_related_log2 = checkboxy('settings_drafts_after_new_logging_view_log', 'After sending a draft related log, automatic view log') + show_help(content_settings_after_sending_log + 'If it was a draft related log, you can enable this option to automatic go to view log page.') + "
            "; html += content_settings_after_sending_draft_related_log1; html += newParameterOn3; html += content_settings_after_sending_draft_related_log2; html += checkboxy('settings_drafts_download_show_button', 'Enable draft download feature') + show_help("With this option you can activate the draft download feature. A download button will then appear next to the upload button on the draft page.") + "
            "; html += "  " + checkboxy('settings_drafts_download_change_logdate', 'Change log dates of the drafts in download file') + show_help("With this option you can choose whether the log dates in the drafts is reduced by one second. This is necessary if you might want to upload the drafts in the download file later, after deleting the drafts on the drafts page, as uploading with the same log date is not possible.") + "
            "; html += newParameterVersionSetzen('0.12') + newParameterOff; html += "
            "; html += "

            "+prepareHideable.replace("#id#","logging")+"

            "; html += "
            "; html += checkboxy('settings_replace_log_by_last_log', 'Replace log by last log template') + show_help("If you enable this option, the last log template will replace the whole log. If you disable it, it will be appended to the log.") + "
            "; html += checkboxy('settings_autovisit', 'Enable \"AutoVisit\" feature for trackables') + show_help("With this option you are able to select trackables which should be automatically set from \"No action\" to \"Visited\" on every log, if the logtype is \"Found It\", \"Webcam Photo Taken\" or \"Attended\". For other logtypes trackables are automatically set from \"Visited\" to \"No action\". You can select \"AutoVisit\" for each trackable in the list on the bottom of the log form.") + "
            "; html += "  " + checkboxy('settings_autovisit_default', 'Set \"AutoVisit\" for all TBs by default') + show_help("With this option all new TBs in your inventory are automatically set to \"AutoVisit\".") + "
            " html += content_settings_show_log_it.replace("show_log_it", "show_log_itX2"); html += content_settings_logit_for_basic_in_pmo.replace("basic_in_pmo","basic_in_pmoX0"); html += checkboxy('settings_improve_character_counter', 'Show length of logtext') + show_help("If you enable this option, a counter shows the length of your logtext and the maximum length.\nOn the old logging page this feature ist auto-enabled.") + "
            "; html += checkboxy('settings_unsaved_log_message', 'Show message in case of unsaved log') + "
            "; html += checkboxy('settings_show_add_cache_info_in_log_page', 'Show additional cache info') + show_help("If you enable this option, additional cache information such as the favorite points or the favorite percent are shown in the log form next to the cache name.

            For basic members, no data is displayed for premium member only caches.") + "
            "; html += content_settings_after_sending_draft_related_log1.replace("settings_drafts_go_automatic_back", "settings_drafts_go_automatic_backX0"); html += newParameterOn3; html += content_settings_after_sending_draft_related_log2.replace("settings_drafts_after_new_logging_view_log", "settings_drafts_after_new_logging_view_logX0"); html += checkboxy('settings_after_new_logging_view_log', 'After sending a non draft related log, automatic view log') + show_help(content_settings_after_sending_log + 'If it was not a draft related log, you can enable this option to automatic go to view log page.') + "
            "; html += newParameterVersionSetzen('0.12') + newParameterOff; var placeholderDescription = "Possible placeholders:
              #Found# : Your founds + 1 (reduce it with a minus followed by a number)
              #Found_no# : Your founds (reduce it with a minus followed by a number)
              #Me# : Your username
              #Owner# : Username of the owner
              #Date# : Actual date
              #Time# : Actual time in format hh:mm
              #DateTime# : Actual date actual time
              #GCTBName# : GC or TB name
              #GCTBLink# : GC or TB link
              #GCTBNameLink# : GC or TB name as a link
              #LogDate# : Content of field \"Date Logged\"
            (Upper and lower case is not required in the placeholders name.)"; html += newParameterOn2; html += checkboxy('settings_hide_locked_tbs_log_form', 'Hide locked trackables from trackable inventory') + show_help("A trackable can be marked as locked in the trackable listing. Locked trackables cannot be logged. With this option you can hide such trackables from trackable inventory.") + "
            "; html += checkboxy('settings_hide_own_tbs_log_form', 'Hide own trackables from trackable inventory') + show_help("With this option you can hide your own trackables from trackable inventory.") + "
            "; html += checkboxy('settings_hide_share_log_button_log_view', 'Hide \"Share log\" button on view log page') + show_help("With this option you can hide the \"Share log\" button on page view geocache log.

            If you just want to hide the social sharing icons for Facebook, Twitter (X) behind the \"Share log\" button instead, you can do this with the parameter \"Hide social sharing via Facebook, Twitter (X)\" in the \"Global - Hiding\" area.") + "
            "; html += checkboxy('settings_remove_target_log_form', 'Do not open links on log page automatic in new browser tab') + show_help("The links on the pages \"Log this geocache\" and \"Edit log\" will automatically open in a new tab. If you want to decide for yourself whether a link should open in the same browser tab or in a new one, you can choose this option.") + "
            "; html += checkboxy('settings_remove_target_log_view', 'Do not open links on view log page automatic in new browser tab') + show_help("The links on the page \"View geocache log\" will automatically open in a new tab. If you want to decide for yourself whether a link should open in the same browser tab or in a new one, you can choose this option.") + "
            "; html += checkboxy('settings_button_sort_tbs_by_name_log_form', 'Enable sorting of trackables by name') + "
            "; html += checkboxy('settings_larger_content_width_log_form', 'Larger page width') + show_help("With this option you can expand the page width according to the setting in the parameter \"Page width\" in the \"Global\" section.") + "
            "; html += checkboxy('settings_less_space_log_lines_log_form', 'Less space between the lines of the log') + "
            "; html += checkboxy('settings_add_log_templates', 'Add log templates') + show_help("Log templates are predefined texts. All of your templates will be displayed on the log form. All you have to do is click on a template and it will be placed in your log. You can also use placeholders for variables that will be replaced in the log.") + "   ( Possible placeholders" + show_help(placeholderDescription) + ")
            "; html += newParameterVersionSetzen('0.15') + newParameterOff; html += "Please note that log templates are useful for automatically entering the number of finds, the date of discovery and the like in the log, but that cache owners are people who are happy about individual logs for their cache. Geocaching is not just about pushing your own statistics, but also about experiencing something. Please take some time to give something back to the owners by telling them about your experiences and writing them good logs. Then there will also be cachers in the future who like to take the trouble to set up new caches. The log templates are useful, but can never replace a complete log."; for (var i = 0; i < anzTemplates; i++) { html += "    " + " "; html += "
            "; html += ""; } html += newParameterOn2; html += "  " + checkboxy('settings_add_cache_log_signature_as_log_template', 'Add cache log signature as a log template') + "
            "; html += "  " + checkboxy('settings_add_tb_log_signature_as_log_template', 'Add TB log signature as a log template') + "
            "; html += checkboxy('settings_add_cache_log_signature', 'Add cache log signature') + show_help("The signature is automatically added to your logs. You can also use placeholders for variables that will be replaced in the log.") + "   ( Possible placeholders" + show_help(placeholderDescription) + ")
            "; html += newParameterVersionSetzen('0.15') + newParameterOff; html += "    " + "
            "; html += "  " + checkboxy('settings_log_signature_on_fieldnotes', 'Add cache log signature on drafts logs') + show_help('If this option is disabled, the log signature will not be used by logs coming from drafts. You can use it, if you already have an signature in your drafts.') + "
            "; html += newParameterOn2; html += checkboxy('settings_add_tb_log_signature', 'Add TB log signature') + show_help("The signature is automatically added to your TB logs. You can also use placeholders for variables that will be replaced in the log.") + "   ( Possible placeholders" + show_help(placeholderDescription) + ")
            "; html += newParameterVersionSetzen('0.15') + newParameterOff; html += "    " + "
            "; html += ""; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += " "; html += "
            Default log type
            Default event log type
            Default owner log type
            Default TB log type
            "; html += "
            New Log Page Only
            "; html += checkboxy('settings_show_pseudo_as_owner', 'Replace placeholder owner, although there could be a pseudonym') + show_help("If you disable this option, the placeholder for the owner cannot be replaced on the newly designed log page.

            If you enable this option, the placeholder for the owner is replaced possibly by the pseudonym of the owner if the real owner is not known.

            On the new designed log page there is shown as owner of the cache not the real owner but possibly the pseudonym of the owner for the cache as it is shown in the cache listing under \"A cache by\". The real owner is not available in this cases.") + "
            "; html += "
            Old Log Page Only
            "; html += checkboxy('settings_show_bbcode', 'Show smilies') + show_help("This option displays smilies options beside the log form. If you click on a smilie, it is inserted into your log.") + "
            "; html += checkboxy('settings_logs_old_fashioned', 'Use old-fashioned log form to log non drafts related logs') + show_help("If you enable this option, you always get the old log form instead of the new one to log non drafts related logs.

            Please look also the parameter \"Use old-fashioned log form to log a draft\" in the \"Draft\" area.") + "
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","mail")+"

            "; html += "
            "; var placeholderDescriptionMail = "Possible placeholders in the mail and message form:
              #Found# : Your founds + 1 (reduce it with a minus followed by a number)
              #Found_no# : Your founds (reduce it with a minus followed by a number)
              #Me# : Your username
              #Receiver# : Username of the receiver
              #Date# : Actual date
              #Time# : Actual time in format hh:mm
              #DateTime# : Actual date actual time
              #GCTBName# : GC or TB name
              #GCTBCode# : GC or TB code in brackets
              #GCTBLink# : GC or TB link in brackets
            (Upper and lower case is not required in the placeholders name.)"; html += " " + "Template" + show_help("The template is automatically added to your mails and messages. You can also use placeholders for variables that will be replaced in the mail and in the message.") + "   ( Possible placeholders" + show_help(placeholderDescriptionMail) + ")
            "; html += " " + "
            "; html += "
            "; html += "

            "+prepareHideable.replace("#id#","linklist")+"" + show_help("In this topic you can configure your personal Linklist which is shown on the top of the page and/or on your dashboard. You can activate it in the \"Global\" and \"Dashboard\" topic.") + "

            "; html += ""; // Section Development. html += "

            "+prepareHideable.replace("#id#","development")+"

            "; html += "
            "; html += checkboxy('settings_gclherror_alert', 'Show an alert if an internal error occurs') + "
            "; html += checkboxy('settings_test_log_console', 'Checks log to console') + "
            "; html += "
            "; // Footer. html += "

            "; html += " " + " "; html += "
            License: GPLv2 | Warranty: NO

            "; var end = (new Date()).getFullYear(); html += "
            Copyright © 2010-2016 Torsten Amshove, 2016-"+end+" 2Abendsegler, 2017-2021 Ruko2010, 2019-"+end+" capoaira
            "; html += "
            "; // Config Content: Aufbauen, Reset Area verbergen, Special Links Nearest List/Map, Own Trackables versorgen. Adapt map icons. // --------------- div.innerHTML = html; $('body')[0].appendChild(div); $('x').each(function() { if ($(this)[0].parentNode) { $(this)[0].parentNode.innerHTML = $(this)[0].parentNode.innerHTML.replace(/ #2170 #2055 Temporäre Deaktivierung des "Manage Filter Sets" Buttons bis die Funktionalität wieder hergestellt ist. disableDepPara("settings_search_enable_user_defined", true); //<-- #2170 #2055 $('#gclh_config_content2').hide(); $('#gclh_config_content_thanks').hide(); $('label[for="settings_use_gclh_layercontrol"], label[for="settings_show_homezone"]').addClass('gclh_ref'); $('#settings_show_homezone,#settings_use_gclh_layercontrol,#settings_bookmarks_top_menu,#settings_bookmarks_top_menu_h').addClass('shadowBig'); setSpecialLinks(); $(".gclh_content svg.browse_map_icon, .gclh_content svg.search_map_icon").each(function(){$(this)[0].setAttribute("viewBox", "0 0 25 25");}); // Config Content: Hauptbereiche hideable machen. // --------------- function makeConfigAreaHideable(configArea) { var show = getValue('show_box_gclh_config_'+configArea, true); var lnk = '#lnk_gclh_config_'+configArea; if ($(lnk)[0]) { if (show == false) setShowHideConfig(false, configArea); $(lnk)[0].addEventListener("click", function() {showHideConfig($('#'+this.id).closest('h4').hasClass('gclh_hide'), configArea);}); // Show, hide all areas in config with one click with the right mouse. document.getElementById("lnk_gclh_config_" + configArea).oncontextmenu = function(){return false;}; $(lnk).bind('contextmenu.new', function() {showHideConfigAll($('#'+this.id).closest('h4').hasClass('gclh_hide'), this.id);}); } } // Anfangsbestand, Events setzen. // (Bei neuen Hauptthemen muss auch function showHideConfigAll gepflegt werden.) if (settings_make_config_main_areas_hideable && !document.location.href.match(/#a#/i)) { makeConfigAreaHideable("global"); makeConfigAreaHideable("config"); makeConfigAreaHideable("sync"); makeConfigAreaHideable("nearestlist"); makeConfigAreaHideable("pq"); makeConfigAreaHideable("bm"); makeConfigAreaHideable("recview"); makeConfigAreaHideable("friends"); makeConfigAreaHideable("hide"); makeConfigAreaHideable("others"); makeConfigAreaHideable("maps"); makeConfigAreaHideable("profile"); makeConfigAreaHideable("db"); makeConfigAreaHideable("listing"); makeConfigAreaHideable("draft"); makeConfigAreaHideable("logging"); makeConfigAreaHideable("mail"); makeConfigAreaHideable("linklist"); makeConfigAreaHideable("development"); } // Linklist: Events, Anfangsbestand aufbauen. // --------- for (var i = 0; i < bookmarks.length; i++) { // Input Events aufbauen, Spalte 2, abweichende Bezeichnungen. document.getElementById('bookmarks_name[' + i + ']').addEventListener("input", updateByInputDescription, false); // Anfangsbestand aufbauen. Prüfen, ob BM in Linklist. Cursor, Opacity entsprechend setzen. if (document.getElementById('gclh_LinkListTop_' + i)) { flagBmInLl(document.getElementById('gclh_LinkListElement_' + i), false, "not-allowed", "0.4", "Already available in Linklist"); } else { flagBmInLl(document.getElementById('gclh_LinkListElement_' + i), false, "grab", "1", "Grab it"); } } var elem = document.getElementsByClassName('gclh_LinkListInlist'); for (var i = 0; i < elem.length; i++) { // Mousedown, Mouseup Events aufbauen, rechte Spalte, Move Icon und Bezeichnung.(Nicht Delete Icon.) elem[i].children[0].children[0].addEventListener("mousedown", function(event){changeAttrMouse(event, this, "move");}, false); // Move Icon elem[i].children[0].addEventListener("mousedown", function(event){changeAttrMouse(event, this, "desc");}, false); // Description elem[i].children[0].children[0].addEventListener("mouseup", function(event){changeAttrMouse(event, this, "move");}, false); // Move Icon elem[i].children[0].addEventListener("mouseup", function(event){changeAttrMouse(event, this, "desc");}, false); // Description } tempConfigColoring(); // Linklist: Delete Icon rechte Spalte. // --------- $(".gclh_LinkListDelIcon").click(function() { var row = this.parentNode.parentNode; var tablebody = row.parentNode; $(row).remove(); if (tablebody.children.length == 0) $('Drop here...').appendTo(tablebody); // BM als nicht vorhanden in Linklist kennzeichnen. var index = this.parentNode.parentNode.id.replace("gclh_LinkListTop_", ""); flagBmInLl(document.getElementById("gclh_LinkListElement_" + index), false, "grab", "1", "Grab it"); }); // Linklist: Drag and Drop von linker Spalte in rechte Spalte und sortieren in rechter Spalte. // --------- $(".gclh_LinkListElement").draggable({ revert: "invalid", helper: "clone", start: function(event, ui) { $(ui.helper).addClass("gclh_form"); }, stop: function(event, ui) { $(ui.helper).removeClass("gclh_form"); } }); $("#gclh_LinkListTop").droppable({ accept: function(d) { if (!d.hasClass("gclh_LinkListInlist") && d.hasClass("gclh_LinkListElement")) { // Wenn dragging stattfindet, Cursor und Opacity passend setzen. if ($('.gclh_LinkListElement.ui-draggable-dragging').length != 0) { var index = d[0].id.replace("gclh_LinkListElement_", ""); if (document.getElementById("gclh_LinkListTop_" + index)) { flagBmInLl(d[0].parentNode.children[2], true, "not-allowed", "1", ""); } else { flagBmInLl(d[0].parentNode.children[2], true, "grabbing", "1", ""); return true; } } } }, drop: function(event, ui) { // Platzhalter entfernen. $(this).find(".gclh_LinkListPlaceHolder").remove(); // Index ermitteln. var index = ui.draggable[0].id.replace("gclh_LinkListElement_", ""); // Custom BM? if (ui.draggable[0].children[1].id.match("custom")) { var textTitle = "Custom" + ui.draggable[0].children[1].id.replace("settings_custom_bookmark[", "").replace("]", ""); } else var textTitle = ui.draggable[0].children[1].innerHTML; // Abweichende Bezeichnung ermitteln. Falls leer, default nehmen. var text = document.getElementById("bookmarks_name["+index+"]").value; if (!text.match(/(\S+)/)) text = textTitle; var textName = textTitle; // BM in Linklist aufbauen. var htmlRight = ""; htmlRight += ""; htmlRight += " "; htmlRight += text; htmlRight += ""; htmlRight += ""; htmlRight += " "; htmlRight += ""; var row = $("").html(htmlRight); // Entsprechende Bookmark als vorhanden in Linklist kennzeichnen. flagBmInLl(document.getElementById("gclh_LinkListElement_" + index), false, "not-allowed", "0.4", "Already available in Linklist"); // Click Event für Delete Icon aufbauen. row.find(".gclh_LinkListDelIcon").click(function() { var row = this.parentNode.parentNode; var tablebody = row.parentNode; $(row).remove(); if (tablebody.children.length == 0) $('Drop here...').appendTo(tablebody); }); $(row).appendTo(this); } }).sortable({ items: "tr:not(.gclh_LinkListPlaceHolder)" }); // Map / Layers: // ------------- function layerOption(name, selected) { return ""; } $("#btn_map_layer_right").click(function() { animateClick(this); var source = "#settings_maplayers_unavailable"; var destination = "#settings_maplayers_available"; $(source+" option:selected").each(function() { var name = $(this).html(); if (name == settings_map_default_layer) $("#settings_mapdefault_layer").html(name); $(destination).append(layerOption(name, (settings_map_default_layer == name))); }); $(source+" option:selected").remove(); }); $("#btn_map_layer_left").click(function() { animateClick(this); var source = "#settings_maplayers_available"; var destination = "#settings_maplayers_unavailable"; $(source+" option:selected").each(function() { var name = $(this).html(); if (name == settings_map_default_layer) { $("#settings_mapdefault_layer").html("not available"); settings_map_default_layer = ""; } $(destination).append(layerOption(name, false)); }); $(source+" option:selected").remove(); }); $("#btn_set_default_layer").click(function() { animateClick(this); $("#settings_maplayers_available option:selected").each(function() { var name = $(this).html(); $("#settings_mapdefault_layer").html(name); settings_map_default_layer = name; }); }); // Fill layer lists. var layerListAvailable = ""; var layerListUnAvailable = ""; // Wenn bisher keine Layer ausgewählt, alle auswählen. if (settings_map_layers == "" || settings_map_layers.length < 1) { for (name in all_map_layers) { $("#settings_maplayers_available").append(layerOption(name, (settings_map_default_layer == name))); } } else { for (name in all_map_layers) { if (settings_map_layers.indexOf(name) != -1) $("#settings_maplayers_available").append(layerOption(name, (settings_map_default_layer == name))); else $("#settings_maplayers_unavailable").append(layerOption(name, false)); } } // Show/Hide Einstellungen zu Layers in Map. $("#settings_use_gclh_layercontrol").click(function() { $("#MapLayersConfiguration").toggle(); }); // Colorpicker: // ------------ var code = GM_getResourceText("jscolor"); code += 'new jscolor.init();'; injectPageScript(code, "body"); // Multi homezone: // --------------- function gclh_init_multi_homecoord_remove_listener($el) { $el.find('.remove').click(function() { $(this).closest('.multi_homezone_element').remove(); }); } // Initialize remove listener for present elements. gclh_init_multi_homecoord_remove_listener($('.multi_homezone_settings')); // Initialize add listener for multi homecoord entries. $('.multi_homezone_settings .addentry').click(function() { var $newEl = $(hztp); $('.multi_homezone_settings tbody').append($newEl); // Initialize remove listener for new element. gclh_init_multi_homecoord_remove_listener($newEl); // Reinit jscolor. if (typeof(chrome) != "undefined") { $('.gclh_form.color:not(.withPicker)').each(function(i, e) { var homezonepic = new jscolor.color(e, { required: true, adjust: true, hash: true, caps: true, pickerMode: 'HSV', pickerPosition: 'right' }); $(e).addClass("withPicker"); }); } else injectPageScript('new jscolor.init();', "body"); }); // Show/Hide Einstellungen zu homezone circels. $("#settings_show_homezone").click(function() { $("#ShowHomezoneCircles").toggle(); }); // Own entries in copy data to clipboard menu: // ------------------------------------------- $('#cdos_main .cff_element').each(function() {buildAroundCff('cdos', this);}); buildEventCreateCff('cdos'); // Rest: // ----- function gclh_show_linklist() { if (document.getElementById('lnk_gclh_config_linklist').title == "show") document.getElementById('lnk_gclh_config_linklist').click(); } // Open Helptexts slightly late so it doesn't flutter so often. $('.gclh_info').each(function() { this.addEventListener('mouseover', function() { var a = this; setTimeout(function() {$(a).addClass('mouseover');}, 400); }) this.addEventListener('mouseleave', function() { $(this).removeClass('mouseover'); var a = this; setTimeout(function() {$(a).removeClass('mouseover');}, 400); }) }); // Monitor select of color scheme. $('#settings_color_schemes')[0].addEventListener('click', checkColorSchemeSelected); var lastColorScheme = 0; function checkColorSchemeSelected() { var value = $('#settings_color_schemes')[0].value; if (value && value != lastColorScheme && value > 0) { setColorOfScheme(colorSchemes[value].bg, 'bg'); setColorOfScheme(colorSchemes[value].ht, 'ht'); setColorOfScheme(colorSchemes[value].if, 'if'); setColorOfScheme(colorSchemes[value].bh, 'bh'); setColorOfScheme(colorSchemes[value].bu, 'bu'); setColorOfScheme(colorSchemes[value].bo, 'bo'); setColorOfScheme(colorSchemes[value].nv, 'nv'); lastColorScheme == $('#settings_color_schemes option[selected="selected"]').value; } } function setColorOfScheme(color, name) { if ($('#settings_color_'+name)[0] && $('#settings_color_'+name)[0].value && $('#settings_color_'+name)[0].value != color) { $('#settings_color_'+name)[0].value = $('#settings_color_'+name)[0].defaultValue = color; $('#settings_color_'+name)[0].focus(); $('#set_color_'+name).focus(); $('#set_color_'+name).click(); } } $('#create_homezone, #cff_create, #btn_close2, #btn_saveAndUpload, #btn_save, #thanks_close_button, #rc_close_button, #rc_reset_button').click(function() {if ($(this)[0]) animateClick(this);}); $('#check_for_update')[0].addEventListener("click", function() {checkForUpdate(true);}, false); $('#rc_link')[0].addEventListener("click", rcPrepare, false); $('#rc_reset_button')[0].addEventListener("click", rcReset, false); $('#rc_close_button')[0].addEventListener("click", rcClose, false); $('#thanks_link')[0].addEventListener("click", thanksShow, false); $('#thanks_close_button')[0].addEventListener("click", gclh_showConfig, false); $('#gclh_linklist_link_1')[0].addEventListener("click", gclh_show_linklist, false); $('#gclh_linklist_link_2')[0].addEventListener("click", gclh_show_linklist, false); $('#btn_close2')[0].addEventListener("click", btnClose, false); $('#btn_save')[0].addEventListener("click", function() {btnSave("normal");}, false); $('#btn_saveAndUpload')[0].addEventListener("click", function() {btnSave("upload");}, false); $('#settings_bookmarks_on_top')[0].addEventListener("click", handleRadioTopMenu, false); $('#settings_bookmarks_top_menu')[0].addEventListener("click", handleRadioTopMenu, false); $('#settings_bookmarks_top_menu_h')[0].addEventListener("click", handleRadioTopMenu, false); handleRadioTopMenu(true); $('#settings_load_logs_with_gclh')[0].addEventListener("click", alert_settings_load_logs_with_gclh, false); $('#settings_drafts_go_automatic_back')[0].addEventListener("click", function() { if ($('#settings_drafts_go_automatic_back').prop('checked')) $('#settings_drafts_after_new_logging_view_log, #settings_drafts_after_new_logging_view_logX0').prop('checked', false); }, false); $('#settings_drafts_go_automatic_backX0')[0].addEventListener("click", function() { if ($('#settings_drafts_go_automatic_backX0').prop('checked')) $('#settings_drafts_after_new_logging_view_log, #settings_drafts_after_new_logging_view_logX0').prop('checked', false); }, false); $('#settings_drafts_after_new_logging_view_log')[0].addEventListener("click", function() { if ($('#settings_drafts_after_new_logging_view_log').prop('checked')) $('#settings_drafts_go_automatic_back,#settings_drafts_go_automatic_backX0').prop('checked', false); }, false); $('#settings_drafts_after_new_logging_view_logX0')[0].addEventListener("click", function() { if ($('#settings_drafts_after_new_logging_view_logX0').prop('checked')) $('#settings_drafts_go_automatic_back,#settings_drafts_go_automatic_backX0').prop('checked', false); }, false); $('#restore_settings_lines_color_zebra')[0].addEventListener("click", restoreField, false); $('#restore_settings_lines_color_user')[0].addEventListener("click", restoreField, false); $('#restore_settings_lines_color_owner')[0].addEventListener("click", restoreField, false); $('#restore_settings_lines_color_reviewer')[0].addEventListener("click", restoreField, false); $('#restore_settings_lines_color_vip')[0].addEventListener("click", restoreField, false); $('#restore_settings_font_color_menu')[0].addEventListener("click", restoreField, false); $('#restore_settings_font_color_menuX0')[0].addEventListener("click", restoreField, false); $('#restore_settings_font_color_submenu')[0].addEventListener("click", restoreField, false); $('#restore_settings_font_color_submenuX0')[0].addEventListener("click", restoreField, false); $('#restore_settings_count_own_matrix_show_color_next')[0].addEventListener("click", restoreField, false); $('#settings_process_vup')[0].addEventListener("click", alert_settings_process_vup, false); $('#restore_settings_lists_disabled_color')[0].addEventListener("click", restoreField, false); $('#restore_settings_lists_archived_color')[0].addEventListener("click", restoreField, false); $('#restore_settings_searchmap_disabled_color')[0].addEventListener("click", restoreField, false); $('#restore_settings_show_copydata_own_stuff_name')[0].addEventListener("click", restoreField, false); $('#restore_settings_show_copydata_own_stuff_value')[0].addEventListener("click", restoreField, false); $('#restore_settings_show_copydata_separator')[0].addEventListener("click", restoreField, false); $('#restore_settings_color_bg')[0].addEventListener("click", restoreField, false); $('#restore_settings_color_ht')[0].addEventListener("click", restoreField, false); $('#restore_settings_color_if')[0].addEventListener("click", restoreField, false); $('#restore_settings_color_bu')[0].addEventListener("click", restoreField, false); $('#restore_settings_color_bh')[0].addEventListener("click", restoreField, false); $('#restore_settings_color_bo')[0].addEventListener("click", restoreField, false); $('#restore_settings_color_nv')[0].addEventListener("click", restoreField, false); // Events setzen für Parameter, die im GClh Config mehrfach ausgegeben wurden, weil sie zu mehreren Themen gehören. Es handelt // sich hier um den Parameter selbst. In der Function werden Events für den Parameter selbst (ZB: "settings_show_vip_list") // und dessen Clone gesetzt, die hinten mit "X" und Nummerierung von 0-9 enden können (ZB: "settings_show_vip_listX0"). setEvForDouPara("settings_show_save_message", "click"); setEvForDouPara("settings_show_vip_list", "click"); setEvForDouPara("settings_process_vup", "click"); setEvForDouPara("settings_font_color_menu", "input"); setEvForDouPara("settings_font_color_menu", "change"); setEvForDouPara("settings_font_color_submenu", "input"); setEvForDouPara("settings_font_color_submenu", "change"); setEvForDouPara("settings_font_size_menu", "input"); setEvForDouPara("settings_distance_menu", "input"); setEvForDouPara("settings_font_size_submenu", "input"); setEvForDouPara("settings_distance_submenu", "input"); setEvForDouPara("settings_show_log_it", "click"); setEvForDouPara("settings_logit_for_basic_in_pmo", "click"); setEvForDouPara("settings_show_thumbnails", "click"); setEvForDouPara("settings_hover_image_max_size", "input"); setEvForDouPara("settings_imgcaption_on_top", "click"); setEvForDouPara("settings_spoiler_strings", "input"); setEvForDouPara("settings_show_elevation_of_waypoints", "click"); setEvForDouPara("settings_primary_elevation_service", "input"); setEvForDouPara("settings_secondary_elevation_service", "input"); setEvForDouPara("settings_hide_upvotes", "click"); setEvForDouPara("settings_smaller_upvotes_icons", "click"); setEvForDouPara("settings_no_wiggle_upvotes_click", "click"); setEvForDouPara("settings_show_eventday", "click"); setEvForDouPara("settings_drafts_go_automatic_back", "click"); setEvForDouPara("settings_drafts_after_new_logging_view_log", "click"); // Events setzen für Parameter, die im GClh Config eine Abhängigkeit derart auslösen, dass andere Parameter aktiviert bzw. // deaktiviert werden müssen. ZB. können Mail Icons in VIP List (Parameter "settings_show_mail_in_viplist") nur aufgebaut // werden, wenn die VIP Liste erzeugt wird (Parameter "settings_show_vip_list"). Clone müssen hier auch berücksichtigt werden. setEvForDepPara("settings_change_header_layout", "settings_show_smaller_gc_link"); setEvForDepPara("settings_change_header_layout", "settings_remove_logo"); setEvForDepPara("settings_show_smaller_gc_link", "settings_remove_logo"); setEvForDepPara("settings_change_header_layout", "settings_remove_message_in_header"); setEvForDepPara("settings_change_header_layout", "settings_gc_tour_is_working"); setEvForDepPara("settings_change_header_layout", "settings_fixed_header_layout"); setEvForDepPara("settings_change_header_layout", "settings_font_color_menu"); setEvForDepPara("settings_change_header_layout", "restore_settings_font_color_menu"); setEvForDepPara("settings_change_header_layout", "settings_font_color_submenu"); setEvForDepPara("settings_change_header_layout", "restore_settings_font_color_submenu"); setEvForDepPara("settings_change_header_layout", "settings_bookmarks_top_menu_h"); setEvForDepPara("settings_change_header_layout", "settings_menu_float_right"); setEvForDepPara("settings_change_header_layout", "settings_font_size_menu"); setEvForDepPara("settings_change_header_layout", "settings_distance_menu"); setEvForDepPara("settings_change_header_layout", "settings_font_size_submenu"); setEvForDepPara("settings_change_header_layout", "settings_distance_submenu"); setEvForDepPara("settings_change_header_layout", "settings_menu_number_of_lines"); setEvForDepPara("settings_change_header_layout", "settings_menu_show_separator"); setEvForDepPara("settings_bookmarks_on_top", "settings_bookmarks_top_menu_h"); setEvForDepPara("settings_bookmarks_on_top", "settings_bookmarks_search"); setEvForDepPara("settings_bookmarks_on_top", "settings_bookmarks_search_default"); setEvForDepPara("settings_bookmarks_on_top", "settings_menu_float_right"); setEvForDepPara("settings_bookmarks_on_top", "settings_menu_number_of_lines"); setEvForDepPara("settings_bookmarks_on_top", "settings_menu_show_separator"); setEvForDepPara("settings_load_logs_with_gclh", "settings_show_mail_in_viplist"); setEvForDepPara("settings_load_logs_with_gclh", "settings_show_cache_listings_in_zebra"); setEvForDepPara("settings_load_logs_with_gclh", "settings_show_cache_listings_color_user"); setEvForDepPara("settings_load_logs_with_gclh", "settings_show_cache_listings_color_owner"); setEvForDepPara("settings_load_logs_with_gclh", "settings_show_cache_listings_color_reviewer"); setEvForDepPara("settings_load_logs_with_gclh", "settings_show_cache_listings_color_vip"); setEvForDepPara("settings_show_vip_list", "settings_show_cache_listings_color_vip"); setEvForDepPara("settings_show_vip_list", "settings_show_tb_listings_color_vip"); setEvForDepPara("settings_show_vip_list", "settings_lines_color_vip"); setEvForDepPara("settings_show_vip_list", "restore_settings_lines_color_vip"); setEvForDepPara("settings_show_vip_list", "settings_show_reviewer_as_vip"); setEvForDepPara("settings_show_vip_list", "settings_show_lackey_as_vip"); setEvForDepPara("settings_show_vip_list", "settings_show_owner_vip_list"); setEvForDepPara("settings_show_vip_list", "settings_show_long_vip"); setEvForDepPara("settings_show_vip_list", "settings_vip_show_nofound"); setEvForDepPara("settings_show_vip_list", "settings_show_mail_in_viplist"); setEvForDepPara("settings_show_vip_list", "settings_show_mail_in_allmyvips"); setEvForDepPara("settings_show_vip_list", "settings_make_vip_lists_hideable"); setEvForDepPara("settings_show_vip_list", "settings_process_vup"); setEvForDepPara("settings_show_vip_list", "settings_show_vup_friends"); setEvForDepPara("settings_show_vip_list", "settings_vup_hide_avatar"); setEvForDepPara("settings_show_vip_list", "settings_vup_hide_log"); setEvForDepPara("settings_show_vip_listX0", "settings_show_cache_listings_color_vip"); setEvForDepPara("settings_show_vip_listX0", "settings_show_tb_listings_color_vip"); setEvForDepPara("settings_show_vip_listX0", "settings_lines_color_vip"); setEvForDepPara("settings_show_vip_listX0", "restore_settings_lines_color_vip"); setEvForDepPara("settings_show_vip_listX0", "settings_show_reviewer_as_vip"); setEvForDepPara("settings_show_vip_listX0", "settings_show_lackey_as_vip"); setEvForDepPara("settings_show_vip_listX0", "settings_show_owner_vip_list"); setEvForDepPara("settings_show_vip_listX0", "settings_show_long_vip"); setEvForDepPara("settings_show_vip_listX0", "settings_vip_show_nofound"); setEvForDepPara("settings_show_vip_listX0", "settings_show_mail_in_viplist"); setEvForDepPara("settings_show_vip_listX0", "settings_show_mail_in_allmyvips"); setEvForDepPara("settings_show_vip_listX0", "settings_make_vip_lists_hideable"); setEvForDepPara("settings_show_vip_listX0", "settings_process_vup"); setEvForDepPara("settings_show_vip_listX0", "settings_show_vup_friends"); setEvForDepPara("settings_show_vip_listX0", "settings_vup_hide_avatar"); setEvForDepPara("settings_show_vip_listX0", "settings_vup_hide_log"); setEvForDepPara("settings_process_vup", "settings_show_vup_friends"); setEvForDepPara("settings_process_vup", "settings_vup_hide_avatar"); setEvForDepPara("settings_process_vup", "settings_vup_hide_log"); setEvForDepPara("settings_process_vupX0", "settings_show_vup_friends"); setEvForDepPara("settings_process_vupX0", "settings_vup_hide_avatar"); setEvForDepPara("settings_process_vupX0", "settings_vup_hide_log"); setEvForDepPara("settings_vup_hide_avatar", "settings_vup_hide_log"); setEvForDepPara("settings_show_mail", "settings_show_mail_in_viplist"); setEvForDepPara("settings_show_mail", "settings_show_mail_in_allmyvips"); setEvForDepPara("settings_show_mail", "settings_mail_icon_new_win"); setEvForDepPara("settings_show_message", "settings_message_icon_new_win"); setEvForDepPara("settings_show_thumbnails", "settings_hover_image_max_size"); setEvForDepPara("settings_show_thumbnails", "settings_imgcaption_on_top"); setEvForDepPara("settings_show_thumbnails", "settings_spoiler_strings"); setEvForDepPara("settings_show_thumbnails", "settings_public_profile_avatar_show_thumbnail"); setEvForDepPara("settings_show_thumbnailsX0", "settings_hover_image_max_size"); setEvForDepPara("settings_show_thumbnailsX0", "settings_imgcaption_on_top"); setEvForDepPara("settings_show_thumbnailsX0", "settings_spoiler_strings"); setEvForDepPara("settings_show_thumbnailsX0", "settings_public_profile_avatar_show_thumbnail"); setEvForDepPara("settings_show_thumbnailsX1", "settings_hover_image_max_size"); setEvForDepPara("settings_show_thumbnailsX1", "settings_imgcaption_on_top"); setEvForDepPara("settings_show_thumbnailsX1", "settings_spoiler_strings"); setEvForDepPara("settings_show_thumbnailsX1", "settings_public_profile_avatar_show_thumbnail"); setEvForDepPara("settings_map_overview_build", "settings_map_overview_zoom"); setEvForDepPara("settings_map_overview_build", "settings_map_overview_layer"); setEvForDepPara("settings_map_overview_build", "settings_map_overview_browse_map_icon"); setEvForDepPara("settings_map_overview_build", "settings_map_overview_browse_map_icon_new_tab"); setEvForDepPara("settings_map_overview_build", "settings_map_overview_search_map_icon"); setEvForDepPara("settings_map_overview_build", "settings_map_overview_search_map_icon_new_tab"); setEvForDepPara("settings_count_own_matrix_show_next", "settings_count_own_matrix_show_count_next"); setEvForDepPara("settings_count_own_matrix_show_next", "settings_count_own_matrix_show_color_next"); setEvForDepPara("settings_count_own_matrix_show_next", "restore_settings_count_own_matrix_show_color_next"); setEvForDepPara("settings_count_own_matrix_show_next", "settings_count_own_matrix_links_radius"); setEvForDepPara("settings_count_own_matrix_show_next", "settings_count_own_matrix_links"); setEvForDepPara("settings_add_link_gc_map_on_google_maps", "settings_switch_from_google_maps_to_gc_map_in_same_tab"); setEvForDepPara("settings_add_link_new_gc_map_on_google_maps", "settings_switch_from_google_maps_to_new_gc_map_in_same_tab"); setEvForDepPara("settings_add_link_google_maps_on_gc_map", "settings_switch_to_google_maps_in_same_tab"); setEvForDepPara("settings_add_link_gc_map_on_osm", "settings_switch_from_osm_to_gc_map_in_same_tab"); setEvForDepPara("settings_add_link_new_gc_map_on_osm", "settings_switch_from_osm_to_new_gc_map_in_same_tab"); setEvForDepPara("settings_add_link_osm_on_gc_map", "settings_switch_to_osm_in_same_tab"); setEvForDepPara("settings_add_link_flopps_on_gc_map", "settings_switch_to_flopps_in_same_tab"); setEvForDepPara("settings_add_link_geohack_on_gc_map", "settings_switch_to_geohack_in_same_tab"); setEvForDepPara("settings_add_link_komoot_on_gc_map", "settings_switch_to_komoot_in_same_tab"); setEvForDepPara("settings_show_latest_logs_symbols", "settings_show_latest_logs_symbols_count"); setEvForDepPara("settings_load_logs_with_gclh", "settings_show_latest_logs_symbols"); setEvForDepPara("settings_log_statistic", "settings_log_statistic_reload"); setEvForDepPara("settings_log_statistic", "settings_log_statistic_percentage"); setEvForDepPara("settings_friendlist_summary", "settings_friendlist_summary_viponly"); setEvForDepPara("settings_driving_direction_link", "settings_driving_direction_parking_area"); setEvForDepPara("settings_improve_add_to_list", "settings_improve_add_to_list_height"); setEvForDepPara("settings_set_default_langu", "settings_default_langu"); setEvForDepPara("settings_pq_set_cachestotal", "settings_pq_cachestotal"); setEvForDepPara("settings_pq_set_difficulty", "settings_pq_difficulty"); setEvForDepPara("settings_pq_set_difficulty", "settings_pq_difficulty_score"); setEvForDepPara("settings_pq_set_terrain", "settings_pq_terrain"); setEvForDepPara("settings_pq_set_terrain", "settings_pq_terrain_score"); setEvForDepPara("settings_pq_previewmap", "settings_pq_previewmap_layer"); setEvForDepPara("settings_show_all_logs", "settings_show_all_logs_count"); setEvForDepPara("settings_strike_archived", "settings_highlight_usercoords"); setEvForDepPara("settings_strike_archived", "settings_highlight_usercoords_bb"); setEvForDepPara("settings_strike_archived", "settings_highlight_usercoords_it"); setEvForDepPara("settings_but_search_map", "settings_but_search_map_new_tab"); setEvForDepPara("settings_compact_layout_nearest", "settings_fav_proz_nearest"); setEvForDepPara("settings_compact_layout_nearest", "settings_open_tabs_nearest"); setEvForDepPara("settings_compact_layout_pqs", "settings_fav_proz_pqs"); setEvForDepPara("settings_compact_layout_pqs", "settings_open_tabs_pqs"); setEvForDepPara("settings_compact_layout_recviewed", "settings_fav_proz_recviewed"); setEvForDepPara("settings_show_elevation_of_waypoints","settings_primary_elevation_service"); setEvForDepPara("settings_show_elevation_of_waypoints","settings_secondary_elevation_service"); setEvForDepPara("settings_show_elevation_of_waypointsX0","settings_primary_elevation_service"); setEvForDepPara("settings_show_elevation_of_waypointsX0","settings_secondary_elevation_service"); setEvForDepPara("settings_show_gpsvisualizer_link","settings_show_gpsvisualizer_gcsymbols"); setEvForDepPara("settings_show_gpsvisualizer_link","settings_show_gpsvisualizer_typedesc"); setEvForDepPara("settings_show_openrouteservice_link","settings_show_openrouteservice_home"); setEvForDepPara("settings_show_openrouteservice_link","settings_show_openrouteservice_medium"); setEvForDepPara("settings_show_log_counter_but","settings_show_log_counter"); setEvForDepPara("settings_show_remove_ignoring_link","settings_use_one_click_ignoring"); setEvForDepPara("settings_set_showUnpublishedHides_sort","settings_showUnpublishedHides_sort"); setEvForDepPara("settings_showUnpublishedHides","settings_set_showUnpublishedHides_sort"); setEvForDepPara("settings_showUnpublishedHides","settings_showUnpublishedHides_sort"); setEvForDepPara("settings_lists_disabled","settings_lists_disabled_color"); setEvForDepPara("settings_lists_disabled","restore_settings_lists_disabled_color"); setEvForDepPara("settings_lists_disabled","settings_lists_disabled_strikethrough"); setEvForDepPara("settings_lists_archived","settings_lists_archived_color"); setEvForDepPara("settings_lists_archived","restore_settings_lists_archived_color"); setEvForDepPara("settings_lists_archived","settings_lists_archived_strikethrough"); setEvForDepPara("settings_lists_icons_visible","settings_lists_log_status_icons_visible"); setEvForDepPara("settings_lists_icons_visible","settings_lists_cache_type_icons_visible"); setEvForDepPara("settings_searchmap_disabled","settings_searchmap_disabled_strikethrough"); setEvForDepPara("settings_searchmap_disabled","settings_searchmap_disabled_color"); setEvForDepPara("settings_searchmap_disabled","restore_settings_searchmap_disabled_color"); setEvForDepPara("settings_show_copydata_menu","settings_show_copydata_own_stuff_show"); setEvForDepPara("settings_show_copydata_menu","settings_show_copydata_plus"); setEvForDepPara("settings_show_copydata_menu","settings_show_copydata_separator"); setEvForDepPara("settings_show_copydata_menu","restore_settings_show_copydata_separator"); setEvForDepPara("settings_show_copydata_plus","settings_show_copydata_separator"); setEvForDepPara("settings_show_copydata_plus","restore_settings_show_copydata_separator"); setEvForDepPara("settings_show_copydata_menu","settings_show_copydata_own_stuff_name"); setEvForDepPara("settings_show_copydata_menu","restore_settings_show_copydata_own_stuff_name"); setEvForDepPara("settings_show_copydata_menu","settings_show_copydata_own_stuff_value"); setEvForDepPara("settings_show_copydata_menu","restore_settings_show_copydata_own_stuff_value"); setEvForDepPara("settings_show_copydata_own_stuff_show","settings_show_copydata_own_stuff_name"); setEvForDepPara("settings_show_copydata_own_stuff_show","restore_settings_show_copydata_own_stuff_name"); setEvForDepPara("settings_show_copydata_own_stuff_show","settings_show_copydata_own_stuff_value"); setEvForDepPara("settings_show_copydata_own_stuff_show","restore_settings_show_copydata_own_stuff_value"); setEvForDepPara("settings_lists_show_dd","settings_lists_hide_desc"); setEvForDepPara("settings_lists_show_dd","settings_lists_upload_file"); setEvForDepPara("settings_lists_show_dd","settings_lists_open_tabs"); setEvForDepPara("settings_autovisit","settings_autovisit_default"); setEvForDepPara("settings_add_log_templates","settings_log_template_name[0]"); setEvForDepPara("settings_add_log_templates","settings_log_template[0]"); setEvForDepPara("settings_add_log_templates","settings_log_template_name[1]"); setEvForDepPara("settings_add_log_templates","settings_log_template[1]"); setEvForDepPara("settings_add_log_templates","settings_log_template_name[2]"); setEvForDepPara("settings_add_log_templates","settings_log_template[2]"); setEvForDepPara("settings_add_log_templates","settings_log_template_name[3]"); setEvForDepPara("settings_add_log_templates","settings_log_template[3]"); setEvForDepPara("settings_add_log_templates","settings_log_template_name[4]"); setEvForDepPara("settings_add_log_templates","settings_log_template[4]"); setEvForDepPara("settings_add_log_templates","settings_log_template_name[5]"); setEvForDepPara("settings_add_log_templates","settings_log_template[5]"); setEvForDepPara("settings_add_log_templates","settings_log_template_name[6]"); setEvForDepPara("settings_add_log_templates","settings_log_template[6]"); setEvForDepPara("settings_add_log_templates","settings_log_template_name[7]"); setEvForDepPara("settings_add_log_templates","settings_log_template[7]"); setEvForDepPara("settings_add_log_templates","settings_log_template_name[8]"); setEvForDepPara("settings_add_log_templates","settings_log_template[8]"); setEvForDepPara("settings_add_log_templates","settings_log_template_name[9]"); setEvForDepPara("settings_add_log_templates","settings_log_template[9]"); setEvForDepPara("settings_add_log_templates","settings_add_cache_log_signature_as_log_template"); setEvForDepPara("settings_add_log_templates","settings_add_tb_log_signature_as_log_template"); setEvForDepPara("settings_add_cache_log_signature","settings_log_signature"); setEvForDepPara("settings_add_cache_log_signature","settings_log_signature_on_fieldnotes"); setEvForDepPara("settings_add_tb_log_signature","settings_tb_signature"); setEvForDepPara("settings_map_overview_search_map_icon", "settings_map_overview_search_map_icon_new_tab"); setEvForDepPara("settings_map_show_btn_hide_header","settings_hide_map_header"); setEvForDepPara("settings_searchmap_show_btn_save_as_pq","settings_save_as_pq_set_all"); setEvForDepPara("settings_show_enhanced_map_popup","settings_show_latest_logs_symbols_count_map"); setEvForDepPara("settings_show_enhanced_map_popup","settings_show_country_in_place"); setEvForDepPara("settings_show_enhanced_map_popup","settings_show_enhanced_map_coords"); setEvForDepPara("settings_modify_new_drafts_page", "settings_drafts_cache_link"); setEvForDepPara("settings_modify_new_drafts_page", "settings_drafts_cache_link_new_tab"); setEvForDepPara("settings_modify_new_drafts_page", "settings_drafts_color_visited_link"); setEvForDepPara("settings_modify_new_drafts_page", "settings_drafts_old_log_form"); setEvForDepPara("settings_modify_new_drafts_page", "settings_drafts_log_icons"); setEvForDepPara("settings_drafts_cache_link", "settings_drafts_cache_link_new_tab"); setEvForDepPara("settings_drafts_download_show_button", "settings_drafts_download_change_logdate"); setEvForDepPara("settings_searchmap_improve_add_to_list","settings_searchmap_improve_add_to_list_height"); // Abhängigkeiten der Linklist Parameter. for (var i = 0; i < 100; i++) { // 2. Spalte: Links für Custom BMs. if (document.getElementById("gclh_LinkListElement_" + i)) { setEvForDepPara("settings_bookmarks_on_top", "gclh_LinkListElement_" + i, false); setEvForDepPara("settings_bookmarks_show", "gclh_LinkListElement_" + i, false); } if (document.getElementById("settings_custom_bookmark[" + i + "]")) { setEvForDepPara("settings_bookmarks_on_top", "settings_custom_bookmark[" + i + "]", false); setEvForDepPara("settings_bookmarks_show", "settings_custom_bookmark[" + i + "]", false); } // 3. Spalte: Target für Links für Custom BMs. if (document.getElementById("settings_custom_bookmark_target[" + i + "]")) { setEvForDepPara("settings_bookmarks_on_top", "settings_custom_bookmark_target[" + i + "]", false); setEvForDepPara("settings_bookmarks_show", "settings_custom_bookmark_target[" + i + "]", false); } // 4. Spalte: Bezeichnungen. if (document.getElementById("bookmarks_name[" + i + "]")) { setEvForDepPara("settings_bookmarks_on_top", "bookmarks_name[" + i + "]", false); setEvForDepPara("settings_bookmarks_show", "bookmarks_name[" + i + "]", false); } else break; } // 5. Spalte: Linklist. setEvForDepPara("settings_bookmarks_on_top", "gclh_LinkListTop", false); setEvForDepPara("settings_bookmarks_show", "gclh_LinkListTop", false); // Anfangsbesetzung herstellen bei Abhängigkeiten. setStartForDepPara(); // Save, Close Buttons dynamisch mit F2 bzw. ESC Beschriftung versehen. $('#settings_f2_save_gclh_config')[0].addEventListener("click", setValueInSaveButton, false); $('#settings_esc_close_gclh_config')[0].addEventListener("click", setValueInCloseButton, false); // Positionierung innerhalb des GClh Config bei Aufrufen. if (document.location.href.match(/#a#/i)) { document.location.href = document.location.href.replace(/#a#/i, "#"); var diff = 4; if (document.location.href.match(/#llb#/i)) { if (document.getElementById('settings_bookmarks_top_menu').checked) diff += 141 - 6; else diff += 165 - 25; } if (document.location.href.match(/#(ll|llb)#/i)) { document.location.href = document.location.href.replace(/#(ll|llb)#/i, "#"); gclh_show_linklist(); } if (document.location.href.match(/#(\S+)/)) { var arg = document.location.href.match(/#(.*)/); if (arg) { document.location.href = clearUrlAppendix(document.location.href, false); $('html,body').animate({scrollTop: ($('#'+arg[1]).offset().top) - diff}, 1500, "swing"); } } } } if ($('.hover.open')[0]) $('.hover.open')[0].className = ""; // Save by pressing the F2 key or by pressing the Ctrl+s keys together. Close by pressing the ESC key. if (check_config_page()) window.addEventListener('keydown', keydown, true); function keydown(e) { if (check_config_page()) { if ($('#settings_f2_save_gclh_config')[0].checked && !global_mod_reset) { if (e.keyCode == 113 && noSpecialKey(e)) $('#btn_save')[0].click(); if (e.keyCode == 83 && e.ctrlKey == true && e.altKey == false && e.shiftKey == false) { e.preventDefault(); $('#btn_save')[0].click(); } } if ($('#settings_esc_close_gclh_config')[0].checked && !global_mod_reset) { if (e.keyCode == 27 && noSpecialKey(e)) $('#btn_close2')[0].click(); } } } // Save Button. function btnSave(type) { window.scroll(0, 0); $("#settings_overlay").fadeOut(300); document.location.href = clearUrlAppendix(document.location.href, false); if ($('#settings_show_save_message')[0].checked) showSaveForm(); var settings = {}; function setValue(key, value) {settings[key] = value;} var value = document.getElementById("settings_home_lat_lng").value; var latlng = toDec(value); if (latlng) { if (getValue("home_lat", 0) != parseInt(latlng[0] * 10000000)) setValue("home_lat", parseInt(latlng[0] * 10000000)); // * 10000000 because GM don't know float. if (getValue("home_lng", 0) != parseInt(latlng[1] * 10000000)) setValue("home_lng", parseInt(latlng[1] * 10000000)); } setValue("settings_bookmarks_search_default", document.getElementById('settings_bookmarks_search_default').value); settings_show_all_logs_count = document.getElementById('settings_show_all_logs_count').value; setValue("settings_show_all_logs_count", countOfLogsInListing()); // Homezone circle. setValue("settings_homezone_radius", document.getElementById('settings_homezone_radius').value); setValue("settings_homezone_color", document.getElementById('settings_homezone_color').value.replace("#","")); if (document.getElementById('settings_homezone_opacity').value <= 100 && document.getElementById('settings_homezone_opacity').value >= 0) setValue("settings_homezone_opacity", document.getElementById('settings_homezone_opacity').value); // Multi homezone circles. var settings_multi_homezone = {}; var $hzelements = $('.multi_homezone_element'); for (var i = 0; i < $hzelements.length; i++) { var $curEl = $hzelements.eq(i); settings_multi_homezone[i] = {}; var latlng = toDec($curEl.find('.coords:eq(0)').val()); settings_multi_homezone[i].lat = parseInt(latlng[0] * 10000000); settings_multi_homezone[i].lng = parseInt(latlng[1] * 10000000); settings_multi_homezone[i].radius = $curEl.find('.radius:eq(0)').val(); settings_multi_homezone[i].color = $curEl.find('.color:eq(0)').val().replace("#",""); settings_multi_homezone[i].opacity = $curEl.find('.opacity:eq(0)').val(); } setValue("settings_multi_homezone", JSON.stringify(settings_multi_homezone)); // Own entries in copy data to clipboard menu. var settings_show_copydata_own_stuff = setDataCff('cdos'); setValue("settings_show_copydata_own_stuff", JSON.stringify(settings_show_copydata_own_stuff)); setValue("settings_new_width", document.getElementById('settings_new_width').value); setValue("settings_default_logtype", document.getElementById('settings_default_logtype').value); setValue("settings_default_logtype_event", document.getElementById('settings_default_logtype_event').value); setValue("settings_default_logtype_owner", document.getElementById('settings_default_logtype_owner').value); setValue("settings_default_tb_logtype", document.getElementById('settings_default_tb_logtype').value); setValue("settings_mail_signature", document.getElementById('settings_mail_signature').value.replace(/‌/g, "")); // Entfernt Steuerzeichen. setValue("settings_log_signature", document.getElementById('settings_log_signature').value.replace(/‌/g, "")); setValue("settings_tb_signature", document.getElementById('settings_tb_signature').value.replace(/‌/g, "")); setValue("settings_map_default_layer", settings_map_default_layer); setValue("settings_hover_image_max_size", document.getElementById('settings_hover_image_max_size').value); setValue("settings_spoiler_strings", document.getElementById('settings_spoiler_strings').value); setValue("settings_font_size_menu", document.getElementById('settings_font_size_menu').value); setValue("settings_font_size_submenu", document.getElementById('settings_font_size_submenu').value); setValue("settings_distance_menu", document.getElementById('settings_distance_menu').value); setValue("settings_distance_submenu", document.getElementById('settings_distance_submenu').value); setValue("settings_font_color_menu", document.getElementById('settings_font_color_menu').value.replace("#","")); setValue("settings_font_color_submenu", document.getElementById('settings_font_color_submenu').value.replace("#","")); setValue("settings_menu_number_of_lines", document.getElementById('settings_menu_number_of_lines').value); setValue("settings_lines_color_zebra", document.getElementById('settings_lines_color_zebra').value.replace("#","")); setValue("settings_lines_color_user", document.getElementById('settings_lines_color_user').value.replace("#","")); setValue("settings_lines_color_owner", document.getElementById('settings_lines_color_owner').value.replace("#","")); setValue("settings_lines_color_reviewer", document.getElementById('settings_lines_color_reviewer').value.replace("#","")); setValue("settings_lines_color_vip", document.getElementById('settings_lines_color_vip').value.replace("#","")); setValue("settings_map_overview_zoom", document.getElementById('settings_map_overview_zoom').value); setValue("settings_map_overview_layer", document.getElementById('settings_map_overview_layer').value); setValue("settings_count_own_matrix_show_count_next", document.getElementById('settings_count_own_matrix_show_count_next').value); setValue("settings_count_own_matrix_show_color_next", document.getElementById('settings_count_own_matrix_show_color_next').value.replace("#","")); setValue("settings_count_own_matrix_links_radius", document.getElementById('settings_count_own_matrix_links_radius').value); setValue("settings_count_own_matrix_links", document.getElementById('settings_count_own_matrix_links').value); setValue("settings_show_latest_logs_symbols_count", document.getElementById('settings_show_latest_logs_symbols_count').value); setValue("settings_default_langu", document.getElementById('settings_default_langu').value); setValue("settings_log_statistic_reload", document.getElementById('settings_log_statistic_reload').value); setValue("settings_pq_cachestotal", document.getElementById('settings_pq_cachestotal').value); setValue("settings_pq_difficulty", document.getElementById('settings_pq_difficulty').value); setValue("settings_pq_difficulty_score", document.getElementById('settings_pq_difficulty_score').value); setValue("settings_pq_terrain", document.getElementById('settings_pq_terrain').value); setValue("settings_pq_terrain_score", document.getElementById('settings_pq_terrain_score').value); setValue("settings_pq_previewmap_layer", document.getElementById('settings_pq_previewmap_layer').value); setValue("settings_improve_add_to_list_height", document.getElementById('settings_improve_add_to_list_height').value); setValue("settings_primary_elevation_service", document.getElementById('settings_primary_elevation_service').value); setValue("settings_secondary_elevation_service", document.getElementById('settings_secondary_elevation_service').value); setValue("settings_show_latest_logs_symbols_count_map", document.getElementById('settings_show_latest_logs_symbols_count_map').value); setValue("settings_show_openrouteservice_medium", document.getElementById('settings_show_openrouteservice_medium').value); setValue("settings_showUnpublishedHides_sort", document.getElementById('settings_showUnpublishedHides_sort').value); setValue("settings_lists_disabled_color", document.getElementById('settings_lists_disabled_color').value.replace("#","")); setValue("settings_lists_archived_color", document.getElementById('settings_lists_archived_color').value.replace("#","")); setValue("settings_searchmap_disabled_color", document.getElementById('settings_searchmap_disabled_color').value.replace("#","")); setValue("settings_show_copydata_own_stuff_name", document.getElementById('settings_show_copydata_own_stuff_name').value); setValue("settings_show_copydata_own_stuff_value", document.getElementById('settings_show_copydata_own_stuff_value').value); setValue("settings_show_copydata_separator", document.getElementById('settings_show_copydata_separator').value); setValue("settings_cache_notes_min_size", document.getElementById('settings_cache_notes_min_size').value); setValue("settings_color_bg", document.getElementById('settings_color_bg').value.replace("#","")); setValue("settings_color_ht", document.getElementById('settings_color_ht').value.replace("#","")); setValue("settings_color_if", document.getElementById('settings_color_if').value.replace("#","")); setValue("settings_color_bu", document.getElementById('settings_color_bu').value.replace("#","")); setValue("settings_color_bh", document.getElementById('settings_color_bh').value.replace("#","")); setValue("settings_color_bo", document.getElementById('settings_color_bo').value.replace("#","")); setValue("settings_color_nv", document.getElementById('settings_color_nv').value.replace("#","")); setValue("settings_searchmap_improve_add_to_list_height", document.getElementById('settings_searchmap_improve_add_to_list_height').value); // Map Layers in vorgegebener Reihenfolge übernehmen. var new_map_layers_available = document.getElementById('settings_maplayers_available'); var new_settings_map_layers = new Array(); for (name in all_map_layers) { for (var i = 0; i < new_map_layers_available.options.length; i++) { if (name == new_map_layers_available.options[i].value) { new_settings_map_layers.push(new_map_layers_available.options[i].value); break; } } } setValue('settings_map_layers', new_settings_map_layers.join("###")); // Checkboxes übernehmen. var checkboxes = new Array( 'settings_submit_log_button', 'settings_log_inline', 'settings_log_inline_pmo4basic', 'settings_bookmarks_show', 'settings_bookmarks_on_top', 'settings_change_header_layout', 'settings_fixed_header_layout', 'settings_remove_logo', 'settings_remove_message_in_header', 'settings_bookmarks_search', 'settings_redirect_to_map', 'settings_hide_facebook', 'settings_hide_socialshare', 'settings_hide_disclaimer', 'settings_hide_cache_notes', 'settings_hide_empty_cache_notes', 'settings_adapt_height_cache_notes', 'settings_show_all_logs', 'settings_decrypt_hint', 'settings_visitCount_geocheckerCom', 'settings_show_bbcode', 'settings_show_eventday', 'settings_show_eventtime_with_24_hours', 'settings_show_mail', 'settings_gc_tour_is_working', 'settings_show_smaller_gc_link', 'settings_menu_show_separator', 'settings_menu_float_right', 'settings_show_message', 'settings_show_remove_ignoring_link', 'settings_use_one_click_ignoring', 'settings_show_common_lists_in_zebra', 'settings_show_common_lists_color_user', 'settings_show_cache_listings_in_zebra', 'settings_show_cache_listings_color_user', 'settings_show_cache_listings_color_owner', 'settings_show_cache_listings_color_reviewer', 'settings_show_cache_listings_color_vip', 'settings_show_tb_listings_in_zebra', 'settings_show_tb_listings_color_user', 'settings_show_tb_listings_color_owner', 'settings_show_tb_listings_color_reviewer', 'settings_show_tb_listings_color_vip', 'settings_show_mail_in_allmyvips', 'settings_show_mail_in_viplist', 'settings_process_vup', 'settings_show_vup_friends', 'settings_vup_hide_avatar', 'settings_vup_hide_log', 'settings_f2_save_gclh_config', 'settings_esc_close_gclh_config', 'settings_f4_call_gclh_config', 'settings_call_config_via_sriptmanager', 'settings_f10_call_gclh_sync', 'settings_call_sync_via_sriptmanager', 'settings_show_sums_in_bookmark_lists', 'settings_show_sums_in_watchlist', 'settings_hide_warning_message', 'settings_show_save_message', 'settings_map_overview_build', 'settings_logit_for_basic_in_pmo', 'settings_log_statistic', 'settings_log_statistic_percentage', 'settings_count_own_matrix', 'settings_count_foreign_matrix', 'settings_count_own_matrix_show_next', 'settings_hide_left_sidebar_on_google_maps', 'settings_add_link_gc_map_on_google_maps', 'settings_switch_from_google_maps_to_gc_map_in_same_tab', 'settings_add_link_new_gc_map_on_google_maps', 'settings_switch_from_google_maps_to_new_gc_map_in_same_tab', 'settings_add_link_google_maps_on_gc_map', 'settings_switch_to_google_maps_in_same_tab', 'settings_add_links_google_maps_on_google_search', 'settings_add_link_gc_map_on_osm', 'settings_switch_from_osm_to_gc_map_in_same_tab', 'settings_add_link_new_gc_map_on_osm', 'settings_switch_from_osm_to_new_gc_map_in_same_tab', 'settings_add_link_osm_on_gc_map', 'settings_switch_to_osm_in_same_tab', 'settings_add_link_flopps_on_gc_map', 'settings_switch_to_flopps_in_same_tab', 'settings_add_link_geohack_on_gc_map', 'settings_switch_to_geohack_in_same_tab', 'settings_add_link_komoot_on_gc_map', 'settings_switch_to_komoot_in_same_tab', 'settings_sort_default_bookmarks', 'settings_make_vip_lists_hideable', 'settings_show_latest_logs_symbols', 'settings_set_default_langu', 'settings_hide_colored_versions', 'settings_make_config_main_areas_hideable', 'settings_faster_profile_trackables', 'settings_show_google_maps', 'settings_show_log_it', 'settings_show_nearestuser_profil_link', 'settings_show_homezone', 'settings_show_hillshadow', 'remove_navi_play', 'remove_navi_community', 'remove_navi_shop', 'settings_bookmarks_top_menu', 'settings_hide_advert_link', 'settings_hide_spoilerwarning', 'settings_hide_top_button', 'settings_hide_hint', 'settings_strike_archived', 'settings_highlight_usercoords', 'settings_highlight_usercoords_bb', 'settings_highlight_usercoords_it', 'settings_map_hide_found', 'settings_map_hide_hidden', 'settings_map_hide_dnfs', 'settings_map_hide_2', 'settings_map_hide_9', 'settings_map_hide_5', 'settings_map_hide_3', 'settings_map_hide_6', 'settings_map_hide_453', 'settings_map_hide_7005', 'settings_map_hide_13', 'settings_map_hide_1304', 'settings_map_hide_4', 'settings_map_hide_11', 'settings_map_hide_137', 'settings_map_hide_8', 'settings_map_hide_1858', 'settings_show_fav_percentage', 'settings_show_vip_list', 'settings_show_owner_vip_list', 'settings_autovisit', 'settings_autovisit_default', 'settings_show_thumbnails', 'settings_imgcaption_on_top', 'settings_hide_avatar', 'settings_link_big_listing', 'settings_show_big_gallery', 'settings_automatic_friend_reset', 'settings_show_long_vip', 'settings_load_logs_with_gclh', 'settings_hide_map_header', 'settings_replace_log_by_last_log', 'settings_show_real_owner', 'settings_hide_archived_in_owned', 'settings_show_button_for_hide_archived', 'settings_hide_visits_in_profile', 'settings_add_log_templates', 'settings_add_cache_log_signature_as_log_template', 'settings_add_tb_log_signature_as_log_template', 'settings_add_cache_log_signature', 'settings_log_signature_on_fieldnotes', 'settings_add_tb_log_signature', 'settings_vip_show_nofound', 'settings_use_gclh_layercontrol', 'settings_use_gclh_layercontrol_on_browse_map', 'settings_use_gclh_layercontrol_on_search_map', 'settings_fixed_pq_header', 'settings_sync_autoImport', 'settings_map_hide_sidebar', 'settings_friendlist_summary', 'settings_friendlist_summary_viponly', 'settings_search_enable_user_defined', 'settings_pq_warning', 'settings_pq_set_cachestotal', 'settings_pq_option_ihaventfound', 'settings_pq_option_idontown', 'settings_pq_option_ignorelist', 'settings_pq_option_isenabled', 'settings_pq_option_filename', 'settings_pq_set_difficulty', 'settings_pq_set_terrain', 'settings_pq_automatically_day', 'settings_pq_previewmap', 'settings_mail_icon_new_win', 'settings_message_icon_new_win', 'settings_hide_cache_approvals', 'settings_driving_direction_link', 'settings_driving_direction_parking_area', 'settings_show_elevation_of_waypoints', 'settings_img_warning', 'settings_remove_banner', 'settings_compact_layout_bm_lists', 'settings_compact_layout_pqs', 'settings_compact_layout_list_of_pqs', 'settings_compact_layout_nearest', 'settings_compact_layout_recviewed', 'settings_map_links_statistic', 'settings_map_percentage_statistic', 'settings_improve_add_to_list', 'settings_show_flopps_link', 'settings_show_brouter_link', 'settings_show_gpsvisualizer_link', 'settings_show_gpsvisualizer_gcsymbols', 'settings_show_gpsvisualizer_typedesc', 'settings_show_openrouteservice_link', 'settings_show_openrouteservice_home', 'settings_show_copydata_menu', 'settings_show_copydata_plus', 'settings_show_copydata_own_stuff_show', 'settings_show_default_links', 'settings_bm_changed_and_go', 'settings_bml_changed_and_go', 'settings_show_tb_inv', 'settings_but_search_map', 'settings_but_search_map_new_tab', 'settings_show_pseudo_as_owner', 'settings_fav_proz_nearest', 'settings_open_tabs_nearest', 'settings_fav_proz_pqs', 'settings_open_tabs_pqs', 'settings_fav_proz_recviewed', 'settings_show_all_logs_but', 'settings_show_log_counter_but', 'settings_show_log_counter', 'settings_show_bigger_avatars_but', 'settings_show_who_gave_favorite_but', 'settings_hide_feedback_icon', 'settings_compact_layout_new_dashboard', 'settings_show_draft_indicator', 'settings_show_enhanced_map_popup', 'settings_show_enhanced_map_coords', 'settings_modify_new_drafts_page', 'settings_gclherror_alert', 'settings_embedded_smartlink_ignorelist', 'settings_both_tabs_list_of_pqs_one_page', 'settings_past_events_on_bm', 'settings_show_log_totals', 'settings_show_reviewer_as_vip', 'settings_show_lackey_as_vip', 'settings_hide_found_count', 'settings_show_compact_logbook_but', 'settings_log_status_icon_visible', 'settings_cache_type_icon_visible', 'settings_showUnpublishedHides', 'settings_set_showUnpublishedHides_sort', 'settings_lists_compact_layout', 'settings_lists_disabled', 'settings_lists_disabled_strikethrough', 'settings_lists_archived', 'settings_lists_archived_strikethrough', 'settings_lists_icons_visible', 'settings_lists_log_status_icons_visible', 'settings_lists_cache_type_icons_visible', 'settings_lists_premium_column', 'settings_lists_found_column_bml', 'settings_lists_show_log_it', 'settings_lists_back_to_top', 'settings_searchmap_autoupdate_after_dragging', 'settings_improve_character_counter', 'settings_searchmap_compact_layout', 'settings_searchmap_disabled', 'settings_searchmap_disabled_strikethrough', 'settings_searchmap_show_hint', 'settings_relocate_other_map_buttons', 'settings_show_radius_on_flopps', 'settings_show_edit_links_for_logs', 'settings_lists_show_dd', 'settings_lists_hide_desc', 'settings_lists_upload_file', 'settings_lists_open_tabs', 'settings_profile_old_links', 'settings_listing_old_links', 'settings_searchmap_show_btn_save_as_pq', 'settings_save_as_pq_set_all', 'settings_map_overview_browse_map_icon', 'settings_map_overview_search_map_icon', 'settings_show_link_to_browse_map', 'settings_show_hide_upvotes_but', 'settings_hide_upvotes', 'settings_smaller_upvotes_icons', 'settings_no_wiggle_upvotes_click', 'settings_show_country_in_place', 'settings_test_log_console', 'settings_map_overview_browse_map_icon_new_tab', 'settings_map_overview_search_map_icon_new_tab', 'settings_color_navi_search', 'settings_map_show_btn_hide_header', 'settings_show_found_caches_at_corrected_coords_but', 'settings_compact_layout_cod', 'settings_show_button_fav_proz_cod', 'settings_show_compact_certitude_information', 'settings_anonymous_on_certitude', 'settings_change_font_cache_notes', 'settings_larger_map_as_browse_map', 'settings_fav_proz_cod', 'settings_logs_old_fashioned', 'settings_prevent_watchclick_popup', 'settings_upgrade_button_header_remove', 'settings_unsaved_log_message', 'settings_sort_map_layers', 'settings_add_search_in_logs_func', 'settings_show_add_cache_info_in_log_page', 'settings_show_create_pq_from_pq_splitter', 'settings_drafts_cache_link', 'settings_drafts_color_visited_link', 'settings_drafts_cache_link_new_tab', 'settings_drafts_old_log_form', 'settings_drafts_log_icons', 'settings_drafts_go_automatic_back', 'settings_drafts_after_new_logging_view_log', 'settings_after_new_logging_view_log', 'settings_listing_hide_external_link_warning', 'settings_listing_links_new_tab', 'settings_show_cache_type_icons_in_dashboard', 'settings_public_profile_avatar_show_thumbnail', 'settings_drafts_download_show_button', 'settings_drafts_download_change_logdate', 'settings_dashboard_show_logs_in_markdown', 'settings_public_profile_smaller_privacy_btn', 'settings_searchmap_improve_add_to_list', 'settings_improve_notifications', 'settings_remove_target_log_form', 'settings_remove_target_log_view', 'settings_hide_locked_tbs_log_form', 'settings_hide_own_tbs_log_form', 'settings_hide_share_log_button_log_view', 'settings_dashboard_hide_tb_activity', 'settings_button_sort_tbs_by_name_log_form', 'settings_larger_content_width_log_form', 'settings_less_space_log_lines_log_form', ); for (var i = 0; i < checkboxes.length; i++) { if (document.getElementById(checkboxes[i])) setValue(checkboxes[i], document.getElementById(checkboxes[i]).checked); } // Remove hidden banners. if (!settings_remove_banner) { settings_remove_banner_text_ids = []; setValue("settings_remove_banner_text_ids", JSON.stringify(settings_remove_banner_text_ids)); } // Save Log-Templates. for (var i = 0; i < anzTemplates; i++) { var name = document.getElementById('settings_log_template_name[' + i + ']'); var text = document.getElementById('settings_log_template[' + i + ']'); if (name && text) { setValue('settings_log_template_name[' + i + ']', name.value); setValue('settings_log_template[' + i + ']', text.value.replace(/‌/g, "")); // Entfernt das Steuerzeichen. } } // Save Linklist Rechte Spalte. var queue = $("#gclh_LinkListTop tr:not(.gclh_LinkListPlaceHolder)"); var tmp = new Array(); for (var i = 0; i < queue.length; i++) {tmp[i] = queue[i].id.replace("gclh_LinkListTop_", "");} setValue("settings_bookmarks_list", JSON.stringify(tmp)); // Save Linklist Abweichende Bezeichnungen, 2. Spalte. for (var i = 0; i < bookmarks.length; i++) { if (document.getElementById('bookmarks_name[' + i + ']') && document.getElementById('bookmarks_name[' + i + ']') != "") { // Set custom name. setValue("settings_bookmarks_title[" + i + "]", document.getElementById('bookmarks_name[' + i + ']').value); } } // Save Linklist Custom Links, URL, target, linke Spalte. for (var i = 0; i < anzCustom; i++) { setValue("settings_custom_bookmark[" + i + "]", document.getElementById("settings_custom_bookmark[" + i + "]").value); if (document.getElementById('settings_custom_bookmark_target[' + i + ']').checked) setValue('settings_custom_bookmark_target[' + i + ']', "_blank"); else setValue('settings_custom_bookmark_target[' + i + ']', ""); } setValueSet(settings).done(function() { if (type === "upload") { gclh_sync_DB_CheckAndCreateClient() .done(function(){ gclh_sync_DBSave().done(function() { window.location.reload(false); }); }) .fail(function(){ alert('The GC little helper II is not authorized to use your Dropbox. Please go to the GClh II Sync and authenticate it for your Dropbox first. Nevertheless your configuration is saved localy.'); window.location.reload(false); }); } else window.location.reload(false); }); GM_setValue('test_log_console', getValue('settings_test_log_console', false)); if (getValue("settings_show_save_message")) { setTimeout(function() { $('#save_overlay_h3')[0].innerHTML = "saved"; $("#save_overlay").fadeOut(250); }, 150); } } } /////////////////////////////////// // 6.5.2 Config - Functions ($$cap) (Functions for GClh Config on the geocaching webpages.) /////////////////////////////////// // Highlight new parameters in GClh Config and set version info. var d = "
            "; var s = ""; //--> $$001 newParameterOn1 = d.replace("#", "06"); newParameterOn2 = d.replace("#", "10"); newParameterOn3 = d.replace("#", "03"); newParameterLL1 = s.replace("#", "06"); newParameterLL2 = s.replace("#", "10"); newParameterLL3 = s.replace("#", "03"); //<-- $$001 function newParameterVersionSetzen(version) { var newParameterVers = "" + version + ""; else newParameterVers += ">"; if (settings_hide_colored_versions) newParameterVers = ""; return newParameterVers; } newParameterOff = "
            "; function newParameterLLVersionSetzen(version) { var newParameterVers = '' + version + ''; else newParameterVers += '>'; if (settings_hide_colored_versions) newParameterVers = ""; return newParameterVers; } if (settings_hide_colored_versions) newParameterOn1 = newParameterOn2 = newParameterOn3 = newParameterLL1 = newParameterLL2 = newParameterLL3 = newParameterOff = ""; // Reload page. function reloadPage() { if (document.location.href.indexOf("#") == -1 || document.location.href.indexOf("#") == document.location.href.length - 1) { $('html, body').animate({scrollTop: 0}, 0); document.location.reload(true); } else document.location.replace(document.location.href.slice(0, document.location.href.indexOf("#"))); } // Radio Buttons zur Linklist. function handleRadioTopMenu(first) { if (first == true) { var time = 0; var timeShort = 0; } else { var time = 500; var timeShort = 450; } // Wenn Linklist nicht on top angezeigt wird, dann muss unbedingt vertikales Menü aktiv sein, falls nicht vertikales Menü setzen. if (!$('#settings_bookmarks_on_top')[0].checked && !$('#settings_bookmarks_top_menu')[0].checked) $('#settings_bookmarks_top_menu')[0].click(); if ($('#settings_bookmarks_top_menu')[0].checked) { if ($('#box_top_menu_v')[0].style.display != "block") { $('#box_top_menu_v').animate({height: "152px"}, time); $('#box_top_menu_v')[0].style.display = "block"; setTimeout(function() { $('#box_top_menu_h').animate({height: "0px"}, time); setTimeout(function() {$('#box_top_menu_h')[0].style.display = "none";}, timeShort); }, time); } } if ($('#settings_bookmarks_top_menu_h')[0].checked) { if ($('#box_top_menu_h')[0].style.display != "block") { $('#box_top_menu_h').animate({height: "188px"}, time); $('#box_top_menu_h')[0].style.display = "block"; setTimeout(function() { $('#box_top_menu_v').animate({height: "0px"}, time); setTimeout(function() {$('#box_top_menu_v')[0].style.display = "none";}, timeShort); }, time); } } } // Events setzen für Parameter, die im GClh Config mehrfach ausgegeben wurden, weil sie zu mehreren Themen gehören. Es handelt // sich hier um den Parameter selbst. In der Function werden Events für den Parameter selbst (ZB: "settings_show_vip_list") // und dessen Clone gesetzt, die hinten mit "X" und Nummerierung von 0-9 enden können (ZB: "settings_show_vip_listX0"). function setEvForDouPara(paraName, event) { var paId = paraName; if (document.getElementById(paId)) { document.getElementById(paId).addEventListener(event, function() {handleEvForDouPara(this);}, false); for (var i = 0; i < 10; i++) { var paIdX = paId + "X" + i; if (document.getElementById(paIdX)) { document.getElementById(paIdX).addEventListener(event, function() {handleEvForDouPara(this);}, false); } } } } // Handling von Events zu Parametern, die im GClh Config mehrfach ausgegeben wurden, weil sie zu mehreren Themen gehören. Es kann sich hier um den Parameter selbst // handeln (ZB: "settings_show_vip_list"), oder um dessen Clone, die hinten mit "X" und Nummerierung von 0-9 enden können (ZB: "settings_show_vip_listX0"). Hier wird // Wert des eventauslösenden Parameters, das kann auch Clone sein, an den eigentlichen Parameter und dessen Clone weitergereicht. function handleEvForDouPara(para) { var paId = para.id.replace(/(X[0-9]*)/, ""); if (document.getElementById(paId)) { if (document.getElementById(paId).type == "checkbox") { document.getElementById(paId).checked = para.checked; for (var i = 0; i < 10; i++) { var paIdX = paId + "X" + i; if (document.getElementById(paIdX)) document.getElementById(paIdX).checked = para.checked; } } else if (para.id.match(/_color_/)) { document.getElementById(paId).value = para.value; document.getElementById(paId).style.backgroundColor = "#" + para.value; document.getElementById(paId).style.color = para.style.color; for (var i = 0; i < 10; i++) { var paIdX = paId + "X" + i; if (document.getElementById(paIdX)) { document.getElementById(paIdX).value = para.value; document.getElementById(paIdX).style.backgroundColor = "#" + para.value; document.getElementById(paIdX).style.color = para.style.color; } } } else { document.getElementById(paId).value = para.value; for (var i = 0; i < 10; i++) { var paIdX = paId + "X" + i; if (document.getElementById(paIdX)) document.getElementById(paIdX).value = para.value; } } } } // Events setzen für Parameter, die im GClh Config eine Abhängigkeit derart auslösen, dass andere Parameter aktiviert bzw. // deaktiviert werden müssen. ZB. können Mail Icons in VIP List (Parameter "settings_show_mail_in_viplist") nur aufgebaut // werden, wenn die VIP Liste erzeugt wird (Parameter "settings_show_vip_list"). Clone müssen hier auch berücksichtigt werden. function setEvForDepPara(paraName, paraNameDep, allActivated) { var paId = paraName; var paIdDep = paraNameDep; var countDep = global_dependents.length; if (allActivated != false) allActivated = true; // Wenn Parameter und abhängiger Parameter existieren, dann für Parameter Event setzen, falls nicht vorhanden und Parameter, abhängigen Parameter merken. if (document.getElementById(paId) && document.getElementById(paIdDep)) { var available = false; for (var i = 0; i < countDep; i++) { if (global_dependents[i]["paId"] == paId) { available = true; break; } } if (available == false) { document.getElementById(paId).addEventListener("click", function() {handleEvForDepPara(this);}, false); } global_dependents[countDep] = new Object(); global_dependents[countDep]["paId"] = paId; global_dependents[countDep]["paIdDep"] = paIdDep; global_dependents[countDep]["allActivated"] = allActivated; // Alle möglichen Clone zum abhängigen Parameter suchen. for (var i = 0; i < 10; i++) { var paIdDepX = paIdDep + "X" + i; // Wenn Clone zum abhängigen Parameter existiert, dann Parameter und Clone zum abhängigen Parameter merken. if (document.getElementById(paIdDepX)) { countDep++; global_dependents[countDep] = new Object(); global_dependents[countDep]["paId"] = paId; global_dependents[countDep]["paIdDep"] = paIdDepX; global_dependents[countDep]["allActivated"] = allActivated; } else break; } } } // Anfangsbesetzung herstellen. function setStartForDepPara() { var countDep = global_dependents.length; var paIdCompare = ""; // Sort nach paId. global_dependents.sort(function(a, b){ if (a.paId < b.paId) return -1; if (a.paId > b.paId) return 1; return 0; }); var copy_global_dependents = global_dependents; for (var i = 0; i < countDep; i++) { if (paIdCompare != copy_global_dependents[i]["paId"]) { if (document.getElementById(copy_global_dependents[i]["paId"])) { var para = document.getElementById(copy_global_dependents[i]["paId"]); handleEvForDepPara(para); } paIdCompare = copy_global_dependents[i]["paId"]; } } } // Handling Events. function handleEvForDepPara(para) { var paId = para.id; var countDep = global_dependents.length; var copy_global_dependents = global_dependents; // Wenn Parameter existiert, dann im Array der abhängigen Parameter nachsehen, welche abhängigen Parameter es dazu gibt. if (document.getElementById(paId)) { for (var i = 0; i < countDep; i++) { if (global_dependents[i]["paId"] == paId) { // Wenn abhängige Parameter existiert. if (document.getElementById(global_dependents[i]["paIdDep"])) { // Wenn Parameter markiert, dann soll abhängiger Parameter aktiviert werden. Zuvor prüfen, ob alle Parameter zu diesem abhängigen Parameter aktiviert // werden sollen. Nur dann darf abhängiger Parameter aktiviert werden. (ZB: Abh. Parameter "settings_show_mail_in_viplist", ist von zwei Parametern abhängig. if (para.checked) { if (checkDisabledForDepPara(global_dependents[i]["paIdDep"])) { var activate = true; if (global_dependents[i]["allActivated"]) { for (var k = 0; k < countDep; k++) { if (copy_global_dependents[k]["paIdDep"] == global_dependents[i]["paIdDep"] && copy_global_dependents[k]["paId"] != global_dependents[i]["paId"]) { if (document.getElementById(copy_global_dependents[k]["paId"]) && document.getElementById(copy_global_dependents[k]["paId"]).checked); else { activate = false; break; } } } } if (activate) disableDepPara(global_dependents[i]["paIdDep"], false); } // Wenn Parameter nicht markiert, dann soll abhängiger Parameter deaktiviert werden. Zuvor prüfen, ob alle Parameter zu diesem abhängigen Parameter deaktiviert // werden sollen. Nur dann darf abhängiger Parameter deaktiviert werden. (ZB: Abhängiger Parameter Linklistparameter, sind von zwei Parametern abhängig.) } else { if (!checkDisabledForDepPara(global_dependents[i]["paIdDep"])) { var deactivate = true; if (global_dependents[i]["allActivated"] != true) { for (var k = 0; k < countDep; k++) { if (copy_global_dependents[k]["paIdDep"] == global_dependents[i]["paIdDep"] && copy_global_dependents[k]["paId"] != global_dependents[i]["paId"]) { if (document.getElementById(copy_global_dependents[k]["paId"]) && document.getElementById(copy_global_dependents[k]["paId"]).checked) { deactivate = false; break; } } } } if (deactivate) disableDepPara(global_dependents[i]["paIdDep"], true); } } } } } } } // Prüfen, ob disabled. function checkDisabledForDepPara(id) { var elem = document.getElementById(id); var elem$ = $("#"+id); if ((elem.disabled) || (elem$.hasClass("ui-droppable") && elem$.hasClass("ui-droppable-disabled")) || (elem$.hasClass("ui-draggable") && elem$.hasClass("ui-draggable-disabled"))) { return true; } else return false; } // Disabled setzen bzw. entfernen. function disableDepPara(id, set) { var elem = document.getElementById(id); var elem$ = $("#"+id); if (elem$.hasClass("ui-droppable")) { elem$.droppable("option", "disabled", set); elem$.sortable("option", "disabled", set); if (set == true) elem.parentNode.style.opacity = "0.5"; else elem.parentNode.style.opacity = "1"; } else if (elem$.hasClass("ui-draggable")) { elem$.draggable("option", "disabled", set); if (set == true) elem.parentNode.style.opacity = "0.5"; else elem.parentNode.style.opacity = "1"; } else { elem.disabled = set; if (set == true) elem.style.opacity = "0.5"; else elem.style.opacity = "1"; // Alle möglichen Clone zum abhängigen Parameter suchen und ebenfalls verarbeiten. for (var j = 0; j < 10; j++) { var paIdDepX = id + "X" + j; if (document.getElementById(paIdDepX)) { document.getElementById(paIdDepX).disabled = set; if (set == true) document.getElementById(paIdDepX).style.opacity = "0.5"; else document.getElementById(paIdDepX).style.opacity = "1"; } else break; } } } // Warnung, wenn Logs nicht durch GClh geladen werden sollen. function alert_settings_load_logs_with_gclh() { if (!document.getElementById("settings_load_logs_with_gclh").checked) { var mess = "If this option is disabled, there are no VIP-, VUP-, mail-, message- " + "and top icons, no line colors and no mouse activated big images " + "at the logs. Also the VIP and VUP lists, hide avatars, log filter and " + "log search and the latest logs won't work."; alert(mess); } } // Wenn VUPs im Config deaktiviert wird und es sind VUPs vorhanden, dann Confirm Meldung, dass die VUPs gelöscht werden. // Ansonsten können Konstellationen mit Usern entstehen, die gleichzeitig VIP und VUP sind. function alert_settings_process_vup() { if (!document.getElementById("settings_process_vup").checked && getValue("vups")) { var vups = getValue("vups"); vups = vups.replace(/, (?=,)/g, ",null"); vups = JSON.parse(vups); if (vups.length > 0) { var text = "You have " + vups.length + " VUPs (very unimportant persons) saved. If you disable this feature of VUP processing, the VUPs are deleted. Please note, it can not be revoked.\n\n" + "Click OK to delete the VUPs now and disable the feature."; if (window.confirm(text)) { var vups = new Array(); setValue("vups", JSON.stringify(vups)); } else { document.getElementById("settings_process_vup").checked = "checked"; } } } } // Feldinhalt auf default zurücksetzen. function restoreField() { if (document.getElementById(this.id).disabled) return; animateClick(this); var fieldId = this.id.replace(/restore_/, ""); var field = document.getElementById(fieldId); if (this.id.match(/_color/)) { field.value = "93B516"; field.style.color = "black"; if (fieldId == "settings_lines_color_zebra") field.value = "EBECED"; else if (fieldId == "settings_lines_color_user") field.value = "C2E0C3"; else if (fieldId == "settings_lines_color_owner") field.value = "E0E0C3"; else if (fieldId == "settings_lines_color_reviewer") field.value = "EAD0C3"; else if (fieldId == "settings_lines_color_vip") field.value = "F0F0A0"; else if (fieldId == "settings_lists_disabled_color") field.value = "4A4A4A"; else if (fieldId == "settings_lists_archived_color") field.value = "8C0B0B"; else if (fieldId == "settings_searchmap_disabled_color") field.value = "4A4A4A"; else if (fieldId == "settings_font_color_menu") restoreColor("settings_font_color_menuX0", "restore_settings_font_color_menuX0", field.value); else if (fieldId == "settings_font_color_menuX0") restoreColor("settings_font_color_menu", "restore_settings_font_color_menu", field.value); else if (fieldId == "settings_font_color_submenu") restoreColor("settings_font_color_submenuX0", "restore_settings_font_color_submenuX0", field.value); else if (fieldId == "settings_font_color_submenuX0") restoreColor("settings_font_color_submenu", "restore_settings_font_color_submenu", field.value); else if (fieldId == "settings_count_own_matrix_show_color_next") {field.value = "5151FB"; field.style.color = "white";} else if (fieldId.match(/settings_color_(bg|ht|if|bh|bu)/)) field.value = "D8CD9D"; else if (fieldId == "settings_color_bo") field.value = "778555"; else if (fieldId == "settings_color_nv") field.value = "F0DFC6"; field.style.backgroundColor = "#" + field.value; } else { if (fieldId == "settings_show_copydata_own_stuff_name") field.value = "Photo file name"; else if (fieldId == "settings_show_copydata_own_stuff_value") field.value = "#yyyy#.#mm#.#dd# - #GCName# - #GCCode# - 01"; else if (fieldId == "settings_show_copydata_separator") field.value = "\n"; $(field)[0].focus(); } } function restoreColor(p, r, v) { if ($('#'+r)[0] && $('#'+p)[0].value != v) $('#'+r)[0].click(); } // Bezeichnung Save, Close Button setzen. function setValueInSaveButton() { var cont = setValueInButton("Save", "(F2)", "settings_f2_save_gclh_config", "btn_save"); return cont; } function setValueInCloseButton() { var cont = setValueInButton("Close", "(ESC)", "settings_esc_close_gclh_config", "btn_close2"); return cont; } function setValueInButton(cont, fKey, para, butt) { if ($('#'+para)[0]) { // Nach Aufbau Config. if ($('#'+para)[0].checked) cont += " "+fKey; $('#'+butt)[0].setAttribute("value", cont); } else { // Vor Aufbau Config. if (getValue(para,"")) cont += " "+fKey; return cont; } } // Temporäry coloring of config, reset and thanks, to look what happens by click of the color and show buttons. function showColor(setButton, area) { $('#set_color_' + setButton)[0].addEventListener("click", function() { animateClick(this); var color = '#' + $('#' + this.id.replace('set', 'settings'))[0].value; if (area.match('hover')) { appendCssStyle(area + ' {background-color:' + color + ' !important;}'); } else { $(area).each(function() { var setcolor = color; if ($(this)[0].className && $(this)[0].className.match('gclh_new_para06')) setcolor = color + '99'; if ($(this)[0].className && $(this)[0].className.match('gclh_new_para03')) setcolor = color + '47'; $(this)[0].style.backgroundColor = setcolor; }); } if (setButton == 'bu') $('#set_color_bh').click(); }, false); } function showBorder(setButton, bostyle, area) { $('#set_color_' + setButton)[0].addEventListener("click", function() { animateClick(this); var color = '#' + $('#' + this.id.replace('set', 'settings'))[0].value; $(area).each(function() { $(this)[0].style.border = ' ' + bostyle + ' ' + color; }); }, false); } function tempConfigColoring() { showColor('bg', '.settings_overlay'); showColor('ht', 'a.gclh_info span'); showColor('if', '.gclh_content input[type="text"]:not(.color), .gclh_content textarea, .gclh_content select, .gclh_content pre'); showColor('bh', '.gclh_content button:hover, .gclh_content input[type="button"]:hover, .gclh_rc_content input[type="button"]:hover'); showColor('bu', '.gclh_content button, .gclh_content input[type="button"], .gclh_rc_content input[type="button"]'); showColor('bo', '.gclh_headline'); showColor('nv', '.gclh_new_para10, .gclh_new_para06, .gclh_new_para03'); showBorder('bo', '1.5px solid', '.settings_overlay, .gclh_headline, .gclh_content input, .gclh_content button, .gclh_content textarea, .gclh_content select, .gclh_content pre, .gclh_linklist_right'); showBorder('bo', '1px solid', 'a.gclh_info span, .gclh_rc_area, .gclh_thanks_area'); showBorder('bg', '2px solid', '.gclh_thanks_table'); } // Info gespeichert ausgeben. function showSaveForm() { if (document.getElementById('save_overlay')) { } else { var css = ""; css += "#save_overlay {width:560px; margin-left: 20px; overflow: auto; padding:10px; position: absolute; left:30%; top:70px; z-index:1004; border-radius: 10px;}"; css += "h3 {margin: 0;}"; appendCssStyle(css); var side = $('body')[0]; var html = "

            "; var div = document.createElement("div"); div.setAttribute("id", "save_overlay"); div.setAttribute("align", "center"); div.innerHTML = html; div.appendChild(document.createTextNode("")); side.appendChild(div); } $('#save_overlay_h3')[0].innerHTML = "save..."; $('#save_overlay')[0].style.display = ""; } // Änderungen an abweichenden Bezeichnungen in Spalte 2, in Value in Spalte 3 updaten. function updateByInputDescription() { // Ids ermitteln für linke und rechte Spalte. var idColLeft = this.id.replace("bookmarks_name[", "gclh_LinkListElement_").replace("]", ""); var idColRight = this.id.replace("bookmarks_name[", "gclh_LinkListTop_").replace("]", ""); // Bezeichnung ermitteln. if (this.value.match(/(\S+)/)) var description = this.value; else { if (document.getElementById(idColLeft).children[1].id.match("custom")) { var description = "Custom" + document.getElementById(idColLeft).children[1].id.replace("settings_custom_bookmark[", "").replace("]", ""); this.value = description; } else var description = document.getElementById(idColLeft).children[1].innerHTML; } // Update. if (document.getElementById(idColRight) && document.getElementById(idColRight).children[0].childNodes[2]) { document.getElementById(idColRight).children[0].childNodes[2].nodeValue = description; } } // Attribute ändern bei Mousedown, Mouseup in rechter Spalte, Move Icon und Bezeichnung. function changeAttrMouse(event, elem, obj) { if (event.type == "mousedown") elem.style.cursor = "grabbing"; else { if (obj == "move") elem.style.cursor = "grab"; else if (obj == "desc") elem.style.cursor = "unset"; } } // BM kennzeichnen wenn sie in Linklist ist. function flagBmInLl(tdBmEntry, doDragging, setCursor, setOpacity, setTitle) { if (doDragging) { tdBmEntry.style.cursor = setCursor; tdBmEntry.style.opacity = setOpacity; tdBmEntry.children[0].style.cursor = setCursor; tdBmEntry.children[0].style.opacity = setOpacity; tdBmEntry.children[1].style.cursor = setCursor; tdBmEntry.children[1].style.opacity = setOpacity; } else { tdBmEntry.children[0].style.cursor = setCursor; tdBmEntry.children[0].style.opacity = setOpacity; tdBmEntry.children[0].title = setTitle; } } // Sort Linklist. function sortBookmarksByDescription(sort, bm) { // BMs für Sortierung aufbereiten. Wird immer benötigt, auch wenn nicht sortiert wird. var cust = 0; for (var i = 0; i < bm.length; i++) { bm[i]['number'] = i; if (typeof(bm[i]['custom']) != "undefined" && bm[i]['custom'] == true) { bm[i]['origTitle'] = "Custom" + cust + ": " + bm[i]['title']; bm[i]['sortTitle'] = cust; cust++; } else { bm[i]['origTitle'] = bm[i]['sortTitle'] = (typeof(bookmarks_orig_title[i]) != "undefined" && bookmarks_orig_title[i] != "" ? bookmarks_orig_title[i] : bm[i]['title']); bm[i]['sortTitle'] = bm[i]['sortTitle'].toLowerCase().replace(/ä/g,"a").replace(/ö/g,"o").replace(/ü/g,"u").replace(/ß/g,"s"); } } // BMs nach sortTitle sortieren. if (sort) { bm.sort(function(a, b){ if ((typeof(a.custom) != "undefined" && a.custom == true) && !(typeof(b.custom) != "undefined" && b.custom == true)) { // a nach hinten, also a > b. return 1; } else if (!(typeof(a.custom) != "undefined" && a.custom == true) && (typeof(b.custom) != "undefined" && b.custom == true)) { // b nach hinten, also a < b. return -1; } if (a.sortTitle < b.sortTitle) return -1; if (a.sortTitle > b.sortTitle) return 1; return 0; }); } return bm; } // Show, hide all areas in config with one click of right mouse. function showHideConfigAll(show, id_lnk) { setShowHideConfig(show, "global"); setShowHideConfig(show, "config"); setShowHideConfig(show, "sync"); setShowHideConfig(show, "nearestlist"); setShowHideConfig(show, "pq"); setShowHideConfig(show, "bm"); setShowHideConfig(show, "recview"); setShowHideConfig(show, "friends"); setShowHideConfig(show, "hide"); setShowHideConfig(show, "others"); setShowHideConfig(show, "maps"); setShowHideConfig(show, "profile"); setShowHideConfig(show, "db"); setShowHideConfig(show, "listing"); setShowHideConfig(show, "draft"); setShowHideConfig(show, "logging"); setShowHideConfig(show, "mail"); setShowHideConfig(show, "linklist"); setShowHideConfig(show, "development"); if (show) { document.getElementById(id_lnk).scrollIntoView(); window.scrollBy(0, -9); } else window.scroll(0, 0); } // Show, hide area in config. function showHideConfig(show, configArea) { setShowHideConfig(show, configArea); var id_lnk = 'lnk_gclh_config_'+configArea; if (show) { document.getElementById(id_lnk).scrollIntoView(); window.scrollBy(0, -9); } } function setShowHideConfig(show, configArea) { var lnk = '#lnk_gclh_config_'+configArea; var content = '#gclh_config_'+configArea; if (show) { $(lnk)[0].closest('span').setAttribute('title', 'hide topic\n(all topics with right mouse)'); $(lnk).closest('h4').removeClass('gclh_hide'); $(content).show(); } else { $(lnk)[0].closest('span').setAttribute('title', 'show topic\n(all topics with right mouse)'); $(lnk).closest('h4').addClass('gclh_hide'); $(content).hide(); } setValue('show_box_gclh_config_'+configArea, show); } // Show config screen "thanks". function thanksShow() { if (document.getElementById('settings_overlay')) document.getElementById('settings_overlay').style.overflow = "hidden"; $('#gclh_config_content1').hide(); $('#gclh_config_content3').hide(); $('#gclh_config_content_thanks').show(600); } // Build line with user and contribution on config screen "thanks". function thanksLineBuild(gcname, ghname, proj, devl, dev, err, sepa) { return "" + "" + (gcname != "" ? ""+gcname+"" : ghname) + "" + thanksFlagBuild(proj) + thanksFlagBuild(devl) + thanksFlagBuild(dev) + thanksFlagBuild(err) + ""; } function thanksFlagBuild(flag) {return "";} // Functions to provide cff (checkbox, input field and textarea field). function openCff(ident, header, titleName, titleValue, depId) { var c = ''; c += "
            "; c += "
            " + header + "
            "; c += "
            "; return c; } function buildEntryCff(ident, cffData, idNr, nonArray, createAction) { var id = ident + '_#_' + idNr; var c = ''; if (createAction) { var div = document.createElement("div"); div.id = id.replace('#', 'element'); div.className = 'cff_element'; } else { c += "
            "; } c += ""; c += ""; if (nonArray) { c += ""; } c += ""; c += ""; if (!nonArray) { c += ""; } c += ""; c += "
            "; c += ""; if (nonArray) { c += ""; } c += "
            "; c += "
            "; if (createAction) { div.innerHTML = c; return div; } else { return c; } } function buildDoubleEditCff(ident, idNr) { var id = '#' + ident + '_main'; if ($(id + ' .cff_element')[0] && $(id + ' .cff_edit.first').length == 0) { var a = document.createElement("a"); a.className = 'cff_edit_double'; a.href = 'javascript:void(0);'; a.innerHTML += ""; a.innerHTML += ""; $(id + ' .cff_edit_delete')[0].after(a); a.addEventListener("click", function() { animateClick($(this).closest('a')[0]); var displayOrg = window.getComputedStyle($(this).closest('.cff_element').find('.cff_content')[0]).display; if (displayOrg == 'none') var displayNew = 'block'; else var displayNew = 'none'; $(this).closest('.cff_elements').find('.cff_content').each(function() { $(this)[0].style.display = displayNew; }); if (displayNew == 'block') $(this).closest('.cff_element').find('.cff_value')[0].focus(); }); } } function closeCff(ident) { var c = ''; c += "
            "; c += ""; c += "
            "; return c; } function cssCff(ident, blockRight, widthName, widthValue, heightValue) { var id = '#' + ident + '_main'; var css = ''; css += id + '{margin-left: ' + blockRight + 'px;}'; css += id + ' .cff_show {margin-left: 0px;}'; css += id + ' .cff_name {margin-top: 2px; margin-right: 12px; width: ' + widthName + 'px;}'; css += id + ' .cff_name_restore {margin-left: -12px;}'; css += id + ' a {cursor: default;}'; css += id + ' .cff_edit, ' + id + ' .cff_delete {margin-left: 4px; height: 16px; cursor: pointer; vertical-align: text-top; border: 0;}'; css += id + ' .cff_edit.first {margin-top: -2px; margin-left: 20px; height: 14px;}'; css += id + ' .cff_edit.last {margin-top: 3px; margin-left: -8px; height: 14px;}'; css += id + ' .cff_content {margin-left: 32px; margin-bottom: -2px; margin-top: 2px; display: none;}'; css += id + ' .cff_value {width: ' + widthValue + 'px; height: ' + heightValue + 'px;}'; css += id + ' .cff_create {margin-left: 0px; margin-top: 2px;}'; appendCssStyle(css, '', ident + '_main_css'); } function getLastIdNrCff(ident) { var id = '#' + ident + '_main'; if ($(id + ' .cff_element:last')[0]) { var idNr = $(id + ' .cff_element:last')[0].id.match(/(\d*)$/); if (idNr && idNr[1]) idNr = idNr[1]; } if (!idNr) var idNr = 0; idNr = parseInt(idNr); return idNr; } function buildDataCff(show, name, value) { var cffData = {}; cffData.show = show; cffData.name = name; cffData.value = value; return cffData; } function buildAroundCff(ident, cff) { $(cff).find('.cff_edit_delete .cff_edit')[0].addEventListener("click", function() { animateClick(this); $(this).closest('.cff_element').find('.cff_content').toggle(); if (window.getComputedStyle($(this).closest('.cff_element').find('.cff_content')[0]).display != 'none') { $(this).closest('.cff_element').find('.cff_value')[0].focus(); } }); if ($(cff).find('.cff_delete')[0]) { $(cff).find('.cff_delete')[0].addEventListener("click", function() { $(this).closest('.cff_element').remove(); buildDoubleEditCff(ident); }); } if ($(cff).find('.cff_show')[0].id.match('^'+ident)) { if ($(cff).closest('.cff_main').attr('data-depId')) { setEvForDepPara($(cff).closest('.cff_main').attr('data-depId'), $(cff).find('.cff_show')[0].id); setEvForDepPara($(cff).closest('.cff_main').attr('data-depId'), $(cff).find('.cff_name')[0].id); setEvForDepPara($(cff).closest('.cff_main').attr('data-depId'), $(cff).find('.cff_value')[0].id); } setEvForDepPara($(cff).find('.cff_show')[0].id, $(cff).find('.cff_name')[0].id); setEvForDepPara($(cff).find('.cff_show')[0].id, $(cff).find('.cff_value')[0].id); setStartForDepPara(); } $(cff).find('.cff_name').attr('title', $(cff).closest('.cff_main').attr('data-titleName')); $(cff).find('.cff_value').attr('title', $(cff).closest('.cff_main').attr('data-titleValue')); buildDoubleEditCff(ident); } function buildEventCreateCff(ident) { var id = '#' + ident + '_main'; $(id + ' .cff_create')[0].addEventListener("click", function() { var ident = $(this).closest('.cff_main')[0].id.replace('_main',''); var idNr = getLastIdNrCff(ident) + 1; var cffData = buildDataCff(true, idNr, ''); $(id + ' .cff_elements')[0].append(buildEntryCff(ident, cffData, idNr, false, true)); $(id + ' .cff_name:last')[0].focus(); buildAroundCff(ident, $(id + ' .cff_element:last')[0]); }); } function setDataCff(ident) { var cffElements = $('#' + ident + '_main .cff_element'); var settingsElements = {}; var count = 0; for (var i = 0; i < cffElements.length; i++) { if (!$(cffElements[i]).find('.cff_show')[0].id.match('^'+ident)) continue; if ($(cffElements[i]).find('.cff_name')[0].value.match(/^(\s*)$/) || $(cffElements[i]).find('.cff_value')[0].value.match(/^(\s*)$/)) continue; settingsElements[count] = {}; settingsElements[count].show = $(cffElements[i]).find('.cff_show')[0].checked; settingsElements[count].name = $(cffElements[i]).find('.cff_name')[0].value; settingsElements[count].value = $(cffElements[i]).find('.cff_value')[0].value; count++; } return settingsElements; } /////////////////////////////// // 6.5.3 Config - Reset ($$cap) (Functions for GClh Config Reset on the geocaching webpages.) /////////////////////////////// function rcPrepare() { global_mod_reset = true; if (document.getElementById('settings_overlay')) document.getElementById('settings_overlay').style.overflow = "hidden"; $('#gclh_config_content1').hide(); $('#gclh_config_content3').hide(); $('#gclh_config_content2').show(600); } function rcReset() { try { if (document.getElementById("rc_standard").checked || document.getElementById("rc_temp").checked) { if (!window.confirm("Click OK to reset the data. \nPlease note, this process can not be revoked.")) return; } if (document.getElementById("rc_doing")) document.getElementById("rc_doing").src = "/images/loading2.gif"; if (document.getElementById("rc_reset_button")) document.getElementById("rc_reset_button").disabled = true; if (document.getElementById("rc_homecoords").checked) { var keysDel = new Array(); keysDel[keysDel.length] = "home_lat"; keysDel[keysDel.length] = "home_lng"; rcConfigDataDel(keysDel); } if (document.getElementById("rc_uid").checked) { var keysDel = new Array(); keysDel[keysDel.length] = "uid"; rcConfigDataDel(keysDel); } if (document.getElementById("rc_standard").checked) { //--> $$004 rcGetData(urlConfigSt, "st"); //<-- $$004 } if (document.getElementById("rc_temp").checked) { rcGetData(urlScript, "js"); } } catch(e) {gclh_error("Reset config data",e);} } function rcGetData(url, name) { global_rc_data = global_rc_status = ""; GM_xmlhttpRequest({ method: "GET", url: url, onload: function(response) { global_rc_status = parseInt(response.status); global_rc_data = response.responseText; } }); function rcCheckDataLoad(waitCount, name) { if (global_rc_data == "" || global_rc_status != 200) { waitCount++; if (waitCount <= 25) setTimeout(function(){rcCheckDataLoad(waitCount, name);}, 200); else { alert("Can not load file with " + (name == "st" ? "standard configuration data":"script data") + ".\nNothing changed."); if (document.getElementById("rc_doing")) setTimeout(function(){document.getElementById("rc_doing").src = "";}, 500); } } else { if (name == "st") rcConfigDataChange(global_rc_data); if (name == "js") rcConfigDataNotInUseDel(global_rc_data); } } rcCheckDataLoad(0, name); } function rcConfigDataDel(data) { var config_tmp = {}; var changed = false; for (key in CONFIG) { var del = false; for (var i = 0; i < data.length; i++) { if (key == data[i]) { changed = true; del = true; document.getElementById('rc_configData').innerText += "delete: " + data[i] + ": " + CONFIG[key] + "\n"; break; } } if (!del) config_tmp[key] = CONFIG[key]; } CONFIG = config_tmp; rcConfigUpdate(changed); } function rcConfigDataChange(stData) { var data = JSON.parse(stData); var changed = false; var changedData = ""; for (key in data) { if (data[key] != CONFIG[key]) { changed = true; changedData += "change: " + key + ": " + CONFIG[key] + " -> " + data[key] + "\n"; CONFIG[key] = data[key]; } } document.getElementById('rc_configData').innerText += changedData; rcConfigUpdate(changed); } function rcConfigDataNotInUseDel(data) { var config_tmp = {}; var changed = false; var changedData = ""; for (key in CONFIG) { var kkey = key.split("["); var kkey = kkey[0]; //--> $$005 if (kkey.match(/^(show_box|set_switch)/) || kkey.match(/^gclh_(.*)(_logs_get_last|_logs_count)$/)) { config_tmp[key] = CONFIG[key]; //<-- $$005 } else if (kkey.match(/autovisit_(\d+)/) || kkey.match(/^(friends_founds_|friends_hides_)/) || kkey.match(/^(settings_DB_auth_token|settings_remove_banner_text_ids|new_version|class|token)$/)) { changed = true; changedData += "delete: " + key + ": " + CONFIG[key] + "\n"; } else if (data.match(kkey)) { config_tmp[key] = CONFIG[key]; } else { changed = true; changedData += "delete: " + key + ": " + CONFIG[key] + "\n"; } } //--> $$007 // Reset data outside of CONFIG. [changed, changedData] = rcNoConfigDataDel('clipboard', false, changed, changedData); //<-- $$007 document.getElementById('rc_configData').innerText = changedData; CONFIG = config_tmp; rcConfigUpdate(changed); } function rcNoConfigDataDel(dataName, dataNew, changed, changedData) { var data = GM_getValue(dataName); if (data != undefined && data != false) { changed = true; changedData += "delete: " + dataName + "\n"; GM_setValue(dataName, dataNew); } return [changed, changedData]; } function rcConfigUpdate(changed) { setTimeout(function(){ if (document.getElementById("rc_doing")) document.getElementById("rc_doing").src = ""; if (document.getElementById("rc_reset_button")) document.getElementById("rc_reset_button").disabled = false; }, 500); if (changed) { var defer = $.Deferred(); GM_setValue("CONFIG", JSON.stringify(CONFIG)); defer.resolve(); return defer.promise(); } else document.getElementById('rc_configData').innerText += "(nothing to change)\n"; } function rcClose() { window.scroll(0, 0); $("#settings_overlay").fadeOut(400); document.location.href = clearUrlAppendix(document.location.href, false); window.location.reload(false); } ////////////////////////////// // 6.5.4 Config - Sync ($$cap) (Functions for GClh Config Sync on the geocaching webpages.) ////////////////////////////// // Get/Set Config Data. function sync_getConfigData() { var data = {}; var value = null; for (key in CONFIG) { if (!gclhConfigKeysIgnoreForBackup[key]) { value = getValue(key, null); if (value != null) data[key] = value; } } return JSON.stringify(data, undefined, 2); } function sync_setConfigData(data) { var parsedData = JSON.parse(data); var settings = {}; for (key in parsedData) { if (!gclhConfigKeysIgnoreForBackup[key]) settings[key] = parsedData[key]; } setValueSet(settings).done(function() {}); } var dropbox_client = null; var dropbox_save_path = '/GCLittleHelperSettings.json'; // Dropbox auth token bereitstellen. (function(window){ window.utils = { parseQueryString: function(str) { try { var ret = Object.create(null); if (typeof str !== 'string') return ret; str = str.trim().replace(/^(\?|#|&)/, ''); if (!str) return ret; str.split('&').forEach(function(param) { var parts = param.replace(/\+/g, ' ').split('='); // Firefox (pre 40) decodes `%3D` to `=` (https://github.com/sindresorhus/query-string/pull/37) var key = parts.shift(); var val = parts.length > 0 ? parts.join('=') : undefined; key = decodeUnicodeURIComponent(key); // missing `=` should be `null`: (https://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters) val = val === undefined ? null : decodeUnicodeURIComponent(val); if (ret[key] === undefined) ret[key] = val; else if (Array.isArray(ret[key])) ret[key].push(val); else ret[key] = [ret[key], val]; }); return ret; } catch(e) {gclh_error("parseQueryString()",e)}; } }; })(window); // Save dropbox auth token if one is passed (from Dropbox). var DB_token = utils.parseQueryString(window.location.hash).access_token; var AppId = utils.parseQueryString(window.location.search).AppId; // Von Dropbox zurück, schaue ob Token von uns angefordert wurde. if (AppId == 'GClh') { if (DB_token) { // Gerade von DB zurück, also Show config. setValue('settings_DB_auth_token', DB_token); gclh_showSync(); document.getElementById('syncDBLabel').click(); } else { // Maybe the user denies Access (this is mostly an unwanted click), so show him, that he // has refused to give us access to his dropbox and that he can re-auth if he want to. error = utils.parseQueryString(window.location.hash).error_description; if (error) alert('We received the following error from dropbox: "' + error + '" If you think this is a mistake, you can try to re-authenticate in the GClh II Sync.'); } } // Created the Dropbox Client with the given auth token from config. function gclh_sync_DB_CheckAndCreateClient() { var deferred = $.Deferred(); token = getValue('settings_DB_auth_token'); if (token) { // Try to create an instance and test it with the current token dropbox_client = new Dropbox({accessToken: token}); dropbox_client.usersGetCurrentAccount() .then(function(response) { deferred.resolve(); }) .catch(function(error) { console.error('gclh_sync_DB_CheckAndCreateClient: Error while creating Dropbox Client:'); console.error(error); deferred.reject(); }); } else { // No token was given, user has to (re)auth GClh for dropbox dropbox_client = null; deferred.reject(); } return deferred.promise(); } // If the Dropbox Client could not be instantiated (because of wrong token, App deleted or not authenticated at all), this will show the Auth link. function gclh_sync_DB_showAuthLink() { var APP_ID = 'zp4u1zuvtzgin6g'; // If client could not created, try to get a new Auth token. Set the login anchors href using dropbox_client.getAuthenticationUrl() dropbox_auth_client = new Dropbox({clientId: APP_ID}); authlink = document.getElementById('authlink'); // Dropbox redirect URL and AppId. authlink.href = dropbox_auth_client.getAuthenticationUrl('https://www.geocaching.com/account/settings/profile?AppId=GClh'); $(authlink).show(); $('#btn_DBSave').hide(); $('#btn_DBLoad').hide(); $('#syncDBLoader').hide(); } // If the Dropbox Client is instantiated and the connection stands, this funciton shows the load and save buttons. function gclh_sync_DB_showSaveLoadLinks() { $('#btn_DBSave').show(); $('#btn_DBLoad').show(); $('#syncDBLoader').hide(); $('#authlink').hide(); } // Saves the current config to dropbox. function gclh_sync_DBSave() { var deferred = $.Deferred(); gclh_sync_DB_CheckAndCreateClient() .fail(function(){ // Should not be reached, because we checked the client earlier alert('Something went wrong. Please reload the page and try again.'); deferred.reject(); $('#syncDBLoader').hide(); return deferred.promise(); }); $('#syncDBLoader').show(); dropbox_client.filesUpload({ path: dropbox_save_path, contents: sync_getConfigData(), mode: 'overwrite', autorename: false, mute: false }) .then(function(response) { deferred.resolve(); $('#syncDBLoader').hide(); }) .catch(function(error) { console.error('gclh_sync_DBSave: Error while uploading config file:'); console.error(error); deferred.reject(); $('#syncDBLoader').hide(); }); return deferred.promise(); } // Loads the config from dropbox and replaces the current configuration with it. function gclh_sync_DBLoad() { var deferred = $.Deferred(); gclh_sync_DB_CheckAndCreateClient() .fail(function(){ // Should not be reached, because we checked the client earlier alert('Something went wrong. Please reload the page and try again.'); deferred.reject(); return deferred.promise(); }); $('#syncDBLoader').show(); dropbox_client.filesDownload({path: dropbox_save_path}) .then(function(data) { var blob = data.fileBlob; var reader = new FileReader(); reader.addEventListener("loadend", function() { sync_setConfigData(reader.result); deferred.resolve(); }); reader.readAsText(blob); $('#syncDBLoader').hide(); }) .catch(function(error) { console.error('gclh_sync_DBLoad: Error while downloading config file:'); console.error(error); deferred.reject(); $('#syncDBLoader').hide(); }); return deferred.promise(); } // Gets the hash of the saved config, so we can determine if we have to apply the config loaded from dropbox via autosync. function gclh_sync_DBHash() { var deferred = $.Deferred(); gclh_sync_DB_CheckAndCreateClient() .fail(function(){ deferred.reject('Dropbox client is not initiated.'); return deferred.promise(); }); dropbox_client.filesGetMetadata({ "path": dropbox_save_path, "include_media_info": false, "include_deleted": false, "include_has_explicit_shared_members": false }) .then(function(response) { // console.log('content_hash:' + response.content_hash); if (response != null && response != "") deferred.resolve(response.content_hash); else deferred.reject('Error: response had no file or file was empty.'); }) .catch(function(error) { console.log('gclh_sync_DBHash: Error while getting hash for config file:'); console.log(error); deferred.reject(error); }); return deferred.promise(); } // Sync anzeigen. function gclh_showSync() { btnClose(); scroll(0, 0); if ($('#bg_shadow')[0]) { if ($('#bg_shadow')[0].style.display == "none") $('#bg_shadow')[0].style.display = ""; } else buildBgShadow(); if ($('#sync_settings_overlay')[0] && $('#sync_settings_overlay')[0].style.display == "none") $('#sync_settings_overlay')[0].style.display = ""; else { var div = document.createElement("div"); div.setAttribute("id", "sync_settings_overlay"); div.setAttribute("class", "settings_overlay"); var html = ""; html += "

            GC little helper II Synchronizer v" + scriptVersion + "

            "; html += "
            "; html += "

            DropBox (click to hide/show)

            "; html += ""; html += "

            Manual (click to hide/show)

            "; html += ""; html += "

            "; html += ""; html += "
            "; div.innerHTML = html; $('body')[0].appendChild(div); $('#btn_close3, #btn_DBLoad, #btn_DBSave, #btn_DownloadConfig, #btn_ImportConfig, #btn_ExportConfig, #syncDBLabel, #syncManualLabel').click(function() {if ($(this)[0]) animateClick(this);}); $('#btn_close3')[0].addEventListener("click", btnClose, false); $('#btn_ExportConfig')[0].addEventListener("click", function() { $('#configData')[0].innerText = sync_getConfigData(); }, false); $('#btn_DownloadConfig')[0].addEventListener("click", function() { var element = document.createElement('a'); var [year, month, day] = determineCurrentDate(); element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(sync_getConfigData())); element.setAttribute('download', year + "_" + month + "_" + day + "_" + "config.txt"); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); }, false); $('#btn_ImportConfig')[0].addEventListener("click", function() { var data = $('#configData')[0].innerText; if (data == null || data == "" || data == " ") { alert("No data"); return; } try { sync_setConfigData(data); window.scroll(0, 0); $('#sync_settings_overlay').fadeOut(300); if (settings_show_save_message) { showSaveForm(); setTimeout(function() { $('#save_overlay_h3')[0].innerHTML = "imported"; $("#save_overlay").fadeOut(250); }, 150); } reloadPage(); } catch(e) {alert("Invalid format");} }, false); $('#btn_DBSave')[0].addEventListener("click", function() { gclh_sync_DBSave(); }, false); $('#btn_DBLoad')[0].addEventListener("click", function() { gclh_sync_DBLoad().done(function() {reloadPage();}); }, false); $('#syncDBLabel').click(function() { $('#syncDB').toggle(); gclh_sync_DB_CheckAndCreateClient() .done(function() {gclh_sync_DB_showSaveLoadLinks();}) .fail(function() {gclh_sync_DB_showAuthLink();}); }); $('#syncManualLabel').click(function() { $('#syncManual').toggle(); }); } if ($('.hover.open')[0]) $('.hover.open')[0].className = ""; } // Auto import from Dropbox. if (settings_sync_autoImport && (settings_sync_last.toString() === "Invalid Date" || (new Date() - settings_sync_last) > settings_sync_time) && document.URL.indexOf("#access_token") === -1) { gclh_sync_DBHash() .done(function(hash) { if (hash != settings_sync_hash) { gclh_sync_DBLoad().done(function() { settings_sync_last = new Date(); settings_sync_hash = hash; setValue("settings_sync_last", settings_sync_last.toString()).done(function() { setValue("settings_sync_hash", settings_sync_hash).done(function() { if (is_page("profile")) reloadPage(); }); }); }); } }) .fail(function(error) { console.log('Autosync: Hash function was not successful:'); console.log(error); }); } ////////////////////////////////////// // 6.6. GC - General Functions ($$cap) (Functions generally usable on geocaching webpages.) ////////////////////////////////////// // Search in array. function in_array(search, arr) { for (var i = 0; i < arr.length; i++) {if (arr[i] == search) return true;} return false; } // Sort case insensitive. function caseInsensitiveSort(a, b) { var ret = 0; a = a.toLowerCase(); b = b.toLowerCase(); if (a > b) ret = 1; if (a < b) ret = -1; return ret; } // Sort functions for unpublished in Dashboard. function abc(a, b) { var sort = $(a)[0].name < $(b)[0].name ? -1 : $(b)[0].name < $(a)[0].name ? 1 : 0; return sort; } function gcOld(a, b) { var sort = $(b)[0].referenceCode < $(a)[0].referenceCode ? -1 : $(a)[0].referenceCode < $(b)[0].referenceCode ? 1 : 0; return sort; } function gcNew(a, b) { var sort = $(a)[0].referenceCode < $(b)[0].referenceCode ? -1 : $(b)[0].referenceCode < $(a)[0].referenceCode ? 1 : 0; return sort; } // Trim. function trim(s) { var whitespace = ' \n '; for (var i = 0; i < whitespace.length; i++) { while (s.substring(0, 1) == whitespace.charAt(i)) { s = s.substring(1, s.length); } while (s.substring(s.length - 1, s.length) == whitespace.charAt(i)) { s = s.substring(0, s.length - 1); } } if (s.substring(s.length - 6, s.length) == " ") s = s.substring(0, s.length - 6); return s; } // Trim decimal value to a given number of digits. function roundTO(val, decimals) {return Number(Math.round(val+'e'+decimals)+'e-'+decimals);} // Calculate tile numbers X/Y from latitude/longitude or reverse. function lat2tile(lat,zoom) {return (Math.floor((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,zoom)));} function long2tile(lon,zoom) {return (Math.floor((lon+180)/360*Math.pow(2,zoom)));} function tile2long(x,z) {return (x/Math.pow(2,z)*360-180);} function tile2lat(y,z) {var n=Math.PI-2*Math.PI*y/Math.pow(2,z); return (180/Math.PI*Math.atan(0.5*(Math.exp(n)-Math.exp(-n))));} // Ist Config aktiv? function check_config_page() { var config_page = false; if ($('#bg_shadow')[0] && $('#bg_shadow')[0].style.display == "" && $('#settings_overlay')[0] && $('#settings_overlay')[0].style.display == "") config_page = true; return config_page; } // Ist Sync aktiv? function check_sync_page() { var sync_page = false; if ($('#bg_shadow')[0] && $('#bg_shadow')[0].style.display == "" && $('#sync_settings_overlay')[0] && $('#sync_settings_overlay')[0].style.display == "") sync_page = true; return sync_page; } // Is special processing allowed on the current page? function checkTaskAllowed(task, doAlert) { if ((document.location.href.match(/^https?:\/\/(www\.wherigo|www\.waymarking|labs\.geocaching)\.com/) || isMemberInPmoCache()) || (task != "Find Player" && document.location.href.match(/(\.com\/map\/|\.com\/play\/map)/))) { if (doAlert != false) alert("This GC little helper II functionality is not available at this page.\n\nPlease go to the \"Dashboard\" page, there is anyway all of these \nfunctionality available. ( www.geocaching.com/my )"); return false; } return true; } // Is page own public profile? function isOwnPublicProfile() { return is_page('publicProfile') && $('#ctl00_ProfileHead_ProfileHeader_lblMemberName').html() == global_me; } // Is page own statistics? function isOwnStatisticsPage() { if ((document.location.href.match(/\.com\/my\/statistics\.aspx/)) || (is_page("publicProfile") && $('#ctl00_ContentBody_lblUserProfile')[0].innerHTML.match(global_me) && $('#ctl00_ContentBody_ProfilePanel1_lnkStatistics.Active')[0])) { return true; } else return false; } // Is event in cache listing. function isEventInCacheListing() { if (is_page("cache_listing") && $('#cacheDetails svg.cache-icon use')[0] && $('#cacheDetails svg.cache-icon use')[0].href.baseVal.match(/\/cache-types.svg\#icon-(6$|6-|453$|453-|13$|13-|7005$|7005-|3653$|3653-)/)) { return true; } else return false; } // Is Basic Member in PMO Cache? function isMemberInPmoCache() { if (is_page("cache_listing") && $('#premium-upgrade-widget')[0]) return true; else return false; } // Random number between max and min. function random(max, min) {return Math.floor(Math.random() * (max - min + 1)) + min;} // Convert a 12 hour time string to a 24 hour time string. // Examples: 12:00 AM->00:00 / 12:30 AM->00:30 / 01:30 AM->01:30 / 00:00 PM->12:00 / 01:30 PM->13:30 function convert12To24Hour(str) { let dString = '01 Jan 2000 ' + str; let dParse = Date.parse(dString); let date = new Date(dParse); let tString = date.toLocaleTimeString(window.navigator.language, {hour: '2-digit', minute: '2-digit'}); return tString; } // Determine current date and deliver year, month and day. function determineCurrentDate() { var now = new Date(); var day = now.getDate().toString().length < 2 ? "0"+now.getDate() : now.getDate(); var month = (now.getMonth()+1).toString().length < 2 ? "0"+(now.getMonth()+1) : (now.getMonth()+1); var year = now.getFullYear(); return [year, month, day]; } // Current date, time. function getDateTime(format = 'dd.mm.yy') { var now = new Date(); var aDate = $.datepicker.formatDate(format, now); var hrs = now.getHours(); var min = now.getMinutes(); var sec = now.getSeconds(); hrs = ((hrs < 10) ? '0' + hrs : hrs); min = ((min < 10) ? '0' + min : min); sec = ((sec < 10) ? '0' + sec : sec); var aTime = hrs+':'+min; var aDateTime = aDate+' '+aTime; var aDateBigtime = aDate+' '+hrs+':'+min+':'+sec; return [aDate, aTime, aDateTime, aDateBigtime]; } // Build time string. function buildTimeString(min) { if (min < 2) return (min + " minute"); else if (min < 121) return (min + " minutes"); else if (min < 2881) return ("more than " + Math.floor(min / 60) + " hours"); else return ("more than " + Math.floor(min / (60*24)) + " days"); } // Calculates difference between two dates and returns it as a "humanized" string. function adjustPlural(singularWord, timesNumber) {return singularWord + ((Math.abs(timesNumber) != 1) ? "s" : "");} function getDateDiffString(dateNew, dateOld) { var dateDiff = new Date(dateNew - dateOld); dateDiff.setUTCFullYear(dateDiff.getUTCFullYear() - 1970); var strDateDiff = "", timeunitValue = 0; var timeunitsHash = {year: "getUTCFullYear", month: "getUTCMonth", day: "getUTCDate", hour: "getUTCHours", minute: "getUTCMinutes", second: "getUTCSeconds", millisecond: "getUTCMilliseconds"}; for (var timeunitName in timeunitsHash) { timeunitValue = dateDiff[timeunitsHash[timeunitName]]() - ((timeunitName == "day") ? 1 : 0); if (timeunitValue !== 0) { if ((timeunitName == "millisecond") && (strDateDiff.length !== 0)) continue; // Milliseconds won't be added unless difference is less than 1 second. strDateDiff += ((strDateDiff.length === 0) ? "" : ", ") + timeunitValue + " " + adjustPlural(timeunitName, timeunitValue); } } // Replaces last comma with "and" to humanize the string. strDateDiff = strDateDiff.replace(/,([^,]*)$/, " and$1"); return strDateDiff; } // Close Overlays, Find Player, Config, Sync. function btnClose(clearUrl) { if (global_mod_reset) { rcClose(); return; } if ($('#bg_shadow')[0]) $('#bg_shadow')[0].style.display = "none"; if ($('#settings_overlay')[0]) $('#settings_overlay')[0].style.display = "none"; if ($('#sync_settings_overlay')[0]) $('#sync_settings_overlay')[0].style.display = "none"; if ($('#findplayer_overlay')[0]) $('#findplayer_overlay')[0].style.display = "none"; if (clearUrl != false) document.location.href = clearUrlAppendix(document.location.href, false); } // Darken the side. function buildBgShadow() { var shadow = document.createElement("div"); shadow.setAttribute("id", "bg_shadow"); shadow.setAttribute("style", "z-index: 9998; width: 100%; height: 100%; background-color: #000000; position:fixed; top: 0; left: 0; opacity: 0.5; filter: alpha(opacity=50);"); $('body')[0].appendChild(shadow); $('#bg_shadow')[0].addEventListener("click", btnClose, false); } // Get Geocaching Access Token. function gclh_GetGcAccessToken( handler ) { setTimeout(function() { $.ajax({ type: "POST", url: "/account/oauth/token", timeout: 10000 }) .done( function(r) { try { handler(r); } catch(e) {gclh_error("gclh_GetGcAccessToken()",e);} }); }, 0); } // Convert cache type to cache symbol. function convertCachetypeToCachesymbol(cacheType) { var cacheSymbol = ''; if (cacheType) { if (cacheType.match(/traditional/i)) cacheSymbol = '#traditional'; else if (cacheType.match(/multi/i)) cacheSymbol = '#multi'; else if (cacheType.match(/mystery/i)) cacheSymbol = '#mystery'; else if (cacheType.match(/earth/i)) cacheSymbol = '#earth'; else if (cacheType.match(/letterbox/i)) cacheSymbol = '#letterbox'; else if (cacheType.match(/webcam/i)) cacheSymbol = '#webcam'; else if (cacheType.match(/wherigo/i)) cacheSymbol = '#wherigo'; else if (cacheType.match(/virtual/i)) cacheSymbol = '#virtual'; else if (cacheType.match(/mega/i)) cacheSymbol = '#mega'; else if (cacheType.match(/giga/i)) cacheSymbol = '#giga'; else if (cacheType.match(/trash/i)) cacheSymbol = '#cito'; else if (cacheType.match(/Community Celebration/i)) cacheSymbol = '#celebration'; else if (cacheType.match(/HQ Celebration/i)) cacheSymbol = '#hq_celebration'; else if (cacheType.match(/(Project A\.P\.E\.|Project APE)/i)) cacheSymbol = '#ape'; else if (cacheType.match(/Groundspeak HQ/i)) cacheSymbol = '#hq'; else if (cacheType.match(/event/i)) cacheSymbol = '#event'; else if (cacheType.match(/GPS Adventures Exhibit Cache/i)) cacheSymbol = '#gpsa'; } return cacheSymbol; } // Animate Click. function animateClick(element) { element.animate({opacity: 0.3}, {duration: 200, direction: 'reverse'}); } // Consideration of special keys ctrl, alt, shift on keyboard input. function noSpecialKey(e) { if (e.ctrlKey != false || e.altKey != false || e.shiftKey != false) return false; else return true; } // Addition in url, introduced by "#", reset to "#". function clearUrlAppendix(url, onlyTheFirst) { var urlSplit = url.split('#'); var newUrl = ""; if (onlyTheFirst) newUrl = url.replace(urlSplit[1], "").replace("##", "#"); else newUrl = urlSplit[0] + "#"; return newUrl; } // Add a link to copy to clipboard. // element_to_copy: innerHtml of this element will be copied. If you pass // a string, the string will be the copied text. In this // case you have to pass an anker_element!!! // anker_element: Before this element the copy marker will be inserted, // if you set this to null, the element_to_copy will be // used as an anker. // title: You can enter a text that will be displayed between // Copy --TEXT OF TITLE-- to clipboard. If you leave it // blank, it will just "Copy to clipboard" be displayed. // style: You can add styles to the surrounding span by passing // it in this variable. function addCopyToClipboardLink(element_to_copy, anker_element= null, title="", style= "") { try { var ctoc = false; var span = document.createElement('span'); span.setAttribute("class",'ctoc_link'); span.innerHTML = ' '; if (style != "") span.setAttribute("style", style); if (!anker_element) anker_element = element_to_copy; if (!anker_element.parentNode) return; anker_element.parentNode.insertBefore(span, anker_element); appendCssStyle(".ctoc_link:link {text-decoration: none ;}", null, 'ctoc_link_style_id'); span.addEventListener('click', function() { // Tastenkombination Strg+c ausführen für eigene Verarbeitung. ctoc = true; document.execCommand('copy'); }, false); document.addEventListener('copy', function(e){ // Normale Tastenkombination Strg+c für markierter Bereich hier nicht verarbeiten. Nur eigene Tastenkombination Strg+c hier verarbeiten. if (!ctoc) return; // Gegebenenfalls markierter Bereich wird hier nicht beachtet. e.preventDefault(); // Copy Data wird hier verarbeitet. if (typeof element_to_copy === 'string' || element_to_copy instanceof String) { e.clipboardData.setData('text/plain', element_to_copy); } else { e.clipboardData.setData('text/plain', element_to_copy.innerHTML); } animateClick(span); ctoc = false; }); } catch(e) {gclh_error("Copy to clipboard",e);} } // Length, Maxlength of field and number of words. function limitedField(editor, counterelement, limitNum, showWords) { changed = true; var length = $(editor).val().replace(/\n/g, "\r\n").length; if (length >= limitNum) { counterelement.innerHTML = '' + length + '/' + limitNum + ''; } else counterelement.innerHTML = length + '/' + limitNum; if (showWords) { var wordsArr = $(editor).val().replace(/\n/g, ' ').split(' '); var words = 0; for (let i=0; i 0) return pair[1]; } } return undefined; }; }; // End of mainGC. ////////////////////////////// // 7. Global Functions ($$cap) (Functions global usable.) ////////////////////////////// // Change coordinates from N/S/E/W Deg Min.Sec to Dec. function toDec(coords) { var match = coords.match(/([0-9]+)°([0-9]+)\.([0-9]+)′(N|S), ([0-9]+)°([0-9]+)\.([0-9]+)′(W|E)/); if (match) { var dec1 = parseInt(match[1], 10) + (parseFloat(match[2] + "." + match[3]) / 60); if (match[4] == "S") dec1 = dec1 * -1; dec1 = Math.round(dec1 * 10000000) / 10000000; var dec2 = parseInt(match[5], 10) + (parseFloat(match[6] + "." + match[7]) / 60); if (match[8] == "W") dec2 = dec2 * -1; dec2 = Math.round(dec2 * 10000000) / 10000000; return new Array(dec1, dec2); } else { match = coords.match(/(N|S)\s?([0-9]+)°?\s?([0-9]+)\.([0-9]+)′?'?\s?(E|W)\s?([0-9]+)°?\s?([0-9]+)\.([0-9]+)/); if (match) { var dec1 = parseInt(match[2], 10) + (parseFloat(match[3] + "." + match[4]) / 60); if (match[1] == "S") dec1 = dec1 * -1; dec1 = Math.round(dec1 * 10000000) / 10000000; var dec2 = parseInt(match[6], 10) + (parseFloat(match[7] + "." + match[8]) / 60); if (match[5] == "W") dec2 = dec2 * -1; dec2 = Math.round(dec2 * 10000000) / 10000000; return new Array(dec1, dec2); } else { match = coords.match(/(N|S) ([0-9]+) ([0-9]+) ([0-9]+)\.([0-9]+) (E|W) ([0-9]+) ([0-9]+) ([0-9]+)\.([0-9]+)/); if (match) { var dec1 = parseInt(match[2], 10) + (parseFloat(match[3]) / 60) + (parseFloat(match[4] + "." + match[5]) / 3600); if (match[1] == "S") dec1 = dec1 * -1; dec1 = Math.round(dec1 * 10000000) / 10000000; var dec2 = parseInt(match[7], 10) + (parseFloat(match[8]) / 60) + (parseFloat(match[9] + "." + match[10]) / 3600); if (match[6] == "W") dec2 = dec2 * -1; dec2 = Math.round(dec2 * 10000000) / 10000000; return new Array(dec1, dec2); } else { match = coords.match(/(N|S) ([0-9]+) ([0-9]+) ([0-9]+\..[0-9].) (E|W) ([0-9]+) ([0-9]+) ([0-9]+\..[0-9].)/); if (match) { var dec1 = parseInt(match[2], 10) + (parseFloat(match[3]) / 60) + (parseFloat(match[4]) / 3600); if (match[1] == "S") dec1 = dec1 * -1; dec1 = Math.round(dec1 * 10000000) / 10000000; var dec2 = parseInt(match[6], 10) + (parseFloat(match[7]) / 60) + (parseFloat(match[8]) / 3600); if (match[5] == "W") dec2 = dec2 * -1; dec2 = Math.round(dec2 * 10000000) / 10000000; return new Array(dec1, dec2); } else return false; } } } } // Change coordinates from Deg to DMS. function DegtoDMS(coords) { var match = coords.match(/^(N|S) ([0-9][0-9]). ([0-9][0-9])\.([0-9][0-9][0-9]) (E|W) ([0-9][0-9][0-9]). ([0-9][0-9])\.([0-9][0-9][0-9])$/); if (!match) return ""; var lat1 = parseInt(match[2], 10); var lat2 = parseInt(match[3], 10); var lat3 = parseFloat("0." + match[4]) * 60; lat3 = Math.round(lat3 * 10000) / 10000; var lng1 = parseInt(match[6], 10); var lng2 = parseInt(match[7], 10); var lng3 = parseFloat("0." + match[8]) * 60; lng3 = Math.round(lng3 * 10000) / 10000; return match[1] + " " + lat1 + "° " + lat2 + "' " + lat3 + "\" " + match[5] + " " + lng1 + "° " + lng2 + "' " + lng3 + "\""; } // Change coordinates from Dec to Deg. function DectoDeg(lat, lng) { var n = "000"; lat = lat / 10000000; var pre = ""; if (lat > 0) pre = "N"; else { pre = "S"; lat = lat * -1; } var tmp1 = parseInt(lat); var tmp2 = (lat - tmp1) * 60; tmp1 = String(tmp1); if (tmp1.length == 1) tmp1 = "0" + tmp1; tmp2 = Math.round(tmp2 * 10000) / 10000; tmp2 = String(tmp2); if (tmp2.length == 0) tmp2 = tmp2 + "0.000"; else if (tmp2.indexOf(".") == -1) tmp2 = tmp2 + ".000"; else if (tmp2.indexOf(".") != -1) tmp2 = tmp2 + n.slice(tmp2.length - tmp2.indexOf(".") - 1); var new_lat = pre + " " + tmp1 + "° " + tmp2; lng = lng / 10000000; var pre = ""; if (lng > 0) pre = "E"; else { pre = "W"; lng = lng * -1; } var tmp1 = parseInt(lng); var tmp2 = (lng - tmp1) * 60; tmp1 = String(tmp1); if (tmp1.length == 2) tmp1 = "0" + tmp1; else if (tmp1.length == 1) tmp1 = "00" + tmp1; tmp2 = Math.round(tmp2 * 10000) / 10000; tmp2 = String(tmp2); if (tmp2.length == 0) tmp2 = tmp2 + "0.000"; else if (tmp2.indexOf(".") == -1) tmp2 = tmp2 + ".000"; else if (tmp2.indexOf(".") != -1) tmp2 = tmp2 + n.slice(tmp2.length - tmp2.indexOf(".") - 1); var new_lng = pre + " " + tmp1 + "° " + tmp2; return new_lat + " " + new_lng; } // Show other coordinates. function otherFormats(box, coords, trenn) { var dec = toDec(coords); var lat = dec[0]; var lng = dec[1]; if (lat < 0) lat = "S "+(lat * -1); else lat = "N "+lat; if (lng < 0) lng = "W "+(lng * -1); else lng = "E "+lng; box.innerHTML += trenn+"Dec: "+lat+" "+lng; var dms = DegtoDMS(coords); box.innerHTML += trenn+"DMS: "+dms; } // Decode URI component for non-standard unicode encoding (issue-818). function decodeUnicodeURIComponent(s) { function unicodeToChar(text) { return text.replace(/%u[\dA-F]{4}/gi, function (match) { return String.fromCharCode(parseInt(match.replace(/%u/g, ''), 16)); }); } return decodeURIComponent(unicodeToChar(s)); } // Encode in URL. function urlencode(s, convertPlus) { s = s.replace(/&/g, "&"); s = s.replace(/</g, "%3C"); s = s.replace(/>/g, "%3E"); s = encodeURIComponent(s); // Alles außer: A bis Z, a bis z und - _ . ! ~ * ' ( ) s = s.replace(/~/g, "%7e"); s = s.replace(/'/g, "%27"); s = s.replace(/%26amp%3b/g, "%26"); s = s.replace(/%26nbsp%3B/g, "%20"); if (convertPlus != false) { s = s.replace(/%2B/ig, "%252b"); } s = s.replace(/ /g, "+"); return s; } // Decode from URL. function urldecode(s, convertSpace=false) { s = s.replace(/\+/g, " "); s = s.replace(/%252b/ig, "+"); s = s.replace(/%7e/g, "~"); s = s.replace(/%27/g, "'"); s = s.replace(/%253C/ig, "<"); s = s.replace(/%253E/ig, ">"); s = decodeUnicodeURIComponent(s); if (convertSpace) { s = s.replace(/%20/g, " "); } return s; } // Decode HTML, e.g.: "&" in "&" (e.g.: User "Rajko & Dominik"). function decode_innerHTML(v_mit_innerHTML) { var elem = document.createElement('textarea'); elem.innerHTML = v_mit_innerHTML.innerHTML; v_decode = elem.value; v_new = v_decode.trim(); return v_new; } function decode_innerText(v_mit_innerHTML) { var elem = document.createElement('textarea'); elem.innerHTML = v_mit_innerHTML.innerText; v_decode = elem.value; v_new = v_decode.trim(); return v_new; } function html_to_str(s) { s = s.replace(/\&/g, "&"); s = s.replace(/\ /g, " "); return s; } // Create bookmark to GC page. function bookmark(title, href, bookmarkArray) { var bm = new Object(); bookmarkArray[bookmarkArray.length] = bm; bm['href'] = href; bm['title'] = title; return bm; } // Create BM to external page. function externalBookmark(title, href, bookmarkArray) { var bm = bookmark(title, href, bookmarkArray); bm['rel'] = "external"; bm['target'] = "_blank"; } // Create BM to a profile sub page. function profileBookmark(title, id, bookmarkArray) { var bm = bookmark(title, "#", bookmarkArray); bm['id'] = id; bm['name'] = id; } // Create BM mit doppeltem Link. function profileSpecialBookmark(title, href, name, bookmarkArray) { var bm = bookmark(title, href, bookmarkArray); bm['name'] = name; } // Replace apostrophes. function repApo(s) { return s.replace(/'/g, '''); } // Add CSS Style. function appendCssStyle(css, name, id) { if (document.getElementById(id)) return; if (css == "") return; if (name) var tag = $(name)[0]; else var tag = $('head')[0]; var style = document.createElement('style'); style.innerHTML = 'GClhII{} ' + css; style.type = 'text/css'; if (id) style.id = id; tag.appendChild(style); } // Add Meta Info. function appendMetaId(id) { var head = document.getElementsByTagName('head')[0]; var meta = document.createElement('meta'); meta.id = id; head.appendChild(meta); } // Console logging. function gclh_log(log) { var txt = "GClh_LOG - " + document.location.href + ": " + log; if (typeof(console) != "undefined") console.info(txt); else if (typeof(GM_log) != "undefined") GM_log(txt); } // Console error logging. function gclh_error(modul, err) { var txt = "GClh_ERROR - " + modul + " - " + document.location.href + ": " + err.message + "\nStacktrace:\n" + err.stack + (err.stacktrace ? ("\n" + err.stacktrace) : ""); if (typeof(console) != "undefined") console.error(txt); else if (typeof(GM_log) != "undefined") GM_log(txt); if (settings_gclherror_alert) { if ($("#gclh-gurumeditation").length == 0) { $("body").before('
            '); $("#gclh-gurumeditation").append('
            '); $("#gclh-gurumeditation > div").append('

            GC little helper II Error

            '); $("#gclh-gurumeditation > div").append('
            '); $("#gclh-gurumeditation > div").append('

            For more information see the console. Create a new issue / bug report at GitHub.

            '); } $("#gclh-gurumeditation > div > div").append( "

            "+modul + ": " + err.message+"

            "); } } // Test log console. function tlc(output) { if (test_log_console && output != '') console.info('GClh: '+output); } // Set Get Values. function setValue(name, value) { var defer = $.Deferred(); CONFIG[name] = value; GM_setValue("CONFIG", JSON.stringify(CONFIG)); defer.resolve(); return defer.promise(); } function setValueSet(data) { var defer = $.Deferred(); var data2Store = {}; for (key in data) { CONFIG[key] = data[key]; data2Store[key] = data[key]; } GM_setValue("CONFIG", JSON.stringify(CONFIG)); defer.resolve(); return defer.promise(); } function getValue(name, defaultValue) { if (CONFIG[name] === undefined) { CONFIG[name] = GM_getValue(name, defaultValue); if (defaultValue === undefined) return undefined; setValue(name, CONFIG[name]); } return CONFIG[name]; } // Which webpage is it? function is_page(name) { var status = false; var url = document.location.pathname; if (name == "cache_listing") { if (url.match(/^\/(seek\/cache_details\.aspx|geocache\/)/) && !document.getElementById("cspSubmit") && !document.getElementById("cspGoBack")) status = true; // Exclude (new) Log Page if (url.match(/^\/(geocache\/).*\/log/)) status = false; // Exclude unpublished Caches if (document.getElementsByClassName('UnpublishedCacheSearchWidget').length > 0) status = false; } else if (name == "unpublished_cache") { if (document.getElementById("unpublishedMessage") !== null || document.getElementById("ctl00_ContentBody_GeoNav_uxPostReviewerNoteLogType") !== null) status = true; } else if (name == "profile") { if (url.match(/^\/my(\/default\.aspx)?/)) status = true; } else if (name == "publicProfile") { if (url.match(/^\/(profile|p\/)/)) status = true; } else if (name == "lists") { if (url.match(/^\/plan\/lists/)) status = true; } else if (name == "searchmap") { if (url.match(/^\/play\/map/)) status = true; } else if (name == "map") { if (url.match(/^\/map/)) status = true; } else if (name == "find_cache") { if (url.match(/^\/play\/(search|geocache)/)) status = true; } else if (name == "collection_1") { if (url.match(/^\/play\/(friendleague|leaderboard|souvenircampaign|guidelines|promotions)/)) status = true; } else if (name == "hide_cache") { if (url.match(/^\/play\/hide/)) status = true; } else if (name == "geotours") { if (url.match(/^\/play\/geotours/)) status = true; } else if (name == "drafts") { if (url.match(/^\/account\/drafts/)) status = true; } else if (name == "settings") { if (url.match(/^\/account\/(settings|lists|drafts|documents)/)) status = true; } else if (name == "messagecenter") { if (url.match(/^\/account\/messagecenter/)) status = true; } else if (name == "dashboard") { if (url.match(/^\/account\/dashboard$/)) status = true; } else if (name == "owner_dashboard") { if (url.match(/^\/play\/owner/)) status = true; } else if (name == "dashboard-section") { if (url.match(/^\/account\/dashboard/)) status = true; } else if (name == "promos") { // Like 'Wonders of the World'. if (url.match(/^\/promos/)) status = true; } else if (name == "track") { if (url.match(/^\/track\/($|#$|edit|upload|default.aspx)/)) status = true; } else if (name == "souvenirs") { if (url.match(/^\/my\/souvenirs\.aspx/)) status = true; } else if (name == "logbook") { // View all logs. if (url.match(/^\/seek\/geocache_logs\.aspx/)) status = true; } else if (name == 'logform') { if (url.match(/^\/live\/(?:geocache|trackable)\/(?:gc|tb)[a-z0-9]+/i)) status = true; } else { gclh_error("is_page", "is_page("+name+", ... ): unknown name"); } return status; } // Inject script into site context. function injectPageScript(scriptContent, TagName, IdName) { var script = document.createElement("script"); script.setAttribute("type", "text/javascript"); if (IdName !== undefined) { script.setAttribute("id", IdName); } script.innerHTML = scriptContent; var pageHead = document.getElementsByTagName(TagName?TagName:"head")[0]; pageHead.appendChild(script); } function injectPageScriptFunction(funct, functCall) {injectPageScript("(" + funct.toString() + ")" + functCall + ";");} // Run a function as soon as a specific element is available. function waitForElementThenRun(elem, func, timeout=5000, waitTime=10, totalTime=0) { if ($(elem)[0]) func(); else { if ((totalTime += waitTime) < timeout) setTimeout(() => waitForElementThenRun(elem, func, timeout, waitTime, totalTime), waitTime); else console.error(elem + ' not found within ' + totalTime/1000 + 's'); } } // Convert GCCode to id. String.prototype.gcCodeToID = function () { let gcCode = this.trim().toUpperCase().substring(2); let abc = '0123456789ABCDEFGHJKMNPQRTVWXYZ'; let base = 31; let id = -411120; if (gcCode.length <= 3 || (gcCode.length == 4 && gcCode.match(/[0-9A-F]/))) { abc = '0123456789ABCDEF'; base = 16; id = 0; } gcCode.split('').reverse().forEach((letter, i) => { id += abc.indexOf(letter) * Math.pow(base, i); }); return id; } // Simple a quick schnaader's checksum function. String.prototype.checksum = function () { try { // We use the TextEncoder to use UFT-8, so the seed will never get out of range. let encoder = new TextEncoder(); let data = encoder.encode(this); let seed = 0x12345678; for (let i = 0; i < data.length; i++) { seed += (data[i] * (i + 1)); } return (seed & 0xffffffff).toString(16); } catch (e) {gclh_error("Error bulding checksum", e);} } Date.prototype.getWeekday = function(short = false) { let weekdays = short ? ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; return weekdays[this.getDay()]; } start(this);