Skip to content

Instantly share code, notes, and snippets.

@DieBatzen
Last active April 16, 2024 15:54
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save DieBatzen/5814dc7368c1034470c8 to your computer and use it in GitHub Desktop.
Save DieBatzen/5814dc7368c1034470c8 to your computer and use it in GitHub Desktop.
GCTour
// ==UserScript==
// @name GC Tour
// @namespace https://gist.github.com/DieBatzen/5814dc7368c1034470c8/
// @version 4.30
// @description Cachetour planning made easy. Pick some Caches, sort the list and print it out. Free for all users of geocaching.com!
// @author Die Batzen, madd.in
// @run-at document-end
// @match http*://www.geocaching.com/*
// @match https://www.gctour.de/map/show*
// @exclude /^https?://www\.geocaching\.com/(login|jobs|careers|promotions|blog|help)/
// @updateURL https://gist.github.com/DieBatzen/5814dc7368c1034470c8/raw/gctour.version.js
// @downloadURL https://gist.github.com/DieBatzen/5814dc7368c1034470c8/raw/gctour.user.js
// @supportURL https://geoclub.de/forum/viewtopic.php?f=117&t=78798&start=9999
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant GM_log
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @grant GM_openInTab
// @grant GM_listValues
// @grant unsafeWindow
// @icon https://www.gctour.de/i/icon.png
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
// @require https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js
// @require https://raw.githubusercontent.com/eligrey/FileSaver.js/1.3.4/FileSaver.min.js
// @require https://unpkg.com/leaflet@1.3.4/dist/leaflet.js
// @connect gctour.de
// @connect geocaching.com
// @connect gist.github.com
// @connect gist.githubusercontent.com
// @connect nominatim.openstreetmap.org
// @connect *
// ==/UserScript==
/*****************************************************************************
* Copyright (C) 2008 - 2014 Martin Georgi, as of 2015 Die Batzen
*
* This is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
* version.
*
* This is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* To obtain a copy of the GNU General Public License, please see
* <https://www.gnu.org/licenses>
*****************************************************************************/
(function() { // begin of immediately-invoked function expression --> own "GCTour namespace"
"use strict";
/* globals */
let
VERSION = GM_info.script.version, // will be checked once a day
DEBUG_MODE = false,
GCTOUR_HOST = 'https://www.gctour.de/',
HTTP = window.location.protocol, // http or https
GS_HOST = HTTP + '//www.geocaching.com/',
GS_WEB_API = GS_HOST + 'api/proxy/web/v1/',
GS_WPT_IMAGE_PATH = 'images/wpttypes/sm/',
// set $ to jQuery local
$ = window.jQuery,
// are jQuery and UI loaded
IS_JQUERY = (
(typeof $ !== "undefined") && (typeof $ === "function") &&
(typeof $.fn === "object") && (typeof $.ui === "object")),
IS_OPERA = (IS_JQUERY && $.browser.opera) ? true : false,
IS_GREASEMONKEY = (typeof GM_info.scriptHandler === "undefined") ? true : false,
TOURS,
CURRENT_TOUR,
GS_USERINFO,
ROT13_ARRAY,
TIMEOUT,
STICKY = GM_getValue('sticky', false),
PROGRESS_BAR = {"progress" : 0, "total" : 0},
FAVSCORE = true,
DELETED_STYLESHEET_RULES = [],
SEND2CGEO = false,
AUTOTOUR_WEBAPI = true,
AUTOTOUR_MAX_CACHES = 1000, // 8000 is absolute maximum (by GS), but this slows browser down significantly!
LM, // Leaflet Map for autoTour
TOKEN,
WPT_ARRAY = [{
wptTypeId : "2",
guid : "32bc9333-5e52-4957-b0f6-5a2c8fc7b257",
name : "Traditional Cache",
shortname: "traditional",
gsDisplayName: "Traditional Cache"
}, {
wptTypeId : "3",
guid : "a5f6d0ad-d2f2-4011-8c14-940a9ebf3c74",
name : "Multi-cache",
shortname: "multi",
gsDisplayName: "Multi-Cache"
}, {
wptTypeId : "8",
guid : "40861821-1835-4e11-b666-8d41064d03fe",
name : "Unknown Cache",
shortname: "mystery",
gsDisplayName: "Mystery Cache"
}, {
wptTypeId : "5",
guid : "4bdd8fb2-d7bc-453f-a9c5-968563b15d24",
name : "Letterbox Hybrid",
shortname: "letterbox",
gsDisplayName: "Letterbox Hybrid"
}, {
wptTypeId : "11",
guid : "31d2ae3c-c358-4b5f-8dcd-2185bf472d3d",
name : "Webcam Cache",
shortname: "webcam",
gsDisplayName: "Webcam Cache"
}, {
wptTypeId : "4",
guid : "294d4360-ac86-4c83-84dd-8113ef678d7e",
name : "Virtual Cache",
shortname: "virtual",
gsDisplayName: "Virtual Cache"
}, {
wptTypeId : "1858",
guid : "0544fa55-772d-4e5c-96a9-36a51ebcf5c9",
name : "Wherigo Cache",
shortname: "wherigo",
gsDisplayName: "Wherigo Cache"
}, {
wptTypeId : "137",
guid : "c66f5cf3-9523-4549-b8dd-759cd2f18db8",
name : "Earthcache",
shortname: "earth",
gsDisplayName: "EarthCache"
}, {
wptTypeId : "6",
guid : "69eb8534-b718-4b35-ae3c-a856a55b0874",
name : "Event Cache", // includes all event cache types
shortname: "event",
gsDisplayName: "Event Cache"
}, {
wptTypeId : "13",
guid : "57150806-bc1a-42d6-9cf0-538d171a2d22",
name : "Cache In Trash Out Event",
shortname: "cito",
gsDisplayName: "Cache In Trash Out® Event Cache"
}, {
wptTypeId : "453",
guid : "69eb8535-b718-4b35-ae3c-a856a55b0874",
name : "Mega-Event Cache",
shortname: "mega",
gsDisplayName: "Mega-Event Cache"
}, {
wptTypeId : "7005",
guid : "51420629-5739-4945-8bdd-ccfd434c0ead",
name : "Giga-Event Cache",
shortname: "giga",
gsDisplayName: "Giga-Event Cache"
}, {
wptTypeId: "3653",
guid : "3ea6533d-bb52-42fe-b2d2-79a3424d4728",
name: "Community Celebration Event",
shortname: "celebration",
gsDisplayName: "Community Celebration Event"
}, {
wptTypeId: "3774",
guid : "af820035-787a-47af-b52b-becc8b0c0c88",
name: "Geocaching HQ Celebration",
shortname: "hq_celebration",
gsDisplayName: "Geocaching HQ Celebration"
}, {
wptTypeId: "4738",
guid : "bc2f3df2-1aab-4601-b2ff-b5091f6c02e3",
name: "Geocaching HQ Block Party",
shortname: "blockparty",
gsDisplayName: "Geocaching HQ Block Party" // to be checked
}, {
wptTypeId: "3773",
guid : "416f2494-dc17-4b6a-9bab-1a29dd292d8c",
name: "Geocaching HQ",
shortname: "hq",
gsDisplayName: "Geocaching HQ"
}, {
wptTypeId: "1304",
guid : "72e69af2-7986-4990-afd9-bc16cbbb4ce3",
name: "GPS Adventures Exhibit",
shortname: "gpsa",
gsDisplayName: "GPS Adventures Exhibit" // to be checked
}, {
wptTypeId: "12",
guid : "8f6dd7bc-ff39-4997-bd2e-225a0d2adf9d",
name: "Locationless (Reverse) Cache",
shortname: "locationless",
gsDisplayName: "Locationless Cache"
}, {
wptTypeId: "9",
guid : "2555690d-b2bc-4b55-b5ac-0cb704c0b768",
name: "Project APE Cache",
shortname: "ape",
gsDisplayName: "Project A.P.E. Cache"
}
],
SIZES_ARRAY = [{
sizeTypeId : "micro",
name : "Micro",
newSearchId : 2
}, {
sizeTypeId : "small",
name : "Small",
newSearchId : 8
}, {
sizeTypeId : "regular",
name : "Regular",
newSearchId : 3
}, {
sizeTypeId : "large",
name : "Large",
newSearchId : 4
}, {
sizeTypeId : "other",
name : "Other",
newSearchId : 6
}, {
sizeTypeId : "not_chosen",
name : "Not chosen",
newSearchId : 1
}, {
sizeTypeId : "virtual",
name : "Virtual",
newSearchId : 5
}
],
// https://www.geocaching.com/about/icons.aspx
ATTRIBUTES_ARRAY = [
// Attribute: [GS id, image name, description]
['1', 'dogs', 'Dogs'],
['2', 'fee', 'Access/parking fee'],
['3', 'rappelling', 'Climbing gear required'],
['4', 'boat', 'Boat required'],
['5', 'scuba', 'Scuba gear required'],
['6', 'kids', 'Recommended for kids'],
['7', 'onehour', 'Takes less than an hour'],
['8', 'scenic', 'Scenic view'],
['9', 'hiking', 'Significant hike'],
['10', 'climbing', 'Difficult climb'],
['11', 'wading', 'May require wading'],
['12', 'swimming', 'May require swimming'],
['13', 'available', 'Available 24/7'],
['14', 'night', 'Recommended at night'],
['15', 'winter', 'Available in winter'],
['17', 'poisonoak', 'Poisonous plants'],
['18', 'dangerousanimals', 'Dangerous animals'],
['19', 'ticks', 'Ticks'],
['20', 'mine', 'Abandoned mine'],
['21', 'cliff', 'Cliffs/falling rocks'],
['22', 'hunting', 'Hunting area'],
['23', 'danger', 'Dangerous area'],
['24', 'wheelchair', 'Wheelchair accessible'],
['25', 'parking', 'Parking nearby'],
['26', 'public', 'Public transportation nearby'],
['27', 'water', 'Drinking water nearby'],
['28', 'restrooms', 'Public restrooms nearby'],
['29', 'phone', 'Telephone nearby'],
['30', 'picnic', 'Picnic tables nearby'],
['31', 'camping', 'Camping nearby'],
['32', 'bicycles', 'Bicycles'],
['33', 'motorcycles', 'Motorcycles'],
['34', 'quads', 'Quads'],
['35', 'jeeps', 'Off-road vehicles'],
['36', 'snowmobiles', 'Snowmobiles'],
['37', 'horses', 'Horses'],
['38', 'campfires', 'Campfires'],
['39', 'thorn', 'Thorns'],
['40', 'stealth', 'Stealth required'],
['41', 'stroller', 'Stroller accessible'],
['42', 'firstaid', 'Needs maintenance'],
['43', 'cow', 'Livestock nearby'],
['44', 'flashlight', 'Flashlight required'],
['45', 'landf', 'Lost and Found tour'],
['46', 'rv', 'Trucks/RVs'],
['47', 'field_puzzle', 'Field puzzle'],
['48', 'UV', 'UV light required'],
['49', 'snowshoes', 'May require snowshoes'],
['50', 'skiis', 'May require cross country skis'],
['51', 's-tool', 'Special tool required'],
['52', 'nightcache', 'Night cache'],
['53', 'parkngrab', 'Park and grab'],
['54', 'AbandonedBuilding', 'Abandoned structure'],
['55', 'hike_short', 'Short hike (less than 1km)'],
['56', 'hike_med', 'Medium hike (1 km-10 km)'],
['57', 'hike_long', 'Long hike (more than 10km)'],
['58', 'fuel', 'Fuel nearby'],
['59', 'food', 'Food nearby'],
['60', 'wirelessbeacon', 'Wireless beacon'],
['61', 'partnership', 'Partnership cache'],
['62', 'seasonal', 'Seasonal access'],
['63', 'touristOK', 'Recommended for tourists'],
['64', 'treeclimbing', 'Tree climbing required'],
['65', 'frontyard', 'Yard (private residence)'],
['66', 'teamwork', 'Teamwork cache'],
['67', 'geotour', 'GeoTour'],
['69', 'bonuscache', 'Bonus cache'],
['70', 'powertrail', 'Power trail'],
['71', 'challengecache', 'Challenge cache'],
['72', 'hqsolutionchecker', 'Geocaching.com solution checker']
];
/*
// TEST Anfang
// test3
jQuery(function($) {
alert("3. jQuery: " + $.fn.jquery);
});
// test2
if (typeof unsafeWindow.jQuery !== "undefined") {
unsafeWindow.jQuery(function($) {
alert("2. unsafeWindow.jQuery: " + $.fn.jquery);
});
} else {
alert("2. unsafeWindow.jQuery not available");
}
// test1
alert("1. $: " + $.fn.jquery);
// TEST ENDE
*/
/* greasemonkey settings and functions */
// debug output functions
function toLog(typ, msg) {
if (DEBUG_MODE) {
if (console && console[typ] && console.group && console.groupEnd) {
if (typ !== 'time') console.group('GCTour');
console[typ](msg);
if (typ !== 'time') console.groupEnd();
} else {
GM_log(typ + ": " + msg.toString());
}
}
}
function log(msg) {
toLog("log", msg);
}
function debug(msg) {
toLog("debug", msg);
}
function warn(msg) {
toLog("warn", msg);
}
function error(msg) {
toLog("error", msg);
}
function info(msg) {
toLog("info", msg);
}
function table(msg) {
toLog("table", msg);
}
function log_exception(ex) {
toLog("exception", ex);
}
function log_timeStart(msg) {
toLog("time", "time for "+msg);
}
function log_timeEnd(msg) {
toLog("timeEnd", "time for "+msg);
}
// wrapper for properly alerting objects
function alertObject(obj) {
alert(JSON.stringify(obj, null, 4));
};
// wrapper functions for persistence
function saveValue(name, value) {
GM_setValue(name, JSON.stringify(value));
}
function loadValue(name, defaultValue) {
//debug("loadValue: '" + name + "', with default '" + defaultValue + "' (typeof " + (typeof defaultValue) + ")");
var result = GM_getValue(name, "");
//debug("loadValue: result -> '" + result.substr(0, 20) + "...'");
try {
return result != "" ? JSON.parse(result) : defaultValue;
} catch (e) { // fallback eval
debug("loadValue: FALLBACK :-(");
return eval(result);
}
}
// GM_xmlhttpRequest response info
function responseInfo(r) {
debug([ "",
"finalUrl: \t\t" + (r.finalUrl || "-"),
"status: \t\t" + (r.status || "-"),
"statusText: \t" + (r.statusText || "-"),
"readyState: \t" + (r.readyState || "-"),
"responseHeaders: " + (r.responseHeaders.replaceAll('\r\n',";") || "-"),
"responseText: \t" + (r.responseText || "-")
].join("\n"));
}
// set jquery and ui
(function() {
var str = "";
str += "jQuery und UI geladen = " + IS_JQUERY;
if (IS_JQUERY) {
str += "\n\tjQuery Version = " + $.fn.jquery;
str += "\n\tjQueryUI Version = " + $.ui.version;
}
// str += "\n\tisunsafeWindow.jQuery = " + isjQueryWindow;
// str += "\n\tunsafeWindow.jQuery Version = " + ((isjQueryWindow) ? unsafeWindow.jQuery.fn.jquery : "");
// debug(str);
// init gctour object
$.gctour = $.gctour || {};
// init language object
$.gctour.i18n = $.gctour.i18n || {};
// set default Language
$.gctour.defaultLang = 'en';
// init current language = default language
$.gctour.currentLang = $.gctour.defaultLang;
// jquery ui dialog (default setting)
$.gctour.dialog = $.gctour.dialog || {};
// default dialogs (http://api.jqueryui.com/dialog/)
$.extend($.gctour.dialog, {
buttons: {
'OK': {
text: 'OK',
disabled: false,
click: function() {
$(this).dialog("close");
}
},
'Schliessen': {
text: 'Schliessen',
disabled: false,
icons: {
primary: 'ui-icon-closethick'
},
click: function() {
$(this).dialog("close");
}
},
'Abbrechen': {
text: 'Abbrechen',
disabled: false,
click: function() {
$(this).dialog("close");
}
}
},
/*
* Standard Optionen für ein Dialog
*/
basis: function() {
return ({
autoOpen: false,
resizable: true,
closeOnEscape: true,
modal: true,
closeText: $.gctour.lang('btn.Schliessen') || 'Schliessen',
show: 'drop', // blind, drop, scale
buttons: {
'Schliessen': this.buttons.Schliessen
},
width: 700,
height: 500,
minWidth: 300,
minHeight: 200,
maxWidth: 1000,
maxHeight: 700,
title: 'GCTour',
dialogClass: 'gct gct_dialog',
open: function(event, ui) {
//$(".ui-dialog-titlebar-close").hide();
// $(this).dialog( "widget" ).find(".ui-dialog-titlebar-close").hide(); // x oben rechts ausblenden
//$(".ui-widget-overlay").wrap('<div class="gct"></div>'); // wrap für bessere Trennung zu gc.com
},
beforeClose: function(event, ui) {
//if ( $(".ui-widget-overlay").parent().hasClass( "gct" ) ) {
// $(".ui-widget-overlay").unwrap();
//}
},
close: function(event, ui) {
$(this).dialog("destroy"); // diesen Dialog killen, weil immer ein neuer erstellt wird
}
});
},
/*
* Info Optionen für ein Dialog
*/
info: function() {
return ({
autoOpen: true,
resizable: true,
closeOnEscape: true,
modal: true,
closeText: $.gctour.lang('general.close'),
show: true, // true, false, 'blind', 'drop', 'scale'
hide: true,
height: 'auto',
title: 'GCTour Info',
dialogClass: 'gct gct_dialog',
open: function(event, ui) {
addJqUiTheme(GM_getValue('theme', 'smoothness'));
// remove interfering rules from GS stylesheet "coreCSS" (present on (old) dashboard page and others)
var sheet = getStyleSheet("coreCSS");
if(typeof sheet !== "undefined") {
DELETED_STYLESHEET_RULES = deleteStyleSheetRules(sheet,/.ui-|select/);
debug(DELETED_STYLESHEET_RULES.length + ' rules in stylesheet "coresCSS" temporarily removed');
}
},
close: function(event, ui) {
// remove jqui theme
$("head link#gct-ui-theme-link").remove();
// restore deleted stylesheet rules (if necessary)
var sheet = getStyleSheet("coreCSS");
if(typeof sheet !== "undefined") {
for (var i=0; i<DELETED_STYLESHEET_RULES.length; i++) {
sheet.insertRule(DELETED_STYLESHEET_RULES[i], sheet.cssRules.length);
}
debug(DELETED_STYLESHEET_RULES.length + ' rules in stylesheet "coresCSS" restored');
DELETED_STYLESHEET_RULES = [];
}
}
});
}
});
$.fn.addShadowEffect = function() {
return this.each(function() {
$(this).bind({
mouseenter : function() {
$(this).addClass("imgShadow");
},
mouseleave : function() {
$(this).removeClass("imgShadow");
}
});
});
};
$.fn.addOpacityEffect = function() {
return this.each(function() {
var $this = $(this);
$this
.css({
opacity : "0.5"
})
.bind({
mouseenter : function() {
$this.stop().animate({
opacity : '1'
}, 300);
},
mouseleave : function() {
$this.stop().animate({
opacity : '0.5'
}, 300);
}
});
});
};
})();
/* images */
$.gctour.img = {
addToTour : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A%2FwD%2FoL2nkwAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9kFFAUXKNiDRngAAAJmSURBVDjLjZPPS1RRFMc%2F972n1qiUpqMRaj8UXPVj46Igw0WrKIKkwEWSCC4jjKLoX5BoU5GUJg6KFrVpFYiBEAouAkH0Of4endHRKSSY53v3tHgzbyxddFb3Xu753O%2F3nHMVwOBw5LpSvBQtFQIggpAJkV1lGCOe53a13Ln7lYNicKg%2FtrWdlIMinU7LenxNPn4e%2Ft0%2F8P7Jv7kGgOu6x48eKWEzmWA9ESMWX2FlbYml1XnimzF%2BplLcuHbzcEW48mlfpOfxPoAWQRBcz2XWnsWetbFtmzl7jpmZWaILUQzD4MrlplBB%2FqFn73q7G7MAC0C0BgHPc6mprvaBotGiEa1ZXl7hw6ch8q0Czp09H%2Fo%2BPtYJjAYArTUArreLbUcR0YgIon2QJ5q8vDzCleUopXB33atv3r6y2u91uFbWgg%2FQVFdXAeIDBH5cbMTZ2AQgXV5GQzzB6LcRU0RbgJuzkGnfQnQeUf4awNnY5FJbGyjFWHc3%2FoMa0cI%2BC0opTp05jVIqqPJGVqEEk4FoHajOAPyNaZoszi%2BSuHUbN7nlXwiFfIVKkVdYSMQwKAJTGcYiUGFlJfkAi9q6WmLJLRpaW4MXdUbRhebm4Gy8pyf8dxsVWIaJPb8AwK%2BpKf4nAgsKMAyTuro61sNhpicmAMgvKuJkfT0AC9PTODs7mRE0EmjNHgsK0zQBaJqeyhRS8aXkWFAwZ2eHFtE8f9HliUgN9x%2F6AMu0Vre2kydKS8vI1T%2B30ns6kEqlsCwznk476cCC4zjtA4OR147jVOV%2BsZ9UXlxMdHLSBxUX09vXs%2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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACUALAAAAAASABIAAAZ4wJJwSCwaj8gjaZkcLp9QJOkhGHgACM2EQzJCv9EiaQSKBEQGAiHT9Y5IGFKBpCAB2uJ3gNQgOUgfeEQkCyR7EmN0gk4PJAl8iQyLQiQHjnKRkyWEhiQCfiQbmiQVJAMkFyQGJBSjCAAHISMAHRAWmptgTE28vUdBADs%3D',
dialogMask : 'data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%08%00%00%00%08%08%06%00%00%00%C4%0F%BE%8B%00%00%00%01sRGB%00%AE%CE%1C%E9%00%00%00%06bKGD%00%FF%00%FF%00%FF%A0%BD%A7%93%00%00%00%09pHYs%00%00%0E%C4%00%00%0E%C4%01%95%2B%0E%1B%00%00%00%07tIME%07%DB%03%17%0C%03%0F%8C%CB%E4%8C%00%00%00%19tEXtComment%00Created%20with%20GIMPW%81%0E%17%00%00%00%26IDAT%18%D3c%F8%FF%FF%FF%FFMW%3E%FF%C7E3%FC%87%02%98%20%3A%9F%81%A0%09%B8t%C2%00%C3%20p%03%00%DA%B4%F2%A1%8A%CD%18%A3%00%00%00%00IEND%AEB%60%82',
downArrow : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAOCAMAAADKSsaaAAAAAXNSR0IArs4c6QAAAKhQTFRFEnMAFXUAIncAHXoDHnoHIHsAInwGI30AKH4TK4AAM4UGMYYLO4oQQ44VRI4XSZAbUZYhVpcnWpooYZ0wXZ45Yp4wW587ZJ4wXqBCZ6A0ZqA4YaJFaqI2baI4ZaRHZ6RFbaQ%2BbqQ8c6pOe65UgLJZf7JggbRmhLVlhLVpiLdqjbluj7tzlcB%2FlsGBl8GCncSHoMWJoMeJpMiMqMqPp8uPqcuQrM2Tr86VayLUTgAAAAF0Uk5TAEDm2GYAAAABYktHRACIBR1IAAAACXBIWXMAAAsRAA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OjL/NOd/5znc4oCx+r8VEKbMpZaZPfflJucAu4XhKkdN2P/11/ljT5fFXH21pEQWWozmBYGRDTCQ2Ry3neoG2xuND2YefvZvbCoRC60TEiSSd7Gbkk5a0iIiiCon8f6ZnYJyInM1nLtVUVwpul6TCW4CZXxH/6KSbra8shRv275U4JBWWCwVOSFQ4ODTqUqQUd+wxNOgGMhZKdu18MLYQnFrYd7jhfOsRboCbSMrgPlSUFwMQuE4qBzPATCQk1NcU3715Eigtq6vlADPBLWgWZAZV47ENUVBNKEw3bM+ADMSSKmCCSAO4Dm7AtMA0iBIDBCEtZdLyX2bAAJgODjicAqA7HEQAJxgAB2Rmvn0/XeLzuAS3G0AsKhZXlTgEKMDMbAjwzv6Ifw+zAo+Hc6QSmfVw6Mmj5/Fvw0LbiYOri3/cTh4JJ00TgXktIfo67nefbW95PRllHElRWVoJ9t4ZbD16AICDiAA8fPwGgFFUXVReUVVb6dkheIsQXM6sBtfm5gITIxPNhxr8/Te2Ajad1/sionqhs62wtBrAxNMXY/6Rxrqyxvrd9jYA0DZOXe3vGfv8QaWmjr6LXbfyXBe28bKv6/S1gaji8lVUIZXKc3Neyqb9ym3T7R2+1503/wcT3Lkk5CgrKAAAAABJRU5ErkJggg==',
loader2 : 'data:image/gif;base64,R0lGODlh0AANAKUAAP///wAAAL6+vqamppycnLi4uLKyssjIyNjY2MTExNTU1Nzc3ODg4OTk5LCwsLy8vOjo6Ozs7MrKyvLy8vT09M7Ozvb29sbGxtDQ0O7u7tbW1sLCwqqqqvj4+KCgoJaWlv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAfACwAAAAA0AANAAAG/sCPYEAoGo/IpHLJbDqf0Kh0Sq1anwOBsGBwGB5gQWHA8Zq92Y16PSyf0Y+EfL5xd++ONF1Oxt/1e3Z+gHSCZ4Rzhn9xe3Vvi40bfX4GiHyKlYyBj3BiYQVDAl8SFRgKCp6pAhugGq4IsAgbX2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lhVM7fvdXx29qrhgX7Dg32G271OHv3dxg09entSvXnqmXcHJGm/6Ru/ad89dmrm9AdXIK9D+GLq4rXJqYvXtmEzNmMTNmGor6fV6utr6YxWfvjzR0P/vDGTh7GvAP4H2uh1wse2x/0AAAAASUVORK5CYII%3D',
add_comment : GS_HOST + 'images/stockholm/16x16/add_comment.gif',
attribute_blank : GS_HOST + 'images/attributes/attribute-blank.png',
bearing : GS_HOST + 'images/icons/compass/###BEARING###.gif',
cache_size : GS_HOST + 'images/icons/container/###SIZE###.gif',
coord_update : GS_HOST + 'images/icons/coord_update.gif',
fav : GS_HOST + 'images/icons/icon_fav.png',
stars_d : GS_HOST + 'images/stars/stars###DIFFICULTY###.gif',
stars_t : GS_HOST + 'images/stars/stars###TERRAIN###.gif',
tb_coin : GS_HOST + GS_WPT_IMAGE_PATH + 'tb_coin.gif',
wpt_type : GS_HOST + GS_WPT_IMAGE_PATH + '###TYPE###.gif',
sad : HTTP + '//forums.geocaching.com/GC/public/style_emoticons/default/sad.gif'
// not used
//closedHand: 'data:image/x-icon;base64,AAACAAEAICACAAcABQAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA%2F%2F%2F%2FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA%2FAAAAfwAAAP%2BAAAH%2FgAAB%2F8AAAH%2FAAAB%2FwAAA%2F0AAANsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2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F%ED%EE%FE%EE%EE%FE%F0%F0%FE%F0%F0%FF%F1%F1%FF%F2%F2%FE%F2%F2%FF%F2%F3%FD%F3%F3%FE%F3%F3%FF%F4%F4%FF%F5%F5%FE%F5%F5%FF%F6%F6%FE%F8%F8%FD%F9%F9%FE%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%FE%11Created%20with%20GIMP%00!%F9%04%01%0A%00%7F%00%2C%00%00%00%00%0F%00%0D%00%00%07%85%80%7F%82%83%84%85%86%83%0E%17%09%87%83%12%1E1%2B%1C%03%86%06%18%25AR2%2C5%14%84%0B%19(FVbL-%40C%26%93%7F%0F%22%3BM%5Ded47JKG%16%82%15%20%1F%23)30%2FQSUW*%02%7F%13.9%3E%3D%3C%3ANY%5C_%5EE%07%82%1BDHPTX_bcO\'%0D%00%82%108PUZ%60aI%24%0C%01%85!U%5B%5BB%1D%08%8C%11%3F6%1A%05%8C%83%0A%08%FC%0B%04%00%3B',
//preview: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQoAAAB4CAYAAAAKVry3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAKbAAACmwB9fwntgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7L15jKRnft%2F3%2FT3P895v3X0fczSHQ84MzyV3V1RE7W68sODE3iQOZq1AkJHDIATIGyQIEgQI4plBBERBpChZO3KWsOFAtuCEYzgRvJEcaANRkiWvY2kpc3nskHP23V131Xu%2Fz5E%2Fqqs5wz14zCx3FqkP8KKqp4vset%2B369u%2F%2B0fGGMyYMWPGD4L9qN%2FAjBkzHn5mQjFjxowPZCYUM2bM%2BEBmQjFjxowPRPyo38BHgYju%2BfL7ve7y5csAgEuX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x5DnQwLY9RvwPefrMJZ0%2BQmbTnj6BUZLEMFOc5e3GOiZJQLIop0l0vh9dDL0IisdGeV5bRtX0CZyUU0%2BSeHT%2FvgJRFJL20ttG7fxmShj2OFg4TLvTxkk5dccYWfj29jd34yQefm9mA%2BDYzppBFv4FO4Au%2FTAT%2FmYAAAAASUVORK5CYII%3D',
//zoom_in : GS_HOST + 'images/zoom_in.png',
//zoom_out : GS_HOST + 'images/zoom_out.png',
};
/* translations */
$.gctour.i18n.de = {
'name': 'Deutsch',
'general': {
'save': 'Speichern',
'copy': 'kopieren',
'cancel': 'Abbrechen',
'close': 'Schließen',
'edit': 'bearbeiten',
'rename': 'umbenennen',
'delete': 'löschen',
'load': 'laden',
'install': 'Installieren',
'findMe': 'Finde mich!',
'exampleCoords': 'z.B. N49° 26.082 E7° 46.587 oder 49.434701 7.776446',
'notLoggedIn': 'Sie müssen sich auf einer Seite von geocaching.com befinden und dort angemeldet sein.',
'pleaseWait': 'Bitte warten - Daten werden geladen...'
},
'container': {
'toolbar': {
'newList': 'Neue Tour erstellen',
'openTour': 'Eine Tour laden',
'downloadTour': {
'caption': 'Tour runterladen',
'webcodeDownloadHelp': 'Bitte gib hier den Webcode an, den du von deinem Freund bekommen hast und drücke dann auf "Tour runterladen".',
'webcodeerror': 'Der angegebene Webcode existiert leider nicht!',
'webcodesuccess': ' wurde erfolgreich geladen!',
'webcodeOld': '\n !!ACHTUNG!!\nEs handelt sich bei diesem Webcode um eine alte Tour. Um sie auch mit den Vorzügen von GCTour 2.0 nutzen zu können musst du sie bitte jetzt erneut hochladen.'
},
'showSettings': 'Einstellungen anzeigen',
'saveSettings': 'Touren und Einstellungen sichern'
},
'tourHeader': {
'sendToGps': 'an GPSr senden',
'downloadGpx': 'GPX downloaden',
'saveAsBookmarklist': {
'title': 'als Bookmarkliste speichern (PMO)',
'caption': 'Tour als Bookmarkliste speichern',
'success': 'Tour als Bookmarkliste gespeichert',
'up-to-date': 'Die Bookmarkliste der Tour ist auf dem neusten Stand',
'duplicate': 'Die Bookmarkliste dieser Tour wurde bereits angelegt',
'added': 'Der Bookmarkliste hinzugefügt',
'removed': 'Von der Bookmarkliste entfernt'
},
'makeMap': {
'caption': 'auf Karte anzeigen',
'wait': 'Verfügbarkeit der Karte wird getestet.'
},
'upload': {
'caption': 'Tour hochladen',
'tourUploaded1': '<br>Tour erfolgreich hochgeladen! Der Webcode lautet:<br><b>',
'tourUploaded2': '</b><br><br>Die Onlineabfrage kann unter <a href="' + GCTOUR_HOST + 'tour/xWEBCODEx" target="_blank">' + GCTOUR_HOST + 'tour/xWEBCODEx</a> geschehen.<br><br>',
'tourUploadPMO': 'PM Only Caches (nicht zu verarbeiten)',
'tourUploadRetracted': 'Caches mit ungültigem GC Code (nicht zu verarbeiten)'
},
'addOwnWaypoint': 'eigenen Wegpunkt hinzufügen',
'sortAlphabetically': 'alphabetisch sortieren'
},
'cacheList': {
'logYourVisit': 'logge deinen Besuch',
'moveToList': 'in andere Tour verschieben',
'removeFromList': 'aus Tour entfernen'
}
},
'settings': {
'caption': 'Einstellungen',
'language': {
'header': 'Sprache',
'select': 'Sprache wählen'
},
'printview': {
'header': 'Druckansicht',
'printMinimal': 'Minimierte Druckansicht',
'printMinimalDesc': 'Beinhaltet nur noch Hint und Spoiler zu jedem Geocache.',
'logCount': 'Anzahl der Logs in Druckansicht',
'logCounts': ['keine', 'alle', 'anzeigen'],
'fontSize': 'Schriftgr&ouml;&szlig;e',
'decryptHints': 'Hints entschlüsseln',
'decryptHintsDesc': 'Die Hinweise werden schon mittels Rot13 in der Druckansicht entschlüsselt.',
'editDescription': 'Beschreibung editierbar',
'editDescriptionDesc': 'Die Beschreibung lässt sich komplett nach eigenem Belieben anpassen.',
'showSpoiler': 'Spoiler Bilder anzeigen',
'showSpoilerDesc': 'Es werden die Spoiler mitgedruckt.',
'additionalWaypoints': 'Eigene Wegpunkte anzeigen',
'additionalWaypointsDesc': 'In der Druckansicht findet sich eine Tabelle mit allen "eigenen Wegpunkten".',
'additionalWaypoints2': 'Eigene Wegpunkte auf Titelseite einsortieren',
'additionalWaypoints2Desc': 'Eigene Wegpunkte werden auf der Titelseite in die Cache-Tabelle einsortiert. Ansonsten wird eine eigene Tabelle angelegt.',
'loggedVisits': 'Log-Counter anzeigen',
'loggedVisitsDesc': 'Eine Übersicht wie oft der Geocache schon gefunden wurde.',
'pageBreak': 'Seitenumbruch nach Geocache',
'pageBreakDesc': 'Es wird nach jedem Geocache eine neue Seite angefangen. Sieht man erst beim Ausdrucken.',
'pageBreakAfterMap': 'Seitenumbruch nach Übersichtskarte',
'pageBreakAfterMapDesc': 'Es wird ein Seitenumbruch nach der Übersichtseite hinzugefügt, um das Deckblatt abzuheben.',
'frontPage': 'Titelseite',
'frontPageDesc': 'Es wird eine Titelseite erzeugt mit allen Geocaches, Index und Platz für Notizen.',
'outlineMap': 'Übersichtskarte für alle Caches',
'outlineMapDesc': 'Auf der Titelseite wird eine Karte mit allen Geocaches in der Tour angezeigt.',
'outlineMapSingle': 'Übersichtskarte für jeden Cache',
'outlineMapSingleDesc': 'Unter jedem Geocache erscheint eine Karte mit seinen "Additional Waypoints".',
'showCacheDetails': 'Cache-Listings und eigene Wegpunkte drucken',
'showCacheDetailsDesc': 'Alle Geocache-Listings und eigene Wegpunkte der Tour werden mitgedruckt (wenn deaktiviert, wird nur die Titelseite gedruckt).',
'printCacheTableD': 'Spalten in Cachetabelle auf der Titelseite auswählen',
'printCacheTableDDesc': 'Auf der Titelseite können hier Spalten der Cachetabelle ausgewählt werden. Nur ausgewählte Spalten werden gedruckt.<br>'
},
'map': {
'header': 'Karte',
'type': 'Standard Kartentyp',
'types': {
'OSM Mapnik': 'mapnik',
'OSM DE': 'osmde',
'OSM Fahrrad': 'osmaC',
'OSM Outdoors': 'osmaO',
'OSM ÖPNV': 'osmaP',
'Topo Deutschland': 'oda',
'Google Karte': 'roadmap',
'Google Satellit': 'satellite',
'Google Hybrid': 'hybrid',
'Google Gelände': 'terrain'
},
'size': 'Standard Kartengröße',
'geocacheid': 'Geocache Code anzeigen',
'geocacheidDesc': 'Es wird immer der GCCode (z.B. GC0815) mit auf der Karte angezeigt.',
'geocachename': 'Geocache Namen anzeigen',
'geocachenameDesc': 'Der Name eines Geocaches wird zusätzlich mit eingeblendet.',
'geocacheindex': 'Geocache Index anzeigen',
'geocacheindexDesc': 'Die Postion innerhalb der Tour wird mit angezeigt.',
'awpts': 'Additional Waypoints anzeigen',
'awptsDesc': 'Wenn aktiviert, dann werden die "Additional Waypoints" eines Geocaches mit angezeigt.',
'awpt_name': 'Additional Waypoints Namen einblenden',
'awpt_nameDesc': 'Der Name eines "Additional Waypoints" wird mit angezeigt.',
'awpt_lookup': 'Additional Waypoints Lookup einblenden',
'awpt_lookupDesc': 'Der Lookupcode eines "Additional Waypoints" wird mit angezeigt.',
'owpts': 'Eigene Wegpunkte einblenden',
'owptsDesc': 'Wenn du "Eigene Wegpunkte" mit in deiner Tour hast, so werden diese auch mit auf der Karte angezeigt.',
'owpt_name': 'Namen eigener Wegpunkte anzeigen',
'owpt_nameDesc': 'Zusätzlich kann man sich noch den Namen zu jedem Wegpunkt anzeigen lassen.'
},
'gpx': {
'html': 'Beschreibung mit HTML',
'htmlDesc': 'Manche Geräte/Programme haben Probleme beim Anzeigen eines Geocaches mit HTML-Formatierung. Wenn du nur noch kryptische Beschreibungen siehst, dann bitte diese Option deaktivieren.',
'wpts': 'Additional-Waypoints exportieren',
'wptsDesc': 'Additional-Waypoints werden als extra Wegpunkt mit in die GPX exportiert. Damit hat man jeden Parkplatz direkt auf dem Gerät.',
'attributesToLog': 'Cache-Attribute als erster Logeintrag',
'attributesToLogDesc': 'Cache Attribute werden zusätzlich als erstes Log eingetragen.',
'stripGC': 'Entferne "GC" in GC-Code',
'stripGCDesc': 'Alte Geräte haben Probleme mit Wegpunkten, deren Namen länger als 8 Zeichen sind. Wenn du so ein altes Garmin hast, dann bitte diese Option anwählen!',
'maxLogCount': 'Max. Anzahl der Logs',
'prefixFavScore': 'Zeige den Prozentwert der Favoritenpunkte vor dem Cachenamen',
'prefixFavScoreDesc': 'Im Geocaching-Menü des GPSr wird vor dem Cachenamen der Prozentwert der Favoritenpunkte angezeigt (z.B. "8%GC10000 - A New Beginning"). Damit lässt sich leicht erkennen, wie ein Cache bewertet wurde.'
},
'theme': {
'select': 'Theme wählen'
},
'exportimport': {
'export': 'Export der GCTour-Einstellungen (inklusive aller Touren)',
'import': 'Import der GCTour-Einstellungen (inklusive aller Touren)'
}
},
'autoTour': {
'wait': 'Bitte warten - autoTour wird erzeugt!',
'radius': 'Radius',
'center': 'Mittelpunkt',
'refresh': 'Vorschau aktualisieren',
'cacheCounts': 'Geocaches',
'maxCaches': 'Geocaches: ###NHITS### | Maximum: '+AUTOTOUR_MAX_CACHES+'<br>Die ersten '+AUTOTOUR_MAX_CACHES+' werden gespeichert.',
'duration': 'Dauer',
'filterLabel': 'Filter',
'filter': {
'type': 'Typ',
'size': 'Größe',
'difficulty': 'Schwierigkeit',
'terrain': 'Gelände',
'special': {
'caption': 'Spezial',
'pm': {
'all': 'Alle',
'basic': 'Keine PM only',
'premium': 'PM only'
},
'notfound': 'Nicht gefunden',
'isActive': 'Aktiv',
'minFavorites': 'Mindestzahl Favoriten'
}
}
},
'dlg': {
'newVersion': {
'caption': 'Neue Version verfügbar',
'content': 'Es gibt eine neue Version von GCTour.\nZum update gehen? \n\n', //ohne Anwendung
'changelog': 'Neue GCTour-Version ' + VERSION + ' installiert. Übersicht der Änderungen: '
},
'error': {
'content': '<img src="' + $.gctour.img.sad + '">&nbsp;&nbsp;Leider ist ein Fehler aufgetreten!<br/>' +
'Versuch es einfach noch einmal oder suche nach einem <a href="#" id="gctour_update_error_dialog">Update</a>!<br/><br/>'
}
},
'notifications': {
'addgeocache': {
'success': {
'caption': '{0} wurde hinzugefügt!',
'content': '<b>{0}</b> enthält jetzt auch <b>{1}</b>.'
},
'contains': {
'caption': '{0} wurde <i>nicht</i> hinzugefügt!',
'content': '<b>{0}</b> enthält <b>{1}</b> schon.'
}
}
},
'units': {
'km': 'Kilometer',
'mi': 'Meilen'
},
'send2cgeo': {
'title': 'an c:geo senden',
'noWP': 'ohne eigene Wegpunkte',
'usage': '<li>c:geo auf dem Mobilgerät starten und in eine Cacheliste wechseln</li>' +
'<li><i>Menü → Importieren → Importiere von send2cgeo</i></li>' +
'<li>Die Tour (ohne eigene Wegpunkte) wird automatisch in die ausgewählte Liste geladen</li>' +
'<li>c:geo wartet noch 3 Minuten, um weitere Caches herunterzuladen</li>',
'overview': 'Übersicht',
'setup': {
'header': 'Setup',
'registerBrowser': 'Hier klicken um den Browser für Send2cgeo zu registrieren',
'desc1': '<li>c:geo auf dem Androidgerät starten, dann <i>Menu → Einstellungen → Dienste → Send to c:geo</i></li>' +
'<li><i>Registrierung anfordern</i> wählen, es öffnet sich ein Fenster mit einer fünfstelligen PIN</li>',
'desc2': 'PIN hier eingeben:',
'desc3': 'PIN senden und damit Gerät hinzufügen'
},
'register': 'Browser noch nicht für Send2cgeo registriert - bitte zum "Setup" Tab wechseln und den Browser registrieren.',
'senderror': 'Ein Fehler ist aufgetreten, bitte später noch einmal versuchen.'
},
'marker': {
'coord': 'Koordinaten',
'content': 'Inhalt',
'contentHint': 'wird in Druckansicht angezeigt',
'type': 'Typ'
},
'update': {
'dialog': '<div><p>Es ist eine neue Version von <a target="_blank" href="' + GCTOUR_HOST + '"><b>GCTour</b></a> verf&uuml;gbar.</p><p>Du verwendest Version <b>###VERSION_OLD###</b>, die aktuellste Version ist <b>###VERSION_NEW###</b>.</p><div class="dialogFooter"></div>',
'upToDate': 'GCTour ' + VERSION + ' ist aktuell!'
},
'printview': {
'found': 'Fund',
'note': 'Notiz',
'marker': 'Eigene Wegpunkte',
'removeMap': 'Karte entfernen',
'zoomMap': 'Diese Karte in einem neuem Tab öffnen.',
'dontPrintHint': '<b>Hinweis:</b><br/>Elemente in einem solchen Kasten werden <u>nicht</u> mit gedruckt!',
'reloadMap': 'Karte neu laden',
'print': 'Druck starten',
'mapHeight': 'Höhe',
'printWidth': 'Breite'
},
'cache': {
'addToTour': 'Zur Tour hinzufügen',
'directPrint': 'Drucke diesen Geocache',
'moveCoords': 'Verschiebe die Koordinaten',
'movedCoords': 'Die Koordinaten zu diesem Geocache wurden verschoben!',
'moveCoordsHelp': 'Hier hast du die Möglichkeit die original Koordinaten dieses Geocaches durch neue zu ersetzen. Diese werden dann in der Druckansicht, wie auch in der GPX verwendet. Praktisch bei der Lösung eines Mysteries.',
'deleteCoords': 'Koordinaten löschen',
'originalCoords': 'Originale Koordinaten',
'newCoords': 'Neue Koordinaten',
'addToCurrentTour': 'Zur <b>aktuellen</b> Tour hinzufügen',
'addToNewTour': 'Zu <b>neuer</b> Tour hinzufügen',
'shown': 'Angezeigte Caches',
'marked': 'Markierte Caches',
'all': 'Alle Caches'
},
'tour': {
'newDialog': 'Bitte gib einen Namen für die neue Tour ein ...',
'copy': 'Tour kopieren',
'copyNameAppendix': 'Kopie',
'delete': 'diese Tour löschen',
'deleteDialog': 'Soll die Tour wirklich gelöscht werden?',
'empty': 'Die Tour ist leer.'
}
};
$.gctour.i18n.en = {
'name': 'English',
'general': {
'save': 'Save',
'copy': 'copy',
'cancel': 'Cancel',
'close': 'Close',
'edit': 'Edit',
'rename': 'Rename',
'delete': 'delete',
'load': 'load',
'install': 'Install',
'findMe': 'Find me!',
'exampleCoords': 'e.g. N49° 26.082 E7° 46.587 or 49.434701 7.776446',
'notLoggedIn': 'You must be on a geocaching.com page and logged in there.',
'pleaseWait': 'Please wait - loading data ...'
},
'container': {
'toolbar': {
'newList': 'New tour',
'openTour': 'Load a tour',
'downloadTour': {
'caption': 'Download Tour',
'webcodeDownloadHelp': 'Please enter here the webcode you receive from your friend and click on "Download tour".',
'webcodeerror': 'The choosen webcode does not exist!',
'webcodesuccess': ' was successfully loaded!',
'webcodeOld': '\n !!ATTENTION!!\nThis webcode is connected with an old tour. To get all benefits of GCTour 2.0 you must upload this tour again.'
},
'showSettings': 'Show settings',
'saveSettings': 'Backup tours and settings',
'homepage': 'GCTour Home'
},
'tourHeader': {
'sendToGps': 'Send to GPSr',
'downloadGpx': 'Download GPX',
'saveAsBookmarklist': {
'title': 'Save as bookmark list (PMO)',
'caption': 'Save tour as bookmark list',
'success': 'Tour saved as bookmark list',
'up-to-date': 'The bookmark list for this tour is up-to-date',
'duplicate': 'A bookmark list for this tour already exists',
'added': 'Added to bookmark list',
'removed': 'Removed from bookmark list'
},
'makeMap': {
'caption': 'View on map',
'wait': 'Testing availablity of this map'
},
'upload': {
'caption': 'Upload Tour',
'tourUploaded1': '<br>Uploading tour was successful! Webcode:<br><b>',
'tourUploaded2': '</b><br><br>You can view the tour at <a href="' + GCTOUR_HOST + 'tour/xWEBCODEx" target="_blank">' + GCTOUR_HOST + 'tour/xWEBCODEx</a>.<br><br>',
'tourUploadPMO': 'Skipped PM only Caches',
'tourUploadRetracted': 'Skipped caches with invalid GC code'
},
'addOwnWaypoint': 'Add own waypoint',
'sortAlphabetically': 'Sort alphabetically'
},
'cacheList': {
'logYourVisit': 'Log your visit',
'moveToList': 'Move to another tour',
'removeFromList': 'Remove from tour'
}
},
'settings': {
'caption': 'Settings',
'language': {
'header': 'Language',
'select': 'Select language'
},
'printview': {
'header': 'Printview',
'printMinimal': 'Minimal printview',
'printMinimalDesc': 'This contains only the hint and spoiler of a geocache.',
'logCount': 'Number of logs in printview',
'logCounts': ['none', 'all', 'show'],
'fontSize': 'Font size',
'fontSizes': ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'],
'decryptHints': 'Decrypt hints',
'decryptHintsDesc': 'Hints will be already decrypted in the printout.',
'editDescription': 'Description editable',
'editDescriptionDesc': 'The description can be edited in the way you want it.',
'showSpoiler': 'Display spoiler',
'showSpoilerDesc': 'Spoiler images will be on the printout.',
'additionalWaypoints': 'Show additional waypoints',
'additionalWaypointsDesc': 'The printview will contain a table with all "Additional waypoints" from a geocache.',
'additionalWaypoints2': 'Add own waypoints to cache table',
'additionalWaypoints2Desc': 'Own waypoints will be added to the cache table on front page. Otherwise an extra table will be added.',
'loggedVisits': 'Show log counter',
'loggedVisitsDesc': 'This will show the "Find counts" overview.',
'pageBreak': 'Page break after cache',
'pageBreakDesc': 'After each geocache there will be a page break. Visiable after printing.',
'pageBreakAfterMap': 'Page break after map',
'pageBreakAfterMapDesc': 'It will be a page break after the overview to separate it from the geocaches.',
'frontPage': 'Front page',
'frontPageDesc': 'An overview will be generated containing the complete list of geocaches including index and space to take notes. ',
'outlineMap': 'Outline map for all caches',
'outlineMapDesc': 'The overview will contain a map with all geocaches.',
'outlineMapSingle': 'Outline map for every cache',
'outlineMapSingleDesc': 'After each geocache a map containing the geocache and its "Additional waypoints" will be shown.',
'showCacheDetails': 'Print cache listings and own waypoints',
'showCacheDetailsDesc': 'All geocache listings and own waypoints will be printed (if not set just the front page will be printed).',
'printCacheTableD': 'Select cache table columns on front page',
'printCacheTableDDesc': 'Cache table columns can be selected on front page. Only selected columns will be printed.<br>'
},
'map': {
'header': 'Map',
'type': 'Default map type',
'types': {
'OSM Mapnik': 'mapnik',
'OSM German style': 'osmde',
'OSM Cycle': 'osmaC',
'OSM Outdoors': 'osmaO',
'OSM Public Transport': 'osmaP',
'Topo Germany': 'oda',
'Google Map': 'roadmap',
'Google Satellite': 'satellite',
'Google Hybrid': 'hybrid',
'Google Terrain': 'terrain'
},
'size': 'Default map size',
'sizes': ['large', 'medium', 'small'],
'geocacheid': 'Show geocache id',
'geocacheidDesc': 'The GCCode (eg. GC0815) will be shown on the map.',
'geocacheindex': 'Show geocache index',
'geocacheindexDesc': 'The position of each waypoint in the current tour will be shown on the map.',
'geocachename': 'Show geocache name',
'geocachenameDesc': 'The name of an geocache will be shown on the map.',
'awpts': 'Display addtional waypoints',
'awptsDesc': 'If enabled, additional waypoints will be shown on the map.',
'awpt_name': 'Show name of the additional waypoints',
'awpt_nameDesc': 'The name of the additional waypoints will be shown on the map.',
'awpt_lookup': 'Show lookup code of additional waypoints',
'awpt_lookupDesc': 'The lookup code of the additional waypoints will be shown on the map.',
'owpts': 'Display own waypoints',
'owptsDesc': 'Own waypoints in the current tour will be shown on the map.',
'owpt_name': 'Show name of own waypoints',
'owpt_nameDesc': 'Display the name of your own waypoints'
},
'gpx': {
'header': 'GPX',
'html': 'Description with HTML',
'htmlDesc': 'Some programs/GPSr have problems to show geocaches when their description is HTML formatted. If you only see scrabbled descriptions then please disable this option.',
'wpts': 'Export additional waypoints',
'wptsDesc': 'Additional waypoints will be exported as extra waypoint to the GPX. You will see every parking place on your unit.',
'attributesToLog': 'Create log with cache attributes',
'attributesToLogDesc': 'Cache attributes are also included as a first log.',
'stripGC': 'Strip "GC" in GC-Code',
'stripGCDesc': 'Older GPSr still have problems with waypoints having names longer than 8 characters. Please use this option if you own such an unit.',
'maxLogCount': 'max number of logs',
'prefixFavScore': 'Show favorite score in front of cache name',
'prefixFavScoreDesc': 'When in Geocaching menu of GPSr, the favorite score is shown in front of the cache name (e.g. "8%GC10000 - A New Beginning"). Thereby it\'s easy to see how a cache has been rated.'
},
'theme': {
'header': 'Themes',
'select': 'Select Theme'
},
'exportimport': {
'header': 'Export/Import',
'export': 'Export of GCTour settings (including all tours)',
'import': 'Import of GCTour settings (including all tours)'
}
},
'autoTour': {
'title': 'autoTour',
'wait': 'Please wait - generating autoTour!',
'radius': 'Radius',
'center': 'Center',
'refresh': 'Update preview',
'cacheCounts': 'Geocaches',
'maxCaches': 'Geocaches: ###NHITS### | Maximum: '+AUTOTOUR_MAX_CACHES+'<br>First '+AUTOTOUR_MAX_CACHES+' will be stored.',
'duration': 'Duration',
'filterLabel': 'Filters',
'filter': {
'type': 'Type',
'size': 'Size',
'difficulty': 'Difficulty',
'terrain': 'Terrain',
'special': {
'caption': 'Special',
'pm': {
'all': 'All',
'basic': 'No PM only',
'premium': 'PM only'
},
'notfound': 'I haven\'t found ',
'isActive': 'is Active',
'minFavorites': 'min. Favorites'
}
}
},
'dlg': {
'newVersion': {
'caption': 'New version available',
'content': 'There is a new version of GCTour.\nDo you want to update? \n\n',
'changelog': 'New GCTour version ' + VERSION + ' installed. Overview of changes: '
},
'error': {
'content': '<img src="' + $.gctour.img.sad + '">&nbsp;&nbsp;I\'m sorry but an error occurs.<br/>' +
'Please just try again, or look for an <a href="#" id="gctour_update_error_dialog">update</a>!<br/><br/>'
}
},
'notifications': {
'addgeocache': {
'success': {
'caption': '{0} added successfully!',
'content': '<b>{0}</b> now also contains <b>{1}</b>.'
},
'contains': {
'caption': '{0} was <i>not</i> added!',
'content': '<b>{0}</b> contains <b>{1}</b>.'
}
}
},
'units': {
'km': 'Kilometer',
'mi': 'Miles'
},
'send2cgeo': {
'title': 'Send to c:geo',
'noWP': 'no own waypoints',
'usage': '<li>Start c:geo on your device and go to a list of saved caches</li>' +
'<li>Select Menu → Import → Import from send2cgeo</li>' +
'<li>The tour (without own waypoints) will automatically be downloaded from geocaching.com to the list of saved caches</li>' +
'<li>c:geo will continue to wait for more caches to be downloaded for 3 minutes</li>',
'overview': 'Overview',
'setup': {
'header': 'Setup',
'registerBrowser': 'Click to register this browser for Send2cgeo',
'desc1': '<li>Run c:geo on your android device and select <i>Menu → Settings → Services → Send to c:geo</i></li>' +
'<li>Select <i>Request Registration</i>, you will get an info window showing a five digit PIN</li>',
'desc2': 'Enter PIN here:',
'desc3': 'Send PIN and add device'
},
'register': 'Browser is not registered for Send2cgeo yet - please switch to "Setup" tab and register your browser.',
'senderror': 'An error occurred, please try again later.'
},
'marker': {
'coord': 'Coordinates',
'content': 'Content',
'contentHint': 'will be shown in printview',
'type': 'Type'
},
'update': {
'dialog': '<div><p>There is a new version of <a target="_blank" href="' + GCTOUR_HOST + '"><b>GCTour</b></a> available for installation.</p><p>You currently have installed version <b>###VERSION_OLD###</b>, the latest version is <b>###VERSION_NEW###</b>.</p><div class="dialogFooter"></div>',
'upToDate': 'GCTour ' + VERSION + ' is up to date!'
},
'printview': {
'found': 'Found',
'note': 'Note',
'marker': 'Own waypoints',
'removeMap': 'Remove map',
'zoomMap': 'Open this map in a new tab.',
'dontPrintHint': '<b>Information:</b><br/>Elements in such a box will <u>not</u> be printed!',
'reloadMap': 'Reload map',
'print': 'Start printing',
'mapHeight': 'Height',
'printWidth': 'Width'
},
'cache': {
'addToTour': 'Add to tour',
'directPrint': 'Print this geocache',
'moveCoords': 'Move the coordinates',
'movedCoords': 'The coordinates to this geocaches are moved.',
'moveCoordsHelp': 'You have the possibility to change the original coordinates of this geocache. These will then be used in printview and also in the GPX file. This is quiet handy if you solve a mystery.',
'deleteCoords': 'Delete coordinates',
'originalCoords': 'Original coordinates',
'newCoords': 'New coordinates',
'addToCurrentTour': 'Add to <b>current</b> tour',
'addToNewTour': 'Add to <b>new</b> tour',
'shown': 'Displayed geocaches',
'marked': 'Marked geocaches',
'all': 'All caches'
},
'tour': {
'newDialog': 'Please enter a name for the new tour ...',
'copy': 'Copy tour',
'copyNameAppendix': 'Copy',
'delete': 'Delete this tour',
'deleteDialog': 'Are you sure to delete this tour?',
'empty': 'The tour is empty.'
}
};
$.gctour.i18n.fr = {
'name': 'Français',
'general': {
'save': 'Enregistrer',
'copy': 'dupliquer',
'cancel': 'Abandonner',
'close': 'Fermer',
'edit': 'Editer',
'rename': 'Renommer',
'delete': 'supprimer',
'load': 'charger',
'install': 'Installer',
'findMe': 'Localisez-moi!',
'exampleCoords': 'p. ex. N49° 26.082 E7° 46.587 ou 49.434701 7.776446',
'notLoggedIn': 'Vous devez être connecté à geocaching.com, merci de vous connecter.',
'pleaseWait': 'Veuillez patienter...'
},
'container': {
'toolbar': {
'newList': 'Nouveau tour',
'openTour': 'Ouvrir un Tour',
'downloadTour': {
'caption': 'Télécharger un Tour',
'webcodeDownloadHelp': 'Entrer ici le webcode que vous avez reçu et cliquer sur "Télécharger le Tour".',
'webcodeerror': 'Le webcode saisi est inexistant!',
'webcodesuccess': ' a été chargé avec succès!',
'webcodeOld': '\n !!ATTENTION!!\nCe webcode corrrespond à un ancien tour. Pour profiter pleinement de GCTour 2.0 vous devez soumettre de nouveau ce Tour.'
},
'showSettings': 'Configurer'
},
'tourHeader': {
'sendToGps': 'Transférer vers le GPSr',
'downloadGpx': 'Télécharger le GPX',
'makeMap': {
'caption': 'Voir sur la carte',
'wait': 'Vérification de la disponibilité et création de la carte... '
},
'upload': {
'caption': 'Soumettre un Tour',
'tourUploaded1': '<br>Le Tour a été correctement transféré! Webcode:<br><b>',
'tourUploaded2': '</b><br><br>Vous pouvez visualiser ce Tour sur <a href="' + GCTOUR_HOST + 'tour/xWEBCODEx" target="_blank">' + GCTOUR_HOST + 'tour/xWEBCODEx</a>.<br><br>'
},
'addOwnWaypoint': 'Ajouter un Waypoint personnel',
'sortAlphabetically': 'Trier alphabétiquement'
},
'cacheList': {
'logYourVisit': 'Loguer votre visite',
'removeFromList': 'Supprimer du tour'
}
},
'settings': {
'caption': 'Configuration',
'language': {
'header': 'Langue',
'select': 'Choisir langue'
},
'printview': {
'header': 'Version imprimable',
'printMinimal': 'Version imprimable minimaliste',
'printMinimalDesc': 'Ne contient que l\'indice et le spoiler de la cache.',
'logCount': 'Nombre de logs à inclure dans la version imprimable',
'logCounts': ['aucun', 'tous', 'afficher'],
'fontSize': 'Taille des caractères',
'decryptHints': 'Decryptage des hints',
'decryptHintsDesc': 'Les indices seront décryptés dans la version imprimable.',
'editDescription': 'Description éditable',
'editDescriptionDesc': 'La description est éditable comme bon vous semble.',
'showSpoiler': 'Affichage des spoilers',
'showSpoilerDesc': 'Les images Spoiler seront visibles dans la version imprimables.',
'additionalWaypoints': 'Affichage des Waypoints additionnels',
'additionalWaypointsDesc': 'La version imprimable contiendra un tableau avec tous les "Waypoints additionnels" de la cache.',
'loggedVisits': 'Affichage du nombre de logs',
'loggedVisitsDesc': 'Affiche un récapitulatif des "Trouvé(s)".',
'pageBreak': 'Saut de page entre les caches',
'pageBreakDesc': 'Il y aura un saut de page après chaque cache. Visible seulement à l\'impression.',
'pageBreakAfterMap': 'Saut de page après la carte',
'pageBreakAfterMapDesc': 'Il y aura un saut de page après la vue globale du Tour pour la séparer des pages de caches qui suivent.',
'frontPage': 'Page d\'accueil',
'frontPageDesc': 'Une vue d\'ensemble sera générée et incluera un index avec des cases dédiées à la prise de notes.',
'outlineMap': 'Vue d\'ensemble de toutes les caches du Tour',
'outlineMapDesc': 'La vue d\'ensemble incluera une carte avec toutes les caches.',
'outlineMapSingle': 'Vue d\'ensemble pour chaque cache',
'outlineMapSingleDesc': 'Après chaque cache, une carte indiquant l\'emplacement de la cache et de ses Waypoints additionnels sera affichée.'
},
'map': {
'header': 'Carte',
'type': 'Type de carte par défaut',
'size': 'Taille de carte par défaut',
'geocacheid': 'Afficher l\'Id de la cache sur la carte',
'geocacheidDesc': 'Les codes GC (eg. GC1S5ZE) seront affichés sur la carte.',
'geocacheindex': 'Afficher les Waypoints des caches sur la vue générale',
'geocacheindexDesc': 'Les Waypoints seront affichés sur la carte.',
'geocachename': 'Afficher le nom des caches sur la vue générale',
'geocachenameDesc': 'Les noms des caches seront affichés sur la carte.',
'awpts': 'Afficher les Waypoints',
'awptsDesc': 'Si cette option est cochée les Waypoints associées aux caches seront affichés sur la carte.',
'awpt_name': 'Afficher les noms des Waypoints additionnels',
'awpt_nameDesc': 'Les noms des Waypoints additionnels seront affichés sur la carte.',
'awpt_lookup': 'Afficher les codes lookup des Waypoints additionnels',
'awpt_lookupDesc': 'Les codes lookup des Waypoints seront affichés sur la carte.',
'owpts': 'Afficher les Waypoints personnels',
'owptsDesc': 'Les Waypoints personnels seront visibles sur la carte.',
'owpt_name': 'Afficher le nom des Waypoints personnels',
'owpt_nameDesc': 'Affiche le nom des Waypoints personnels sur la carte'
},
'gpx': {
'html': 'Description des caches au format HTML',
'htmlDesc': 'Certains programmes/GPSr ont des problèmes pour afficher les descriptions au format HTML. Si vous ne voyez qu\'une description tronquée de la cache, désactivez cette option.',
'wpts': 'Exporter les Waypoints additionnels',
'wptsDesc': 'Les Waypoints additionnels seront exportés vers votres GPS. Les parkings conseillés seront visibles sur votre GPS.',
'attributesToLog': 'Créer connecter avec les attributs du cache',
'attributesToLogDesc': 'Attributs de mise en cache sont également enregistrés comme un premier signe.',
'stripGC': 'Tronquer le préfixe "GC" dans le GC-Code',
'stripGCDesc': 'Les anciens GPSr ont parfois des problèmes avec les noms de Waypoints de plus de 8 caractères. Dans ce cas cochez cette option.',
'maxLogCount': 'nombre maximum de journaux'
},
'theme': {
'select': 'Choisir Theme'
}
},
'autoTour': {
'wait': 'Veuillez patienter pendant la génération automatique du Tour ...',
'radius': 'Rayon',
'center': 'Centre',
'refresh': 'Actualiser l\'aperçu',
'cacheCounts': 'Géocaches',
'duration': 'Durée',
'filterLabel': 'Filtres',
'filter': {
'type': 'Type',
'size': 'Taille',
'difficulty': 'Difficulté',
'terrain': 'Terrain',
'special': {
'caption': 'Spécial'
}
}
},
'dlg': {
'newVersion': {
'caption': 'Nouvelle version disponible',
'content': 'Une nouvelle version de GCTour est disponible.\n Voulez-vous mettre à jour? \n\n'
},
'error': {
'content': '<img src="' + $.gctour.img.sad + '">&nbsp;&nbsp;Désolé une erreur est survenue.<br/>' +
'Réessayez SVP, ou vérifier les <a href="#" id="gctour_update_error_dialog">mises à jour</a> du script!<br/><br/>'
}
},
'notifications': {
'addgeocache': {
'success': {
'caption': '{0} a été ajouté',
'content': '<b>{0}</b> contient désormais aussi <b>{1}</b>.'
},
'contains': {
'caption': '{0} n\'a pas été ajouté',
'content': '<b>{0}</b> contient <b>{1}</b>.'
}
}
},
'units': {
'km': 'Kilomètre',
'mi': 'Miles'
},
'send2cgeo': {
'title': 'Transférer vers le c:geo'
},
'marker': {
'coord': 'Coordonnées',
'content': 'Description',
'contentHint': 'sera visble dans la version imprimable'
},
'update': {
'dialog': '<div><p>Une nouvelle version de <a target="_blank" href="' + GCTOUR_HOST + '"><b>GCTour</b></a> est disponible.</p><p>Version installée: <b>###VERSION_OLD###</b>, version la plus récente disponible: <b>###VERSION_NEW###</b>.</p><div class="dialogFooter"></div>',
'upToDate': 'GCTour ' + VERSION + ' est à jour!'
},
'printview': {
'found': 'Trouvée',
'note': 'Note',
'marker': 'Waypoint personnel',
'removeMap': 'Supprimer la carte',
'zoomMap': 'Ouvrir la carte dans un nouvel onglet.',
'dontPrintHint': '<b>Information:</b><br/>Les éléménts ayant cette apparence ne seront <u>pas</u> imprimés!',
'print': 'Lancez l\'impression'
},
'cache': {
'addToTour': 'Ajouter au tour',
'directPrint': 'Imprimer cette cache',
'moveCoords': 'Ajuster les coordonnées',
'movedCoords': 'Les coordonnées de cette cache ont été ajustées.',
'moveCoordsHelp': 'Vous avez la possibilité d\'ajuster les coordonnées de cette cache. Ces coordonnées seront utilisées dans la version imprimable et dans le fichier GPX . Très utile pour la saisie des solutions des caches Mystery.',
'deleteCoords': 'Supprimer les coordonnées',
'originalCoords': 'Coordonnées initiales',
'newCoords': 'Nouvelles coordonnées',
'addToCurrentTour': 'Ajouter au tour <b>actuel</b>',
'addToNewTour': 'Ajouter à un <b>nouveau</b> tour',
'shown': 'Caches affichées',
'marked': 'Caches marquées',
'all': 'Tous caches'
},
'tour': {
'newDialog': 'Veuillez saisir un nom pour ce nouveau tour ...',
'copy': 'Dupliquer le tour',
'copyNameAppendix': 'Copie',
'delete': 'Supprimer ce tour',
'deleteDialog': 'Etes-vous sûrs de vouloir supprimer ce tour?',
'empty': 'Le tour est vide.'
}
};
$.gctour.i18n.nl = {
'name': 'Nederlands',
'general': {
'save': 'Bewaren',
'copy': 'kopiëren',
'cancel': 'Annuleren',
'close': 'Sluiten',
'edit': 'Bewerken',
'rename': 'Hernoem',
'delete': 'verwijderen',
'load': 'laden',
'install': 'Installeren',
'findMe': 'Vind me!',
'exampleCoords': 'bv. N49° 26.082 E7° 46.587 of 49.434701 7.776446',
'notLoggedIn': 'U dient ingelogd te zijn, gelieve in te loggen.',
'pleaseWait': 'Even geduld - gegevens worden geladen ...'
},
'container': {
'toolbar': {
'newList': 'Nieuwe toer',
'openTour': 'Een toer laden',
'downloadTour': {
'caption': 'Toer downloaden',
'webcodeDownloadHelp': 'Gelieve de ontvangen webcode in te vullen en klik op "Toer downloaden".',
'webcodeerror': 'De gekozen webcode bestaat niet!',
'webcodesuccess': ' is succesvol geladen!',
'webcodeOld': '\n !!AANDACHT!!\nDeze webcode bevat een oude toer. Om alle voordelen van GCTour 2.0 te benutten moet deze toer opnieuw worden geüpload worden.'
},
'showSettings': 'Instellingen tonen'
},
'tourHeader': {
'sendToGps': 'Naar GPSr versturen',
'downloadGpx': 'GPX downloaden',
'makeMap': {
'caption': 'Bekijk op de kaart',
'wait': 'Beschikbaarheid kaart wordt getest'
},
'upload': {
'caption': 'Toer uploaden',
'tourUploaded1': '<br>Uploaden toer was succesvol! Webcode:<br><b>',
'tourUploaded2': '</b><br><br>Je kan de toer bekijken op <a href="' + GCTOUR_HOST + 'tour/xWEBCODEx" target="_blank">' + GCTOUR_HOST + 'tour/xWEBCODEx</a>.<br><br>',
},
'addOwnWaypoint': 'Eigen waypoint toevoegen',
'sortAlphabetically': 'Alfabetisch sorteren'
},
'cacheList': {
'logYourVisit': 'Log je bezoek',
'removeFromList': 'Van toer verwijderen'
}
},
'settings': {
'caption': 'Instellingen',
'language': {
'header': 'Taal',
'select': 'Taal kiezen'
},
'printview': {
'header': 'Afdrukweergave',
'printMinimal': 'Minimale afdrukweergave',
'printMinimalDesc': 'Dit bevat enkel de hint en spoiler van een geocache.',
'logCount': 'Aantal logs in afdrukweergave',
'logCounts': ['geen', 'alle', 'tonen'],
'fontSize': 'Fontgrootte',
'decryptHints': 'Decodeer hints',
'decryptHintsDesc': 'Hints worden gedecodeerd bij het afdrukken.',
'editDescription': 'Beschrijving wijzigbaar',
'editDescriptionDesc': 'De beschrijving van de geocache kan aangepast worden.',
'showSpoiler': 'Spoiler tonen',
'showSpoilerDesc': 'Spoilers worden afgedrukt.',
'additionalWaypoints': 'Additional waypoints tonen',
'additionalWaypointsDesc': 'De afdrukweergave zal een tabel met de "additional waypoints" van een geocache bevatten.',
'loggedVisits': 'Log teller tonen',
'loggedVisitsDesc': 'Dit toont een "Find Counts" overzicht.',
'pageBreak': 'Pagina einde achter cache',
'pageBreakDesc': 'Bij het afdrukken komt achter elke geocache een nieuwe pagina.',
'pageBreakAfterMap': 'Pagina einde achter kaart',
'pageBreakAfterMapDesc': 'Er komt een nieuwe pagina tussen het overzicht en de geocaches.',
'frontPage': 'Frontpagina',
'frontPageDesc': 'Een overzicht wordt gemaakt met de volledige lijst van de geocaches met een index en plaats voor notities.',
'outlineMap': 'Kaart maken voor alle geocaches',
'outlineMapDesc': 'Het overzicht zal een kaart met alle geocaches bevatten.',
'outlineMapSingle': 'Kaart maken voor elke cache afzonderlijk',
'outlineMapSingleDesc': 'Na iedere geocache komt een kaart met de geocache en de additional waypoints.'
},
'map': {
'header': 'Kaart',
'type': 'Standaard kaarttype',
'size': 'Standaard kaartgrootte',
'geocacheid': 'Toon geocache id',
'geocacheidDesc': 'De GCCode (eg. GC2NTTG) wordt getoond op de kaart.',
'geocacheindex': 'Toon geocache index',
'geocacheindexDesc': 'De volgorde binnen de toer wordt getoond op de kaart.',
'geocachename': 'Toon geocache naam',
'geocachenameDesc': 'De naam van de geocache wordt getoond op de kaart.',
'awpts': 'Toon additional waypoints',
'awptsDesc': 'Additional waypoints worden getoond op de kaart.',
'awpt_name': 'Toon naam additional waypoints',
'awpt_nameDesc': 'De naam van het additional waypoint wordt getoond op de kaart.',
'awpt_lookup': 'Toon lookup code additional waypoints',
'awpt_lookupDesc': 'De lookup code van het additional waypoints wordt getoond op de kaart.',
'owpts': 'Toon eigen waypoints',
'owptsDesc': 'Eigen waypoints worden getoond op de kaart.',
'owpt_name': 'Toon naam eigen waypoints',
'owpt_nameDesc': 'De naam van het eigen waypoint wordt getoond op de kaart.'
},
'gpx': {
'html': 'Beschrijving met HTML',
'htmlDesc': 'Sommige programma\'s en GPS toestellen hebben problemen met geocache beschrijvingen in HTML. Indien dit het geval is, kan je best deze optie afzetten.',
'wpts': 'Exporteer additional waypoints',
'wptsDesc': 'Additional waypoints worden geëxporteerd als extra waypoint naar GPX. Alle paarkeerplaatsen zullen zichtbaar zijn op je toestel.',
'attributesToLog': 'Maken te loggen met cache attributen',
'attributesToLogDesc': 'Cache attributen worden ook geregistreerd als een eerste teken.',
'stripGC': '"GC" in GC-Code verwijderen',
'stripGCDesc': 'Oudere GPS toestellen kunnen problemen hebben met waypoints waarvan de naam langer is dan 8 tekens. Gebruik deze optie indien dit het geval is.',
'maxLogCount': 'Max aantal logs'
},
'theme': {
'select': 'Theme kiezen'
}
},
'autoTour': {
'wait': 'Even geduld – autoTour wordt aangemaakt!',
'radius': 'Radius',
'center': 'Middelpunt',
'refresh': 'Vernieuw voorbeeld',
'cacheCounts': 'Geocaches',
'duration': 'Duur',
'filterLabel': 'Filter',
'filter': {
'type': 'Type',
'size': 'Grootte',
'difficulty': 'Moeilijkheid',
'terrain': 'Terrein',
'special': {
'caption': 'Speciaal'
}
}
},
'dlg': {
'newVersion': {
'caption': 'Nieuwe versie beschikbaar',
'content': 'Er is een nieuwe versie van GCTour beschikbaar.\nWil je upgraden? \n\n'
},
'error': {
'content': '<img src="' + $.gctour.img.sad + '">&nbsp;&nbsp;Spijtig genoeg is er een fout gebeurd.<br/>' +
'Probeer het opnieuw proberen, of kijk voor <a href="#" id="gctour_update_error_dialog">update</a>!<br/><br/>'
}
},
'notifications': {
'addgeocache': {
'success': {
'caption': '{0} werd toegevoegd',
'content': '<b>{0}</b> bevat nu <b>{1}</b>.'
},
'contains': {
'caption': '{0} werd <i>niet</i> toegevoegd',
'content': '<b>{0}</b> bevat <b>{1}</b> reeds.'
}
}
},
'units': {
'km': 'Kilometer',
'mi': 'Miles'
},
'send2cgeo': {
'title': 'Naar c:geo versturen'
},
'marker': {
'coord': 'Coördinaten',
'content': 'Inhoud',
'contentHint': 'zal getoond worden in afdrukweergave'
},
'update': {
'dialog': '<div><p>Er is een nieuwe versie van <a target="_blank" href="' + GCTOUR_HOST + '"><b>GCTour</b></a> beschikbaar voor installatie.</p><p>Versie <b>###VERSION_OLD###</b> is momenteel geïnstalleerd, de recentste versie is <b>###VERSION_NEW###</b>.</p><div class="dialogFooter"></div>',
'upToDate': 'GCTour ' + VERSION + ' is op dit moment!'
},
'printview': {
'found': 'Gevonden',
'note': 'Note',
'marker': 'Eigen waypoint',
'removeMap': 'Kaart verwijderen',
'zoomMap': 'Open deze kaart in een nieuwe tab.',
'dontPrintHint': '<b>Ter info:</b><br/>Gegevens in dit kader worden <u>niet</u> afgedrukt!',
'print': 'Begin met afdrukken'
},
'cache': {
'addToTour': 'Aan toer toevoegen',
'directPrint': 'Deze geocache afdrukken',
'moveCoords': 'Verplaats de coördinaten',
'movedCoords': 'De coördinaten voor deze geocache zijn verplaatst.',
'moveCoordsHelp': 'Je kan de originele coördinaten van deze geocache verplaatsen. Deze worden dan gebruikt in de afdrukweergave en in het GPX bestand. Dit kan handig zijn bij een opgeloste mystery.',
'deleteCoords': 'Verwijderen coördinaten',
'originalCoords': 'Originele coördinaten',
'newCoords': 'Nieuwe coördinaten',
'addToCurrentTour': 'aan <b>huidige</b> toer',
'addToNewTour': 'aan <b>nieuwe</b> toer',
'shown': 'Getoonde geocaches',
'marked': 'Gemarkeerde geocaches',
'all': 'Alle caches'
},
'tour': {
'newDialog': 'Gelieve de naam van de nieuwe toer in te vullen ...',
'copy': 'Toer kopiëren',
'copyNameAppendix': 'Kopie',
'delete': 'Deze toer wissen',
'deleteDialog': 'Weet je zeker dat je deze toer wil verwijderen?',
'empty': 'De toer is leeg.'
}
};
$.gctour.i18n.pt = {
'name': 'Português',
'general': {
'save': 'Guardar',
'copy': 'copiar',
'cancel': 'Cancelar',
'close': 'Fechar',
'edit': 'Editar',
'rename': 'Renomear',
'delete': 'apagar',
'load': 'carregar',
'install': 'Instalar',
'findMe': 'Encontra-me!',
'exampleCoords': 'p.ex. N49° 26.082 E7° 46.587 ou 49.434701 7.776446',
'notLoggedIn': 'Você precisa estar logado, faça o login.',
'pleaseWait': 'Por favor aguarde - a carregar conte&#250;do ...'
},
'container': {
'toolbar': {
'newList': 'Nova Rota',
'openTour': 'Carregar uma Rota',
'downloadTour': {
'caption': 'Transferir Rota',
'webcodeDownloadHelp': 'Por favor introduza aqui o código que recebeu e clique em "Transferir Rota".',
'webcodeerror': 'O C&#243;digo escolhido n&#227;o existe!',
'webcodesuccess': ' foi carregada!',
'webcodeOld': '\n !!ATEN&#199;&#195;O!!\nEste c&#243;digo est&#225; conectado com uma rota antiga. Para obter todos os benef&#237;cios do GCTour 2.0, tem de enviar a rota novamente.'
},
'showSettings': 'Mostrar Configurações'
},
'tourHeader': {
'sendToGps': 'Enviar para o GPSr',
'downloadGpx': 'Transferir GPX',
'makeMap': {
'caption': 'Visualizar no mapa',
'wait': 'A testar disponibilidade deste mapa'
},
'upload': {
'caption': 'Enviar rota',
'tourUploaded1': '<br>Rota enviada com sucesso! C&#243;digo:<br><b>',
'tourUploaded2': '</b><br><br>Pode ver a rota em <a href="' + GCTOUR_HOST + 'tour/xWEBCODEx" target="_blank">' + GCTOUR_HOST + 'tour/xWEBCODEx</a>.<br><br>',
},
'addOwnWaypoint': 'Adicionar o seu Waypoint',
'sortAlphabetically': 'Ordenar alfabeticamente'
},
'cacheList': {
'logYourVisit': 'Registe a sua visita',
'removeFromList': 'Remover da lista'
}
},
'settings': {
'caption': 'Configurações',
'language': {
'header': 'Idioma',
'select': 'Escolha idioma'
},
'printview': {
'header': 'Modo de impressão',
'printMinimal': 'Modo de Impress&#227;o m&#237;nimo',
'printMinimalDesc': 'Cont&#233;m apenas a dica e o spoiler da geocache.',
'logCount': 'N&#250;mero de logs no modo de impress&#227;o',
'logCounts': ['nenhum', 'tudo', 'mostrar'],
'fontSize': 'Tamanho da letra',
'decryptHints': 'Decifrar dicas',
'decryptHintsDesc': 'As dicas v&#227;o estar decifradas no modo de impress&#227;o.',
'editDescription': 'Descri&#231;&#227;o edit&#225;vel',
'editDescriptionDesc': 'A descri&#231;&#227;o pode ser editada da forma como quiser.',
'showSpoiler': 'Mostrar spoiler',
'showSpoilerDesc': 'Imagens de spoiler v&#227;o estar no modo de impress&#227;o.',
'additionalWaypoints': 'Mostrar Waypoints Adicionais',
'additionalWaypointsDesc': 'O modo de impress&#227;o vai conter uma tabela com todos os "Waypoints Adicionais" de uma geocache.',
'loggedVisits': 'Mostrar contador de log',
'loggedVisitsDesc': 'Vai mostrar um resumo do "Contador de Visitas".',
'pageBreak': 'Espa&#231;o na pagina depois da cache',
'pageBreakDesc': 'Depois de cada geocache vai existir uma espa&#231;amento. Vis&#237;vel depois da impress&#227;o.',
'pageBreakAfterMap': 'Espa&#231;o na p&#225;gina depois do mapa',
'pageBreakAfterMapDesc': 'Vai existir um espa&#231;amento depois do resumo para separar as geocaches.',
'frontPage': 'Primeira p&#225;gina',
'frontPageDesc': 'Um resumo vai ser gerado incluindo uma lista completa de todas as geocaches com um &#237;ndice e um espa&#231;o para colocar notas.',
'outlineMap': 'Mapa com todas as caches',
'outlineMapDesc': 'O resumo vai conter um mapa com todas as geocaches.',
'outlineMapSingle': 'Mapa para todas as caches',
'outlineMapSingleDesc': 'Depois de cada geocache est&#225; um mapa contendo a geocache e os seus "Waypoints Adicionais".'
},
'map': {
'header': 'Mapa',
'type': 'Tipo de Mapa padr&#227;o',
'size': 'Tamanho de Mapa padr&#227;o',
'geocacheid': 'Mostrar id da Geocache',
'geocacheidDesc': 'O c&#243;digo GCCode (eg. GC0815) estar&#225; visivel no mapa.',
'geocacheindex': 'Mostrar ind&#237;ce da Geocache',
'geocacheindexDesc': 'A posi&#231;&#227;o de cada waypoint estar&#225; vis&#237;vel na rota seleccionada.',
'geocachename': 'Mostrar nome da Geocache',
'geocachenameDesc': 'O nome da geocache estar&#225; visivel.',
'awpts': 'Mostrar Waypoints Adicionais',
'awptsDesc': 'Se seleccionada, os Waypoints-Adicionais v&#227;o estar vis&#237;veis.',
'awpt_name': 'Mostrar o nome dos Waypoints Adicionais',
'awpt_nameDesc': 'O nome dos Waypoints-Adicionais v&#227;o estar no mapa.',
'awpt_lookup': 'Mostrar c&#243;digo dos Waypoints Adicionais',
'awpt_lookupDesc': 'Os c&#243;digos dos Waypoints-Adicionais v&#227;o estar vis&#237;veis.',
'owpts': 'Mostrar os nossos waypoints',
'owptsDesc': 'Se tem Waypoints seus na rota seleccionada e se esta op&#231;&#227;o estiver marcada, v&#227;o estar vis&#237;veis no mapa.',
'owpt_name': 'Mostrar o nome dos nossos waypoints',
'owpt_nameDesc': 'Mostrar o nome dos seus Waypoints'
},
'gpx': {
'html': 'Descri&#231;&#227;o com HTML',
'htmlDesc': 'Alguns programas/GPSr tem problemas em mostrar as geocaches se a descri&#231;&#227;o estiver no formato HTML. Se a descri&#231;&#227;o estiver confusa, desactive este op&#231;&#227;o.',
'wpts': 'Exportar waypoints adicionais',
'wptsDesc': 'Os waypoints-adicionais v&#227;o ser exportados como waypoint extra no GPX. Ir&#225; ver cada lugar de estacionamento na sua unidade.',
'attributesToLog': 'Criar login com atributos de cache',
'attributesToLogDesc': 'Atributos de cache também são registrados como um primeiro sinal.',
'stripGC': 'Remover "GC" no GC-Code',
'stripGCDesc': 'GPSr antigos tem problemas com os waypoints com nome maior que 8 caracteres. Use esta op&#231;&#227;o se tem uma unidade destas.',
'maxLogCount': 'Número máximo de logs'
},
'theme': {
'select': 'Escolha Theme'
}
},
'autoTour': {
'title': 'autoRota',
'wait': 'Por favor aguarde - criando a autoRota!',
'radius': 'Raio',
'center': 'Centro',
'refresh': 'Atualizar Visualização',
'cacheCounts': 'Geocaches',
'duration': 'Duração',
'filterLabel': 'Filtros',
'filter': {
'type': 'Typ',
'size': 'Rozmiar',
'difficulty': 'Trudność',
'terrain': 'Teren',
'special': {
'caption': 'Specjalne'
}
}
},
'dlg': {
'newVersion': {
'caption': 'Nova versão dispon&#xED;vel',
'content': 'Existe uma nova vers&#227;o de GCTour.\nDeseja actualizar? \n\n'
},
'error': {
'content': '<img src="' + $.gctour.img.sad + '">&nbsp;&nbsp;Lamento mas ocorreu um erro.<br/>' +
'Por favor tente outra vez, ou procure por uma <a href="#" id="gctour_update_error_dialog">atualização</a>!<br/><br/>'
}
},
'notifications': {
'addgeocache': {
'success': {
'caption': '{0} foi adicionada!',
'content': '<b>{0}</b> agora inclui <b>{1}</b>.'
},
'contains': {
'caption': '{0} não foi adicionada',
'content': '<b>{0}</b> contém <b>{1}</b> já.'
}
}
},
'units': {
'km': 'Quilometros',
'mi': 'Milhas'
},
'send2cgeo': {
'title': 'Enviar para o c:geo'
},
'marker': {
'coord': 'Coordenadas',
'content': 'Conte&#250;do',
'contentHint': 'estar&#225; visivel no modo de impress&#227;o',
'type': 'Tipo'
},
'update': {
'dialog': '<div><p>Existe uma nova vers&#227;o de <a target="_blank" href="' + GCTOUR_HOST + '"><b>GCTour</b></a> dispon&#237;vel para instalar.</p><p>Tem a versão <b>###VERSION_OLD###</b> instalada, a &#250;ltima versão &#233; <b>###VERSION_NEW###</b>.</p><div class="dialogFooter"></div>',
'upToDate': 'GCTour ' + VERSION + ' está atualmente!'
},
'printview': {
'found': 'Encontrada',
'note': 'Nota',
'marker': 'Waypoint pr&#243;prio',
'removeMap': 'Remover mapa',
'zoomMap': 'Abrir este mapa num novo separador.',
'dontPrintHint': '<b>Informa&#231;&#227;o:</b><br />Elementos na caixa <u>n&#227;o</u> v&#227;o ser impressos!',
'print': 'Iniciar a impressão'
},
'cache': {
'addToTour': 'Adicionar à rota',
'directPrint': 'Imprimir esta Geocache',
'moveCoords': 'Mover as coordenadas',
'movedCoords': 'As coordenadas desta geocache foram mudadas.',
'moveCoordsHelp': 'Tens a oportunidade de mudar as coordenadas originais desta geocache. Ser&#227;o usadas no modo de impress&#227;o e tamb&#233;m no ficheiro GPX. &#201; util se resolver o enigma.',
'deleteCoords': 'Coordenadas para deletar',
'originalCoords': 'Coordenadas Originais',
'newCoords': 'Novas Coordenadas',
'addToCurrentTour': 'para a rota <b>seleccionada</b>',
'addToNewTour': 'para uma <b>nova</b> rota',
'shown': 'Geocaches vis&#237;veis',
'marked': 'Geocaches marcados',
'all': 'Tudo Caches'
},
'tour': {
'newDialog': 'Introduza um nome para a nova rota ...',
'copy': 'Copiar rota',
'copyNameAppendix': 'Cópia',
'delete': 'Apagar esta rota',
'deleteDialog': 'Deseja mesmo remover esta rota?',
'empty': 'A lista est&#225; vazia.'
}
};
// init translations
(function() {
/*$.each($.gctour.i18n, function(l, o) {
console.table(o);
});*/
/*
return translate from [language][str]
is language or str undefined = return ""
*/
$.gctour.lang = function(str) {
var i18n = $.gctour.i18n,
cur = $.gctour.currentLang,
def = $.gctour.defaultLang,
i,
arr,
trans,
cur_trans,
def_trans;
// try to get current and default translation
cur_trans = i18n[cur] || false;
def_trans = i18n[def] || false;
arr = str.split('.');
for (i = 0; i < arr.length; i++) {
cur_trans = cur_trans ? cur_trans[arr[i]] : undefined;
def_trans = def_trans ? def_trans[arr[i]] : undefined;
}
// use default language as fallback
trans = (cur_trans !== undefined) ? cur_trans :
(def_trans !== undefined) ? def_trans :
((DEBUG_MODE === true) ? "MISSING TRANSLATION" : "");
/*
// debug info current language
if (!i18n[cur]) {
debug("ERROR: language '" + cur + "' is undefined");
} else if (cur_trans === undefined) {
debug("ERROR: active language (" + cur + "), search '" + str + "' is undefined");
}
// debug info default language
if (!i18n[def]) {
debug("ERROR: language '" + def + "' is undefined");
} else if (def_trans === undefined) {
debug("ERROR: default language (" + def + "), search '" + str + "' is undefined");
}
*/
return trans;
};
})();
/* styles: CSS Container, run before init() */
function initStyle() {
// adding styles
GM_addStyle(("" +
"/* GCTour - Container */\n" +
"" +
"#gctourButtonWrapper {" +
" height: 32px !important;" +
" padding: 0 !important;" +
" position: fixed !important;" +
" top: 30px !important;" +
" width: 35px !important;" +
" background-color: #fff;" +
" z-index: 10000 !important;" +
" border: 1px solid #333;" +
" border-width: 1px 1px 1px 0;" +
" border-radius: 0 5px 5px 0;" +
" -moz-user-select: none;" +
"}" +
"" +
"#gctourButtonWrapper img {" +
" position: relative;" +
" top: 8px;" +
" left: 8px;" +
" vertical-align: top;" +
"}" +
"" +
"#gctourContainer {" +
" background-color: #fff;" +
" overflow: hidden;" +
" left: -210px;" +
" padding: 0 !important;" +
" position: fixed !important;" +
" top: 15px !important;" +
" width: 200px;" +
" z-index: 10001 !important;" +
" border: 1px solid #333;" +
" border-left: 0px;" +
" border-radius: 0 5px 5px 0;" +
" font-size: 12px;" +
" font-family: Arial;" +
" line-height: 1.5;" +
"}" +
"" +
"#gctourContainer .cachelist {" +
" width: 100%;" +
" margin: 0;" +
" padding:0;" +
" font-size:80%;" +
" list-style-type:none;" +
"}" +
"" +
"#gctourContainer .cachelist li {" +
" color:#000;" +
" margin:0.5em;" +
" padding:3px;" +
" width:120px;" +
" min-height:44px;" +
" list-style-position:inside;" +
" border:1pt dashed gray;" +
" background-color:#FFF;" +
" -moz-background-clip:border;" +
" -moz-background-inline-policy:continuous;" +
" -moz-background-origin:padding;" +
" -moz-border-radius:8px 0 8px 0;" +
" border-radius:8px 0 8px 0;" +
" box-sizing:content-box;" +
"}" +
"" +
"#gctourContainer img.imgShadow {" +
" -moz-box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.2);" +
" box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.2);" +
" background-color: lightgray;" +
"}" +
"" +
"#gctourContainer img.tourImage {" +
" cursor: pointer;" +
" margin: 0 2px 0 2px;" +
"}" +
"" +
"/* Styling the placeholder for when the user starts dragging an item */\n" +
"" +
"#gctourContainer li.ui-sortable-placeholder {" +
" min-height:50px;" +
" max-height:80px;" +
" width: 90%;" +
" background-color: rgba(0, 0, 0, 0.03);" +
"}" +
"/* GCTour - Grand */\n" +
"" +
".gctour-grand-default {" +
" /* http://www.colorzilla.com/gradient-editor/#a7cfef+0,c9dded+3,ffffff+10;gctour-grand-default" +
" * http://css3please.com/" +
" */" +
" background: rgb(167,207,239); /* Old browsers */" +
" background: -moz-linear-gradient(top, rgba(167,207,239,1) 0%, rgba(201,221,237,1) 3px, rgba(255,255,255,1) 10px); /* FF3.6+ */" +
" background: -webkit-linear-gradient(top, rgba(167,207,239,1) 0%,rgba(201,221,237,1) 3px,rgba(255,255,255,1) 10px); /* Chrome10+,Safari5.1+ */" +
" background: -o-linear-gradient(top, rgba(167,207,239,1) 0%,rgba(201,221,237,1) 3px,rgba(255,255,255,1) 10px); /* Opera 11.10+ */" +
" background: linear-gradient(top, rgba(167,207,239,1) 0%,rgba(201,221,237,1) 3px,rgba(255,255,255,1) 10px); /* W3C */" +
"}" +
"" +
".gctour-grand-hover {" +
" /* http://www.colorzilla.com/gradient-editor/#ffad32+0,ffd699+3,ffffff+10;gctour-grand-hover */" +
" background: rgb(255,173,50); /* Old browsers */" +
" background: -moz-linear-gradient(top, rgba(255,173,50,1) 0%, rgba(255,214,153,1) 3px, rgba(255,255,255,1) 10px); /* FF3.6+ */" +
" background: -webkit-linear-gradient(top, rgba(255,173,50,1) 0%,rgba(255,214,153,1) 3px,rgba(255,255,255,1) 10px); /* Chrome10+,Safari5.1+ */" +
" background: -o-linear-gradient(top, rgba(255,173,50,1) 0%,rgba(255,214,153,1) 3px,rgba(255,255,255,1) 10px); /* Opera 11.10+ */" +
" background: linear-gradient(top, rgba(255,173,50,1) 0%,rgba(255,214,153,1) 3px,rgba(255,255,255,1) 10px); /* W3C */" +
"}" +
"" +
".gctour-grand-highlight {" +
" /* http://www.colorzilla.com/gradient-editor/#ffe000+0,ffee7f+3,ffffff+10;gctour-grand-highlight */" +
" background: rgb(255,224,0); /* Old browsers */" +
" background: -moz-linear-gradient(top, rgba(255,224,0,1) 0%, rgba(255,238,127,1) 3px, rgba(255,255,255,1) 10px); /* FF3.6+ */" +
" background: -webkit-linear-gradient(top, rgba(255,224,0,1) 0%,rgba(255,238,127,1) 3px,rgba(255,255,255,1) 10px); /* Chrome10+,Safari5.1+ */" +
" background: -o-linear-gradient(top, rgba(255,224,0,1) 0%,rgba(255,238,127,1) 3px,rgba(255,255,255,1) 10px); /* Opera 11.10+ */" +
" background: linear-gradient(top, rgba(255,224,0,1) 0%,rgba(255,238,127,1) 3px,rgba(255,255,255,1) 10px); /* W3C */" +
"}" +
"" +
".gctour-grand-active {" +
" /* Grün http://www.colorzilla.com/gradient-editor/#3dff32+0,9eff99+3,ffffff+10;gctour-grand-active */" +
" background: rgb(61,255,50); /* Old browsers */" +
" background: -moz-linear-gradient(top, rgba(61,255,50,1) 0%, rgba(158,255,153,1) 3px, rgba(255,255,255,1) 10px); /* FF3.6+ */" +
" background: -webkit-linear-gradient(top, rgba(61,255,50,1) 0%,rgba(158,255,153,1) 3px,rgba(255,255,255,1) 10px); /* Chrome10+,Safari5.1+ */" +
" background: linear-gradient(top, rgba(61,255,50,1) 0%,rgba(158,255,153,1) 3px,rgba(255,255,255,1) 10px); /* W3C */$$$$" +
" background: -o-linear-gradient(top, rgba(61,255,50,1) 0%,rgba(158,255,153,1) 3px,rgba(255,255,255,1) 10px); /* Opera 11.10+ */" +
"}" +
"" +
".gctour-grand-error {" +
" /* http://www.colorzilla.com/gradient-editor/#ff3232+0,ff9999+3,ffffff+10;gctour-grand-error */" +
" background: rgb(255,50,50); /* Old browsers */" +
" background: -moz-linear-gradient(top, rgba(255,50,50,1) 0%, rgba(255,153,153,1) 3px, rgba(255,255,255,1) 10px); /* FF3.6+ */" +
" background: -webkit-linear-gradient(top, rgba(255,50,50,1) 0%,rgba(255,153,153,1) 3px,rgba(255,255,255,1) 10px); /* Chrome10+,Safari5.1+ */" +
" background: -o-linear-gradient(top, rgba(255,50,50,1) 0%,rgba(255,153,153,1) 3px,rgba(255,255,255,1) 10px); /* Opera 11.10+ */" +
" background: linear-gradient(top, rgba(255,50,50,1) 0%,rgba(255,153,153,1) 3px,rgba(255,255,255,1) 10px); /* W3C */" +
"}" +
"" +
"/* GCTour Slider */\n" +
"" +
".gct_scrollbar {" +
" background-color:pink;" +
" height: 20px;" +
" left: 0;" +
" position: absolute;" +
" top: 0;" +
" width: 100%;" +
"}" +
"" +
".gct_scroller{" +
" background-color:lime;" +
" height: 20px;" +
" left: 0;" +
" position: absolute;" +
" top: 0;" +
" width: 20px; " +
"}" +
"" +
"" +
"/* GCTour Pop-Up */\n" +
"" +
".gct_popup{" +
" position:absolute;" +
" z-index:10; " +
" width:172px;" +
" height:102px;" +
" text-align:center;" +
" color:#FF0000;" +
" font: 14px Verdana, Arial, Helvetica, sans-serif;" +
" background-color:lime;" +
" border-radius: 5px;" +
"}" +
"" +
".gct_popup_header{" +
" border-radius: 5px 5px 0px 0px;" +
"}" +
"" +
".dialogMask {" +
" background-image:url(##dialogMaskImage##);" +
" height:100%;" +
" left:0;" +
" opacity:0.7;" +
" position:fixed;" +
" top:0;" +
" width:100%;" +
" z-index:1100;" +
"}" +
"" +
".dialogBody {" +
" -moz-border-radius:5px;" +
" border-radius:5px;" +
" background:none repeat scroll 0 0 #fff;" +
" border:1px solid #333333;" +
" color:#333333;" +
" cursor:default;" +
" font-family:Arial;" +
" font-size:12px;" +
" left:50%;" +
" margin-left:-250px;" +
" margin-top:20px;" +
" padding:0 0 1em;" +
" position:fixed;" +
" text-align:left;" +
" top:0;" +
" width:625px;" +
" z-index:2001;" +
" max-height:85%;" +
" min-height:440px;" +
" overflow:auto;" +
"}" +
"" +
".dialogBody p {" +
" font-size:12px;" +
" font-weight:normal;" +
" margin:1em 0;" +
"}" +
"" +
".dialogBody button {" +
" background: none no-repeat scroll 4px center #eeeeee;" +
" border: 1px outset #666666" +
"}" +
"" +
".dialogBody button:hover {" +
" background-color: #f9f9f9;" +
"}" +
"" +
"/* autoTour */\n" +
"" +
".dialogBody select {" +
" width: auto;" +
" display: initial;" +
" padding: initial;" +
" -moz-appearance: menulist;" +
" -webkit-appearance: menulist;" +
"}" +
"" +
".dialogBody label {" +
" text-transform: none;" +
" display: inline;" +
"}" +
"" +
".header h1 {" +
" background-color:#B2D4F3;" +
" background-repeat:repeat-x;" +
" font-size:110% !important;" +
" font-family:Helvetica Neue,Arial,Helvetica,sans-serif;" +
" margin-bottom:0.2em;" +
" margin-top:0;" +
" padding:0.5em;" +
" -moz-border-radius: 5px;" +
" border-radius: 5px;" +
" color:#333333;" +
" background-image:url(##tabBgImage##)" +
"}" +
"" +
"/*" +
".dialogBody h1 {" +
" background-color:#7A7A7A;" +
" border-bottom:1px solid #333333;" +
" font-size:110%;" +
" font-family:Helvetica Neue,Arial,Helvetica,sans-serif;" +
" margin-bottom:0.2em;" +
" padding:0.5em;" +
" -moz-border-radius:5px;" +
" border-radius:5px;" +
" color:#fff;" +
"}" +
"*/" +
"" +
".dialogHistory {" +
" border:1px inset #999999;" +
" margin:0 1em 1em;" +
" padding-bottom: 1em;" +
" max-height: 200px;" +
" overflow-y:auto;" +
" width:518px;" +
" padding-left:1em;" +
"}" +
"" +
".dialogHistory ul {" +
" margin-left:2em;" +
"}" +
"" +
".dialogHistory li {" +
" list-style-type:circle;" +
"}" +
"" +
".dialogFooter input {" +
" -moz-border-radius:3px;" +
" border-radius:3px;" +
" background:none no-repeat scroll 4px center #EEEEEE;" +
" border:1px outset #666666;" +
" cursor:pointer;" +
" float:right;" +
" margin-left:0.5em;" +
" padding:3px 5px 5px 20px;" +
" min-width:100px;" +
" font-size: 12px;" +
"}" +
"" +
".dialogFooter input:hover {" +
" background-color:#f9f9f9;" +
"}" +
"" +
".dialogContent {" +
" padding:0 10px 0 10px;" +
"}" +
"" +
".dialogMin {" +
" min-height:0 !important" +
"}" +
"" +
"" +
"/* neuer Dialog-Style mit jQuery-ui + gcTour Header (.gct_dialog) */\n" +
"" +
".gct_dialog {" +
" font-size: 100% !important;" +
" font-family: Arial !important;" +
" z-index: 1100 !important;" +
"}" +
".gct_dialog .ui-widget {" +
"}" +
".gct_dialog.ui-dialog {" +
" padding: 0;" +
"}" +
".gct_dialog.ui-dialog .ui-widget-header {" +
" border: 0;" +
"}" +
".gct_dialog.ui-dialog .ui-dialog-titlebar {" +
" padding: 0.2em 0.1em;" +
//" background: -moz-linear-gradient(center top, #A7CFEF 0%, #C9DDED 3px, #FFFFFF 10px) repeat scroll 0 0 transparent;" +
" color: #000;" +
"}" +
".gct_dialog.ui-dialog .ui-dialog-title {" +
" padding-top: 4px;" +
" text-align: left;" +
" padding-left: 120px;" +
" width: 75%;" +
" background: url(##gctourLogo##) 2px 2px no-repeat;" +
"}" +
".gct_dialog.ui-dialog .ui-dialog-buttonpane {" +
" padding: 0 0.4em 0 0.4em;" +
"}" +
".gct_dialog .ui-button-text-only .ui-button-text {" +
" padding: 0.2em 0.8em;" +
"}" +
".gct_dialog .ui-progressbar .ui-progressbar-value {" +
" margin: 0;" +
"}" +
".gct_dialog .progressbar-label {" +
" width: 80%;" +
" text-align: center;" +
"}" +
"" +
"/* jqui settings dialog */\n" +
"" +
"div.gct_dialog select {" +
" width: auto;" +
" display: initial;" +
" padding: initial;" +
" -moz-appearance: menulist;" +
" -webkit-appearance: menulist;" +
"}" +
"div.gct_dialog label {" +
" text-transform: none;" +
" font-size: 100%;" +
"}" +
"div.gct_dialog input[type='radio'] {" +
" display: initial;" +
"}" +
"" +
"#dialogDetails {" +
" height:364px;" +
" padding:3px;" +
" overflow:auto;" +
" background-color:#eff4f9;" +
" border:1px solid #C0CEE3;" +
" -moz-border-radius: 0 5px 5px 0;" +
" border-radius: 0 5px 5px 0;" +
" width:424px;" +
" position: absolute;" +
" right: 10px;" +
"}" +
"" +
".dialogList {" +
" margin:0;" +
" padding:0;" +
"}" +
".dialogList li {" +
" font-size:10px;" +
" padding:3px;" +
" clear:both;" +
" list-style-type: none;" +
"}" +
"" +
".activeTour, .gct_sortable-placeholder {" +
" border: 1px solid #C0CEE3;" +
" -moz-border-radius: 5px 0 0 5px;" +
" border-radius: 5px 0 0 5px;" +
" background-color: #eff4f9;" +
" padding: 1px;" +
"}" +
".gct_sortable-placeholder {" +
" background-color: rgba(0, 0, 0, 0.03);" +
" height: 3em;" +
"}" +
"" +
"#dialogListContainer {" +
" height:374px;" +
" overflow:auto;" +
" width:146px;" +
" position: absolute;" +
" left: 10px;" +
"}" +
"" +
"#dialogListContainer a{" +
" text-decoration:underline;" +
"}" +
"" +
".unselectable {" +
" -o-user-select: none;" +
" -webkit-user-select: none;" +
" -moz-user-select: -none;" +
" -khtml-user-select: none;" +
" user-select: none;" +
"}" +
"" +
"#cacheList .counter {" +
" position:absolute;" +
" right:4px;" +
" bottom: 0;" +
" z-index:0;" +
" overflow:hidden;" +
" font: normal 24px arial,sans-serif;" +
" color: #d5d5d5;" +
" text-align:right;" +
" text-shadow: 1px 1px 1px #C0C0C0;" +
" vertical-align: text-bottom;" +
" background-color: transparent;" +
" margin-right:0;" +
" margin-bottom:0;" +
" padding: 0;" +
"}" +
"" +
"#gctour-notification-box {" +
" position: fixed;" +
" right: 4px;" +
" bottom: 2%;" +
" width: 220px;" +
" height: auto;" +
" max-height: 96%;" +
" overflow: hidden;" +
" overflow-y: auto;" +
" list-style-type: none;" +
" margin: 0;" +
" padding: 0;" +
" z-index: 1102;" +
"}" +
"" +
"#gctour-notification-box li {" +
" overflow: hidden;" +
" background-image: url('" + $.gctour.img.bg + "');" +
" background-repeat: repeat-x;" +
" background-attachment: scroll;" +
" background-position: left top;" +
" box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);" +
" width: 220px;" +
" cursor: pointer;" +
"}" +
"" +
".gctour-notification-green {" +
" background-color: lightgreen;" +
" color: #000000;" +
" border: 1px solid #50C24E;" +
" text-shadow: 0 1px 0 #FFFFFF;" +
"}" +
"" +
".gctour-notification-red {" +
" background-color: red;" +
" border: 1px solid #8B0000;" +
" color: #FFFFFF;" +
" text-shadow: 0 1px 0 #000000;" +
"}" +
"" +
".gctour-notification-blue {" +
" background-color: #57B7E2;" +
" border: 1px solid #0B90C4;" +
" color: #000000;" +
" text-shadow: 0 1px 0 #FFFFFF;" +
"}" +
"" +
".gctour-notification-yellow {" +
" background-color: #FFFC00;" +
" border: 1px solid #FFC237;" +
" color: #000000;" +
" text-shadow: 0 1px 0 #FFFFFF;" +
"}" +
"" +
"/* jquery ui overwrite */\n" +
"" +
".ui-button-icon-only .ui-icon {" +
" margin-top: -8px !important;" +
" margin-left: -8px !important;" +
"}" +
"" +
".gct .ui-widget-content {" +
" background: #FFFFFF;" +
" /* border: 0; */" +
"}" +
"" +
".gct .ui-widget-content a {" +
" color: #00447c;" +
" text-decoration: underline;" +
"}" +
"" +
".ui-button-text-only .ui-button-text {" +
" padding: .2em .6em;" +
"}" +
"" +
"input.ui-button {" +
" padding: .2em .6em;" +
"}" +
"" +
".ui-dialog .ui-dialog-buttonpane {" +
" margin-top: 0;" +
"}" +
"" +
"/* Handling of Groundspeak's stylesheets: different sites use different stylesheets */\n" +
"" +
".gctour-input-checkbox {" +
" position: relative !important;" +
" opacity: 1 !important;" +
" width: 14px !important;" +
" height: 14px !important;" +
"}" +
"" +
".gctour-input-text {" +
" padding: unset !important;" +
" font-size: 1em !important;" +
" font-family: inherit !important;" +
" border: 1px solid #ccc !important;" +
" border-radius: 3px !important;" +
" height: auto !important;" +
" line-height: inherit !important;" +
"}" +
"" +
".gctour-label {" +
" display: unset !important;" +
"}" +
"" +
".gctour-small {" +
" font-size: 0.6875rem !important;" +
"}" +
"" +
"/* send2cgeo */\n" +
"" +
"#gctour_send2cgeo_progressbar {" +
" margin: 2px 0;" +
"}" +
"" +
".hide {" +
" display: none;" +
"}" +
".ui-progressbar {" +
" position: relative;" +
" width: 60%;" +
"}" +
"" +
".ui-progressbar-value {" +
"}" +
".progress-label {" +
" position: absolute;" +
" width: 100%;" +
" text-align: center;" +
" top: 4px;" +
" font-weight: bold;" +
"}" +
"div.gct_send2cgeo ol li {" +
" padding: 2px;" +
"}" +
"div.gct_send2cgeo ul {" +
" list-style-type: disc;" +
"}" +
"div.gct_send2cgeo ul, ol {" +
" padding-left: 1.5em;" +
" margin-bottom: 0.5em;" +
" margin-left: 1.5em;" +
"}" +
"div.gct_send2cgeo a {" +
" text-decoration: underline;" +
"}" +
"")
.replace("##gctourLogo##", $.gctour.img.gctourLogo)
.replace("##dialogMaskImage##", $.gctour.img.dialogMask)
.replace("##tabBgImage##", $.gctour.img.tabBg));
}
/* utilities */
// Read all GET URL variables and return them as an associative array.
function getUrlVars(url) {
var vars = [],
hash;
var hashes = url.slice(url.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
function createElement(type, attributes) {
var node = document.createElement(type);
for (const attr in attributes) {
if (Object.hasOwn(attributes, attr)) {
node.setAttribute(attr, attributes[attr]);
}
}
return node;
}
function append(thisElement, toThis) {
return toThis.appendChild(thisElement);
}
function fillTemplate(mapping, template) {
var j,
dummy;
for (j = 0; j < mapping.length; j++) {
template = template.replaceAll("###" + mapping[j][0] + "###", mapping[j][1]);
}
dummy = createElement('div');
dummy.innerHTML = template;
return dummy.firstChild;
}
// rot13.js from gc.com
function createROT13array() {
var A = 0,
C = [],
D = "abcdefghijklmnopqrstuvwxyz",
B = D.length;
for (A = 0; A < B; A++) {
C[D.charAt(A)] = D.charAt((A + 13) % 26);
}
for (A = 0; A < B; A++) {
C[D.charAt(A).toUpperCase()] = D.charAt((A + 13) % 26).toUpperCase();
}
return C;
}
function convertROT13Char(A) {
return (A >= "A" && A <= "Z" || A >= "a" && A <= "z" ? ROT13_ARRAY[A] : A);
}
function convertROT13String(C) {
var A = 0,
B = C.length,
D = "";
if (!ROT13_ARRAY) {
ROT13_ARRAY = createROT13array();
}
for (A = 0; A < B; A++) {
D += convertROT13Char(C.charAt(A));
}
return D;
}
function convertROTStringWithBrackets(C) {
var F = "",
D = "",
E = true,
A = 0,
B = C.length;
if (!ROT13_ARRAY) {
ROT13_ARRAY = createROT13array();
}
for (A = 0; A < B; A++) {
F = C.charAt(A);
if (A < (B - 4)) {
if (C.toLowerCase().substr(A, 4) == "<br/>") {
D += "<br/>";
A += 3;
continue;
}
}
if (F == "[" || F == "<") {
E = false;
} else {
if (F == "]" || F == ">") {
E = true;
} else {
if ((F === " ") || (F === "&dhbg;")) {}
else {
if (E) {
F = convertROT13Char(F);
}
}
}
}
D += F;
}
return D;
}
// Replace all &,< and > with their HTML tag; additionally replace <br> by <br /> (may cause problems on Garmin units)
function escapeHTML(htmlString) {
return (!htmlString) ? "" : htmlString.replace(/<br[^>]*>/gi, '<br />').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
// strip all ASCII control codes (range 0-31) from a string, except LF and CR
function stripASCIIcodes(s) {
return s.split('').filter(function(x) {
var n = x.charCodeAt(0);
return n==10 || n==13 || n>31; // keep LF and CR
}).join('');
}
function xsdDateTime(date) {
function pad(n) {
var s = n.toString();
return (s.length < 2) ? '0' + s : s;
}
var yyyy = date.getFullYear(),
mm1 = pad(date.getMonth() + 1),
dd = pad(date.getDate()),
hh = pad(date.getHours()),
mm2 = pad(date.getMinutes()),
ss = pad(date.getSeconds());
return yyyy + '-' + mm1 + '-' + dd + 'T' + hh + ':' + mm2 + ':' + ss + 'Z';
}
// GET, POST, PUT, DELETE
function promiseRequest(method, url, headers, data, progressbar=false) {
log(["---PROMISEREQUEST---",
"\tmethod: " + method,
"\turl: " + url,
"\theaders: " + JSON.stringify(headers),
"\tdata: " + data,
"---PROMISEREQUEST---"
].join("\n"));
// return a promise
return new Promise(function(resolve, reject) {
GM_xmlhttpRequest({
method : method,
url : url,
headers : headers,
data : data,
timeout: 0, // infinity
onload : function(result) {
if (progressbar) updateProgressBar();
responseInfo(result);
if (result.status >= 200 && result.status < 300) { // ok
resolve(result);
} else { // error
//reject(' error: ' + result.status + ', message: ' + result.statusText + ', error message: ' + errMess);
reject(result.responseText);
}
},
ontimeout : function() {
let l = new URL(url);
reject(' timeout detected: "no answer from ' + l.origin + '"');
},
onerror : function(result) { // network error
responseInfo(result);
reject(' error: ' + result.status + ', message: ' + result.statusText);
}
});
});
}
// observe body until elem is available, then run function func once
function waitForElementThenRun(elem, func, timeout) {
// fine, elem is already available; no need to observe, run func immediately
if ($(elem).length>0) {
func();
return
}
timeout = timeout || 10; // default timeout after 10s
timeout *= 1000;
const t0 = Date.now();
log_timeStart('waitForElementThenRun() - '+elem);
let cb = function(_mutationsList, observer) {
// ensure that observing stops after at latest timeout [ms]
if (Date.now() - t0 > timeout) {
log_timeEnd('waitForElementThenRun() - '+elem);
log(elem + ' not found for ' + timeout + 's');
observer.disconnect();
}
if ($(elem).length>0) {
log_timeEnd('waitForElementThenRun() - '+elem);
observer.disconnect();
func();
}
}
// observe body for changes of child nodes
let target = $('body')[0];
let config = {
childList: true,
subtree: true,
attributes: true
};
let observer = new MutationObserver(cb);
if (target) observer.observe(target, config);
}
// inspiration: dojo.date.difference (http://jsfiddle.net/fr4Na/)
function DateDiff(date1, date2, einheit) {
var ms = date1.getTime() - date2.getTime(); // milliseconds
var diff;
switch (einheit) {
case "second":
diff = ms / 1000;
break;
case "minute":
diff = ms / 60000; // 1000 * 60
break;
case "hour":
diff = ms / 3600000; // 1000 * 60 * 60
break;
case "day":
diff = ms / 86400000; // 1000 * 60 * 60 * 24
break;
case "week":
diff = ms / 604800000; // 1000 * 60 * 60 * 24 * 7
break;
default:
diff = ms;
break;
}
return diff;
}
function dateFormatConversion(format) {
return format.replace(/yy/g,'y').replace(/M/g,'m').replace(/mmm/,'M');
/* GS dateformat to jqui datepicker dateformat:
https://www.geocaching.com/account/settings/preferences#SelectedDateFormat
http://api.jqueryui.com/datepicker/#utility-parseDate
GS --> jqui: d-->d,dd-->dd,M-->m,MM-->mm,MMM-->M,yy-->y,yyyy-->yy
"d. M. yyyy" : "d. m. yy", 3. 1. 2017
"d.M.yyyy" : "d.m.yy", 3.1.2017
"d.MM.yyyy" : "d.mm.yy", 3.01.2017
"d/M/yy" : "d/m/y", 3/1/17
"d/M/yyyy" : "d/m/yy", 3/1/2017
"d/MM/yyyy" : "d/mm/yy", 3/01/2017
"dd MMM yy" : "dd M y", 03 Jan 17
"dd.MM.yy" : "dd.mm.y", 03.01.17
"dd.MM.yyyy" : "dd.mm.yy", 03.01.2017
"dd.MM.yyyy." : "dd.mm.yy.", 03.01.2017.
"dd.MMM.yyyy" : "dd.M.yy", 03.Jan.2017
"dd/MM/yy" : "dd/mm/y", 03/01/17
"dd/MM/yyyy" : "dd/mm/yy", 03/01/2017
"dd/MMM/yyyy" : "dd/M/yy", 03/Jan/2017
"dd-MM-yy" : "dd-mm-y", 03-01-17
"dd-MM-yyyy" : "dd-mm-yy", 03-01-2017
"d-M-yyyy" : "d-m-yy", 3-1-2017
"M/d/yyyy" : "m/d/yy", 1/3/2017
"MM/dd/yyyy" : "mm/dd/yy", 01/03/2017
"MMM/dd/yyyy" : "M/dd/yy", Jan/03/2017
"yyyy.MM.dd." : "yy.mm.dd.", 2017.01.03.
"yyyy/MM/dd" : "yy/mm/dd", 2017/01/03
"yyyy-MM-dd" : "yy-mm-dd" 2017-01-03 */
}
async function parseDate(date_string) {
var gs_date_format = GS_USERINFO.dateFormat,
jqui_date_format = dateFormatConversion(gs_date_format),
date,
debugStr = "date to parse: '" + date_string + "'\nGS format: '" + gs_date_format + "'\njqui format: '" + jqui_date_format;
try {
date = $.datepicker.parseDate(jqui_date_format, date_string);
debug(debugStr + "'\nParsed date: '" + date + "'");
} catch (e) {
var err = 'Date format mismatch in fn parseDate - "' + e + '"<br>&nbsp;&nbsp;date format: ' + gs_date_format + '<br>&nbsp;&nbsp;date to parse: ' + date_string;
if (gs_date_format === 'undefined') { // most probably third-party cookies are not accepted by Firefox
err += '<br><br><u>Bitte Firefox-Einstellungen prüfen: Cookies von Drittanbietern müssen akzeptiert werden.</u>';
err += '<br><u>Please check Firefox settings: third-party cookies need to be accepted.</u>';
}
throw err;
}
return date;
}
async function formatDate(date) {
var gs_date_format = GS_USERINFO.dateFormat,
jqui_date_format = dateFormatConversion(gs_date_format);
try {
var date_string = $.datepicker.formatDate(jqui_date_format, date);
debug("date to format: '" + date + "'\nGS format: '" + gs_date_format + "'\njqui format: '" + jqui_date_format + "'\nDatestring: '" + date_string + "'");
} catch(e) {
throw 'Date format mismatch in fn formatDate - "' + e + '"<br>&nbsp;&nbsp;date to format: ' + date + '<br>&nbsp;&nbsp;GS format: ' + gs_date_format;
}
return date_string;
}
/* geo utilities*/
/** Orientiert an Geodesy representation conversion functions (c) Chris Veness 2002-2011 **/
var Geo = {}; // Geo namespace, representing static class
/**
* Interpretiert einen String als Gradzahl. Diese Funktion verarbeitet alle 3 möglichen Formate (d, dm, dms)
* Limitiert auf eine Komponente pro Aufruf.
*
* @param {String} dmsStr: Koordinaten String
* @returns {Number} deg: Degrees
*/
Geo.parseDMS = function(dmsStr) {
// entferne alle nicht Zahlen (Regex:[^\d.\s]) und teile den String an den verbleibenden Leerzeichen (Regex:[^0-9.,])
var dms = dmsStr.replace(/[^\d.\s]/g, ' ').trim().split(/[^0-9.,]+/);
var deg;
// wenn nix mehr übrig bleibt -> keine Koordinate
if (dms == '') {
return NaN;
}
// Anhand der Länge von dms wird ermittelt im welchem Format die Koordinaten vorliegen
switch (dms.length) {
case 3: // interpret 3-part result as d/m/s
deg = dms[0] / 1 + dms[1] / 60 + dms[2] / 3600;
break;
case 2: // interpret 2-part result as d/m
deg = dms[0] / 1 + dms[1] / 60;
break;
case 1: // just d (possibly decimal) or non-separated dddmmss
deg = dms[0];
break;
default:
return NaN;
}
// anschließend negiere Wert wenn der String ein S oder W beinhaltet
if (/^-|^[WS]/i.test(dmsStr.trim())) {
deg = -deg;
}
return deg;
};
/**
* Konvertiert dezimal Gradzahlen zu dem festgelgegten Format ('d', 'dm', 'dms') - Vorangestellt N/S
*
* @param {Number} deg: Degrees
* @param {String} [format=dms]: Return value as 'd', 'dm', 'dms'
* @param {Number} [dp=0|2|4]: No of decimal places to use - default 0 for dms, 2 for dm, 4 for d
* @returns {String} Deg/min/seconds
*/
Geo.toLat = function(deg, format) {
var lat = Geo.toDMS(deg, format);
return lat == '' ? '' : (deg < 0 ? 'S' : 'N') + " " + lat.slice(1); // erste '0' abschneiden für Lat
};
/**
* Konvertiert dezimal Gradzahlen zu dem festgelgegten Format ('d', 'dm', 'dms') - Vorangestellt E/W
*
* @param {Number} deg: Degrees
* @param {String} [format=dms]: Return value as 'd', 'dm', 'dms'
* @returns {String} Deg/min/seconds
*/
Geo.toLon = function(deg, format) {
var lon = Geo.toDMS(deg, format);
return lon == '' ? '' : (deg < 0 ? 'W' : 'E') + " " + lon;
};
/**
* Konvertiert dezimal Gradzahlen in das "deg°"(d), "deg° min" (dm) oder "deg°min'sec''"(dms) Format
*
* @private
* @param {Number} deg: Degrees
* @param {String} [format=dm]: Return Format 'd', 'dm', 'dms'
* @returns {String} Koordinaten String in dem festgelegten Format
* @throws {TypeError} wenn deg ein Object ist
*/
Geo.toDMS = function(deg, format) {
if (typeof deg == 'object') {
throw new TypeError('Geo.toDMS - deg is an object');
}
if (isNaN(deg)) {
return 'NaN';
} // give up here if we can't make a number from deg
// default value of format = dm
if (typeof format == 'undefined') {
format = 'dm';
}
deg = Math.abs(deg); // (unsigned result ready for appending NS|WE)
var dms,
d,
m,
s,
min,
sec,
tmpD,
tmpM;
switch (format) {
case 'd':
d = deg.toFixed(8); // round degrees
tmpD = d;
if (d < 100) {
tmpD = '0' + tmpD;
} // pad with leading zeros
if (d < 10) {
tmpD = '0' + tmpD;
}
dms = tmpD; // add ° symbol
break;
case 'dm':
min = (deg * 60).toFixed(8); // convert degrees to minutes & round
d = Math.floor(min / 60); // get component deg/min
m = (min % 60).toFixed(3); // pad with trailing zeros
tmpD = d;
tmpM = m;
if (d < 100) {
tmpD = '0' + tmpD;
} // pad with leading zeros
if (d < 10) {
tmpD = '0' + tmpD;
}
if (m < 10) {
tmpM = '0' + tmpM;
}
dms = tmpD + '\u00B0' + tmpM; // add ° symbol
break;
case 'dms':
sec = (deg * 3600).toFixed(0); // convert degrees to seconds & round
d = Math.floor(sec / 3600); // get component deg/min/sec
m = Math.floor(sec / 60) % 60;
s = (sec % 60).toFixed(0); // pad with trailing zeros
if (d < 100) {
d = '0' + d;
} // pad with leading zeros
if (d < 10) {
d = '0' + d;
}
if (m < 10) {
m = '0' + m;
}
if (s < 10) {
s = '0' + s;
}
dms = d + '\u00B0' + m + '\u2032' + s + '\u2033'; // add °, ', " symbols
break;
}
return dms;
};
/**
* Erzeugt einen Punkt mit den gegebenen Latitude und Longitude
* @constructor
* @param {Number} lat: latitude in numeric degrees
* @param {Number} lon: longitude in numeric degrees
*/
function LatLon(lat, lon) {
// only accept numbers or valid numeric strings
this._lat = typeof(lat) == 'number' ? lat : typeof(lat) == 'string' && lat.trim() != '' ? +lat : NaN;
this._lon = typeof(lon) == 'number' ? lon : typeof(lon) == 'string' && lon.trim() != '' ? +lon : NaN;
}
/**
* Gibt einen String mit "lat() lon()" von diesem Punkt zurück
*
* @param {String} [format]: Return value als 'd', 'dm', 'dms'
* @returns {String} Space-separated latitude/longitude
*
*/
LatLon.prototype.toString = function(format) {
if (typeof format == 'undefined') {
format = 'dm';
}
if (isNaN(this._lat) || isNaN(this._lon)) {
return '-,-';
}
return Geo.toLat(this._lat, format) + ' ' + Geo.toLon(this._lon, format);
};
/**
* Interpretiert eine Koordinaten Eingabe des Formats "N51° 12.123 E010° 23.123" oder "51.123 10.123" bzw. benutzt Geocoding API um die Koordinaten zu finden.
*
* @param {String} coord_string: Koordinaten in einem Format
* @param {Boolean} [force_Geocoding=false]: Wenn gesetzt sucht die Methode bei nicht numerischer Eingabe mittels Geocoding nach den Koordinaten
* @returns {LatLon} Koordinaten Object
*/
async function parseCoordinates(coord_string, force_Geocoding) {
// entferne alle "," in Koordinaten String
if (typeof coord_string == "string") {
coord_string = coord_string.replace(/,/g, ".");
}
var lat,
lon;
// regex for N51° 12.123 E12° 34.123
var regex_coord_ns = new RegExp(/(N|S)\s*(\d{0,2})\s*°\s*(\d{0,2}[\.,]\d+)/);
var regex_coord_ew = new RegExp(/(E|W)\s*(\d{0,3})\s*°\s*(\d{0,2}[\.,]\d+)/);
//regex for 51.123 12.123
var regex_coord_dec = new RegExp(/(-{0,1}\d{0,2}[\.,]\d+)\s*(-{0,1}\d{0,3}[\.,]\d+)/);
var result_coord_ns = regex_coord_ns.exec(coord_string);
var result_coord_ew = regex_coord_ew.exec(coord_string);
var result_coord_dec = regex_coord_dec.exec(coord_string);
// Koordinate ist keins der beiden numerischen Formate
if (!(result_coord_ns && result_coord_ew) && !result_coord_dec) {
// ... now only a geocoding service can help ...
if (force_Geocoding) {
// search in OSM data
var response = await promiseRequest('GET', "https://nominatim.openstreetmap.org/search?format=json&limit=1&q=" + coord_string);
var geocoding_obj = JSON.parse(response.responseText);
if (geocoding_obj.length === 0) { // no result found
return false;
}
lat = geocoding_obj[0].lat;
lon = geocoding_obj[0].lon;
return new LatLon(lat, lon);
} else {
return false;
}
} else if (result_coord_ns && result_coord_ew) {
// result_coord_ns[0] = "N51° 12.123"
// result_coord_ew[0] = "E010° 23.123"
lat = Geo.parseDMS(result_coord_ns[0]);
lon = Geo.parseDMS(result_coord_ew[0]);
return new LatLon(lat, lon);
} else {
// result enthält beide Teile der Koordinate
lat = Geo.parseDMS(result_coord_dec[1]);
lon = Geo.parseDMS(result_coord_dec[2]);
return new LatLon(lat, lon);
}
}
function distanceBetween(lat1, lon1, lat2, lon2) {
var R = 6371000; // meters (change this constant to get miles)
var dLat = (lat2 - lat1) * Math.PI / 180;
var dLon = (lon2 - lon1) * Math.PI / 180;
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * Math.sin(dLon / 2) * Math.sin(dLon / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d;
}
/* helpers */
// for map page: return center and radius
var getMapCenterAndRadius = function() {
var newMap = false;
if (location.pathname === '/play/map') {
newMap = true;
}
var ret = {};
if (newMap) {
var search = location.search.substring(1);
var params = JSON.parse('{"' + search.replace(/&/g, '","').replace(/=/g,'":"') + '"}', function(key, value) { return key === "" ? value : decodeURIComponent(value) });
ret.center = {};
ret.center.lat = params.lat;
ret.center.lng = params.lng;
// https://gis.stackexchange.com/questions/7430/what-ratio-scales-do-google-maps-zoom-levels-correspond-to#answer-127949
var metersPerPx = 156543.03392*Math.cos(params.lat/180*Math.PI )/Math.pow(2, params.zoom);
var $map =$('div.app-main');
var dim = Math.min($map.width(), $map.height());
ret.radius = (metersPerPx*(dim/2)/1000).toFixed(3); // km
} else { // old map
var googleMap = unsafeWindow.MapSettings ? unsafeWindow.MapSettings.Map : undefined,
bounds;
ret.center = "";
ret.radius = "";
if (typeof(googleMap) !== "undefined") {
bounds = googleMap.getBounds();
ret.center = googleMap.getCenter();
ret.radius = Math.floor(
distanceBetween(
ret.center.lat, ret.center.lng,
bounds.getNorthEast().lat,
bounds.getNorthEast().lng - (bounds.getNorthEast().lng - bounds.getSouthWest().lng) / 2)) / 1000;
}
}
return ret;
};
// is string json, isJSON(response.responseText)
// fn from js-Framework prototype v1.7
var isJSON = function(str) {
if (str.length === 0) {
return false;
}
str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
return (/^[\],:{}\s]*$/).test(str);
};
// is String a GCCode ?
// begin with 'GC' + 1 to 6 chars, current is 5 (01.2017)
// return Boolean
var isGCCode = function(gccode) {
return (/^\s*(GC[0-9A-Z]{1,6})\s*$/).test(gccode);
};
// find GCID (GCCode) in String
// first 'GC' + 1 to 6 chars in a string, current is 5 (01.2017)
// return String
// example: http://jsfiddle.net/NUFGq/15/
var findGCCodeFromString = function(str) {
if (!str || str.length === 0) {
return false;
}
var treffer = str.match(/\bGC([0-9A-Z]{1,6})\b/) || [];
return (treffer[0] || "");
};
// converts GS geocache code string of format GCxxxx to its cache ID
function gCCode2ID(wp) {
// in GS waypoints the letters I,L,O,S,U are missing;
// therefore, for the base-31 conversion, a shift of letters is required first
function shiftLettersInGCCode(wp) {
let char36 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
let char31 = "0123456789ABCDEFGHJKMNPQRTVWXYZ";
wp = wp.split(''); // string to char array
let i, c;
for (i=0; i<wp.length; i++) {
c = wp[i];
wp[i] = char36[char31.indexOf(c)];
}
return wp.join('');
}
wp = wp.substr(2); // remove leading 'GC' from waypoint
wp = shiftLettersInGCCode(wp); // shift letters of GC waypoint
let id = parseInt(wp,31); // base-31 to decimal conversion
// either use the base-31 or hex to decimal conversion
if (id > parseInt('FFFF',31)) // max. occurring hex value in GC waypoints
id = id - 411120; // [65536,...]
else
id = parseInt(wp,16); // [0,65535]
return id;
}
// retrieve stylesheet from document
function getStyleSheet(name) {
for (var i = 0; i < document.styleSheets.length; i++) {
var sheet = document.styleSheets[i];
if (sheet.href && sheet.href.includes(name)) {
return sheet;
}
}
}
// delete stylesheet rules by pattern
function deleteStyleSheetRules(sheet, pattern) {
var length = sheet.cssRules.length;
var deletedRules = [];
for (var i = 0; i < length; i++) {
var rule = sheet.cssRules[i];
if (pattern.test(rule.cssText)) {
deletedRules.push(rule.cssText);
sheet.deleteRule(i);
i -= 1;
length -= 1;
}
}
return deletedRules;
}
/* initialize */
// init core variables
function initCore() {
debug("initCore()");
// setting up the language
$.gctour.currentLang = GM_getValue('language', $.gctour.defaultLang);
// getting all tours
TOURS = loadValue('tours', []);
// go get the current tour from the tour list
var currentTourId = GM_getValue('currentTour', -1);
CURRENT_TOUR = getTourById(currentTourId);
// oh - there is no current tour!? create one!
if (!CURRENT_TOUR) {
CURRENT_TOUR = {};
CURRENT_TOUR.id = getNewTourId();
CURRENT_TOUR.name = "Tour " + CURRENT_TOUR.id;
CURRENT_TOUR.geocaches = [];
TOURS.push(CURRENT_TOUR);
log("found no currentTour! Creating new one: " + CURRENT_TOUR.id + " ; " + CURRENT_TOUR.name);
saveCurrentTour();
}
}
function init() {
debug("init()");
// set Styles (GM_addStyle)
initStyle();
// add global styles
var head = document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
head.appendChild(style);
// initialize tour list under main navigation
initComponents();
// update the complete gui if the tab gets focus and handle resizing
$(window).on({
'focus' : function() {
updateTour();
},
'resize' : function() {
handleResize();
}
});
// process "add to GCTour" link from GCTOUR_HOST
if (document.URL.search("webcode") >= 0) {
document.title = "GCTour";
document.getElementsByTagName('body')[0].innerHTML = "<div align='center'><a href='" + GS_HOST + "'><img border='0' src='" + $.gctour.img.gctourLogo + "'/></a></div>";
downloadTour(document.URL.split("webcode/")[1]);
return;
}
// process autoTour: loop through results on old search page and save autoTour
if (GM_getValue('tq_url')) {
processAutoTour();
}
// maps
// old (browse) map: /map/default.aspx
if (document.URL.search(GS_HOST+"map") >= 0) {
var $header = $("a[href*='account/messagecenter']");
if ($header.filter('.gclh_message-center').length > 0) // GCLH replaced the header
$header = $header.filter('.gclh_message-center').parent().parent();
else
$header = $header.first().parent().parent();
// autoTour button
$("<div>", {
"css" : {
'overflow' : "hidden",
'border-radius' : 5,
'background-color' : "#FFF",
'border' : "2px solid #999",
'cursor' : 'pointer',
'float' : 'right'
},
"html" : $("<h1>", {
"css" : {
'padding' : 0
},
click : function(e) {
var gooMap = getMapCenterAndRadius();
showAutoTourDialog(gooMap.center, gooMap.radius);
},
"html" : $("<img>", {
"title": "map to autoTour",
"src" : $.gctour.img.mapToAutoTour,
"width" : "70px"
})
})
.hover(
function() {
$(this).css({
'backgroundColor' : 'orange'
});
},
function() {
$(this).css({
//'backgroundColor' : '#B2D4F3'
'backgroundColor' : '#FFF'
});
})
}).prependTo($header);
// add to tour in cache pop-up;
// setTimeout is necessary since GCLH2 changes this template, too
setTimeout(function() {
$('#cacheDetailsTemplate').text(
function(index, text) {
var tmpAddToTour = '{{#if $ctx.userIsLoggedIn() }}' +
'<a class="lnk" id="attKnopf" href="javascript:add2tour();">' +
'<img src="' + $.gctour.img.addToTour + '"><span>' + $.gctour.lang('cache.addToTour') + '</span>' +
'</a>';
return text.replace(/\{\{\#if \$ctx.userIsLoggedIn\(\) \}\}/g, tmpAddToTour);
}
);
}, 0);
var add2tour = function() {
setTimeout(function() {
var gccode = $('#gmCacheInfo div[class*="code"]:visible:first').text().trim();
var name = $("#gmCacheInfo a[href*='cache_details.aspx']:visible:first").text().trim();
var guid = getUrlVars($("#gmCacheInfo a[href*='/seek/log.aspx?guid']:visible:first").attr("href"))["guid"];
var imageUrl = $("#gmCacheInfo img[src*='images/mapicons/']:visible:first").attr("src") ||
$("#gmCacheInfo img[src*='" + GS_WPT_IMAGE_PATH + "']:visible:first").attr("src");
var cacheTypeImage = imageUrl.split('/').pop();
debug("map add2tour: gccode:'" + gccode + "' name:'" + name + "' image:'" + cacheTypeImage + "' guid:'" + guid + "'");
addGeocache(gccode, guid, name, cacheTypeImage)();
saveCurrentTourRefreshGUI();
}, 0);
};
// workaround for Violentmonkey in Firefox if "exportFunction" does not exist
// (see https://github.com/violentmonkey/violentmonkey/issues/168#issuecomment-321573665)
// nonetheless, this doesn't work for Chrome/Violentmonkey
if (typeof exportFunction !== 'function') {
exportFunction = function(func, scope, options) {
if (options && options.defineAs) {
scope[options.defineAs] = func;
}
return func;
};
}
exportFunction(add2tour, unsafeWindow, {
defineAs : "add2tour"
});
// make GS scrollbar in search section work
setTimeout(function() {
// show working scrollbar
$('div#scrollbar').css('overflow','');
// remove non-working scrollbar
$('div#scroller').next().remove();
},0);
}
// new (search) map: /play/map
if (document.URL.search("/play/map") >= 0) {
var addAutoTourButton = function() {
let $li = $("<li>", {
"css": {
'height': 26,
'overflow': "hidden",
'border-radius': 5,
'background-color': "#FFF",
'border': "2px solid #999",
'cursor': 'pointer'
},
"html": $("<h1>", {
click: function(e) {
let map = getMapCenterAndRadius();
showAutoTourDialog(map.center, map.radius);
},
"css": {
'margin-top': '0px',
'margin-bottom': '0px'
},
"html": $("<img>", {
"id": "autoTourButton",
"title": "map to autoTour",
"src": $.gctour.img.mapToAutoTour,
"width": "70px"
})
})
.hover(
function() {
$(this).css({'backgroundColor': 'orange'});
},
function() {
$(this).css({'backgroundColor': '#FFF'});
}
)
});
let $autoTourAnchor = $("li a.message-center").parent();
// GCLH2 replaces site header, therefore another anchor is necessary
// (we need to wait until GCLH2 header is ready)
setTimeout(function() {
// add button only once (due to timeout check must be here)
if ($('#autoTourButton')[0]) return;
if ($('gclh_nav').length>0) {
if ($("li.messagecenterheaderwidget").length>0) { // message center
$autoTourAnchor = $("li.messagecenterheaderwidget");
// necessary style adaptation for GCLH2 header
$autoTourAnchor.css("margin-left", "0px");
}
// message center removed by GCLH
else if ($("li.li-user").length>0) { // user section
$autoTourAnchor = $("li.li-user");
$autoTourAnchor.css("margin-left", "9px");
}
// necessary style adaptations for GCLH2 header
$('img',$li).css("margin-bottom", "6px"); // autoTour image
$li.css('height',"29px"); // autoTour li
$autoTourAnchor.next().css("margin-left", "0px"); // dashboard link
}
$li.insertBefore($autoTourAnchor);
},1000);
}
// add cache to tour from cache details in sidebar
var add2tour_cacheDetails = function() {
let gccode = $('span.cache-metadata-code:first').text().trim();
let name = $('div.header-top-left h1').text().trim();
let guid = undefined; // must be present, but not really needed
let type = $('p.status-and-type');
$('span.status', type).remove(); // remove status (if present): Premium, Disabled, ...
type = type.text().trim();
let cacheTypeImage;
let ind = WPT_ARRAY.findIndex(obj => obj.gsDisplayName == type);
cacheTypeImage = WPT_ARRAY[ind].wptTypeId + '.gif';
debug("add2tour_cacheDetails: gccode:'" + gccode + "' name:'" + name + "' image:'" + cacheTypeImage + "' guid:'" + guid + "'");
addGeocache(gccode, guid, name, cacheTypeImage)();
saveCurrentTourRefreshGUI();
};
// add cache to tour from search list in sidebar
var add2tour_searchList = function(cacheitem) {
let guid = undefined;
let name = cacheitem.name;
let gccode = cacheitem.code;
let type = cacheitem.geocacheType;
let cacheTypeImage;
let ind = WPT_ARRAY.findIndex(obj => obj.wptTypeId == type);
cacheTypeImage = WPT_ARRAY[ind].wptTypeId + '.gif';
//debug("add2tour_searchList: gccode:'" + gccode + "' name:'" + name + "' image:'" + cacheTypeImage + "' guid:'" + guid + "'");
addGeocache(gccode, guid, name, cacheTypeImage)();
}
var searchButtonIsActive = function() {
if ($('button[data-event-label="Select Search toggle"]').parent().hasClass('active')) return true;
else return false;
}
var addAllCachesFromSearchList = async function(newTour) {
if (newTour && !newTourFunction()()) {
return; // exit on cancel
}
addProgressbar();
try {
// BM lists need special treatment
if (document.URL.search("/map/lists/") >= 0) {
// get all caches from bm list
let bmId = window.location.href.split('/').pop();
let bml = new Bookmarklist(bmId);
var gcs = await bml.getGeocaches();
gcs = gcs.data;
for (let i=0; i<gcs.length; i++) {
addGeocache(gcs[i].referenceCode, undefined, gcs[i].name, gcs[i].geocacheType + '.gif')();
}
} else {
// map URL: https://www.geocaching.com/play/map?lat=50.5&lng=8.5&zoom=14&asc=true&sort=distance&st=50.5%2C8.5&ot=coords
// radius search: https://www.geocaching.com/api/proxy/web/search/v2?skip=0&take=1000&asc=true&sort=distance&origin=50.5,8.5&rad=16000
// box search: https://www.geocaching.com/api/proxy/web/search/v2?skip=0&take=1000&asc=true&sort=distance&origin=50.5,8.5&rad=16000&box=50.51239,8.450546,50.487658,8.549423 (zoom 14)
// 1) if magnifier is pressed for search, then a radius search is performed
// 2) if filters are set and confirmed by apply, then a box search is performed
// 3) if "Search this area" button is pressed, then a box search is performed
const urlSearchParams = new URLSearchParams(window.location.search);
var center = {};
center.lat = urlSearchParams.get('lat');
center.lng = urlSearchParams.get('lng');
urlSearchParams.delete('lat');
urlSearchParams.delete('lng');
urlSearchParams.delete('ot');
urlSearchParams.delete('st');
var zoom = urlSearchParams.get('zoom');
urlSearchParams.delete('zoom');
// if no radius is present, set to default value 16km
urlSearchParams.append('rad', urlSearchParams.has('r') ? Number(urlSearchParams.get('r')) * 1000 : 16000);
urlSearchParams.delete('r');
const maxCachesToShow = unsafeWindow._gcMapSettings.properties.desktopPageSize,
options = '&' + urlSearchParams.toString();
// radius search
var url = GS_HOST + 'api/proxy/web/search/v2?skip=0&take=' + maxCachesToShow + '&origin=' + center.lat + ',' + center.lng + options,
response = await promiseRequest('GET', url),
caches = JSON.parse(response.responseText).results;
// if radius search results do not match, perform an additional box search
let pagination_label = $('span.pagination-label'),
nResults;
if (pagination_label.length > 0) {
nResults = Number(pagination_label.text().split(" ")[1].replace(/\D/g, ''));
} else { // just 1 results page, therefore no pagination_label
nResults = $('div.sidebar-content li').length;
}
if (caches.length !== nResults) {
// results are from box search instead of radius search, thus perform an additional box search
debug('results are from box search, perform one');
// width and height of GS map
let $map = $('div.app-main'),
pxwidth = $map.width(),
pxheight = $map.height(),
// upper left and lower right corner for box search
map = L.map('map', {
center: [center.lat, center.lng],
zoom: zoom
}),
// upper left corner of GS map
nw = map.containerPointToLatLng(L.point(-pxwidth / 2, -pxheight / 2)),
// lower right corner of GS map
se = map.containerPointToLatLng(L.point(pxwidth / 2, pxheight / 2));
map.remove();
let box = '&box=' + nw.lat + ',' + nw.lng + ',' + se.lat + ',' + se.lng;
url += box;
response = await promiseRequest('GET', url);
caches = JSON.parse(response.responseText).results;
}
for (let i=0; i<caches.length; i++) {
add2tour_searchList(caches[i]);
}
}
// save and update tour, close overlay
saveCurrentTourRefreshGUI();
closeOverlay();
} catch(e) {
if (newTour) deleteCurrentTour(true);
addErrorDialog({
caption : "addAllCachesFromSearchList error",
_exception : e
});
}
}
let add2TourButton =
'<li>' +
'<button id="add2TourButton">' +
'<img class="action-icon" src="' + $.gctour.img.addToTour + '" style="width:20px;height:20px;">' +
'<span>' + $.gctour.lang('cache.addToTour') + '</span>' +
'</button>' +
'</li>';
// observer callback for checking existence of autoTour anchor and sidebar;
// furthermore, add add2tour buttons if they're missing
let cb_body = function() {
//debug('wait for autoTour anchor and sidebar, check if add2tour buttons are present');
if ($("li a.message-center").length===0 || $('div#sidebar').length===0 ||
$('button#addAll2CurrentTourButton').length > 0) {
return;
}
// add autoTour button
addAutoTourButton();
// start observing sidebar for switches between search list and cache details view
// (but keep body observer running to ensure that add2tour buttons are present)
let target_sidebar = $('div#sidebar')[0];
let config_sidebar = {
childList: true,
subtree: true
};
if (target_sidebar) observer_sidebar.observe(target_sidebar, config_sidebar);
}
// observer callback when sidebar switches between search list and cache details view
let cb_sidebar = function() {
// debug('sidebar observer');
if ($('div#geocache-list').length > 0) { // list view
// buttons to add all caches to current or new tour
if ($('button#addAll2CurrentTourButton').length === 0 &&
searchButtonIsActive()) { // only add when necessary and only if search button is active
let addAll2CurrentTourButton =
'<button id="addAll2CurrentTourButton" class="gc-button" title="(' + $.gctour.lang('cache.all') + ') ' + $.gctour.lang('cache.addToCurrentTour').replace('<b>', '').replace('</b>', '') + '">' +
'<img src="' + $.gctour.img.addToTour + '" style="vertical-align: bottom;"/>' +
'</button>';
let addAll2NewTourButton =
'<button id="addAll2NewTourButton" class="gc-button" title="(' + $.gctour.lang('cache.all') + ') ' + $.gctour.lang('cache.addToNewTour').replace('<b>', '').replace('</b>', '') + '">' +
'<img src="' + $.gctour.img.newTour + '" style="vertical-align: bottom;"/>' +
'+' +
'<img src="' + $.gctour.img.addToTour + '" style="vertical-align: bottom;"/>' +
'</button>';
let divAddAll2TourButtons =
'<div class="geocache-action-bar" style="display:grid !important;grid-template-columns:60px 30px;justify-content:end;justify-items:start; padding-bottom:2px !important;">' +
addAll2NewTourButton +
addAll2CurrentTourButton +
'</div>';
if ($('div.geocache-action-bar').length === 1) {
$('div.geocache-action-bar').first().after(divAddAll2TourButtons);
} else { // GCLH2 optionally adds additional buttons
$('div.geocache-action-bar').last().append(divAddAll2TourButtons);
}
$('button#addAll2CurrentTourButton').on('click', function() {
addAllCachesFromSearchList(false);
});
$('button#addAll2NewTourButton').on('click', function() {
addAllCachesFromSearchList(true);
});
// ensure that add2tour buttons are visible in search list
} else if (searchButtonIsActive()) {
$('button#addAll2NewTourButton').css('display','block');
$('button#addAll2CurrentTourButton').css('display','block');
}
} else if ($('div.has-active-cache').length > 0 ) { // cache details view
if ($('button#add2TourButton').length === 0) { // only add once
// add "add2tour" button
$('div.cache-preview-action-menu ul').prepend(add2TourButton);
$('button#add2TourButton').on('click', function(e) {
add2tour_cacheDetails();
});
}
// hide add2tour buttons in bm list view
} else if (!searchButtonIsActive()) { // bm list view
$('button#addAll2NewTourButton').css('display','none');
$('button#addAll2CurrentTourButton').css('display','none');
}
}
// create observer instances linked to callback functions
let observer_body = new MutationObserver(cb_body);
let observer_sidebar = new MutationObserver(cb_sidebar); // ATTENTION: the order matters here
// observe body for changes of child nodes to ensure that required anchors exist:
// 1) <li class="profile-panel-message-center">: autoTour button
// 2) <div id="sidebar">: add2Tour buttons
let target_body = $('body')[0];
let config_body = {
childList: true,
subtree: true
};
if (target_body) observer_body.observe(target_body, config_body);
}
// helper function to add buttons to bookmark and old search list
const addButtonsToAddAllOrSelectedCaches = function(addEntriesFromList) {
let selectMenu =
'<select name="add2tour" id="add2tour">' +
' <option value="all">' + $.gctour.lang("cache.shown") + '</option>' +
' <option value="selected">' + $.gctour.lang("cache.marked") + '</option>' +
'</select>';
// buttons
let $buttons = $("<div>", {
"css" : {
"margin" : "10px 0 10px 0",
"float": "left",
"width": "100%"
},
html : selectMenu
})
.append(
// button to add caches to current tour
$("<button>", {
"css" : {
"margin-left" : 10,
"cursor" : "pointer",
"background-color" : "#EEE"
},
"html" : "<img src='" + $.gctour.img.addToTour + "'/>&nbsp;" + $.gctour.lang('cache.addToCurrentTour')
})
.on('click', {
bLs: ($bookmarkLines) ? $bookmarkLines : '',
newTour: false
}, function(e) {
e.data["checkedOnly"] = ( $("select#add2tour option:selected").text() === $.gctour.lang('cache.marked') ) ? true : false;
e.preventDefault();
addEntriesFromList(e);
}))
.append(
// button to add caches to a new tour
$("<button>", {
"css" : {
"margin-left" : 10,
"cursor" : "pointer",
"background-color" : "#EEE"
},
"html" : "<img src='" + $.gctour.img.newTour + "'/>&nbsp;+&nbsp;<img src='" + $.gctour.img.addToTour + "'/>&nbsp;" + $.gctour.lang('cache.addToNewTour')
})
.on('click', {
bLs: ($bookmarkLines) ? $bookmarkLines : '',
newTour: true
}, function(e) {
e.data["checkedOnly"] = ( $("select#add2tour option:selected").text() === $.gctour.lang('cache.marked') ) ? true : false;
e.preventDefault();
addEntriesFromList(e);
})
);
return $buttons;
}
// add buttons to bookmark list
if (document.URL.search("/plan/lists") >= 0) {
// wait until bml is loaded
const anchor = '.list-geocache-row'; // row identifier
const timeout = 300; // 5min
waitForElementThenRun(anchor, addButtons, timeout);
var $bookmarkLines; // must be global
function addButtons() {
// all bml caches from current active page
$bookmarkLines = $(anchor);
// if buttons were already added, nothing to be done
if ($('img', $('.gc-checkbox-v2').parent()).length === $bookmarkLines.length) {
// continue observing
startObserver();
return;
}
// buttons to add single caches to tour
let checkbox;
for (let i = 0; i < $bookmarkLines.length; i++) {
// if button was already added, nothing to be done
if ($('#gct_add2Tour_' + (i+1), $bookmarkLines)[0]) continue;
checkbox = $('.gc-checkbox-v2', $bookmarkLines[i])[0];
// add button
$("<img>", {
"id": 'gct_add2Tour_' + (i + 1),
"alt": $.gctour.lang('cache.addToTour'),
"title": $.gctour.lang('cache.addToTour'),
"src": $.gctour.img.addToTour,
"css": {
"cursor": "pointer",
"float": "left",
"margin-top": "5px",
"width": "20px"
}
}).on('click', { entry: $bookmarkLines[i] }, function(e) {
let props = getCacheProps(e.data.entry);
addGeocache(props.id, props.guid, props.name, props.image)();
saveCurrentTourRefreshGUI();
}).insertAfter(checkbox); // add button below checkbox
}
// buttons to add marked or all caches in list to current or new tour
if ($('select#add2tour').length == 0) {
let $buttons = addButtonsToAddAllOrSelectedCaches(addEntryFromBookmark);
$buttons.insertBefore($('.gc-page-controls').parent());
$('select#add2tour').css({ "padding-top": "4px", "padding-bottom": "4px" });
}
// for pagination and sorting the buttons need to be updated
startObserver();
}
// helper functions
function startObserver() {
const cb = (_mutationList, observer) => {
observer.disconnect();
waitForElementThenRun(anchor, addButtons, timeout);
};
const observer = new MutationObserver(cb);
// observe page for changes of child nodes
const target = $('div.page-container')[0];
const config = {
childList: true,
subtree: true
};
if (target) observer.observe(target, config);
}
function addEntryFromBookmark(e) {
const ck = e.data.checkedOnly || false;
const nt = e.data.newTour || false;
const listName = nt ? $('h1.standard-list')[0].innerText.split('\n')[0].trim() : "";
if (!nt || (nt && newTourFunction(listName)())) {
$('.list-geocache-row').each((_i, row) => {
const entry = getCacheProps(row);
if (entry && (!ck || (ck && entry.checked))) {
addGeocache(entry.id, entry.guid, entry.name, entry.image)();
}
});
saveCurrentTourRefreshGUI();
}
}
function getCacheProps(row) {
let props = {};
props.id = $('.geocache-name>a', row).attr('href').split('/').at(-1);
props.guid = '';
props.name = $('.geocache-name>a', row).html();
const type = $('svg.geocache-type-icon use', row).attr("href").replace("#", "").replace("_disabled", "");
const ind = WPT_ARRAY.findIndex(obj => obj.shortname == type);
props.image = (ind !== -1) ? WPT_ARRAY[ind].wptTypeId + '.gif' : '2.gif'; // tradi icon as fallback
props.checked = $('div.gc-checkbox-v2 input', row).is(':checked');
return props;
}
}
// add buttons to old search
if (document.URL.search("/seek/nearest.aspx") >= 0) {
// wait until all images are loaded (necessary after GS update from 1.1.2020)
log_timeStart("wptTypeImage2 - wait for wpt type images");
var count = 0;
var wptTypeImage2 = setInterval(function() {
if (++count>20) clearInterval(wptTypeImage2);
debug("wptTypeImage2: wait for wpt type images");
// check for wpt type images
if ($('.SearchResultsWptType').length===0) return;
log_timeEnd("wptTypeImage2 - wait for wpt type images");
// stop interval
clearInterval(wptTypeImage2);
var entry_i,
entry,
entries = getEntriesFromOldSearchpage();
for (entry_i = 0; entry_i < entries.length; entry_i++) {
entry = entries[entry_i];
$("<img>", {
"alt" : $.gctour.lang('cache.addToTour'),
"title" : $.gctour.lang('cache.addToTour'),
"src" : $.gctour.img.addToTour,
"css" : {
"cursor" : "pointer",
"float": "left",
"margin-left": "3px"
}
})
.on('click', {
entry : entry
}, function(e) {
addGeocache(e.data.entry.id, e.data.entry.guid, e.data.entry.name, e.data.entry.image)();
saveCurrentTourRefreshGUI();
})
.appendTo(entry.addBtnPosition);
// keep button in same line
entry.addBtnPosition.style.whiteSpace = 'nowrap';
}
// helper function
var addEntryFromSearchpage = function(e) {
var i, entry;
var ck = e.data.checkedOnly || false;
var nt = e.data.newTour || false;
var entries = getEntriesFromOldSearchpage();
if (!nt || (nt && newTourFunction()())) {
for (i = 0; i < entries.length; i++) {
entry = entries[i];
if ((entry) && (!ck || (ck && entry.checked))) {
addGeocache(entry.id, entry.guid, entry.name, entry.image)();
}
}
saveCurrentTourRefreshGUI();
}
};
// buttons to add marked or all caches in list to current or new tour
let $buttons = addButtonsToAddAllOrSelectedCaches(addEntryFromSearchpage);
$buttons.prependTo("div#ctl00_ContentBody_ResultsPanel");
},200); // setInterval
}
// add buttons to new search page
if (document.URL.search("/play/results") >= 0) {
// wait until search results are loaded
// (for empty searches a longer timeout is necessary)
const timeout = 300; // 5min
const anchor = '.gc-search-results-list-item'; // row identifier
const addButtons = () => {
// all search results from current active page
let $rows = $(anchor);
// buttons to add single caches to tour
let column;
for (let i = 0; i < $rows.length; i++) {
// if button was already added, nothing to be done
if ($('#gct_add2Tour_' + (i + 1), $rows[i])[0]) continue;
// cache icon column
column = $('.gc-geocache-icon', $rows[i]).parent()[0];
// add button
$("<img>", {
"id": 'gct_add2Tour_' + (i+1),
"alt": $.gctour.lang('cache.addToTour'),
"title": $.gctour.lang('cache.addToTour'),
"src": $.gctour.img.addToTour,
"css": {
"cursor": "pointer",
"margin": "0"
}
}).on('click', {
entry: $rows[i]
}, function(e) {
let props = getCacheProps(e.data.entry);
addGeocache(props.id, props.guid, props.name, props.image)();
saveCurrentTourRefreshGUI();
}).appendTo(column);
}
// buttons to add all caches to tour
$('div#gct_addAll2TourButtons').remove();
let addAll2CurrentTourButton =
'<button id="gct_addAll2CurrentTourButton" class="gc-button" style="cursor: pointer" title="(' + $rows.length + ' caches) ' + $.gctour.lang('cache.addToCurrentTour').replace('<b>', '').replace('</b>', '') + '">' +
'<img src="' + $.gctour.img.addToTour + '" style="vertical-align: bottom;"/>' +
'</button>';
let addAll2NewTourButton =
'<button id="gct_addAll2NewTourButton" class="gc-button" style="cursor: pointer" title="(' + $rows.length + ' caches) ' + $.gctour.lang('cache.addToNewTour').replace('<b>', '').replace('</b>', '') + '">' +
'<img src="' + $.gctour.img.newTour + '" style="vertical-align: bottom;"/>' +
'+' +
'<img src="' + $.gctour.img.addToTour + '" style="vertical-align: bottom;"/>' +
'</button>';
let divAddAll2TourButtons =
'<div id="gct_addAll2TourButtons">' +
addAll2NewTourButton +
addAll2CurrentTourButton +
'</div>';
// add buttons right of map button (Note: GS buttons may change in mobile layout, this position is safe)
$(divAddAll2TourButtons).insertAfter($('.add-to-list-control').parent().parent().find('a[href*="/play/map"]')[0]);
// click events
$('#gct_addAll2CurrentTourButton').on('click', () => addAllCachesToTour($rows, false));
$('#gct_addAll2NewTourButton').on('click', () => addAllCachesToTour($rows, true));
// observe search results
startObserver();
}
const startObserver = () => {
const cb = (_mutationList, observer) => {
observer.disconnect();
waitForElementThenRun(anchor, addButtons, timeout);
}
// observe search results for changes of child nodes
const target = $('.gc-search-results-grid')[0],
config = {
childList: true,
subtree: true
},
observer = new MutationObserver(cb);
if (target) observer.observe(target, config);
}
waitForElementThenRun(anchor, addButtons, timeout);
// helper functions
const getCacheProps = (row) => {
let props = {};
props.id = $('.code-display', row).text();
props.guid = '';
props.name = $('.name-display', row).text();
let type = $('.gc-geocache-icon>svg use', row).attr("href").replace("#", "").replace("_disabled", "");
let ind = WPT_ARRAY.findIndex(obj => obj.shortname == type);
props.image = (ind !== -1) ? WPT_ARRAY[ind].wptTypeId + '.gif' : '2.gif'; // tradi icon as fallback
return props;
}
const addAllCachesToTour = (rows, newTour) => {
if (newTour && !newTourFunction()()) {
return; // exit on cancel
}
const str = "(" + $(anchor).length + " caches) " + $.gctour.lang('cache.addToCurrentTour').replace('<b>', '').replace('</b>', '') + "?";
if (!newTour && !confirm(str)) {
return; // exit on cancel
}
let props;
for (let i = 0; i < rows.length; i++) {
props = getCacheProps(rows[i]);
addGeocache(props.id, props.guid, props.name, props.image)();
}
saveCurrentTourRefreshGUI();
}
}
// add buttons to cache details page
if (document.URL.search(GS_HOST + "geocache/GC") >= 0 || document.URL.search("cache_details.aspx") >= 0) {
initButton();
}
}
/* init gui */
function initButton() {
// if we are on a cache page the buttonGroup != null - so add the 'to tour'-button
var cacheControl = $("div.CacheInformationTable:first");
if (cacheControl.length > 0) {
var div_element = createElement('div', {
style : "border-top: 1px solid rgb(192, 206, 227);"
});
cacheControl.append(div_element);
var gcTourFieldset = createElement('fieldset', {
style : "background-color: #EFF4F9;border-color: #C0CEE3 !important;margin-top:0;padding: 0.5em;"
});
append(gcTourFieldset, div_element);
gcTourFieldset.setAttribute('class', 'dialogFooter');
gcTourFieldset.innerHTML = "<legend class='note' style='background:url(\"" + $.gctour.img.gctourLogoSmall + "\") no-repeat scroll 0 0 transparent;padding-left:20px;'>GCTour</legend>";
// 1) add to tour button
var newButton = createElement('input', {
type : "button",
value : " " + $.gctour.lang('cache.addToTour'),
style : "float:left;background-image:url(" + $.gctour.img.addToTour + ")"
});
append(newButton, gcTourFieldset);
newButton.setAttribute('onclick', 'return false;');
// locate the values and save it
var minimal_geocache = getMinimalGeocacheDetails(document.getElementsByTagName('html')[0]);
var cacheId = minimal_geocache.gccode;
var guidId = minimal_geocache.guid;
var cacheName = minimal_geocache.name;
var cacheTypeImage = minimal_geocache.type;
// on click add an element
newButton.addEventListener('click', function() {
addGeocache(cacheId, guidId, cacheName, cacheTypeImage)();
saveCurrentTourRefreshGUI();
}, false);
// 2) direct print button
newButton = createElement('input', {
type : "button",
value : " " + $.gctour.lang('cache.directPrint'),
style : "float:left;background-image:url(" + $.gctour.img.printer + ")"
});
append(newButton, gcTourFieldset);
newButton.setAttribute('onclick', 'return false;');
// on click add an element
newButton.addEventListener('click', function() {
var entry = {};
entry.id = cacheId;
entry.name = escapeHTML(cacheName);
entry.guid = guidId;
entry.image = GS_HOST + GS_WPT_IMAGE_PATH + cacheTypeImage;
var temp_tour = {};
temp_tour.name = entry.name;
temp_tour.geocaches = [entry];
printPageFunction(temp_tour);
}, false);
append(newButton, gcTourFieldset);
// 3) change coordinates button
newButton = createElement('input', {
type : "button",
value : " " + $.gctour.lang('cache.moveCoords'),
style : "float:left;background-image:url(" + $.gctour.img.coord_update + ")"
});
append(newButton, gcTourFieldset);
newButton.setAttribute('onclick', 'return false;');
newButton.addEventListener('click', openChangeCoordinates, false);
append(newButton, gcTourFieldset);
// display changed coordinates (if they have been changed by GCTour)
if (GM_getValue('coords_' + cacheId, "null") != "null") {
var coords_cacheId = GM_getValue('coords_' + cacheId);
displayChangedCoordinates(new LatLon(coords_cacheId.split('#')[0], coords_cacheId.split('#')[1]).toString());
}
}
}
// the tour list under main navigation
function initComponents() {
// gcTour Button
$("<div>", {
id : "gctourButtonWrapper",
"class" : "header gctour-grand-default",
"html" :
$("<img>", {
"src" : $.gctour.img.gctourLogoSmall
})
})
.hover(
function() {
$(this).addClass('gctour-grand-hover');
$("#gctourContainer").animate({
left : 0
}, 500);
},
function() {
$(this).removeClass('gctour-grand-hover');
})
.appendTo("body");
// gcTour Container
$("<div>", {
id : "gctourContainer",
"css" : {
left : (STICKY) ? 0 : -210
}
})
.hover(
function() {
clearTimeout(TIMEOUT);
},
function() {
if (!STICKY) {
TIMEOUT = setTimeout(function() {
$("#gctourContainer").animate({
left : -210
}, 500);
}, 1000);
}
})
.appendTo("body");
var $geocacheList = $('<div>', {
id : "gctour_geocacheList",
"css" : {
overflow : 'auto',
height : '80%',
width : '100%'
},
"html" :
$('<ul>', {
id : "cacheList",
'class' : 'cachelist'
})
.sortable({
axis : 'y',
placeholder : 'ui-sortable-placeholder',
opacity : 0.8,
revert : true,
start : function(e, ui) {
// save old position
$(this).data('old-pos', ui.item.index());
},
stop : function(e, ui) {
// init
var newPos = ui.item.index();
var oldPos = $(this).data('old-pos');
$(this).removeData('old-pos');
debug("Drag n Drop in progress:\n" +
"\tMove " + CURRENT_TOUR.geocaches[oldPos].name + " (" + ui.item.attr('id') + ") from '" + oldPos + "' to '" + newPos + "'");
// ignore the same position
if (oldPos === newPos) {
return;
}
// determine positions
var insertPos = (oldPos > newPos) ? newPos : newPos + 1;
var removePos = (oldPos < newPos) ? oldPos : oldPos + 1;
// changing the position
CURRENT_TOUR.geocaches.splice(insertPos, 0, CURRENT_TOUR.geocaches[oldPos]);
CURRENT_TOUR.geocaches.splice(removePos, 1);
// ... and save the new tour object
setTimeout(function() { // hack to prevent "access violation" from Greasemonkey
saveCurrentTour();
}, 0);
move(ui.item.attr('id'), 0); // force numbering update
return;
}
})
.disableSelection()
});
var webcodelink = GCTOUR_HOST + 'tour/' + $.trim(CURRENT_TOUR.webcode);
var $tourHeader = $("<div>", {
id : "gctour_tourHeader",
"css" : {},
"html" : '<u id="tourName">' + CURRENT_TOUR.name + '</u>&nbsp;<span style="font-size:66%" id="cachecount">(' + CURRENT_TOUR.geocaches.length + ')</span>' +
'<span id="webcode" style="display:' + ((!CURRENT_TOUR.webcode) ? "none" : "inline") + ';"><br/>' +
'Webcode:&nbsp;&nbsp;<b><a href="' + webcodelink + '" title="' + $.gctour.lang('container.tourHeader.makeMap.caption') + '" target="_blank">' + CURRENT_TOUR.webcode + '</a></b>&nbsp;</span><br/>'
});
// copy webcode
let copyImage = document.createElement('img');
copyImage.alt = $.gctour.lang('general.copy');
copyImage.title = $.gctour.lang('general.copy');
copyImage.src = $.gctour.img.copy;
copyImage.style.cursor = 'pointer';
copyImage.style.width = '11px';
copyImage.style.marginLeft = '2px',
copyImage.addEventListener('click', function() {
copyToClipboard($('span#webcode a').prop('href').split('/').pop(-1));
}, true);
addOpacityEffects(copyImage);
$('span#webcode',$tourHeader).append(copyImage);
$tourHeader.append(
// rename
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.edit,
title : $.gctour.lang('general.rename'),
alt : $.gctour.lang('general.rename'),
click : function() {
var newTourName = prompt($.gctour.lang('tour.newDialog'), CURRENT_TOUR.name);
if (!newTourName) {
return;
}
CURRENT_TOUR.name = newTourName;
saveCurrentTour();
updateTour();
}
}),
// print
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.printer,
title : $.gctour.lang('settings.printview.header'),
alt : $.gctour.lang('settings.printview.header'),
click : function() {
printPageFunction(CURRENT_TOUR);
}
}),
// sendToGPS
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.sendGPS,
title : $.gctour.lang('container.tourHeader.sendToGps'),
alt : $.gctour.lang('container.tourHeader.sendToGps'),
click : function() {
send2Garmin();
}
}),
// downloadGPX
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.downloadGPX,
title : $.gctour.lang('container.tourHeader.downloadGpx'),
alt : $.gctour.lang('container.tourHeader.downloadGpx'),
click : function() {
downloadGPXFunction();
}
}),
// send2cgeo
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.send2cgeo,
title : $.gctour.lang('send2cgeo.title'),
alt : $.gctour.lang('send2cgeo.title'),
'style' : (SEND2CGEO) ? '' : 'display:none;',
click : function() {
openGcTour2cgeoDialog();
}
}),
// saveAsBookmarklist (PMO)
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.saveAsBookmarklist,
title : $.gctour.lang('container.tourHeader.saveAsBookmarklist.title'),
alt : $.gctour.lang('container.tourHeader.saveAsBookmarklist.title'),
'style' : (isPremiumUser()) ? '' : 'display:none;',
click : function() {
saveAsBookmarklist();
}
}),
// makeMap
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.map,
title : $.gctour.lang('container.tourHeader.makeMap.caption'),
alt : $.gctour.lang('container.tourHeader.makeMap.caption'),
click : function() {
makeMapFunction();
}
}),
// uploadTour
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.upload,
title : $.gctour.lang('container.tourHeader.upload.caption'),
alt : $.gctour.lang('container.tourHeader.upload.caption'),
click : function() {
uploadTourFunction(CURRENT_TOUR.id);
}
}),
// addWaypoint
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.plus,
title : $.gctour.lang('container.tourHeader.addOwnWaypoint'),
alt : $.gctour.lang('container.tourHeader.addOwnWaypoint'),
click : function() {
showNewMarkerDialog();
}
}),
// sort tour alphabetically
$('<img>', {
'class': 'tourImage',
src: $.gctour.img.sort,
title: $.gctour.lang('container.tourHeader.sortAlphabetically'),
alt: $.gctour.lang('container.tourHeader.sortAlphabetically'),
'style': 'margin-left:0px;',
click: function() {
sortCurrentTourAlphabetically();
}
}),
// deleteTour
$('<img>', {
id : 'gctourDeleteButton',
'class' : 'tourImage',
src : $.gctour.img.del,
title : $.gctour.lang('tour.delete'),
alt : $.gctour.lang('tour.delete'),
css : {
'display': (TOURS.length <= 1) ? 'none' : 'inline',
'margin-left': '0px',
'margin-right': '0px'
},
click : function() {
deleteCurrentTour();
}
})).find("img.tourImage").addShadowEffect().addOpacityEffect();
var $toolbar = $("<div>", {
id : "gctour_toolbar",
"css" : {
height : 20,
'-moz-user-select' : "none"
}
});
$toolbar.append(
// newTourButton
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.newTour,
title : $.gctour.lang('container.toolbar.newList'),
alt : $.gctour.lang('container.toolbar.newList'),
click : function() {
newTourFunction()();
}
}),
// toggleTourListButton
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.openTour,
title : $.gctour.lang('container.toolbar.openTour'),
alt : $.gctour.lang('container.toolbar.openTour'),
click : function() {
openTourDialog();
}
}),
// downloadButton
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.download,
title : $.gctour.lang('container.toolbar.downloadTour.caption'),
alt : $.gctour.lang('container.toolbar.downloadTour.caption'),
click : function() {
downloadTourDialog();
}
}),
// autoTourButton
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.autoTour,
title : $.gctour.lang('autoTour.title'),
alt : $.gctour.lang('autoTour.title'),
click : function() {
var gooMap = getMapCenterAndRadius();
showAutoTourDialog(gooMap.center, gooMap.radius);
}
}),
// toggleSettingsButton
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.settings,
title : $.gctour.lang('container.toolbar.showSettings'),
alt : $.gctour.lang('container.toolbar.showSettings'),
click : function() {
openSettingsDialog();
}
}),
// save settings info
$('<img>', {
'class': 'tourImage',
src: $.gctour.img.save,
title: $.gctour.lang('container.toolbar.saveSettings'),
alt: $.gctour.lang('container.toolbar.saveSettings'),
click: function() {
openSettingsDialog();
$("#tabs").tabs({ active: 5 });
}
}),
// GCTour Home
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.globe,
title : $.gctour.lang('container.toolbar.homepage'),
alt : $.gctour.lang('container.toolbar.homepage'),
style : "float: right; margin-right: 11px;",
click : function() {
GM_openInTab(GCTOUR_HOST, false);
}
}),
// changelog
$('<img>', {
'class': 'tourImage',
src: $.gctour.img.info,
title: 'Changelog',
alt: 'Changelog',
style: "float: right;",
click: function() {
GM_openInTab("https://gist.github.com/DieBatzen/5814dc7368c1034470c8/raw/gctour.zChangelog.txt", false);
}
})
);
// Greasemonkey info
if (IS_GREASEMONKEY) {
$toolbar.append(
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.danger,
title : 'Greasemonkey Info',
alt : 'Greasemonkey Info',
style : "float: right;",
click : function() {
gmNotice();
}
})
);
}
var $header = $("<div>", {
id : "gctour_header",
"class" : "header gctour-grand-default" + ((STICKY) ? " gctour-grand-hover" : ""),
"css" : {
height : 40,
'cursor' : "pointer",
'-moz-user-select' : "none"
},
"html": "<img src='" + $.gctour.img.gctourLogo + "' style='margin: 6px 0px 0px;'/><small style='font-size: 65%;color: gray;vertical-align: bottom;'>v " + VERSION + "</small>" +
"<img id='gcTourPin' style='float:right;margin: 6px 2px 0 0;' src='" + ((STICKY) ? $.gctour.img.pinned : $.gctour.img.pin) + "'>",
click : function(e) {
STICKY = !STICKY;
GM_setValue('sticky', STICKY);
$("img#gcTourPin").attr("src", ((STICKY) ? $.gctour.img.pinned : $.gctour.img.pin));
}
})
.hover(
function() {
$(this).addClass('gctour-grand-hover');
},
function() {
if (!STICKY) {
$(this).removeClass('gctour-grand-hover');
}
});
$("#gctourContainer").append(
$header,
$toolbar,
$tourHeader,
$geocacheList
);
// if available, add link to bookmark list
if (CURRENT_TOUR.bml) {
let bml = new Bookmarklist(CURRENT_TOUR.bml);
bml.addLink();
};
// populate the current list on load
for (var i = 0; i < CURRENT_TOUR.geocaches.length; i++) {
addToCacheList(CURRENT_TOUR.geocaches[i], false);
}
if (CURRENT_TOUR.geocaches.length <= 0) {
var table = document.getElementById('cacheList');
table.innerHTML = $.gctour.lang('tour.empty');
}
// finally: set new heights and layout!
setTimeout(function() { // ensure that everything is loaded before resizing
handleResize();
}, 500);
}
/* init gui utilities*/
// get entries from old search page: https://www.geocaching.com/seek/nearest.aspx
function getEntriesFromOldSearchpage(page=document) {
// Data Rows without header
// <tr class="SolidRow Data BorderTop"> and
// <tr class="AlternatingRow Data BorderTop">
var q = $("table.SearchResultsTable tbody tr.Data",page);
var entries = [];
entries = q.map(function() {
var entryTds = $(this).find('td');
var entry = {};
// use waypoint type column as reference for other columns (GCLH2 may add an additional column for fav score, send2cgeo for adding caches)
var td = entryTds.find(".SearchResultsWptType").closest("td")[0];
var tdWpttype = entryTds.index(td);
// checkbox
entry.checked = entryTds.eq(0).find("input:checkbox:first").is(':checked');
// add2tour button position
entry.addBtnPosition = entryTds[0];
// favorites (do not change since other scripts may add columns)
entry.favorites = entryTds.find("span[id$='FavoritesValue']").text();
// cache type image
entry.image = entryTds.eq(tdWpttype).find("img:first").attr("src").toLowerCase().split('/').pop();
// cache type
entry.type = entry.image.split('.')[0];
entry.type = (entry.type == "earthcache") ? 137 : entry.type;
// GC code
entryTds.eq(tdWpttype + 1).find("span").eq(1).text().search(/\|\s*GC(\S{2,9})\s*\|/);
entry.id = "GC" + RegExp.$1;
// cache name
var lnk = entryTds.eq(tdWpttype + 1).find("a.lnk:first");
entry.name = $.trim(lnk.text());
// cache is available
entry.available = (lnk.css('text-decoration') !== "line-through");
// pmo
entry.pm_only = (entryTds.eq(tdWpttype + 2).find("img[src$='premium_only.png']").length > 0);
// D/T
var dt = $.trim(entryTds.eq(tdWpttype + 3).find('span.small').text());
entry.difficulty = dt.split("/")[0];
entry.terrain = dt.split("/")[1];
// cache size (do not change since GCLH2 may move the size image to a new column)
entry.size = $.trim(entryTds.find('img[src*="/images/icons/container/"]:first').attr("src").split("/")[4].split(".")[0]);
/*
debug(
"getEntriesFromOldSearchpage cache row: " + "\n" +
"\tid:\t\t" + entry.id + "\n" +
"\tname:\t\t" + entry.name + "\n" +
"\tavailable:\t" + entry.available + "\n" +
"\timage:\t\t" + entry.image + "\n" +
"\tsize:\t\t" + entry.size + "\n" +
"\ttype:\t\t" + entry.type + "\n" +
"\tdifficulty:\t" + entry.difficulty + "\n" +
"\tterrain:\t" + entry.terrain + "\n" +
"\tfavorites:\t" + entry.favorites + "\n" +
"\tpm_only:\t" + entry.pm_only + "\n" +
"\tchecked:\t" + entry.checked + "\n");
*/
return entry;
}).get();
return entries;
}
/* gui functions */
function isLoggedIn() {
if (GS_USERINFO.isLoggedIn && window.location.href.includes("geocaching.com")) {
return true;
} else {
let str = '<div>' + $.gctour.lang('general.notLoggedIn') + '</div>';
showNotification({ text: str, style: "red" });
return false;
}
}
function isEmptyTour(tour) {
if (tour.geocaches.length > 0) {
return false;
} else {
let str = '<div>' + $.gctour.lang('tour.empty') + '</div>';
showNotification({ text: str, style: "yellow" });
return true;
}
}
function showGeocacheNotification(geocache, event) {
geocache.name = escapeHTML(geocache.name);
if (event.type == "success") {
$.gctour.notification.add({
title : $.gctour.lang('notifications.addgeocache.success.caption').format(geocache.id),
text : $.gctour.lang('notifications.addgeocache.success.content').format(geocache.tourname, geocache.name),
icon : geocache.image,
style : "green"
});
} else if (event.type == "contains") {
$.gctour.notification.add({
title : $.gctour.lang('notifications.addgeocache.contains.caption').format(geocache.id),
text : $.gctour.lang('notifications.addgeocache.contains.content').format(geocache.tourname, geocache.name),
icon : geocache.image,
style : "yellow"
});
} else {
$.gctour.notification.add({
title : "ERROR",
text : "Event '" + event + "' is not supported!",
style : "red"
});
}
return;
}
function showNotification(options) {
options.title = "GCTour Info";
$.gctour.notification.add(options);
// adapt width slightly
$('#gctour-notification-box, #gctour-notification-box li',).css('width', '275px');
return;
}
function handleResize() {
// Change the height of the container and Cache List
var container = $(window).height() - 30,
header = $("#gctourContainer #gctour_header").height(), // 40
toolbar = $("#gctourContainer #gctour_toolbar").height(), // 20;
tourheader = $("#gctourContainer #gctour_tourHeader").height(),
cachelist = container - (header + toolbar + tourheader /*+ footer*/);
// set the container height
$('#gctourContainer').css("height", container);
// set the cachelist height
$('#cacheList').parent().css("height", cachelist);
/*log(
"handleResize change height:\n" +
"\tcontainer: " + container + "\n" +
"\theader: " + header + "\n" +
"\ttoolbar: " + toolbar + "\n" +
"\ttourheader: " + tourheader + "\n" +
//"\tfooter: " + footer + "\n" +
"\t => cachelist: " + cachelist);*/
}
function updateGUI() {
var cacheList, i;
// update the cache count
updateCacheCount(CURRENT_TOUR.geocaches.length);
// update tourName
$("#tourName").html(CURRENT_TOUR.name);
// update webcode
var $webcode = $("#webcode");
if (CURRENT_TOUR.webcode) {
$webcode
.find("a:first")
.attr('href', GCTOUR_HOST + 'tour/' + $.trim(CURRENT_TOUR.webcode))
.text(CURRENT_TOUR.webcode)
.end()
.show();
} else {
$webcode.hide();
}
// update bookmark list
$('span#gct_bml').remove();
if (CURRENT_TOUR.bml) {
let bml = new Bookmarklist(CURRENT_TOUR.bml);
bml.addLink();
};
cacheList = $('#cacheList');
cacheList.html("");
// populate the current list on load
for (i = 0; i < CURRENT_TOUR.geocaches.length; i++) {
addToCacheList(CURRENT_TOUR.geocaches[i], false);
}
if (CURRENT_TOUR.geocaches.length <= 0) {
cacheList.html($.gctour.lang('tour.empty'));
}
handleResize();
var deleteButton = $('#gctourDeleteButton');
if (TOURS.length == 1 && deleteButton) {
deleteButton.hide();
} else {
deleteButton.show();
}
}
// ToDo: switch to $.fn.addOpacityEffects
var addOpacityEffects = function(elem) {
$(elem)
.css({
opacity : "0.5"
})
.bind({
mouseenter : function() {
$(this).stop().animate({
opacity : '1'
}, 200);
},
mouseleave : function() {
$(this).stop().animate({
opacity : '0.5'
}, 300);
}
});
};
function addClickEffect(element) {
return function() {
element.style.background = '#a9b2bf';
};
}
function removeClickEffect(element) {
return function() {
element.style.background = '#cdd8e8';
};
}
function addHoverEffect(element) {
return function() {
element.style.margin = '0px';
element.style.border = '1px solid lightgray';
element.style.background = '#cdd8e8';
};
}
function removeHoverEffect(element) {
return function() {
element.style.margin = '1px';
element.style.border = '0px solid lightgray';
element.style.background = '';
};
}
function addHoverEffects(element) {
element.addEventListener('mouseover', addHoverEffect(element), false);
element.addEventListener('mouseout', removeHoverEffect(element), false);
element.addEventListener('mousedown', addClickEffect(element), false);
element.addEventListener('mouseup', removeClickEffect(element), false);
element.style.margin = '1px';
}
async function getMapGeocache(gcid) {
try {
var mapCache,
additional_waypoints,
waypoint_i,
geocache = await getGeocache(gcid, 0);
if (geocache === "pm only" || geocache === 404) {
return geocache;
}
mapCache = {};
mapCache.gcid = geocache.gcid;
mapCache.guid = geocache.guid;
mapCache.image = geocache.image;
mapCache.name = geocache.name;
mapCache.difficulty = geocache.difficulty;
mapCache.terrain = geocache.terrain;
mapCache.latitude = geocache.lat;
mapCache.longitude = geocache.lon;
// save additional waypoints
additional_waypoints = geocache.additional_waypoints;
for (waypoint_i = 0; waypoint_i < additional_waypoints.length; waypoint_i++) {
additional_waypoints[waypoint_i].note = "";
}
mapCache.additional_waypoints = additional_waypoints;
return mapCache;
} catch(e) {
throw "fn getMapGeocache - " + e;
}
}
function getMapMarker(markerId) {
var position = getPositionOfId(markerId),
marker = CURRENT_TOUR.geocaches[position];
marker.index = position;
return marker;
}
function uploadMap(markerObj) {
markerObj = handleEmptyValuesForUpload(markerObj);
let jsonMap = JSON.stringify(markerObj).replace(/&/g, " and "); // IMPORTANT! prevents critical errors in webapplication
let headers = {'Content-type' : 'application/x-www-form-urlencoded'};
promiseRequest('POST', GCTOUR_HOST + 'map/save', headers, encodeURI("map=" + jsonMap));
}
async function makeMapFunction() {
try {
if (isEmptyTour(CURRENT_TOUR) || !isLoggedIn()) {
return;
}
// if tour has been uploaded, use "query tour" link on GCTour server instead of fetching data again
let $webcode = $('span#webcode:visible>b>a');
if ($webcode.length>0) {
$webcode[0].click();
return;
}
var gcIds = [],
wptIds = [],
allIds = [],
i;
// cache and custom marker IDs
for (i = 0; i < CURRENT_TOUR.geocaches.length; ++i) {
var marker = CURRENT_TOUR.geocaches[i];
if (marker.id) {
gcIds.push(marker.id);
allIds.push(marker.id);
} else if (marker.wptcode) {
wptIds.push(marker.wptcode);
allIds.push(marker.wptcode);
}
}
// add the overlay while loading
addProgressbar({
caption : $.gctour.lang('container.tourHeader.makeMap.wait'),
_document : document,
closeCallback : function(_document) {
return function() {
if (confirm($.gctour.lang('general.cancel') + "?") == true) {
window.location.reload();
}
};
}
});
// for progress bar update
PROGRESS_BAR.progress = 0;
PROGRESS_BAR.total = gcIds.length + wptIds.length;
// fetch all caches in parallel, not one by one
var promises = [];
for (i = 0; i < gcIds.length; i++) {
promises.push(getMapGeocache(gcIds[i]));
}
FAVSCORE = false; // fav score not needed for map preview
var cache_objects = await Promise.all(promises);
FAVSCORE = true;
// store map specific cache information in array
var geocaches = [];
for (i = 0; i < gcIds.length; i++) {
geocaches.push(cache_objects[i]);
}
// store custom markers in array
var costumMarkers = [];
for (i = 0; i < wptIds.length; i++) {
costumMarkers.push(getMapMarker(wptIds[i]));
updateProgressBar();
}
// store caches and custom markers in object
var cacheObject = {};
cacheObject.geocaches = geocaches;
cacheObject.costumMarkers = costumMarkers;
// upload map content to server
uploadMap(cacheObject);
// open map content from server in new tab (request hash value according to tour content)
var mapUrl = await getMapUrl(allIds.join(","));
setTimeout( function() { // ensure that GCTour server finished all tasks before opening map page
GM_openInTab(mapUrl + '#gui', false);
},1000);
closeOverlay();
} catch(e) {
addErrorDialog({
caption : "makeMapFunction error",
_exception : e
});
}
}
async function upload(tour, pmo, retracted) {
try {
if (!tour.password) {
tour.password = "not yet implemented";
}
tour = handleEmptyValuesForUpload(tour);
var jsonTour = JSON.stringify(tour).replace(/&/g, " and "); // IMPORTANT! prevents critical errors in web application
var headers = {'Content-type' : 'application/x-www-form-urlencoded'};
var response = await promiseRequest('POST', GCTOUR_HOST + 'tour/save', headers, encodeURI("tour=" + jsonTour));
var tourServer = JSON.parse(response.responseText);
// after an error you get this result, e.g.
// {"message":"wrong password","type":"error"}
// only if the result is a message
if (tourServer.message && tourServer.type == "error") {
var pw = prompt("falsches Passwort - bitte richtiges eingeben");
// if pw is empty or dialog closed
if (!pw) {
closeOverlay();
return;
}
tour.password = pw;
upload(tour, pmo, retracted);
} else if (tourServer.message && tourServer.type == "info") {
alert(tourServer.message);
closeOverlay();
} else { // result is a tour
// save password and webcode to tour
CURRENT_TOUR.password = tour.password;
CURRENT_TOUR.webcode = tourServer.webcode;
// save and update tour
saveTour(CURRENT_TOUR);
updateTour();
closeOverlay();
var str = $.gctour.lang('container.tourHeader.upload.tourUploaded1') + CURRENT_TOUR.webcode;
str += $.gctour.lang('container.tourHeader.upload.tourUploaded2').replace(/xWEBCODEx/g, CURRENT_TOUR.webcode);
str = '<div>' + str + '</div>';
showNotification({ text: str, style: "green", timeout: 20000 });
// Basic members cannot upload PMO caches
var nCaches = pmo.length;
if (nCaches > 0) {
var pmoc = $.gctour.lang('container.tourHeader.upload.tourUploadPMO') + ':';
for (let i = 0; i < nCaches; i++) {
pmoc += "<br>#" + pmo[i].index + ": " + pmo[i].name + " (" + pmo[i].id + ")";
}
pmoc = '<small><i>' + pmoc + '</i></small>';
showNotification({ text: pmoc, style: "yellow", timeout: 20000 });
}
// Retracted caches cannot be uploaded
nCaches = retracted.length;
if (nCaches > 0) {
var retr = $.gctour.lang('container.tourHeader.upload.tourUploadRetracted') + ':';
for (let i = 0; i < nCaches; i++) {
retr += "<br>#" + retracted[i].index + ": " + retracted[i].name + " (" + retracted[i].id + ")";
}
retr = '<small><i>' + retr + '</i></small>';
showNotification({ text: retr, style: "yellow", timeout: 20000 });
}
}
} catch(e) {
throw 'fn upload - ' + e;
}
}
async function uploadTourFunction(id) {
try {
if (isEmptyTour(CURRENT_TOUR) || !isLoggedIn()) {
return;
}
var i, tour, costumMarker, mapCache;
i = TOURS.map(function(tour) {
return tour.id
}).indexOf(id);
if (i == -1) {
throw ('uploadTourFunction(), line ' + new Error().lineNumber + ' - tour for index "' + id + '" not found');
}
tour = TOURS[i]; // tour object to upload
var nCaches = tour.geocaches.length;
// deep copy of tour to upload (otherwise tour changes unintentionally before saving the updated status)
CURRENT_TOUR = JSON.parse(JSON.stringify(TOURS[i]));
// add the overlay while loading
GM_setValue("stopTask", false);
addProgressbar({
_document : document,
closeCallback : function(_document) {
return function() {
if (confirm($.gctour.lang('general.cancel') + "?") == true) {
window.location.reload();
}
};
}
});
// for progress bar update
PROGRESS_BAR.progress = 0;
PROGRESS_BAR.total = nCaches;
// fetch all caches in parallel, not one by one
var promises = [];
for (i = 0; i < nCaches; i++) {
costumMarker = (typeof(tour.geocaches[i].latitude) != "undefined");
if (costumMarker) {
promises.push(tour.geocaches[i]);
updateProgressBar();
} else {
promises.push(getMapGeocache(tour.geocaches[i].id));
}
}
FAVSCORE = false; // fav score not needed for tour upload
var cache_objects = await Promise.all(promises);
FAVSCORE = true;
var geocaches = [], retracted = [], pmo = [], costumMarkers = [], gc;
var ind = 0; // in case that PMO caches are skipped for Basic Members or retracted caches are present
for (i = 0; i < nCaches; ++i) {
costumMarker = (typeof(tour.geocaches[i].latitude) != "undefined");
if (!costumMarker) {
mapCache = cache_objects[i];
if (mapCache === "pm only") {
gc = tour.geocaches[i];
gc.index = i + 1;
pmo.push(gc);
}
else if (mapCache === 404) {
gc = tour.geocaches[i];
gc.index = i + 1;
retracted.push(gc);
}
else {
geocaches.push(mapCache);
ind++;
}
} else {
var cm = cache_objects[i];
cm.index = ind;
ind++;
costumMarkers.push(cm);
}
}
// separate own waypoints and caches for tour upload
tour.costumMarkers = costumMarkers;
tour.geocaches = geocaches;
await upload(tour, pmo, retracted);
} catch (e) {
closeOverlay();
addErrorDialog({
caption : "uploadTourFunction error",
_exception : e
});
}
}
function isPremiumUser() {
try {
return (GS_USERINFO.userType === "Premium") ? true : false;
} catch(e) {
throw 'fn isPremiumUser - ' + e;
}
}
function switchToMyLists() {
(document.URL.search("plan/lists") >= 0) ? window.location.reload() : GM_openInTab(GS_HOST + 'plan/lists', false);
}
// prototype for bookmark lists
function Bookmarklist(id) {
this._id = id;
this._headers = { 'Content-Type': 'application/json', 'X-Verification-Token': TOKEN };
this._url = '';
}
// create list
Bookmarklist.prototype.create = async function() {
let list = {};
list.name = ('GCTour - ' + CURRENT_TOUR.name).replace(/%/g,'_'); // '%' in tour name causes error
list.description = 'GCTour';
list.lastUpdateUtc = (new Date()).toJSON();
list.count = 0;
list.type = { "code": "bm" };
list.isShared = true;
list.isPublic = false;
list.isNotify = false;
this._url = GS_WEB_API + 'lists';
let response = await promiseRequest("POST", this._url, this._headers, JSON.stringify(list));
let obj = JSON.parse(response.responseText);
// list id
this._id = obj.referenceCode;
}
// delete list
Bookmarklist.prototype.delete = function() {
this._url = GS_WEB_API + 'lists/' + this._id;
promiseRequest("DELETE", this._url, this._headers);
}
// add all caches to list
Bookmarklist.prototype.addGeocaches = async function(cacheArray) {
if (typeof cacheArray === "undefined") { // add all caches to bm list
cacheArray = [];
let geocaches = CURRENT_TOUR.geocaches;
let nCaches = Math.min(geocaches.length,1000); // max. 1000 caches per bookmark list
for (let i = 0; i < nCaches; i++) {
let cache = {};
cache.name = geocaches[i].name;
cache.id = geocaches[i].id;
cache.rownumber = i;
cache.referenceCode = cache.id;
cache.listItem = {};
cache.listItem.name = cache.name;
cache.listItem.description = "";
cacheArray.push(cache);
}
}
this._url = GS_WEB_API + 'lists/' + this._id + '/geocaches';
await promiseRequest("PUT", this._url, this._headers, JSON.stringify(cacheArray));
}
// delete caches from list (max. 500 per call)
Bookmarklist.prototype.deleteGeocaches = async function(cacheArray) {
if (typeof cacheArray === "undefined") { // delete all caches from list
cacheArray = [];
let geocaches = CURRENT_TOUR.geocaches;
let nCaches = geocaches.length;
for (let i = 0; i < nCaches; i++) {
cacheArray.push(geocaches[i].id);
}
}
this._url = GS_WEB_API + 'lists/' + this._id + '/geocaches/bulkdelete';
if (cacheArray.length>500) { // max. 500 per call
await promiseRequest("POST", this._url, this._headers, JSON.stringify(cacheArray.slice(0, 500)));
await promiseRequest("POST", this._url, this._headers, JSON.stringify(cacheArray.slice(500)));
}
else {
await promiseRequest("POST", this._url, this._headers, JSON.stringify(cacheArray));
}
}
// get all caches from list (max. 500 per call)
Bookmarklist.prototype.getGeocaches = async function() {
let skip = 0;
this._url = GS_WEB_API + 'lists/' + this._id + '/geocaches?skip=' + skip + '&take=500';
let response = await promiseRequest("GET", this._url, this._headers);
let arr = JSON.parse(response.responseText);
// if list has more than 500 caches, fetch the remaining ones
if (arr.total>500) {
skip = 500;
this._url = GS_WEB_API + 'lists/' + this._id + '/geocaches?skip=' + skip + '&take=500';
response = await promiseRequest("GET", this._url, this._headers);
arr.data = arr.data.concat(JSON.parse(response.responseText).data);
}
return arr;
}
// get metadata of list
Bookmarklist.prototype.getMetadata = async function() {
this._url = GS_WEB_API + 'lists/' + this._id;
let response = await promiseRequest("GET", this._url, this._headers);
return JSON.parse(response.responseText);
}
// synchronize name of list
Bookmarklist.prototype.synchronizeName = async function() {
// get metadata
var json = await this.getMetadata();
// if list name differs from tour name then update the list name
var targetName = 'GCTour - ' + CURRENT_TOUR.name;
if (json.name !== targetName) {
json.name = targetName;
this._url = GS_WEB_API + 'lists/' + this._id;
await promiseRequest("PUT", this._url, this._headers, JSON.stringify(json));
}
}
// add list link to tour header
Bookmarklist.prototype.addLink = function() {
$('span#webcode').after('<span id="gct_bml"><br>Bookmark: <b><a href="https://coord.info/' + this._id + '" target="_blank">' + this._id + '</a></b></span>');
// delete list and list link on click
let deleteImage = document.createElement('img');
deleteImage.alt = $.gctour.lang('general.delete');
deleteImage.title = $.gctour.lang('general.delete');
deleteImage.style.cursor = 'pointer';
deleteImage.style.width = '14px';
deleteImage.style.verticalAlign = 'text-bottom',
deleteImage.style.marginLeft = '5px',
deleteImage.src = $.gctour.img.del;
deleteImage.addEventListener('click', async function() {
await deleteBookmarklist(CURRENT_TOUR.bml);
$('span#gct_bml').remove(); // delete list link from tour header
}, true);
addOpacityEffects(deleteImage);
$('span#gct_bml').append(deleteImage);
}
async function saveAsBookmarklist() {
if (isEmptyTour(CURRENT_TOUR) || !isLoggedIn()) {
return;
}
// tour contains own waypoints only
if ($.grep(CURRENT_TOUR.geocaches, function(e) { return e.id; }).length === 0 && !CURRENT_TOUR.bml) { // number of caches
log('nothing to add to a bookmark list - tour contains own waypoints only');
return;
}
try {
// new lists page is only available for Premium member (Groundspeak decision)
if (!isPremiumUser()) {
switchToMyLists();
return;
}
addProgressbar({
caption: $.gctour.lang('container.tourHeader.saveAsBookmarklist.caption'),
closeCallback: function() {
return function() {
closeOverlayRemote(document)();
};
}
});
if (CURRENT_TOUR.bml) { // a bm list for this tour already exists --> update
try {
await updateBookmarklist(CURRENT_TOUR.bml);
} catch (e) { // bml id is invalid
closeOverlay();
// delete link to bml from tour and GUI
delete CURRENT_TOUR.bml;
$('span#gct_bml').remove();
// start over and create new bml
saveAsBookmarklist();
}
} else { // create new bm list
var bml = new Bookmarklist();
// create empty bookmark list
await bml.create();
// add caches from tour to bookmark list
try {
await bml.addGeocaches();
} catch (e) { // tour probably contains retracted caches
let mes = $.gctour.lang('container.tourHeader.upload.tourUploadRetracted') + ':<br>';
try {
let errorMessage = JSON.parse(JSON.parse(e).errorMessage).Message;
// index of retracted cache
let gccode = errorMessage.match(/GC[0-9a-zA-Z]{1,6}/)[0];
let nCaches = CURRENT_TOUR.geocaches.length;
let ind;
for (let i = 0; i < nCaches; i++) {
if (CURRENT_TOUR.geocaches[i].id === gccode) {
ind = i;
break;
}
}
mes += '"#' + (ind+1) + ": " + errorMessage + '"';
}
catch (e) {
mes += '"unknown GC code"';
}
mes = '<small><i>' + mes + '</i></small>';
showNotification({ text: mes, style: "yellow", timeout: 20000 });
}
closeOverlay();
// add link to bookmark list
bml.addLink();
// save BM link in tour
CURRENT_TOUR.bml = bml._id;
saveCurrentTour();
let str = '<div>' + $.gctour.lang('container.tourHeader.saveAsBookmarklist.success') + ':<br><a href="https://coord.info/' + bml._id + '" target="_blank">https://coord.info/' + bml._id + '</a></div>';
showNotification({ text: str, style: "green" });
}
} catch (e) {
addErrorDialog({
caption : "saveAsBookmarklist error",
_exception : e
});
switchToMyLists();
}
}
/* update bm list s.t. it matches the current tour:
* - synchronize tour name to bm list name
* - cache in tour but not in bm list, i.e. cache added to tour --> add cache to bm list
* - cache in bm list but not in tour, i.e. cache removed from tour --> delete cache from bm list
*/
async function updateBookmarklist(bmId) {
// synchronize tour name to bm list name
let bml = new Bookmarklist(bmId);
await bml.synchronizeName();
// get all cache ids from current tour
let tourIDs = [];
let nCaches = CURRENT_TOUR.geocaches.length;
for (let i = 0; i < nCaches; i++) {
if (CURRENT_TOUR.geocaches[i].id) { // only geocaches, no own marker
tourIDs.push(CURRENT_TOUR.geocaches[i].id);
}
}
// get all caches from bm list
var gcs = await bml.getGeocaches();
gcs = gcs.data;
let bmlIDs = [];
for (let i=0; i<gcs.length; i++) {
bmlIDs.push(gcs[i].referenceCode);
}
// caches added to tour --> add to bml
let missingInBml = tourIDs.filter(x => !bmlIDs.includes(x));
// caches removed from tour --> remove from bml
let missingInTour = bmlIDs.filter(x => !tourIDs.includes(x));
// caches that were added to tour also get added to bm list
if (missingInBml.length>0) {
var cacheArray = [];
for (let i = 0; i < missingInBml.length; i++) {
let cache = {};
let ind = CURRENT_TOUR.geocaches.findIndex(cache => cache.id === missingInBml[i]); // index in current tour
cache.name = CURRENT_TOUR.geocaches[ind].name;
cache.id = CURRENT_TOUR.geocaches[ind].id;
cache.rownumber = gcs.length+i; // add row to end of bm list
cache.referenceCode = cache.id;
cache.listItem = {};
cache.listItem.name = cache.name;
cache.listItem.description = "";
cacheArray.push(cache);
}
try {
await bml.addGeocaches(cacheArray);
} catch (e) { // tour probably contains retracted caches
let mes = $.gctour.lang('container.tourHeader.upload.tourUploadRetracted') + ':<br>';
try {
let errorMessage = JSON.parse(JSON.parse(e).errorMessage).Message;
// remove retratced GC code from missing in BM message
let gccode = errorMessage.match(/GC[0-9a-zA-Z]{1,6}/)[0];
missingInBml = missingInBml.filter(item => item !== gccode);
// index of retracted cache
let i = tourIDs.indexOf(gccode);
mes += '"#' + (i+1) + ": " + errorMessage + '"';
}
catch (e) {
mes += '"unknown GC code"';
}
mes = '<small><i>' + mes + '</i></small>';
showNotification({ text: mes, style: "yellow", timeout: 20000 });
}
}
// caches that were deleted from tour also get deleted from bm list
if (missingInTour.length>0) {
await bml.deleteGeocaches(missingInTour);
}
closeOverlay();
// show info dialog
let template = '<a href="https://coord.info/GCxxx" target="_blank">GCxxx</a>';
let missingInBml_links = missingInBml.map(x => template.replace(/GCxxx/g,x)).join(', ');
let missingInTour_links = missingInTour.map(x => template.replace(/GCxxx/g,x)).join(', ');
let message = '<div>'+$.gctour.lang('container.tourHeader.saveAsBookmarklist.up-to-date')+':<br><a href="https://coord.info/'+bmId+'" target="_blank">https://coord.info/'+bmId+'</a><br>';
message += '<br>'+$.gctour.lang('container.tourHeader.saveAsBookmarklist.added')+' ('+missingInBml.length+'):<br>'+missingInBml_links;
if (missingInBml.length>0) message += '<br>';
message += '<br>'+$.gctour.lang('container.tourHeader.saveAsBookmarklist.removed')+' ('+missingInTour.length+'):<br>'+missingInTour_links;
message += '<br><br></div>';
showNotification({ text: message, style: "green", timeout: 10000 });
}
async function deleteBookmarklist(bml_id) {
// delete bookmark list
let bml = new Bookmarklist(bml_id);
bml.delete();
// delete bookmark list id from tour
delete CURRENT_TOUR.bml;
saveCurrentTour();
}
function openGarminExpress(url) {
// if installed then open, otherwise return false
try {
var $iframe = $("<iframe />");
$iframe.css({
"display": "none"
});
$iframe.appendTo("body");
$iframe[0].contentWindow.location.href = url;
return true;
} catch (e) {
return false;
}
}
async function send2Garmin() {
if (isEmptyTour(CURRENT_TOUR) || !isLoggedIn()) {
return;
}
try {
addProgressbar();
var url = GS_WEB_API + 'garminexpress',
headers = { 'Content-Type': 'application/json', 'X-Verification-Token': TOKEN },
isPM = isPremiumUser(),
caches = [],
promises = [],
i;
// only consider geocaches, ignore own waypoints
for (i=0; i<CURRENT_TOUR.geocaches.length; i++) {
if (typeof(CURRENT_TOUR.geocaches[i].id) !== "undefined") {
caches.push(CURRENT_TOUR.geocaches[i]);
// for BM, prepare to check if cache is PMO
if (!isPM) {
let url2 = GS_WEB_API + 'Geocache/'+CURRENT_TOUR.geocaches[i].id;
promises.push(promiseRequest("GET", url2, headers));
}
}
}
// for BM exclude PMO caches (if 1 PMO cache would be present for BM then nothing gets transferred)
if (!isPM) {
let cache_objects = await Promise.all(promises);
for (i=0; i<cache_objects.length; i++) {
let resp = JSON.parse(cache_objects[i].responseText);
if (resp.state.isPremiumOnly) {
caches.splice(i,1);
}
}
}
// no caches left to transfer
if (caches.length===0) {
closeOverlay();
return;
}
var cacheIDArray = [];
for (i=0; i<caches.length; i++) {
cacheIDArray.push( gCCode2ID(caches[i].id.toUpperCase()) );
}
var data = {"geocacheIds": cacheIDArray, "name": CURRENT_TOUR.name, "referenceCode": "GCTour"};
// upload request for Garmin Device data
var response = await promiseRequest("POST", url, headers, JSON.stringify(data));
var hash = JSON.parse(response.responseText);
// call Garmin Express locally
url = 'garminexpress://manifestupdate/?manifesturl=https://api.groundspeak.com/web/v1/garminexpress/public/manifest/' + hash;
if (!openGarminExpress(url)) { // if Garmin Express is not available show info dialog
var info =
'<div style="text-align:center;">' +
'<p style="text-align:left;">Groundspeak message:</p>' +
' <b><i>Garmin Express not detected</b>' +
' <p>Make sure you have the latest version of Garmin Express installed.</p>' +
' <p><a href="http://software.garmin.com/en-US/express.html" target="_blank">Get Garmin Express</a></p></i>' +
'</div>';
showNotification({ text: info, style: "red", timeout: 10000 });
}
closeOverlay();
} catch (e) {
addErrorDialog({
caption : "Send to Garmin error",
_exception : e
});
}
}
function openSettingsDialog() {
log_timeStart('show settings menu');
var settings = new Settings_jqUI();
settings.show();
log_timeEnd('show settings menu');
}
function populateTours() {
var tourIt,
tour,
$tourListLi,
$tourLink,
$webImage,
$deleteButton;
var $tourList = $('#dialogListContainer');
$tourList.html("");
var $tourListUl = $('<ul>', {
"class" : "dialogList",
"id" : "sortable"
});
$tourList.append($tourListUl);
// construct tour list
for (tourIt = 0; tourIt < TOURS.length; tourIt++) {
tour = TOURS[tourIt];
$tourListLi = $('<li>', {
id : "tour" + tour.id
});
$tourListUl.append($tourListLi);
$tourLink = $('<a>', {
"css" : {
"cursor" : "pointer",
"font-size" : 10,
"color" : "#003399"
},
html : tour.name + "&nbsp;<small>(" + tour.geocaches.length + ")</small>"
})
.bind('click', {
tour : tour
}, function(e) {
showCacheList(e.data.tour)();
});
if (tour.webcode) {
$webImage = $('<img>', {
src : $.gctour.img.globe,
"css" : {
"float": "left",
"margin-right" : 3
}
});
$tourLink.prepend($webImage);
}
if (tour.id == CURRENT_TOUR.id) {
$tourLink.css({
'font-weight' : 'bolder'
});
} else {
$deleteButton = $('<img>', {
title : $.gctour.lang('tour.delete'),
src : $.gctour.img.del,
"css" : {
"cursor" : 'pointer',
"float" : 'right'
}
})
.bind('click', {
tour : tour
}, function(e) {
deleteTour(e.data.tour.id)();
});
$tourLink.append($deleteButton);
}
$tourListLi.prepend($tourLink);
}
// sorting tours by drag and drop
$tourListUl.sortable({
axis : "y",
cursor: "move",
helper: "clone", // prevent to fire click events
items: "> li",
placeholder : "gct_sortable-placeholder",
revert: true,
start : function(e, ui) {
// save old position
$(this).data('old-pos', ui.item.index());
},
update: function(e, ui) {
var oldPos = $(this).data('old-pos');
var newPos = ui.item.index();
debug("Drag n Drop in progress:\n" +
"\tMove tour " + TOURS[oldPos].name + " (id: " + ui.item.attr('id') + ") from '" + oldPos + "' to '" + newPos + "'");
// positions to insert/remove
var insertPos = (oldPos > newPos) ? newPos : newPos + 1;
var removePos = (oldPos < newPos) ? oldPos : oldPos + 1;
// insert tour to new position, then remove tour from old position
TOURS.splice(insertPos, 0, TOURS[oldPos]);
TOURS.splice(removePos, 1);
// save tour with new order
saveValue('tours', TOURS);
},
stop : function(e, ui) {
// remove old position
$(this).removeData('old-pos');
}
});
}
function showCacheList(tour) {
return function() {
var cacheList = document.getElementById('dialogDetails');
cacheList.scrollTop = 0;
cacheList.setAttribute("tourid", tour.id);
cacheList.innerHTML = "<u><b>" + tour.name + "</b>";
if (tour.webcode) {
cacheList.innerHTML += "&nbsp;&nbsp;&nbsp;<i>Webcode: <a href='" + GCTOUR_HOST + "tour/" + $.trim(tour.webcode) + "' title='" + $.gctour.lang('container.tourHeader.makeMap.caption') + "' target='_blank'>" + tour.webcode + "</a></i>";
}
cacheList.innerHTML += "</u><br/>";
var copyButton = document.createElement('img');
copyButton.title = $.gctour.lang('tour.copy');
copyButton.src = $.gctour.img.copy;
copyButton.style.cursor = 'pointer';
copyButton.style.marginRight = '5px';
copyButton.style.cssFloat = 'right';
copyButton.addEventListener('click', function() {
var newTour = JSON.parse(JSON.stringify(tour));
newTour.id = getNewTourId();
newTour.name = newTour.name + " - " + $.gctour.lang('tour.copyNameAppendix');
TOURS.push(newTour);
log("Creating copy tour: " + newTour.id + " ; " + newTour.name);
saveTour(newTour, true);
populateTours();
showCacheList(newTour)();
}, false);
var deleteButton = document.createElement('img');
deleteButton.title = $.gctour.lang('tour.delete');
deleteButton.src = $.gctour.img.del;
deleteButton.style.cursor = 'pointer';
deleteButton.style.marginRight = '5px';
deleteButton.style.cssFloat = 'right';
deleteButton.addEventListener('click', deleteTour(tour.id), false);
var renameButton = document.createElement('img');
renameButton.src = $.gctour.img.edit;
renameButton.title = $.gctour.lang('general.rename');
renameButton.alt = $.gctour.lang('general.rename');
renameButton.style.cursor = 'pointer';
renameButton.style.marginRight = '5px';
renameButton.style.cssFloat = 'right';
renameButton.addEventListener('click',
function() {
var newTourName = prompt($.gctour.lang('tour.newDialog'), tour.name);
if (!newTourName) {
return;
}
tour.name = newTourName;
saveTour(tour, true);
populateTours();
showCacheList(tour)();
}, false);
if (tour.id != CURRENT_TOUR.id) {
cacheList.insertBefore(deleteButton, cacheList.firstChild);
}
cacheList.insertBefore(renameButton, cacheList.firstChild);
cacheList.insertBefore(copyButton, cacheList.firstChild);
var cacheListUl = createElement('ul');
cacheListUl.setAttribute("class", "dialogList");
for (var cacheIt = 0; cacheIt < tour.geocaches.length; cacheIt++) {
var geocache = tour.geocaches[cacheIt];
var cacheListLi = createElement('li');
append(cacheListLi, cacheListUl);
cacheListLi.innerHTML = "<img src='" + geocache.image + "' style='margin-left=10px'> " + geocache.name + '&nbsp;<small style="font-size: 90%;">' + ((geocache.id !== undefined) ? '('+geocache.id+')' : '') + "</small>";
}
append(cacheListUl, cacheList);
// make loadButton available
var loadButton = document.getElementById('loadButton');
loadButton.value = '"' + tour.name + '"';
loadButton.removeAttribute('disabled');
// first remove all active tour css classes
$("ul.dialogList > li").removeClass("activeTour");
// and then set it to the clicked tour
$('#tour' + tour.id).addClass("activeTour");
};
}
function moveEntryToOtherTour(entryId,tourId) {
// get entry from current tour
var pos = getPositionOfId(entryId);
var entry = CURRENT_TOUR.geocaches[pos];
// get other tour
var otherTour = getTourById(tourId);
// check if element is already in other tour
var isInTour = false;
$.each(otherTour.geocaches, function(i, obj) {
if (obj.id == entryId || obj.wptcode == entryId) {
isInTour = true;
return false; // break each
}
});
if (isInTour) {
showGeocacheNotification({
id : (entry.id || entry.name),
name : entry.name,
image : entry.image,
tourname : otherTour.name
}, {
type : "contains"
});
return;
}
debug("moving '" + entryId + "' to '"+ otherTour.name + "'");
// add entry to other tour
otherTour.geocaches.push(entry);
// save modified other tour without changing current tour
saveTour(otherTour, true);
// delete entry from current tour and update
deleteElement(entryId)();
showGeocacheNotification({
id : (entry.id || entry.name),
name : entry.name,
image : entry.image,
tourname : otherTour.name
}, {
type : "success"
});
}
function openTourDialog(entryId) {
var overLay = getOverlay({
caption : (entryId === undefined) ? $.gctour.lang('container.toolbar.openTour') : $.gctour.lang('container.cacheList.moveToList')
});
// make dialog draggable
$('#dialogBody').draggable({
cancel: '#dialogListContainer,#dialogDetails,input',
// cursor: "move", // does not work
start: function(e, ui) {
$(this).css('cursor', 'move');
},
stop: function(e, ui) {
$(this).css('cursor', 'default');
}
});
var tourList = createElement('div', {
id : "dialogListContainer"
});
append(tourList, overLay);
var cacheList = createElement('div', {
id : "dialogDetails"
});
append(cacheList, overLay);
populateTours();
// load,close buttons
var buttonsDiv = createElement('div', {
style : "width:580px;position: absolute; bottom: 10px;"
});
append(buttonsDiv, overLay);
buttonsDiv.setAttribute('class', 'dialogFooter');
var closeButton = createElement('input', {
type : "button",
value : $.gctour.lang('general.cancel'),
style : "background-image:url(" + $.gctour.img.closebutton + ")"
});
append(closeButton, buttonsDiv);
closeButton.addEventListener('click', closeOverlay, false);
var loadButton = createElement('input', {
type : "button",
value : $.gctour.lang('general.load'),
disabled : "",
id : "loadButton",
style : "background-image:url(" + $.gctour.img.openTour + ")"
});
append(loadButton, buttonsDiv);
loadButton.addEventListener('click', function() {
var id = $("#dialogDetails").attr("tourid"); // ToDo: to $().data
if (entryId === undefined) {
loadTour(id)();
} else {
moveEntryToOtherTour(entryId,id);
}
closeOverlay();
}, false);
// load currentTour
showCacheList(CURRENT_TOUR)();
loadButton.setAttribute("disabled", "disabled");
}
async function downloadTour(webcode, _url) {
try {
var url,
onlineTour;
// add the overlay while loading
addProgressbar();
url = GCTOUR_HOST + 'tour/' + $.trim(webcode) + '/json';
if (typeof _url !== "undefined") { // url to old server
url = _url;
}
var response = await promiseRequest('GET', url),
booResponse = (response.status === 200), // only status 200
booIsJson = isJSON(response.responseText); // is response json ?
if (!booResponse || !booIsJson) {
alert("Webcode '" + webcode + "' could not be loaded.\n" +
response.status + ", " + response.statusText + ((booIsJson) ? "" : ", format is not valid"));
closeOverlay();
return false;
}
var responseObject = JSON.parse(response.responseText);
if (responseObject.type == "error" && responseObject.message == "no tour") {
// webcode not found on server
closeOverlay();
let str = '<div>' + $.gctour.lang('container.toolbar.downloadTour.webcodeerror') + '</div>';
showNotification({ text: str, style: "yellow" });
} else if (responseObject.type == "oldtour") {
onlineTour = JSON.parse(responseObject.message);
onlineTour.id = getNewTourId();
TOURS.push(onlineTour);
saveCurrentTour();
log("Download of an old online tour successful: " + onlineTour.id + " ; " + onlineTour.name);
closeOverlay();
alert("tour '" + onlineTour.name + "'\n" + $.gctour.lang('container.toolbar.downloadTour.webcodesuccess') + "\n" + $.gctour.lang('container.toolbar.downloadTour.webcodeOld'));
loadTour(onlineTour.id)();
} else {
onlineTour = responseObject;
// sanitize cache names
for (var i = 0; i < onlineTour.geocaches.length; i++) {
onlineTour.geocaches[i].name = escapeHTML(onlineTour.geocaches[i].name);
}
let index = TOURS.findIndex(tour => tour.webcode === onlineTour.webcode);
let id, tour;
if (index === -1) {
// create new tour
onlineTour.id = getNewTourId();
TOURS.push(onlineTour);
id = onlineTour.id;
tour = onlineTour;
} else {
// update existing tour
TOURS[index].geocaches = onlineTour.geocaches;
id = TOURS[index].id;
tour = TOURS[index];
}
saveTour(tour);
closeOverlay();
var str = "<div><br>Tour <u>" + onlineTour.name + "</u> " + $.gctour.lang('container.toolbar.downloadTour.webcodesuccess') + "</div>";
showNotification({ text: str, style: "green" });
loadTour(id)();
}
} catch (e) {
addErrorDialog({
caption : "Download tour error",
_exception : e
});
}
}
function downloadTourDialog() {
var overlay = getOverlay({
caption : $.gctour.lang('container.toolbar.downloadTour.caption'),
minimized : true
});
var divEbene = createElement('div');
append(divEbene, overlay);
divEbene.innerHTML = '<b>Webcode:</b>&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="webcodeInput" class="gctour-input-text" style="width:300px;"><br/>' + $.gctour.lang('container.toolbar.downloadTour.webcodeDownloadHelp');
divEbene = createElement('div');
append(divEbene, overlay);
divEbene.setAttribute('class', 'dialogFooter');
var downloadButton = createElement('input', {
type : "button",
value : $.gctour.lang('container.toolbar.downloadTour.caption'),
style : "background-image:url(" + $.gctour.img.download + ")"
});
append(downloadButton, divEbene);
downloadButton.addEventListener('click', function() {
var webcode = $.trim($('#webcodeInput').val());
if (webcode == "") {
return;
}
downloadTour(webcode);
}, false);
}
/* send2cgeo */
function send2cgeo() {
var caches = CURRENT_TOUR.geocaches,
cacheIDsCount = 0, // number of caches
group = 1, // number of IDs to submit simultaneously
url = "https://send2.cgeo.org/add.html",
$pBar = $("#gctour_send2cgeo_progressbar"),
$btn = $("#btnSend2cgeo"),
txtReg = "Register first!", // response from Send2cgeo if browser is not registered
txtSuc = "Success!", // response from Send2cgeo if submission was successful
// cache IDs
cacheIDs = $.map(caches, function(n, i) {
return ((n.id !== undefined) ? n.id : null);
});
cacheIDsCount = cacheIDs.length;
// set progress bar options
$pBar
.progressbar("option", {
"value" : 0,
"max" : cacheIDsCount
})
.removeClass("hide")
.css({ // necessary for pages in new design (search, dashboard,...), otherwise the progress bar doesn't show up
opacity : "",
display : "",
position : "",
height : "",
width : "",
top : "",
left : "",
fontSize: ""
});
// disable Send2cgeo button
$btn.button("disable");
// send cacheIDs recursively
async function sendRequests(fromPos) {
group = cacheIDsCount; // instead one by one, send all cacheIDs by one call
var toPos = fromPos + group,
param = "",
res = "",
boo = true;
toPos = (toPos > cacheIDsCount) ? cacheIDsCount : toPos;
// cacheIDs to send
param = cacheIDs.slice(fromPos, toPos).join(",");
// submit and wait for response
res = await promiseRequest('GET', url + "?cache=" + param); // https://send2.cgeo.org/add.html?cache=GC123,GC345
res = res.responseText;
$pBar.progressbar("option", "value", toPos);
if (res.indexOf(txtReg) !== -1) { // browser not registered
boo = false;
showNotification({
text: $.gctour.lang('send2cgeo.register'),
style: "yellow",
timeout: 10000
});
$pBar.addClass("hide");
$btn.button("enable");
} else if (res.indexOf(txtSuc) === -1) { // response not ok (cache probably could not be added to the queue)
boo = false;
showNotification({
text: $.gctour.lang('send2cgeo.senderror'),
style: "red",
timeout: 10000
});
$pBar.addClass("hide");
$btn.button("enable");
}
fromPos = toPos;
if (cacheIDsCount > fromPos && boo) {
sendRequests(fromPos);
}
};
// start recursion by sending first cacheID
if (cacheIDsCount > 0) {
sendRequests(0);
}
}
var openGcTour2cgeoDialog = function() {
if (isEmptyTour(CURRENT_TOUR) || !isLoggedIn()) {
return;
}
var cacheIDsCount = $.grep(CURRENT_TOUR.geocaches, function(n, i) {
return (n.id !== undefined);
}).length,
waypointCount = CURRENT_TOUR.geocaches.length - cacheIDsCount,
noWP = (waypointCount > 0 ? ' (' + $.gctour.lang('send2cgeo.noWP') + ')' : ''),
btnText = $.gctour.lang('send2cgeo.title') + noWP,
send =
'<div class="gct_send2cgeo">' +
'<br>' +
'<ol>' +
'<li>' +
'<div><button id="btnSend2cgeo">' + btnText + '</button></div>' +
'<div id="gctour_send2cgeo_progressbar" class="hide">' + // hide progress bar
'<div class="progress-label"></div>' +
'</div>'+
'</li>' +
$.gctour.lang('send2cgeo.usage') +
'</ol>' +
'</div>',
setup =
'<div class="gct_send2cgeo">' +
'<strong>' + $.gctour.lang('send2cgeo.setup.header') + '</strong>' +
'<ol>' +
'<li><a href="https://send2.cgeo.org/api/browser.html" target="_blank" title="https://send2.cgeo.org/api/browser.html">' + $.gctour.lang('send2cgeo.setup.registerBrowser') + '</a></li>' +
$.gctour.lang('send2cgeo.setup.desc1') +
'<li>' +
'<form name="device" action="https://send2.cgeo.org/pin.html" target="_blank" method="post">' +
'<label for="pin" class="gctour-label">' + $.gctour.lang('send2cgeo.setup.desc2') + '</label> ' +
'<input name="pin" type="text" placeholder="12345" maxlength="5" class="gctour-input-text" style="width: 5em; text-align: center;"/>' +
'<input name="button" type="submit" value="' + $.gctour.lang('send2cgeo.setup.desc3') + '" class="ui-button" style="margin-left: 10px;"/>' +
'</form>' +
'</li>' +
'</ol>' +
'</div>' +
'<br>' +
'<hr>' +
'<div class="gct_send2cgeo">' +
'<strong>Send2cgeo</strong>' +
'<ul>' +
'<li><a target="_blank" href="https://send2.cgeo.org/home.html" title="https://send2.cgeo.org/home.html">' + $.gctour.lang('send2cgeo.overview') + '</a></li>' +
'<li><a target="_blank" href="http://www.cgeo.org/faq.html#send2cgeo" title="http://www.cgeo.org/faq.html#send2cgeo">FAQ</a></li>' +
'</ul>' +
'</div>',
// dialog tabs structure
$tabs = $(
'<div id="tabs">' +
' <ul>' +
' <li><a href="#tabs-1">Send</a></li>' +
' <li><a href="#tabs-2">Setup</a></li>' +
' </ul>' +
' <div id="tabs-1">' + send + '</div>' +
' <div id="tabs-2">' + setup + '</div>' +
'</div>'
);
$tabs.on("dialogcreate", function() {
var $thisDlg = $(this).dialog("widget"),
$progressbar = $thisDlg.find("#gctour_send2cgeo_progressbar"),
$pl = $thisDlg.find(".progress-label");
$thisDlg.find("input[type=submit], button").button();
$progressbar.progressbar({
value: false,
max: CURRENT_TOUR.geocaches.length,
change: function() {
var $pBar = $(this),
value = $pBar.progressbar("value"),
max = $pBar.progressbar("option", "max");
$pl.text(value + " / " + max);
},
complete: function() {
$pl.text($pl.text() + " Complete!");
}
});
$thisDlg.find("#btnSend2cgeo").on('click', {}, function() {
send2cgeo();
});
});
// tabs menu
$tabs.dialog($.gctour.dialog.info(), {
title: $.gctour.lang('send2cgeo.title'),
width: '75%',
maxHeight: $(window).height() - 20,
resizable: false,
dialogClass: 'gct_dialog',
buttons: [{
text: $.gctour.lang('general.close'),
icons: {
primary: "ui-icon-closethick"
},
click: function() {
$(this).dialog("close");
}
}]
});
$("div#tabs").tabs({
heightStyle: "content"
});
};
/* overlays */
/* usage:
var options = {
caption: "Test Beschriftung",
color: 'red',
_document: document,
minimized: true,
closeCallback : function(_document){alert('oioio');}
}
getOverlay(options);
*/
function getOverlay(options) {
var bodyNew,
closeButton,
caption,
localDocument,
background_color;
caption = options.caption;
localDocument = options._document || document;
background_color = options.color || "#B2D4F3";
bodyNew = localDocument.getElementsByTagName('body')[0];
// first - close all old overlays
closeOverlayRemote(localDocument)();
var overLay = localDocument.createElement('div');
overLay.align = 'center';
overLay.className = 'dialogMask';
overLay.id = "dialogMask";
var dialogBody = localDocument.createElement('div');
dialogBody.id = "dialogBody";
dialogBody.className = "dialogBody header";
if (options.minimized) {
dialogBody.className += " dialogMin";
}
var dialogHead = localDocument.createElement('h1');
append(dialogHead, dialogBody);
dialogHead.style.backgroundColor = background_color;
var icon = "<img style='float:left;position:relative;top:-3px;' src='" + $.gctour.img.gctourLogo + "'>";
dialogHead.innerHTML = icon + caption;
closeButton = createElement('img', {
style : "cursor:pointer;"
});
append(closeButton, dialogHead);
closeButton.style.cssFloat = "right";
closeButton.src = $.gctour.img.closebutton;
var closeFunction = options.closeCallback || closeOverlayRemote;
closeButton.addEventListener('click', closeFunction(localDocument), false);
// close with ESC key
$(document).on('keydown', function(e) {
if (e.keyCode === 27) { // ESC
closeFunction(localDocument)();
}
});
var dialogContent = localDocument.createElement('div');
append(dialogContent, dialogBody);
dialogContent.className = "dialogContent";
bodyNew.appendChild(overLay);
bodyNew.appendChild(dialogBody);
// make overlay draggable
$("#dialogBody").draggable();
return dialogContent;
}
function closeOverlayRemote(theDocument) {
return function() {
$(theDocument)
.find("#dialogMask").remove().end()
.find("#dialogBody").remove().end()
.find("#progressOverlay").remove();
};
}
function closeOverlay() {
closeOverlayRemote(document)();
}
function getListOverlay(options) {
var overlay = getOverlay(options);
var list = createElement('div', {
id : "dialogListContainer"
});
append(list, overlay);
var listUl = createElement('ul');
listUl.setAttribute("class", "dialogList");
append(listUl, list);
var details = createElement('div', {
id : "dialogDetails"
});
append(details, overlay);
var dialogFooter = createElement('div', {
style : "width:580px;position: absolute; bottom: 10px;"
});
append(dialogFooter, overlay);
dialogFooter.setAttribute('class', 'dialogFooter');
var close = createElement('input', {
type : "button",
value : $.gctour.lang('general.close'),
style : "background-image:url(" + $.gctour.img.save + ")"
});
append(close, dialogFooter);
close.addEventListener('click', closeOverlay, false);
return [listUl, details];
}
function addErrorDialog(options) {
var localDocument;
localDocument = options._document || document;
closeOverlay();
options.minimized = true;
options.color = "#f00";
options.caption = options.caption || 'Error';
// log the exception
log_exception(options._exception);
var overlay = getOverlay(options);
$(overlay).append(
$('<div/>')
.css('border', '1px dashed red')
.css('clear', 'both')
.css('margin', '3px').css('padding', '5px')
.html('<b>' + options._exception + '</b>'),
$('<div/>')
.html($.gctour.lang('dlg.error.content')),
$('<div/>')
.addClass('dialogFooter')
.append(
$('<input/>')
.attr('onclick', 'return false;')
.attr('type', 'button')
.attr('value', $.gctour.lang('general.close'))
.css('background-image', 'url(' + $.gctour.img.closebutton + ')')
.bind('click', function() {
if (localDocument == document) {
closeOverlayRemote(localDocument)();
} else { // if we are on the printview - close the whole window
localDocument.defaultView.close();
}
})
)).find("#gctour_update_error_dialog").bind('click', function() {
update(true);
});
}
function addProgressbar(options) {
var overlay;
if (options) {
var theDocument = options._document || document;
var theCaption = options.caption || $.gctour.lang('general.pleaseWait');
if (options.closeCallback) {
overlay = getOverlay({
caption : theCaption,
minimized : true,
_document : theDocument,
closeCallback : options.closeCallback
});
} else {
overlay = getOverlay({
caption : theCaption,
minimized : true,
_document : theDocument
});
}
} else {
overlay = getOverlay({
caption : $.gctour.lang('general.pleaseWait'),
minimized : true,
_document : document
});
}
var progressBarContainer = document.createElement('div');
append(progressBarContainer, overlay);
progressBarContainer.style.marginLeft = "135px";
var progressBar = document.createElement('div');
append(progressBar, progressBarContainer);
progressBar.style.border = '1px solid lightgray';
progressBar.style.height = '13px';
progressBar.style.width = '208px';
progressBar.style.cssFloat = 'left';
progressBar.style.margin = '10px';
progressBar.style.align = 'center';
progressBar.style.lineHeight = '13px';
progressBar.style.verticalAlign = 'middle';
progressBar.style.background = "url(" + $.gctour.img.loader2 + ")";
progressBar.style.setProperty("-moz-border-radius", "4px", "");
progressBar.style.setProperty("border-radius", "4px", "");
var progressBarElement = document.createElement('div');
append(progressBarElement, progressBarContainer);
progressBarElement.id = 'progressbar';
progressBarElement.style.opacity = '0.6';
progressBarElement.style.width = '0px';
progressBarElement.style.height = '13px';
progressBarElement.style.fontSize = '10px';
progressBarElement.style.backgroundColor = '#E78F08';
progressBarElement.style.position = 'absolute';
progressBarElement.style.margin = '11px';
progressBarElement.align = 'center';
progressBarElement.style.setProperty("-moz-border-radius", "4px", "");
progressBarElement.style.setProperty("border-radius", "4px", "");
}
function setProgress(i, count, theDocument) {
var width = ((208 * (i + 1)) / count);
$("#progressbar", theDocument)
.css('width', width)
.html("<b>" + (i + 1) + "/" + count + "</b>");
}
function updateProgressBar() {
setProgress(PROGRESS_BAR.progress, PROGRESS_BAR.total, document);
PROGRESS_BAR.progress += 1;
}
/* gui notifications */
$.gctour.notification = $.gctour.notification || {};
$.gctour.notification.init = function() {
$('<ul>', {
id : "gctour-notification-box"
}).appendTo('body');
};
$.gctour.notification.add = function(options) {
var content = options.icon ? "<img style='float:left;padding-right:6px;'src='" + options.icon + "'/>" : "";
content += options.title ? "<span style='font-size:18px'><b>" + options.title + "</b></span><br/>" : "";
content += options.text ? options.text : "";
var timeout = options.timeout ? options.timeout : 6000;
var $note = $('<li>', {
"class" : "gctour-notification-" + (options.style ? options.style : "green"),
click : function() {
$(this).animate({
height : 0
}, 600, "linear", function() {
$(this).remove();
});
}
})
//.disableSelection()
.append(
$('<div>', {
html : content,
css : {
'font-size' : '13px',
'line-height' : '16px',
'padding' : '8px 10px 9px',
'position' : 'relative',
'text-align' : 'left',
'width' : 'auto'
}
})
)
.prependTo($('#gctour-notification-box'));
setTimeout(function() {
$note.animate({
height : 0
}, 600, "linear", function() {
$note.remove();
});
}, timeout);
};
$.gctour.notification.init();
$.gctour.notification.test = function() {
if (DEBUG_MODE) {
var dummyNote = [{
title: "test 1",
icon: GS_HOST + GS_WPT_IMAGE_PATH + "2.gif",
text: "test notification",
style: "yellow"
}, {
title: "test 2",
icon: GS_HOST + GS_WPT_IMAGE_PATH + "3.gif",
text: "test notification, longer text",
style: "red"
}, {
title: "test 3",
icon: GS_HOST + GS_WPT_IMAGE_PATH + "4.gif",
text: "test notification, longer text, even longer text",
style: "blue"
}, {
title: "test 4",
icon: GS_HOST + GS_WPT_IMAGE_PATH + "5.gif",
text: "test notification"
}
],
dummyNoteZaehler = 0,
dummyNoteLength = dummyNote.length,
dummyNoteInterval,
foo = function() {
if ((0 <= dummyNoteZaehler) && (dummyNoteZaehler <= dummyNote.length)) {
$.gctour.notification.add(dummyNote[dummyNoteZaehler]);
}
dummyNoteZaehler++;
if (dummyNoteZaehler >= dummyNoteLength) {
clearInterval(dummyNoteInterval);
dummyNoteZaehler = 0;
}
};
$('#ctl00_uxLoginStatus_hlHeaderAvatar').hover(function() {
clearInterval(dummyNoteInterval);
dummyNoteZaehler = 0;
dummyNoteInterval = window.setInterval(foo, 500);
});
}
}
//$.gctour.notification.test();
/* Leaflet maps for autoTour, change coordinates and own waypoints */
function LeafletMap(options) {
if (typeof L !== "object") { // leaflet not available
addErrorDialog({
caption : "Map error",
_document : document,
_exception : 'Leaflet not available'
});
}
this._options = options;
this._id = options.id;
this._marker = '';
this._circle = '';
this._features = [];
this.init();
}
LeafletMap.prototype.init = function() {
// add leaflet css
if ($("head link#gct-leaflet-css").length === 0) { // has to be added only once
$("head").append('<link id="gct-leaflet-css" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css" rel="stylesheet" type="text/css">');
}
// add map
$('<div/>', {
id: this._id,
height: (this._options.height) ? this._options.height : '280px'
}).appendTo(this._options.anchor);
this._lm = L.map(this._id, {
maxZoom: 15,
boxZoom: false,
doubleClickZoom: false,
dragging: false,
keyboard: false,
prefix: false,
scrollWheelZoom: false,
tap: false,
touchZoom: false,
zoomControl: false,
zoomSnap: 0.1
});
L.control.scale().addTo(this._lm);
switch (this._options.map) {
case 'osm':
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
subdomains: 'abc'
}).addTo(this._lm);
break;
case 'gm':
default: // 'gm'
L.tileLayer('https://mt.google.com/vt?&x={x}&y={y}&z={z}', {
attribution: '&copy; <a href="https://maps.google.com/">Google Maps</a>',
maxZoom: 22,
subdomains: '1234'
}).addTo(this._lm);
break;
}
this._lm.setView(this._options.center,15);
}
LeafletMap.prototype.addMarker = function(marker) {
let size = 20, // px
ico,
GSIcon,
GCTIcon;
switch(marker.type) {
case 'gs': // GS marker
GSIcon = L.Icon.extend({
options: {
iconSize: [size, size+3],
iconAnchor: [size/2, size]
}
});
ico = new GSIcon({iconUrl: '/images/wpttypes/pins/'+marker.icon+'.png'});
this._marker = L.marker(marker.center, {icon: ico});
break;
case 'gct': // GCTour marker
GCTIcon = L.Icon.extend({
options: {
iconSize: [size, size],
iconAnchor: [size/2, size]
}
});
ico = new GCTIcon({iconUrl: GCTOUR_HOST+'i/'+marker.icon+'.png'});
this._marker = L.marker(marker.center, {icon: ico});
break;
default:
this._marker = L.marker(marker.center);
}
this._features.push(this._marker);
let group = new L.featureGroup(this._features);
group.addTo(this._lm);
this._lm.fitBounds(group.getBounds().pad(0.1));
}
LeafletMap.prototype.addCircle = function(circle) {
this._circle = L.circle(circle.center, circle.radius/*[m]*/);
this._features.push(this._circle);
let group = new L.featureGroup(this._features);
group.addTo(this._lm);
this._lm.fitBounds(group.getBounds().pad(0.1));
}
LeafletMap.prototype.removeLayer = function() {
if (this._features.length > 0) {
this._lm.removeLayer(this._features.pop());
}
}
/* own marker */
async function showNewMarkerDialog(marker) {
// create overlay
let overlayMarker = getOverlay({
caption : '<b>' + $.gctour.lang('printview.marker') + '</b>',
minimized : true
});
// hidden error field
let dangerDanger = document.createElement('div');
dangerDanger.id = "dangerdanger";
dangerDanger.style.visibility = "hidden";
dangerDanger.style.cssFloat = "right";
dangerDanger.innerHTML = "<img src='" + $.gctour.img.danger + "'>";
overlayMarker.appendChild(dangerDanger);
// content table
let anTable = document.createElement('table');
anTable.style.width = '100%';
anTable.style.clear = 'both';
anTable.align = 'center';
overlayMarker.appendChild(anTable);
// row name
let tr = document.createElement('tr');
anTable.appendChild(tr);
let td = document.createElement('td');
td.style.width = '20%';
td.textContent = 'Name';
tr.appendChild(td);
// input field for name of marker
td = document.createElement('td');
tr.appendChild(td);
let nameInput = document.createElement('input');
nameInput.type = 'text';
nameInput.id = 'markerName';
nameInput.className = "gctour-input-text";
nameInput.style.width = '450px';
td.appendChild(nameInput);
// row name
tr = document.createElement('tr');
anTable.appendChild(tr);
td = document.createElement('td');
tr.appendChild(td);
td.textContent = $.gctour.lang('marker.coord');
// input field for marker coords
td = document.createElement('td');
tr.appendChild(td);
// lat/lon input field
let cordsInput = document.createElement('input');
cordsInput.type = 'text';
cordsInput.id = 'markerCoords';
cordsInput.className = "gctour-input-text";
cordsInput.style.width = '450px';
cordsInput.style.marginRight = '5px';
cordsInput['placeholder'] = 'N49° 26.082 E7° 46.587';
td.appendChild(cordsInput);
// example coords for lat/lon input field
let exampleCoords = document.createElement('div');
exampleCoords.innerHTML = '<div style="font-size:xx-small"><i>' + $.gctour.lang('general.exampleCoords') + '</i></div>';
td.appendChild(exampleCoords);
let defaultMarker = {};
defaultMarker.center = [0,0];
defaultMarker.type = 'gct';
defaultMarker.icon = 'RedFlag';
// check marker coords as you type
let checkMarkerCoord = function(input) {
return async function() {
let coords = await parseCoordinates(input.value);
if (coords === false) {
cordsInput.style.backgroundColor = "#FF8888";
} else {
cordsInput.style.backgroundColor = "#88DC3B";
// add marker
defaultMarker.center = [coords._lat, coords._lon];
lm.removeLayer(); // delete previous marker
lm.addMarker(defaultMarker);
}
};
};
cordsInput.addEventListener('keyup', checkMarkerCoord(cordsInput), false);
cordsInput.addEventListener('paste', checkMarkerCoord(cordsInput), false);
// add map
tr = document.createElement('tr');
anTable.appendChild(tr);
td = document.createElement('td');
tr.appendChild(td);
td = document.createElement('td');
td.align = 'left';
tr.appendChild(td);
let map = document.createElement('div');
td.appendChild(map);
let options = {};
options.id = 'gct-marker-map',
options.center = [0,0];
options.height = '250px';
options.map = 'gm';
options.anchor = $(map);
let lm = new LeafletMap(options);
// row name
tr = document.createElement('tr');
anTable.appendChild(tr);
td = document.createElement('td');
td.innerHTML = $.gctour.lang('marker.content') + '<br/><div style="font-size:xx-small">(' + $.gctour.lang('marker.contentHint') + ')</div>';
tr.appendChild(td);
// text content of marker
td = document.createElement('td');
tr.appendChild(td);
let contentTextarea = document.createElement('textarea');
contentTextarea.style.width = '450px';
contentTextarea.style['border'] = '1px solid #ccc';
contentTextarea.style['border-radius'] = '3px';
contentTextarea.id = 'markerContent';
contentTextarea.rows = '2';
td.appendChild(contentTextarea);
// row name
tr = document.createElement('tr');
anTable.appendChild(tr);
td = document.createElement('td');
td.style.width = '20%';
td.textContent = $.gctour.lang('marker.type');
tr.appendChild(td);
// marker icons
td = document.createElement('td');
tr.appendChild(td);
let markerTypeTable = createElement('table', {
style : "width:auto;"
});
td.appendChild(markerTypeTable);
markerTypeTable.id = 'markerType';
let typeArray = [
[GCTOUR_HOST + 'i/RedFlag.png', 'Red Flag'],
[GCTOUR_HOST + 'i/BlueFlag.png', 'Blue Flag'],
[GCTOUR_HOST + 'i/GreenFlag.png', 'Green Flag'],
[GCTOUR_HOST + 'i/Geocache.png', 'Geocache'],
[GCTOUR_HOST + 'i/GeocacheFound.png', 'Geocache Found'],
[GCTOUR_HOST + 'i/Information.png', 'Information'],
[GCTOUR_HOST + 'i/Park.png', 'Park'],
[GCTOUR_HOST + 'i/ParkingArea.png', 'Parking'],
[GCTOUR_HOST + 'i/SkullAndBones.png', 'Skull And Crossbones']
];
let trElement = createElement('tr', {
style : "height:27px;"
});
markerTypeTable.appendChild(trElement);
for (let i = 0; i < typeArray.length; i++) {
let tdElement = createElement('td', {
style : "width:25px;"
});
tdElement.style.background = "url(" + typeArray[i][0] + ") center center no-repeat";
if (!marker) {
if (i === 0) {
tdElement.style.backgroundColor = '#B2D4F3';
}
} else {
if (typeArray[i][0] == marker.image) {
tdElement.style.backgroundColor = '#B2D4F3';
}
}
tdElement.style.cursor = 'pointer';
tdElement.style.padding = '0px';
tdElement.style.border = '1px solid silver';
tdElement.addEventListener('click', function(){
defaultMarker.icon = typeArray[i][0].split("/").pop().split(".")[0];
// emphasize selected icon
let $icons = $("table#markerType td");
$icons.css("background-color", "");
$($icons[i]).css("background-color", "#B2D4F3");
// update marker
lm.removeLayer();
lm.addMarker(defaultMarker);
}, false);
trElement.appendChild(tdElement);
}
// add save and cancel buttons
tr = document.createElement('tr');
anTable.appendChild(tr);
td = document.createElement('td');
td.colSpan = '2';
td.align = 'right';
tr.appendChild(td);
// vars for saving marker to tour
let latitude = '';
let longitude = '';
let wptCode = '';
// button container
let buttonsDiv = createElement('div');
buttonsDiv.setAttribute('class', 'dialogFooter');
append(buttonsDiv, overlayMarker);
// cancel button
let cancel = createElement('input', {
type : "button",
value : $.gctour.lang('general.cancel'),
style : "background-image:url(" + $.gctour.img.closebutton + ")"
});
append(cancel, buttonsDiv);
cancel.addEventListener('click', closeOverlay, false);
// save button
let save = createElement('input', {
type : "button",
value : $.gctour.lang('general.save'),
style : "background-image:url(" + $.gctour.img.save + ")"
});
append(save, buttonsDiv);
save.addEventListener('click', function() {
let errors = 0;
let markerName = document.getElementById('markerName');
if (markerName.value != "") {
markerName.style.backgroundColor = "#FFFFFF";
} else {
markerName.style.backgroundColor = "#FF8888";
errors++;
}
let markerCoords = document.getElementById('markerCoords');
if (markerCoords.style.backgroundColor != "rgb(136, 220, 59)") {
markerCoords.style.backgroundColor = "#FF8888";
errors++;
}
let markerContent = document.getElementById('markerContent');
let markerType = GCTOUR_HOST + 'i/' + defaultMarker.icon + '.png';
let markerTypeSym = $.map(typeArray, function(value, key) {
if (value[0] === markerType) {
return value[1];
}
});
if (errors !== 0) {
document.getElementById('dangerdanger').style.visibility = "visible";
return;
}
latitude = defaultMarker.center[0];
longitude = defaultMarker.center[1];
let markerPositionDelta = '';
if (marker) {
let markerPosition = getPositionOfId(marker.wptcode);
markerPositionDelta = markerPosition - CURRENT_TOUR.geocaches.length + 1;
deleteElement((marker.id) ? marker.id : marker.wptcode)();
} else {
markerPositionDelta = 0;
}
let entry = addCustomMarker(markerName.value, latitude, longitude, markerContent.value, markerType, markerTypeSym, wptCode);
move(entry.wptcode, markerPositionDelta);
updateGUI();
closeOverlay();
}, false);
// if we edit a marker then set all previous values
if (marker) {
nameInput.value = marker.name;
latitude = marker.latitude;
longitude = marker.longitude;
wptCode = marker.wptcode;
let latLon = new LatLon(marker.latitude, marker.longitude);
cordsInput.value = latLon.toString("dm");
cordsInput.style.backgroundColor = "#88DC3B";
contentTextarea.innerHTML = marker.content;
defaultMarker.icon = marker.image.split('/').pop().split('.')[0];
} else {
let latlon;
// use listing coords when on a cache page and home coords otherwise
if (!(latlon = $('span#uxLatLon').text())) {
latlon = await getHomeCoords();
}
nameInput.value = 'WP';
cordsInput.value = latlon;
}
// set initial marker
checkMarkerCoord(cordsInput)();
// set the focus to coords input
cordsInput.focus();
}
/* change coordinates */
function displayChangedCoordinates(coordinates) {
let coordinates_org,
coordinates_ele = $('#uxLatLon');
try { // if coordinates were already changed by GCTour, extract original coordinates
coordinates_org = coordinates_ele.text().split("(")[1].split(")")[0];
} catch (e) { // no previous changes by GCTour
coordinates_org = coordinates_ele.text();
}
if (!coordinates) { // display original coords
coordinates_ele.html(coordinates_org);
} else { // display new coords
coordinates_ele.html(
"<small><div style='font-weight:bold;'>" + coordinates +
"&nbsp;&nbsp;-&nbsp;&nbsp;changed by GCTour</div> (" + coordinates_org + ")</small>");
}
}
async function openChangeCoordinates() {
// content table
let anTable = createElement('table', {
style : "clear:both;"
});
anTable.style.width = '100%';
anTable.align = 'center';
// create overlay
let overlayMarker = getOverlay({
caption : $.gctour.lang('cache.moveCoords'),
minimized : true
});
overlayMarker.appendChild(anTable);
// help section
let tr = document.createElement('tr');
anTable.appendChild(tr);
let td = document.createElement('td');
td.colSpan = 2;
td.innerHTML = $.gctour.lang('cache.moveCoordsHelp');
tr.appendChild(td);
// original coords name
tr = document.createElement('tr');
anTable.appendChild(tr);
td = document.createElement('td');
td.style.width = '20%';
td.textContent = $.gctour.lang('cache.originalCoords');
tr.appendChild(td);
// get original coordinates
let coordinates = $('#uxLatLon').text();
try {
// if coordinates were already changed by GCTour, extract original coordinates
coordinates = coordinates.split("(")[1].split(")")[0];
} catch (e) {
// no previous changes by GCTour
}
// cache details
let minimal_geocache = getMinimalGeocacheDetails(document.getElementsByTagName('html')[0]);
let gc_type = minimal_geocache.type;
let coords = await parseCoordinates(coordinates);
let cacheId = minimal_geocache.gccode;
// original coords value
td = document.createElement('td');
tr.appendChild(td);
let nameInput = document.createElement('input');
nameInput.type = 'text';
nameInput.id = 'markerName';
nameInput.className = "gctour-input-text";
nameInput.value = coords;
nameInput.style.width = '350px';
nameInput.style.marginRight = '5px';
nameInput.disabled = 'disabled';
td.appendChild(nameInput);
// new coords name
tr = document.createElement('tr');
anTable.appendChild(tr);
td = document.createElement('td');
td.textContent = $.gctour.lang('cache.newCoords');
tr.appendChild(td);
// new coords value
td = document.createElement('td');
tr.appendChild(td);
// hidden lat value (decimal)
let cordsInputLat = document.createElement('input');
cordsInputLat.type = "hidden";
cordsInputLat.id = 'cordsInputLat';
td.appendChild(cordsInputLat);
// hidden lon value (decimal)
let cordsInputLon = document.createElement('input');
cordsInputLon.type = "hidden";
cordsInputLon.id = 'cordsInputLon';
td.appendChild(cordsInputLon);
// visible lat/lon value
let cordsInput = document.createElement('input');
cordsInput.type = 'text';
cordsInput.id = 'markerCoords';
cordsInput.className = "gctour-input-text";
cordsInput.style.width = '350px';
cordsInput.style.marginRight = '5px';
td.appendChild(cordsInput);
// add example coords text to new coords input
let exampleCoords = document.createElement('div');
exampleCoords.innerHTML = '<div style="font-size:x-small"><i>' + $.gctour.lang('general.exampleCoords') + '</i></div>';
td.appendChild(exampleCoords);
// process new coords as you type
let checkMarkerCoord = function(input) {
return async function() {
let coords = await parseCoordinates(input.value);
if (coords === false) {
cordsInput.style.backgroundColor = "#FF8888";
} else {
cordsInput.style.backgroundColor = "#88DC3B";
cordsInputLat.value = coords._lat;
cordsInputLon.value = coords._lon;
// update marker on map
let marker = {};
marker.center = [cordsInputLat.value, cordsInputLon.value];
marker.type = 'gs';
marker.icon = gc_type.split(".")[0];
lm.removeLayer(); // remove previous marker first
lm.addMarker(marker);
}
};
};
// check new coords on key input or paste
cordsInput.addEventListener('keyup', checkMarkerCoord(cordsInput), false);
cordsInput.addEventListener('paste', checkMarkerCoord(cordsInput), false);
// map section
let mapTd = document.createElement('td');
mapTd.align = 'left';
// add map to table
tr = document.createElement('tr');
anTable.appendChild(tr);
td = document.createElement('td');
tr.appendChild(td);
tr.appendChild(mapTd);
let options = {};
options.id = 'gct-changeCoords-map',
options.center = [coords._lat, coords._lon];
options.height = '250px';
options.map = 'gm';
options.anchor = $(mapTd);
let lm = new LeafletMap(options);
// save/delete/cancel buttons
// container for buttons
let buttonsDiv = createElement('div');
append(buttonsDiv, overlayMarker);
buttonsDiv.setAttribute('class', 'dialogFooter');
// cancel button
let cancel = createElement('input', {
type : "button",
value : $.gctour.lang('general.cancel'),
style : "background-image:url(" + $.gctour.img.closebutton + ")"
});
append(cancel, buttonsDiv);
cancel.addEventListener('click', closeOverlay, false);
// delete button
let delete_btn = createElement('input', {
type : "button",
value : $.gctour.lang('cache.deleteCoords'),
style : "background-image:url(" + $.gctour.img.closebutton + ")"
});
append(delete_btn, buttonsDiv);
delete_btn.addEventListener('click', function() {
GM_deleteValue('coords_' + cacheId);
displayChangedCoordinates();
updateGUI();
closeOverlay();
}, false);
// save button
let save = createElement('input', {
type : "button",
value : $.gctour.lang('general.save'),
style : "background-image:url(" + $.gctour.img.save + ")"
});
append(save, buttonsDiv);
save.addEventListener('click', function() {
GM_setValue('coords_' + cacheId, cordsInputLat.value + '#' + cordsInputLon.value);
displayChangedCoordinates(new LatLon(cordsInputLat.value, cordsInputLon.value).toString());
updateGUI();
closeOverlay();
}, false);
// initialize
let latlng = '';
if (GM_getValue('coords_' + cacheId, "null") != "null") { // coords have been changed before
var coords_cacheId = GM_getValue('coords_' + cacheId);
latlng = new LatLon(coords_cacheId.split('#')[0], coords_cacheId.split('#')[1]);
} else { // original coords
latlng = await parseCoordinates(coordinates);
}
cordsInputLat.value = latlng._lat;
cordsInputLon.value = latlng._lon;
cordsInput.value = latlng.toString();
cordsInput.style.backgroundColor = "#88DC3B";
let marker = {};
marker.center = [cordsInputLat.value, cordsInputLon.value];
marker.type = 'gs';
marker.icon = gc_type.split(".")[0];
lm.addMarker(marker);
}
/* tour functions */
function getTourById(id) {
for (var i = 0; i < TOURS.length; i++) {
if (TOURS[i].id == id) {
return TOURS[i];
}
}
return;
}
function getNewTourId() {
var tourId = 0;
for (var i = 0; i < TOURS.length; i++) {
if (TOURS[i].id >= tourId) {
tourId = TOURS[i].id + 1;
}
}
return tourId;
}
function isGcIdInTable(gcId) {
for (var i = 0; i < CURRENT_TOUR.geocaches.length; i++) {
if (CURRENT_TOUR.geocaches[i].id == gcId) {
return true;
}
}
return false;
}
function getPositionOfId(theId) {
var id = -1;
$.each(CURRENT_TOUR.geocaches, function(i, obj) {
if (obj.id == theId || obj.wptcode == theId) {
id = i;
return false; // break each
}
});
return id;
}
function saveTour(tour, notLoad) {
var i;
for (i = 0; i < TOURS.length; ++i) {
if (TOURS[i].id == tour.id) {
TOURS[i] = tour;
}
}
GM_setValue('tours', JSON.stringify(TOURS));
if (notLoad === undefined) {
GM_setValue('currentTour', tour.id);
log("updating " + tour.name);
}
}
function saveCurrentTour() {
saveTour(CURRENT_TOUR);
}
// move a cache to a given position in the list
function move(id, positionDelta) {
var i;
// locate the selected cache in the list
var position = getPositionOfId(id);
// return if we are at the end or at top of the list!
if ((position === 0 && positionDelta < 0) || (position == CURRENT_TOUR.geocaches.length - 1 && positionDelta > 0)) {
return;
}
// save clicked cache
var geoCache = CURRENT_TOUR.geocaches[position];
// remove it from the current geocaches
CURRENT_TOUR.geocaches.splice(position, 1);
var tempCaches = [];
// first push all caches in front of the selected in the new array
for (i = 0; i < position + positionDelta; i++) {
tempCaches.push(CURRENT_TOUR.geocaches[i]);
}
// then the selected
tempCaches.push(geoCache);
// and now the rest
for (i = position + positionDelta; i < CURRENT_TOUR.geocaches.length; i++) {
tempCaches.push(CURRENT_TOUR.geocaches[i]);
}
// ... and make it persistent
CURRENT_TOUR.geocaches = tempCaches;
saveCurrentTour();
updateTourNumbering();
}
function moveUp(id) {
return function() {
move(id, -1);
};
}
function moveDown(id) {
return function() {
move(id, 1);
};
}
function moveTop(id) {
return function() {
var position = getPositionOfId(id);
move(id, -position);
};
}
function moveBottom(id) {
return function() {
var position = getPositionOfId(id);
move(id, CURRENT_TOUR.geocaches.length - position - 1);
};
}
function updateCacheCount(count) {
$("#cachecount")
.html('(' + count + ')')
.stop(true, true)
.animate({
backgroundColor : '#ffe000'
}, 800)
.animate({
backgroundColor : '#ffffff'
}, 700);
if (!STICKY) { // nur wenn sichtbar
$("#gctourButtonWrapper")
.stop(true, true)
.toggleClass("gctour-grand-highlight", 300)
.toggleClass("gctour-grand-highlight", 1200);
}
}
function updateTourNumbering() {
$('ul#cacheList div.counter').each(function(i) {
$(this).text(i+1);
});
}
function saveCurrentTourRefreshGUI() {
saveCurrentTour();
updateTourNumbering();
updateCacheCount(CURRENT_TOUR.geocaches.length);
}
function addToCacheList(theEntry, effects) {
var costumMarker = (typeof(theEntry.latitude) !== "undefined");
// if this is a custom marker user other id
var theId = (!costumMarker) ? theEntry.id : theEntry.wptcode;
var entryLi = createElement('li', {
id : theId,
style : "position:relative;opacity:0;width:90%;list-style-image='url('" + theEntry.image + "');background-color:pink;"
});
//set the type
entryLi.style.listStyleImage = "url('" + theEntry.image + "')";
// make the gcid link
var nameCite = createElement('span', {
style : "vertical-align:top"
});
if (!costumMarker) {
var coordinates = GM_getValue('coords_' + theId, "null"); // changed by GCTour
if (coordinates != "null") {
var moveCoords = createElement('img', {
src : $.gctour.img.coord_update,
height : "12",
style : "float:right;margin-right:5px;margin-top:2px",
alt : $.gctour.lang('cache.movedCoords'),
title : $.gctour.lang('cache.movedCoords')
});
nameCite.appendChild(moveCoords);
}
var linkElement = document.createElement('a');
linkElement.style.fontFamily = 'arial,sans-serif';
linkElement.href = 'http://coord.info/' + theId;
linkElement.target = '_blank';
linkElement.textContent = theId;
nameCite.appendChild(linkElement);
} else {
nameCite.innerHTML += theEntry.name;
nameCite.style.textDecoration = "underline";
}
// the log/edit, move and delete button
var functionButtonsDiv = document.createElement('div');
functionButtonsDiv.style.cssFloat = 'right';
functionButtonsDiv.setAttribute("class", "controls");
if (!costumMarker) {
var logVisitImage = document.createElement('img');
logVisitImage.alt = $.gctour.lang('container.cacheList.logYourVisit');
logVisitImage.title = $.gctour.lang('container.cacheList.logYourVisit');
logVisitImage.style.cursor = 'pointer';
logVisitImage.src = $.gctour.img.add_comment;
logVisitImage.addEventListener('click', function() {
GM_openInTab(GS_HOST + 'seek/log.aspx?wp=' + theId, false);
}, true);
addOpacityEffects(logVisitImage);
functionButtonsDiv.appendChild(logVisitImage);
} else {
var editMarkerButton = document.createElement('img');
editMarkerButton.alt = $.gctour.lang('general.edit');
editMarkerButton.title = $.gctour.lang('general.edit');
editMarkerButton.style.cursor = 'pointer';
editMarkerButton.src = $.gctour.img.edit;
editMarkerButton.addEventListener('click', function() {
showNewMarkerDialog(theEntry);
}, false);
addOpacityEffects(editMarkerButton);
functionButtonsDiv.appendChild(editMarkerButton);
}
// button to move an element to a different tour
var moveImage = document.createElement('img');
moveImage.alt = $.gctour.lang('container.cacheList.moveToList');
moveImage.title = $.gctour.lang('container.cacheList.moveToList');
moveImage.style.cursor = 'pointer';
moveImage.style.marginLeft = '1px';
moveImage.style.marginRight = '1px';
moveImage.src = $.gctour.img.move;
moveImage.addEventListener('click', function() {
openTourDialog(theId);
});
addOpacityEffects(moveImage);
functionButtonsDiv.appendChild(moveImage);
// button to remove an element from a tour
var deleteImage = document.createElement('img');
deleteImage.alt = $.gctour.lang('container.cacheList.removeFromList');
deleteImage.title = $.gctour.lang('container.cacheList.removeFromList');
deleteImage.style.cursor = 'pointer';
deleteImage.src = $.gctour.img.del;
deleteImage.addEventListener('click', deleteElement(theId), true);
addOpacityEffects(deleteImage);
functionButtonsDiv.appendChild(deleteImage);
entryLi.appendChild(functionButtonsDiv);
entryLi.appendChild(nameCite);
var nameDiv = document.createElement('div');
nameDiv.style.clear = 'left';
nameDiv.style.position = 'relative';
nameDiv.style.zIndex = 2;
nameDiv.style.width = '90%';
// truncate single words that are too long
nameDiv.style.overflow = 'hidden';
nameDiv.style.textOverflow = 'ellipsis';
if (!costumMarker) {
nameDiv.innerHTML += theEntry.name;
} else {
nameDiv.innerHTML += new LatLon(theEntry.latitude, theEntry.longitude).toString() + " " + theEntry.content;
}
entryLi.appendChild(nameDiv);
var counterDiv = document.createElement('div');
counterDiv.className = 'counter unselectable';
counterDiv.innerHTML = (getPositionOfId(theEntry.id || theEntry.wptcode) + 1);
entryLi.appendChild(counterDiv);
$('#cacheList').append(entryLi);
if (unsafeWindow.draglist) {
unsafeWindow.draglist.sync(); // needed to function properly
}
if (effects) { // when adding more than one cache this gets quite slow ...
$("#" + theId).fadeTo(1000, 1);
} else {
$("#" + theId).css({
opacity : 1
});
}
}
function addToCurrentTour(entry) {
var currentTourId = GM_getValue('currentTour', -1);
CURRENT_TOUR = getTourById(currentTourId);
CURRENT_TOUR.geocaches.push(entry);
log("saving " + (entry.id ? entry.id : entry.wptcode) + " to " + CURRENT_TOUR.name);
}
function addCustomMarker(name, lat, lon, content, typeImage, typeSymbol, wptcode) {
// customMarker:
// name -> cachename parking area
// lat -> latitude 51.12342
// lon -> longitude -12.33456
// content -> content "Test\nLINEBREAK"
// image -> typeimage https://www.gctour.de/i/ParkingArea.png
// symbol -> GPX symbol name "Red Flag"
// wptcode -> waypoint id 1664d58479d
if (CURRENT_TOUR.geocaches.length === 0) {
$('ul#cacheList').html('');
}
var entry = {};
entry.wptcode = (wptcode) ? wptcode : (new Date().getTime() - Math.round(lat + lon * 1000)).toString(16);
entry.name = name;
entry.latitude = lat;
entry.longitude = lon;
entry.image = typeImage;
entry.content = content;
entry.symbol = typeSymbol;
log("New custom marker: " + entry.name + " lat:" + entry.latitude + " lon:" + entry.longitude + " Type:" + entry.symbol + " content:" + entry.content);
// add the newbie
addToCacheList(entry, true);
addToCurrentTour(entry);
return entry;
}
function addGeocache(theId, theGuId, theName, theTypeImage) {
return function(event) {
if (CURRENT_TOUR.geocaches.length === 0) {
$('ul#cacheList').html('');
}
if (!isGcIdInTable(theId)) {
// entry:
// id -> the gc.com id GC00815
// guid -> the guid 6e974919-2b47-46e2-8661-3fc62a5a9650
// name -> the cachename Echo the tomcat
// image -> the typeimage 2.gif
var entry = {};
entry.id = theId;
entry.name = escapeHTML(theName);
entry.guid = theGuId;
entry.image = GS_HOST + GS_WPT_IMAGE_PATH + theTypeImage;
// add the newbie
addToCacheList(entry, false);
addToCurrentTour(entry);
showGeocacheNotification({
id : theId,
name : theName,
image : GS_HOST + GS_WPT_IMAGE_PATH + theTypeImage,
tourname : CURRENT_TOUR.name
}, {
type : "success"
});
} else {
showGeocacheNotification({
id : theId,
name : theName,
image : GS_HOST + GS_WPT_IMAGE_PATH + theTypeImage,
tourname : CURRENT_TOUR.name
}, {
type : "contains"
});
}
};
}
function deleteElement(theId) {
return function() {
let delay = 500;
// effect
$("#" + theId)
.fadeOut(delay, function() {
$(this).remove();
});
// locate the element to delete
for (var i = 0; i < CURRENT_TOUR.geocaches.length; i++) {
if (CURRENT_TOUR.geocaches[i].id == theId || CURRENT_TOUR.geocaches[i].wptcode == theId) {
CURRENT_TOUR.geocaches.splice(i, 1);
log("removing '" + theId + "' from '" + CURRENT_TOUR.name + "'");
break;
}
}
saveCurrentTour();
// update the cache count
updateCacheCount(CURRENT_TOUR.geocaches.length);
// update numbering
setTimeout(function() {
updateTourNumbering();
}, delay);
// if tour is empty display hint
if (CURRENT_TOUR.geocaches.length === 0) {
$('#cacheList').html($.gctour.lang('tour.empty'));
}
};
}
function removeElements(descriptionElement, id, tagName) {
return function() {
var elements = descriptionElement.getElementsByTagName(tagName);
for (var x = 0; x < elements.length; x++) {
if (elements[x].id == id) {
elements[x].style.display = "none";
}
}
};
}
function updateTour() {
initCore();
updateGUI();
}
function loadTour(id) {
return function() {
GM_setValue('currentTour', id);
if (document.URL.search("webcode") >= 0) {
window.location = GS_HOST;
} else {
updateTour();
}
};
}
function newTourFunction(preset) {
return function() {
var newTour = {};
newTour.id = getNewTourId();
var tourName = (preset) ? preset : "Tour " + newTour.id;
newTour.name = prompt($.gctour.lang('tour.newDialog'), tourName);
newTour.geocaches = [];
if (!newTour.name) {
return false;
}
TOURS.push(newTour);
log("Creating new tour: " + newTour.id + " ; " + newTour.name);
saveTour(newTour);
updateTour();
return true;
};
}
function deleteTour(id, force) {
return function() {
if (force || confirm($.gctour.lang('tour.deleteDialog'))) {
for (var i = 0; i < TOURS.length; i++) {
if (TOURS[i].id == id) {
log("removing '" + TOURS[i].name + "'");
var cachelist = $('#dialogDetails');
if (cachelist.length > 0 && cachelist.attr("tourid") == TOURS[i].id) {
showCacheList(CURRENT_TOUR)();
$('#loadButton').attr("disabled", "disabled");
}
$("#tour" + id).remove();
if (TOURS[i].bml) {
deleteBookmarklist(TOURS[i].bml);
}
TOURS.splice(i, 1);
saveCurrentTour();
break;
}
}
}
};
}
function deleteCurrentTour(force=false) {
if (force || confirm($.gctour.lang('tour.deleteDialog'))) {
var tableId;
for (tableId = 0; tableId < TOURS.length; tableId++) {
if (TOURS[tableId].id == CURRENT_TOUR.id) {
break;
}
}
var nextTourId = TOURS[(tableId + 1) % TOURS.length].id;
var currentTourId = CURRENT_TOUR.id;
loadTour(nextTourId)();
deleteTour(currentTourId, true)();
}
}
function sortCurrentTourAlphabetically() {
CURRENT_TOUR.geocaches = CURRENT_TOUR.geocaches.sort((a, b) => a.name.localeCompare(b.name, undefined, { 'numeric': true }));
saveCurrentTour();
loadTour(CURRENT_TOUR.id)();
debug("tour sorted alphabetically");
}
/* printpage functions */
async function printPageFunction(tour) {
if (isEmptyTour(tour) || !isLoggedIn()) {
return;
}
var i,
waypoint_i,
tr,
td,
nCaches = tour.geocaches.length,
minimal = GM_getValue('printMinimal', false);
var cacheDetailTemplate =
'<div class="cacheDetail ###HIDDENSTYLE###" id="###GUID###">' +
' <div class="geocache_count ###HIDDENSTYLE###"><span>###CACHECOUNT###</span></div>' +
' <div class="geocache_id">###GCID###</div>' +
' <div>' +
' <img src="' + $.gctour.img.wpt_type + '">' +
' <span style="font-weight: bold;">###CACHENAME###</span>' +
' <span style="margin-right: 3px;"> (###OWNER### - ###HIDDEN###)</span>' +
' </div>' +
' <div class="details">' +
' <span><img src="' + $.gctour.img.coord_update + '" heigth="12px" class="###COORDINATESISEDIT###"/> ###COORDINATES###</span>' +
' <span><img src="' + $.gctour.img.bearing + '"/>###DISTANCE###&nbsp;</span>' +
' <span>D:<img src="' + $.gctour.img.stars_d + '"/></span>' +
' <span>T:<img src="' + $.gctour.img.stars_t + '"/></span>' +
' <span>S:<img src="' + $.gctour.img.cache_size + '"/></span>' +
' </div>' +
' <div>' +
' <span>###ATTRIBUTES###</span>' +
' <span><img alt="Inventory" style="padding-left: 10px;" src="' + $.gctour.img.tb_coin + '"/>Inventory:</span>' +
' <span>###INVENTORY###</span>' +
' <span><img src="' + $.gctour.img.fav + '" style="padding-left: 10px;"/>Favorites: ###FAV### ###FAVSCORE###</span>' +
' </div>' +
' <div class="content">' +
' <div class="short ###HIDDENSTYLE###">###SHORT_DESCRIPTION###</div>' +
' <div class="long ###HIDDENSTYLE###">###LONG_DESCRIPTION###</div>' +
' <div>###GCCOMMENT###</div>' +
' <div class="removable">###CACHENOTE###</div>' +
' <div contenteditable="true"><b><u>Hint:</u></b>###HINT###</div>' +
' <div class="waypoints ###HIDDENSTYLE###">###ADDITIONAL_WAYPOINTS###</div>' +
' <div class="images">###IMAGES###</div>' +
' <div id = "###MAPID###" class="map ###HIDDENSTYLE###">###MAP###</div>' +
' <div class="removable ###HIDDENSTYLE###">###LOGCOUNTER###</div>' +
' <div class="logs ###HIDDENSTYLE###">###LOGS###</div>' +
' <div style="clear:both">&nbsp;</span>' +
' </div>' +
'</div>';
var ownMarkerTemplate =
'<div class="cacheDetail ###HIDDENSTYLE###">' +
' <div class="geocache_count ###HIDDENSTYLE###" style="padding:5px !important"><span>###CACHECOUNT###</span></div>' +
' <div class="wpt_id">###GCID###</div>' +
' <div>' +
' <img src="###TYPE###">' +
' <span style="font-weight: bold;">###NAME###</span><br/>' +
' <span>###COORDINATES###</span>' +
' </div>' +
' <div>' +
' <div class="long">###CONTENT###</div>' +
' </div>' +
'</div>';
// show/hide cache and own marker details (but only if title page is present and minimal printview is not set; otherwise print preview is completely empty)
if (GM_getValue('showCacheDetails', true)===false && GM_getValue('printFrontpage', true) && !minimal) {
cacheDetailTemplate = cacheDetailTemplate.replace("###HIDDENSTYLE###", "hidden");
ownMarkerTemplate = ownMarkerTemplate.replace("###HIDDENSTYLE###", "hidden");
} else {
cacheDetailTemplate = cacheDetailTemplate.replace("###HIDDENSTYLE###", "");
ownMarkerTemplate = ownMarkerTemplate.replace("###HIDDENSTYLE###", "");
}
// clear content
$('html').html(""); // result: <html><head></head><body></body></html>
// title of print preview page
$('html').append('<title>' + $.gctour.lang('settings.printview.header') + '</title>');
var bodyTag = document.getElementsByTagName('body')[0];
bodyTag.style.background = 'none';
bodyTag.style.backgroundColor = "white";
bodyTag.innerHTML = '';
// add styles to body tag
$('head').remove(); // presence of head tag causes problems when printing in Firefox --> add styles to body tag
$('<link/>').attr("href", "https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/base/jquery-ui.css").attr("rel", "stylesheet").appendTo($(bodyTag));
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = '*{ font-size:' + GM_getValue("printFontSize", "x-small") + ' } .cacheDetail{ border: 1px solid lightgray; width: 100%; text-align: left;padding:5px; -moz-box-sizing: border-box; } .wpt_id{ position:relative; padding:5px !important; float:right; font-weight:bold; } .geocache_id{ position:relative; padding:20px !important; padding-right: 5px !important; float:right; font-weight:bold; } .content{ clear:both; border-top:2px dashed lightgray; margin-top:10px; padding-top:10px; } img{ vertical-align:middle; } #details span{ margin-left: 10px } .images{clear:both;height:auto}' +
'.map{clear:both} .logs{clear:both} .hidden{display:none} .highlight{background-color:pink}' +
'.geocache_count{ position:relative; padding:20px !important; padding-left: 5px !important; padding-right: 5px !important; float:right; font-weight:bold; } .geocache_count span{padding: 5px; font-weight: bold; -moz-border-radius: 5px; border-radius: 5px; border:2px dotted black;}' +
'sup {vertical-align:baseline;font-size:77%;position:relative;top:-5px;}' +
'.dialogMask {background-image:url(' + $.gctour.img.dialogMask + ');height:100%;left:0;opacity:0.7;position:fixed;top:0;width:100%;z-index:1100;}' +
'.dialogBody{-moz-border-radius:5px; border-radius:5px; background:none repeat scroll 0 0 #fff;border:1px solid #333333;color:#333333;cursor:default;font-family:Arial;font-size:12px;left:50%;margin-left:-250px;margin-top:20px;padding:0 0 1em;position:fixed;text-align:left;top:0;width:500px;z-index:1101;max-height:85%;min-height:370px;overflow:auto;}' +
'.dialogBody p {font-size:12px;font-weight:normal;margin:1em 0em;}' +
'.dialogBody h1{background-color:#B2D4F3;font-size:110%;font-family:Helvetica Neue,Arial,Helvetica,sans-serif;margin-bottom:0.2em;padding:0.5em;-moz-border-radius:5px 5px 0px 0px;border-radius:5px 5px 0px 0px;color:#333333;background-image:url("' + $.gctour.img.tabBg + '");margin:0px;}' +
'.dialogHistory {border:1px inset #999999;margin:0 1em 1em;height:200px;overflow-y:auto;width:448px;padding-left:1em;}' +
'.dialogHistory ul{margin-left:2em;}' +
'.dialogHistory li{list-style-type:circle;}' +
'.dialogFooter input{-moz-border-radius:3px;border-radius:3px;background:none no-repeat scroll 4px center #EEEEEE;border:1px outset #666666;cursor:pointer;float:right;margin-left:0.5em;padding:3px 5px 5px 20px;min-width:100px;}' +
'.dialogFooter input:hover { background-color:#f9f9f9; }' +
'.dialogContent {padding:0px 10px 0px 10px;}' +
'.dialogMin {min-height:0px !important}' +
'.noprint {padding:2px;border: 1px solid #c0cee3;z-index: 10000;background-color: #eff4f9; text-align: left;margin-top:10px} .noprint>div {margin-top:2px} ' +
'.noprint>input {border: 1px outset #666666;cursor: pointer;margin:5px;padding: 3px 5px 5px 25px;background: none no-repeat scroll 4px center #eeeeee;float:left;clear:both;} ' +
'.noprint>input:hover {background-color:#f9f9f9}';
// limit the font size of the cache table to "small"; for bigger sizes the table most likely gets too wide
var fs = GM_getValue("printFontSize", "x-small");
if ((fs != "xx-small") && (fs != "x-small") && (fs != "small")) {
fs = "small";
}
style.innerHTML += 'div#printTitle>table * {font-size:' + fs + ';}' +
'.noprint * {font-size:' + fs + ';}';
bodyTag.appendChild(style);
style = document.createElement('style');
style.media = 'print';
style.type = 'text/css';
//hide the map control in print
style.innerHTML = '.noprint { display: none; } body {margin: 0;padding: 0;color: black;background: transparent;width:99%}';
bodyTag.appendChild(style);
var body = document.createElement('div');
var printviewWidthDefault = 648;
var printviewWidth = GM_getValue("printviewWidth", printviewWidthDefault);
$(body).width(printviewWidth+"px");
$(body).css("margin", "30px auto");
bodyTag.appendChild(body);
var $printInfo = $('<div/>', {
'class': 'noprint',
'html': $.gctour.lang('printview.dontPrintHint'),
'css': {
'font-size': fs
}
});
$(body).append($printInfo);
//////////////////////////////////////////////
// begin slider for changing width of print preview
var $div_width = $('<div/>', {
'class': 'noprint',
'html': $.gctour.lang('printview.printWidth'),
'css': {
'font-size': fs
}
}),
$slider = $('<div/>', {
'id': 'slider',
'css': {
'display': 'inline-block',
'margin-left': '10px',
'margin-right': '40px',
'top': '2px'
}
}),
$slider_handle = $('<div/>', {
'id': 'slider_handle',
'class': 'ui-slider-handle',
'css': {
'width': '3.5em',
'text-align': 'center',
'font-size': 'smaller',
'top': '-2.25px'
}
});
$(body).append(
$div_width.append(
$slider.append($slider_handle)));
var offset = 150;
$(function() {
var handle = $("#slider_handle");
$("#slider").slider({
value: printviewWidth,
min: 600,
max: $(document).width()-24,
create: function() {
handle.text($(this).slider("value") + "px");
$(this).width($("#slider").parent().width()-offset);
},
slide: function(event, ui) {
handle.text(ui.value + "px");
$("#slider").parent().parent().width(ui.value);
$(this).width($("#slider").parent().width()-offset);
},
stop: function(event, ui) { // store current width as new default value
GM_setValue("printviewWidth", $(this).slider("value"));
}
});
});
// reset button
$("#slider").parent().append('<div id="reset" style="display: inline-block;"></div>');
$("#reset").button({
label: "Reset"
}).click(function(event) {
$("#slider").slider("value", printviewWidthDefault);
$("#slider_handle").text(printviewWidthDefault + "px");
$("#slider").parent().parent().width(printviewWidthDefault);
$("#slider").width($("#slider").parent().width()-offset);
GM_setValue("printviewWidth", printviewWidthDefault);
});
$("div#reset > span.ui-button-text").css("font-size","smaller");
// end slider for changing width of print preview
//////////////////////////////////////////////
addProgressbar({
_document : document,
closeCallback : function(_document) {
return function() {
if (confirm($.gctour.lang('general.cancel') + "?") == true) {
window.location.reload();
}
};
}
});
// for progress bar update
PROGRESS_BAR.progress = 0;
PROGRESS_BAR.total = nCaches;
$("<fieldset/>", {
'class' : 'noprint'
})
.css('right', '50px')
.css('position', 'fixed')
.append(
$("<legend/>").html($.gctour.lang('settings.printview.header'))
.css('background', "url(\"" + $.gctour.img.gctourLogoSmall + "\") no-repeat scroll 0 0 transparent")
.css('padding-left', '20px'),
$("<input/>").attr("type", "input").attr("value", $.gctour.lang('printview.print')).css("background-image", "url(" + $.gctour.img.printer + ")").click(function() {
self.print()
}),
$("<input/>").attr("type", "input").attr("value", $.gctour.lang('general.close')).css("background-image", "url(" + $.gctour.img.closebutton + ")").click(function() {
window.location.reload();
})).appendTo($(body));
// front page
if (GM_getValue('printFrontpage', true) && !minimal) {
var title = $('<div>', {
id : 'printTitle',
css : {
width : "100%",
textAlign : 'center',
"page-break-after" : ((GM_getValue('printPageBreakAfterMap', true)) ? 'always' : 'never')
},
html : "<h1>" + tour.name + "</h1>"
});
$(body).append(title);
var coverTable = document.createElement('table');
coverTable.style.width = "100%";
coverTable.style.border = '1px solid lightgray';
var str =
'<thead><tr> ' +
' <th colspan="2" style="border-bottom:1px solid lightgray;"><b>Geocache</b></th> ' +
' <th style="border-bottom:1px solid lightgray;">&nbsp;</th> ' +
' <th style="border-bottom:1px solid lightgray;">&nbsp;</th> ';
if (GM_getValue('printCacheTableD', true)) {
str += ' <th style="border-bottom:1px solid lightgray;" align="center"><b>D</b></th> ';
}
if (GM_getValue('printCacheTableT', true)) {
str += ' <th style="border-bottom:1px solid lightgray;" align="center"><b>T</b></th> ';
}
if (GM_getValue('printCacheTableS', true)) {
str += ' <th style="border-bottom:1px solid lightgray;" align="center"><b>S</b></th> ';
}
if (GM_getValue('printCacheTableL4L', true)) {
str += ' <th style="border-bottom:1px solid lightgray;" align="center"><b>L4L</b>&nbsp;</th> ';
}
if (GM_getValue('printCacheTableFav', true)) {
str += ' <th colspan="2" style="border-bottom:1px solid lightgray;" align="center"><b>Fav</b>&nbsp;</th> ';
}
str += ' <th style="border-bottom:1px solid lightgray;"><b>' + $.gctour.lang('marker.coord') + '</b></th> ';
if (GM_getValue('printCacheTableFound', true)) {
str += ' <th style="border-bottom:1px solid lightgray;"><b>' + $.gctour.lang('printview.found') + '</b></th> ';
}
if (GM_getValue('printCacheTableNote', true)) {
str += ' <th style="border-bottom:1px solid lightgray;">&nbsp;&nbsp;<b>' + $.gctour.lang('printview.note') + '</b></th> ';
}
str += '</tr><thead>';
coverTable.innerHTML = str;
var tbody = createElement('tbody');
append(tbody, coverTable);
// table of caches
var isCostumMarker = false,
id,
coords;
for (i = 0; i < nCaches; ++i) {
var costumMarker = (typeof(tour.geocaches[i].latitude) != "undefined");
if (costumMarker) {
id = "WP";
coords = "'coords_WP" + (i + 1) + "'>" + new LatLon(tour.geocaches[i].latitude, tour.geocaches[i].longitude).toString();
} else {
id = tour.geocaches[i].id;
coords = "'coords_" + tour.geocaches[i].id + "'>";
}
if (GM_getValue('addCustomMarkerToCacheTable', true) === true) {
costumMarker = false; // add custom marker to cache table
}
if (!costumMarker) {
tr = createElement('tr');
tbody.appendChild(tr);
// numbering
td = createElement('td');
tr.appendChild(td);
td.innerHTML = "<b style='margin:0 6px'>" + (i + 1) + "</b>";
// image
td = createElement('td', {
style : "border-bottom:1px solid lightgray;"
});
tr.appendChild(td);
td.innerHTML = "<img src='" + tour.geocaches[i].image + "'>";
// name
td = createElement('td', {
style : "text-align:left;border-bottom:1px solid lightgray;white-space:nowrap;"
});
tr.appendChild(td);
td.innerHTML = "<a style='color:#000000;text-decoration: none' target='_blank' href='http://coord.info/" + tour.geocaches[i].id + "'>" + tour.geocaches[i].name + "</a>";
// id
td = createElement('td', {
style : "text-align:left;border-bottom:1px solid lightgray;border-right:1px dashed lightgray;"
});
tr.appendChild(td);
td.innerHTML = "<span style='margin:0 2px'>" + id + "</span>";
// difficulty
if (GM_getValue('printCacheTableD', true)) {
td = createElement('td', {
style : "border-bottom:1px solid lightgray;border-right:1px dashed lightgray;"
});
tr.appendChild(td);
td.innerHTML = "<span style='margin:0 2px' id='d_" + tour.geocaches[i].id + "'></span>";
}
// terrain
if (GM_getValue('printCacheTableT', true)) {
td = createElement('td', {
style : "border-bottom:1px solid lightgray;border-right:1px dashed lightgray;"
});
tr.appendChild(td);
td.innerHTML = "<span style='margin:0 2px' id='t_" + tour.geocaches[i].id + "'></span>";
}
// size
if (GM_getValue('printCacheTableS', true)) {
td = createElement('td', {
style : "border-bottom:1px solid lightgray;border-right:1px dashed lightgray;"
});
tr.appendChild(td);
td.innerHTML = "<span style='margin:0 2px' id='s_" + tour.geocaches[i].id + "'></span>";
}
// last 4 logs
if (GM_getValue('printCacheTableL4L', true)) {
td = createElement('td', {
style : "border-bottom:1px solid lightgray;white-space:nowrap;"
});
tr.appendChild(td);
td.innerHTML = "<canvas id='l4l_" + tour.geocaches[i].id + "' width='17' height='17' style='margin-left: 2px;position: relative;top: 2px;'/>";
}
// favorite points
if (GM_getValue('printCacheTableFav', true)) {
td = createElement('td', {
style : "text-align:left;border-bottom:1px solid lightgray;border-left:1px dashed lightgray;"
});
tr.appendChild(td);
td.innerHTML = "<span id='fp_" + tour.geocaches[i].id + "'></span>";
// favorite score
td = createElement('td', {
style : "text-align:right;border-bottom:1px solid lightgray;border-right:1px dashed lightgray;"
});
tr.appendChild(td);
td.innerHTML = "<span id='fs_" + tour.geocaches[i].id + "'></span>";
}
// coords
td = createElement('td', {
style : "border-bottom:1px solid lightgray;white-space:nowrap;"
});
tr.appendChild(td);
td.innerHTML = "<span style='margin:0 2px' id=" + coords + "</span>";
// found checkbox
if (GM_getValue('printCacheTableFound', true)) {
td = createElement('td');
tr.appendChild(td);
td.style.verticalAlign = "middle";
td.innerHTML = "<div style='margin-left:auto;margin-right:auto;width:10px;height:10px;border:1px solid lightgray;'>&nbsp;</div>";
}
// note
if (GM_getValue('printCacheTableNote', true)) {
td = createElement('td', {
style : "border-bottom:1px solid lightgray;"
});
tr.appendChild(td);
td.style.verticalAlign = "middle";
td.style.width = "100%";
td.innerHTML = "&nbsp;";
}
} else {
if (GM_getValue('addCustomMarkerToCacheTable', false) === false) { // custom marker in separate table
isCostumMarker = costumMarker;
continue;
}
}
}
// table of custom markers
if (isCostumMarker) {
tbody.innerHTML +=
'<tr> ' +
' <td colspan="11" style="border-bottom:1px solid lightgray;"><b>' + $.gctour.lang('printview.marker') + '</b></td> ' +
'</tr>';
for (i = 0; i < nCaches; ++i) {
costumMarker = (typeof(tour.geocaches[i].latitude) != "undefined");
if (costumMarker) {
tr = document.createElement('tr');
tbody.appendChild(tr);
td = document.createElement('td');
tr.appendChild(td);
td.innerHTML = "<b style='margin:0 10px'>" + (i + 1) + "</b>";
td = document.createElement('td');
tr.appendChild(td);
td.innerHTML = "<img src='" + tour.geocaches[i].image + "'>";
td = document.createElement('td');
tr.appendChild(td);
td.style.verticalAlign = "middle";
td.style.width = "30%";
td.colSpan = "9";
td.style.borderBottom = '1px solid lightgray';
td.innerHTML = tour.geocaches[i].name;
td.innerHTML += " - " + new LatLon(tour.geocaches[i].latitude, tour.geocaches[i].longitude).toString();
}
}
}
$(title).append($(coverTable));
var overview_map = createElement('div', {
id : "overview_map"
});
$(title).append($(overview_map));
}
var geocaches = [];
var costumMarkers = [];
var maxPrintLogs = parseInt(GM_getValue('maxPrintLogs', 3), 10);
// fetch all caches in parallel, not one by one
var promises = [];
for (i = 0; i < nCaches; i++) {
costumMarker = (typeof(tour.geocaches[i].latitude) != "undefined");
if (costumMarker) {
promises.push(tour.geocaches[i]);
updateProgressBar();
} else {
// retrieve at least 4 logs (if available) in order to display Last4Logs status, independent of maxPrintLogs parameter
promises.push(getGeocache(tour.geocaches[i].id, Math.max(4,maxPrintLogs)));
}
}
try {
var cache_objects = await Promise.all(promises);
for (i = 0; i < cache_objects.length; ++i) {
costumMarker = (typeof(tour.geocaches[i].latitude) != "undefined");
if (!costumMarker) {
var geocache = cache_objects[i], pmOnlyDiv;
if (geocache == "pm only") {
pmOnlyDiv = createElement('div');
pmOnlyDiv.setAttribute('class', 'cacheDetail');
pmOnlyDiv.innerHTML = "<b><img src='" + tour.geocaches[i].image + "'>" + tour.geocaches[i].name + " (" + tour.geocaches[i].id + ") is PM ONLY</b>";
body.appendChild(pmOnlyDiv);
body.appendChild(document.createElement('br'));
$(document).find("span#coords_" + tour.geocaches[i].id)
.html("PM ONLY");
} else if (geocache == 404) {
pmOnlyDiv = createElement('div');
pmOnlyDiv.setAttribute('class', 'cacheDetail');
pmOnlyDiv.innerHTML = "<b><img src='" + tour.geocaches[i].image + "'>" + tour.geocaches[i].name + " (" + tour.geocaches[i].id + ") has INVALID GC CODE</b>";
body.appendChild(pmOnlyDiv);
body.appendChild(document.createElement('br'));
$(document).find("span#coords_" + tour.geocaches[i].id)
.html("INVALID GC CODE");
} else {
// logs
var logs_div = createElement('div');
var logs = geocache.logs;
// if maxprintlogs <= -1, export all logs to the print overview
if (maxPrintLogs <= -1) {
maxPrintLogs = logs.length;
}
for (var log_i = 0; (log_i < logs.length && (log_i < maxPrintLogs)); log_i++) {
var log_div = createElement('div', {
style : "width:100%;page-break-inside:avoid;"
});
log_div.setAttribute("class", "removable");
var log_type_img = createElement('img', {
src : GS_HOST + 'images/logtypes/' + logs[log_i].LogTypeImage
});
log_div.appendChild(log_type_img);
log_div.innerHTML += " " + logs[log_i].Visited + " - " + logs[log_i].UserName + " (" + logs[log_i].GeocacheFindCount + ")<br/>";
log_div.innerHTML += logs[log_i].LogText;
log_div.style.borderBottom = "1px dashed lightgray";
append(log_div, logs_div);
}
var dummy_additional_waypoints = createElement('div');
if (GM_getValue('printAdditionalWaypoints', true)) {
var wpts_table = createElement('table', {
style : "width:100%;border-collapse:separate;"
});
append(wpts_table, dummy_additional_waypoints);
wpts_table.setAttribute("class", "removable");
var content = "";
for (var waypoints_i = 0; waypoints_i < geocache.additional_waypoints.length; waypoints_i++) {
if (waypoints_i % 2 === 0) {
content += "<tr>";
}
content += "<td style='width:50%;'>";
content += "<img src='" + geocache.additional_waypoints[waypoints_i].symbol + "'>&nbsp;";
content += "<b>" + geocache.additional_waypoints[waypoints_i].prefix + "&middot;</b>";
content += "<b>" + geocache.additional_waypoints[waypoints_i].name + "</b>";
content += " | " + geocache.additional_waypoints[waypoints_i].coordinates + "<br/>";
content += "<i>" + geocache.additional_waypoints[waypoints_i].note + "</i><br/>";
content += "</td>";
if (waypoints_i % 2 === 1 || waypoints_i === geocache.additional_waypoints.length-1) {
content += "</tr>";
}
}
wpts_table.innerHTML = content;
}
// images
var dummy_images = createElement('div');
if (GM_getValue('printSpoilerImages', true)) {
var image_table = createElement('table', {
style : "border-collapse:separate;border-spacing:2px;width:100%"
});
append(image_table, dummy_images);
content = "";
for (var images_i = 0; images_i < geocache.images.length; images_i++) {
if (images_i % 2 === 0) {
content += "<tr>";
}
content += "<td class='removable'>";
content += "<img style='max-width:8cm;' src='" + geocache.images[images_i].href + "'><br/>";
content += "<b>" + geocache.images[images_i].textContent + "</b>";
content += "</td>";
if (images_i % 2 === 1 || images_i === geocache.images.length-1) {
content += "</tr>";
}
}
image_table.innerHTML = content;
}
// inventory
var inventory = createElement('span');
for (var inventory_i = 0; inventory_i < geocache.$inventory.length; inventory_i++) {
var image = createElement('img');
image.src = geocache.$inventory[inventory_i].src;
append(image, inventory);
}
if (geocache.$inventory.length === 0) {
var empty_inventory = createElement('span');
empty_inventory.innerHTML = "empty";
append(empty_inventory, inventory);
}
// attributes
var attributes = createElement('span');
for (var attributes_i = 0; attributes_i < geocache.$attributes.length; attributes_i++) {
var attribute = geocache.$attributes[attributes_i];
attribute.style.width = "16px";
attribute.style.height = "16px";
attribute.style.marginRight = "3px";
if (attribute.src != $.gctour.img.attribute_blank) {
append(attribute, attributes);
}
}
var map_element_dummy = createElement('div');
var map_element = createElement('div');
append(map_element, map_element_dummy);
// map the geocache to uploadable version
var mapCache = {};
mapCache.gcid = geocache.gcid;
mapCache.guid = geocache.guid;
mapCache.image = geocache.image;
mapCache.name = geocache.name;
mapCache.difficulty = geocache.difficulty;
mapCache.terrain = geocache.terrain;
mapCache.latitude = geocache.lat;
mapCache.longitude = geocache.lon;
// add additional waypoints
var additional_waypoints = geocache.additional_waypoints;
for (waypoint_i = 0; waypoint_i < additional_waypoints.length; waypoint_i++) {
additional_waypoints[waypoint_i].note = "";
}
mapCache.additional_waypoints = additional_waypoints;
geocaches.push(mapCache);
// export from GCComment script
var gcComment = "";
if (geocache.comment) {
gcComment = "<b><u>GCComment:</u></b><br/>";
if (geocache.comment.lat) {
var parsedCoords = new LatLon(geocache.comment.lat, geocache.comment.lng).toString();
gcComment += "<b>Final Coordinates:</b> " + parsedCoords + "<br/>";
}
gcComment += "<b>Comment:</b> (" + geocache.comment.state + ") " + geocache.comment.commentValue;
}
// cache note from Groundspeak
var cache_note = "";
if (geocache.cache_note) {
cache_note = "<b><u>Cache Note:</u></b><br/>";
cache_note += '<span style="word-wrap:break-word;">' + geocache.cache_note + '</span>';
}
if (GM_getValue('printFrontpage', true) && !minimal) {
$(document)
// setting real coordinates on front page
.find("span#coords_" + geocache.gcid)
.html(geocache.coordinates)
.css({
'border-bottom' : (geocache.coordinatesisedit === true ? '2px solid gray' : 'none')
})
.end()
// setting D, T, size and favorite points on front page
.find("span#d_" + geocache.gcid).html(geocache.difficulty).end()
.find("span#t_" + geocache.gcid).html(geocache.terrain).end()
.find("span#s_" + geocache.gcid).html(geocache.size.substring(0, 1)).end()
.find("span#fp_" + geocache.gcid).html(geocache.fav).end()
.find("span#fs_" + geocache.gcid).html(geocache.favScore).end();
// set the last 4 logs icon:
if (GM_getValue('printCacheTableL4L', true)) {
getLast4Logs(geocache.logs, $("canvas#l4l_" + geocache.gcid, document));
}
}
geocache.name = escapeHTML(geocache.name);
var geocacheMapping = [
['GCID', geocache.gcid],
['CACHECOUNT', i + 1],
['GUID', geocache.guid],
['TYPE', geocache.type],
['CACHENAME', (geocache.available) ? geocache.name : "<span style='text-decoration: line-through !important;'>" + geocache.name + "</span>"],
['CACHESYM', geocache.cacheSym],
['OWNER', geocache.owner],
['HIDDEN', await formatDate(geocache.hidden)],
['ATTRIBUTES', attributes.innerHTML],
['BEARING', geocache.bearing],
['DISTANCE', geocache.distance],
['INVENTORY', inventory.innerHTML],
['COORDINATESISEDIT', (geocache.coordinatesisedit === true) ? '' : 'hidden'],
['COORDINATES', geocache.coordinates],
['DIFFICULTY', geocache.difficulty.replace(/\./, "_")],
['TERRAIN', geocache.terrain.replace(/\./, "_")],
['SIZE', geocache.size.toLowerCase().replace(/ /, "_")],
['SHORT_DESCRIPTION', (geocache.$short_description.length === 1) ? geocache.$short_description.html() : ""],
['LONG_DESCRIPTION', (geocache.$long_description.length === 1) ? geocache.$long_description.html() : ""],
['GCCOMMENT', gcComment],
['CACHENOTE', cache_note],
['HINT', (GM_getValue('decryptPrintHints', true)) ? geocache.hint : convertROTStringWithBrackets(geocache.hint)],
['ADDITIONAL_WAYPOINTS', dummy_additional_waypoints.innerHTML],
['IMAGES', dummy_images.innerHTML],
['MAP', map_element_dummy.innerHTML],
['MAPID', "MAP_" + geocache.gcid],
['LOGCOUNTER', (GM_getValue('printLoggedVisits', false) && geocache.find_count) ? geocache.find_count : ""], // empty for non-published caches
['LOGS', logs_div.innerHTML],
['FAV', geocache.fav ? geocache.fav : 'none'],
['FAVSCORE', geocache.favScore],
['HIDDENSTYLE', minimal ? 'hidden' : '']
];
var cacheDetailTemp = fillTemplate(geocacheMapping, cacheDetailTemplate);
// class "removable" elements and removable images in cache description
$(".removable, div.short img, div.long img", cacheDetailTemp)
.click(function(e) {
e.stopPropagation();
$(this).remove();
})
.hover(
function() {
$(this).css({
"opacity" : "0.5",
"cursor" : "url('" + $.gctour.img.del + "'),pointer"
});
},
function() {
$(this).css({
"opacity" : 1
});
});
// remove href attribute from links in cache description
$("div.short a, div.long a", cacheDetailTemp).removeAttr("href");
// add edit mode
if (GM_getValue('printEditMode', true)) {
$("div.short, div.long", cacheDetailTemp).attr('contenteditable', 'true');
}
if (GM_getValue('printPageBreak', false)) {
if (i < nCaches - 1) {
cacheDetailTemp.style.pageBreakAfter = 'always';
}
}
body.appendChild(cacheDetailTemp);
body.appendChild(document.createElement('br'));
}
} else {
// map custom marker to uploadable version
var cm = cache_objects[i];
cm.index = i;
costumMarkers.push(cm);
var markerMapping = [
['GCID', $.gctour.lang('printview.marker')],
['CACHECOUNT', (i + 1)],
['TYPE', tour.geocaches[i].image],
['NAME', tour.geocaches[i].name],
['COORDINATES', new LatLon(tour.geocaches[i].latitude, tour.geocaches[i].longitude).toString()],
['CONTENT', tour.geocaches[i].content.replace(/\n/g, "<br />")],
['HIDDENSTYLE', minimal ? 'hidden' : '']
];
cacheDetailTemp = fillTemplate(markerMapping, ownMarkerTemplate);
body.appendChild(cacheDetailTemp);
body.appendChild(document.createElement('br'));
}
}
closeOverlayRemote(document)(); // close old overlay (scraping data)
// maps
addProgressbar({
caption : $.gctour.lang('container.tourHeader.makeMap.wait'),
_document : document,
closeCallback : function(_document) {
return function() {
if (confirm($.gctour.lang('general.cancel') + "?") == true) {
window.location.reload();
}
};
}
});
// upload map content to server
var cacheObject = {};
cacheObject.geocaches = geocaches;
cacheObject.costumMarkers = costumMarkers;
uploadMap(cacheObject);
// show maps
try {
var overviewMapQuery = "";
var geocacheCodes = [];
for (i = 0; i < nCaches; ++i) {
var marker = tour.geocaches[i];
if (marker.wptcode) {
overviewMapQuery += marker.wptcode;
} else {
overviewMapQuery += (marker.id) ? marker.id : marker.gcid;
geocacheCodes.push((marker.id) ? marker.id : marker.gcid);
}
if (i < nCaches - 1) {
overviewMapQuery += ",";
}
}
// overview map
var printOverviewMap = (
GM_getValue('printOutlineMap', true) &&
GM_getValue('printFrontpage', true) &&
!minimal);
var mapCount = (printOverviewMap) ? 1 : 0;
mapCount += (GM_getValue('printOutlineMapSingle', false)) ? geocacheCodes.length : 0;
if (printOverviewMap) {
$("div#overview_map", document).first().append(await getMapElement(overviewMapQuery, document));
setProgress(0, mapCount, document);
}
// map for each geocache
var printMapForEachCache = (
GM_getValue('showCacheDetails', true) &&
GM_getValue('printOutlineMapSingle', false));
if (printMapForEachCache) {
for (i = 0; i < geocacheCodes.length; ++i) {
var geocacheCode = geocacheCodes[i];
var mapElement = $("div#MAP_" + geocacheCode, document).first();
if (mapElement) {
mapElement.append(await getMapElement(geocacheCode, document));
}
setProgress(i + 1, mapCount, document);
}
}
closeOverlayRemote(document)();
} catch (e) {
throw "show maps - " + e;
}
}
catch(e) {
addErrorDialog({
caption : "printPageFunction error",
_document : document,
_exception : e
});
}
// scale listing images to fit print preview
$('div.short img, div.long img').removeAttr('width').removeAttr('height').removeAttr('style').css({'max-width':'100%','max-height':'100%','object-fit':'contain'});
}
// funktion ähnlich http://www.gsak.net/help/hs11980.htm
function getLast4Logs(logs, canvas_element) {
var getColor = function(log4Logs) {
if ((typeof(log4Logs)) === 'undefined') {
return "LightGray";
}
switch (log4Logs.LogType) {
case "Found it":
return "green";
case "Didn't find it":
return "red";
case "Needs Maintenance":
return "blue";
case "Temporarily Disable Listing":
return "black";
case "Needs Archived":
return "yellow";
default:
return "LightGray";
}
};
var ctx = canvas_element.get(0).getContext('2d');
ctx.fillStyle = "black";
ctx.clearRect(1, 1, 15, 15);
var pos = [[2, 2], [9, 2], [2, 9], [9, 9]];
var dim = [6, 6];
for (var i = 0; i < pos.length; i++) {
ctx.fillStyle = getColor(logs[i]);
ctx.fillRect(pos[i][0], pos[i][1], dim[0], dim[1]);
}
}
/* printpage maps */
function updateMapSize(newDocument, mapId, factor) {
return function() {
var map = newDocument.getElementById(mapId).getElementsByTagName('iframe')[0];
map.style.width = (factor * 20) + "cm";
map.style.height = (1 * 500) + "px";
};
}
function getMapType() {
return GM_getValue('printOutlineMapType', 'roadmap');
}
function getMapSettings() {
var settings = [];
// settings String:
// 1 - Geocache GCID
// 2 - Geocache Name
// 3 - Waypoint Hide all
// 4 - Waypoint Name
// 5 - Waypoint Lookup
// 6 - Own Waypoint show
// 7 - Own Waypoints name
// 8 - Show gc.de maps overlay
// 9 - Show Geocache Index
settings.push(GM_getValue('settings_map_geocacheid', true));
settings.push(GM_getValue('settings_map_geocachename', true));
settings.push(GM_getValue('settings_map_awpts', true));
settings.push(GM_getValue('settings_map_awpt_name', true));
settings.push(GM_getValue('settings_map_awpt_lookup', true));
settings.push(GM_getValue('settings_map_owpts', true));
settings.push(GM_getValue('settings_map_owpt_name', true));
settings.push(false); // gc.de maps does not exist anymore: do not skip here, but set to false!
settings.push(GM_getValue('settings_map_geocacheindex', true));
return settings.join("").replace(/true/g, "1").replace(/false/g, "0");
}
async function getMapUrl(mapQuery) {
try {
var headers = { 'Content-type': 'application/x-www-form-urlencoded' },
response = await promiseRequest('POST', GCTOUR_HOST + "map/make", headers, encodeURI("ids=" + mapQuery)),
hash_value = response.responseText;
debug("Hash '" + hash_value + "' for this query '" + mapQuery + "'");
return GCTOUR_HOST + "map/show/h/" + hash_value + "/" + getMapSettings() + "/" + getMapType();
} catch(e) {
throw 'fn getMapUrl - ' + e;
}
}
async function getMap(mapQuery) {
var map_size_px,
mapId = mapQuery.replace(/,/g, ""),
map_frame = document.createElement('iframe');
switch (GM_getValue('defaultMapSize', 'large')) {
case "medium":
map_size_px = 375;
break;
case "small":
map_size_px = 250;
break;
default:
map_size_px = 500;
break;
}
map_frame.className = 'cacheMap';
map_frame.id = mapId;
map_frame.style.width = "100%";
map_frame.style.height = map_size_px + 'px';
$(map_frame).css("border", '1px solid lightgray');
$(map_frame).css("box-sizing", "border-box");
map_frame.src = await getMapUrl(mapQuery);
return map_frame;
}
async function getMapControl(mapQuery, map_frame, newDocument) {
var control_container = createElement('div'),
map_size_px;
control_container.className = 'noprint';
switch (GM_getValue('defaultMapSize', 'large')) {
case "small":
map_size_px = 250;
break;
case "medium":
map_size_px = 375;
break;
default:
map_size_px = 500;
break;
}
$(control_container).append(
$('<div>'+$.gctour.lang('printview.mapHeight')+'</div>')
.css('float', 'left')
.css('margin-right', '5px'),
$("<div/>").gct_slider({
min : 100,
max : 1000,
value : map_size_px,
document : newDocument,
slide : function(values) {
map_frame.style.height = values.value + "px";
}
})
.css('float', 'left')
.css('width', '250px'),
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.del,
title : $.gctour.lang('printview.removeMap'),
alt : $.gctour.lang('printview.removeMap'),
click : function() {
map_frame.parentNode.style.display = "none";
}
})
.css('float', 'right'),
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.refresh,
title : $.gctour.lang('printview.reloadMap'),
alt : $.gctour.lang('printview.reloadMap'),
click : function() {
map_frame.src = map_frame.src; // necessary to reload map
}
})
.css('float', 'right'),
$('<img>', {
'class' : 'tourImage',
src : $.gctour.img.map,
title : $.gctour.lang('printview.zoomMap'),
alt : $.gctour.lang('printview.zoomMap'),
click : async function() {
GM_openInTab(await getMapUrl(mapQuery), false);
}
})
.css('float', 'right'),
$('<div/>')
.css('clear', 'both')).find("img.tourImage").addShadowEffect().addOpacityEffect().css('margin-left', '5px');
return control_container;
}
// add gct_slider method to jquery (e.g. height slider in print preview)
(function($) {
var methods = {
init : function(options) {
var settings = $.extend({
'min' : '0',
'max' : '100',
'document' : document,
'value' : 0
}, options),
scroller_element = $("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>")
.appendTo(this),
dragged = false,
slider_width = 0,
slider_offset = 0,
percentage = 0,
self = this;
// set start value
percentage = (100 * settings.value) / settings.max;
scroller_element
.css("left", (percentage) + "%")
.click(function(event) {
event.preventDefault();
})
.hover(
function() {
$(this).addClass("ui-state-hover");
},
function() {
$(this).removeClass("ui-state-hover");
})
.focus(function() {
$(".ui-slider .ui-state-focus").removeClass("ui-state-focus");
$(this).addClass("ui-state-focus");
})
.blur(function() {
$(this).removeClass("ui-state-focus");
})
.mousedown(function(e) {
e.preventDefault();
dragged = true;
slider_width = parseInt(self.css("width"), 10);
slider_offset = parseInt(self.offset().left, 10);
scroller_element.addClass("ui-state-active");
methods["trigger"].apply(self, ["start", methods["calculate"].apply(self, [percentage])]);
});
this.addClass('ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all')
.append(scroller_element);
$('*', settings.document).mousemove(function(e) {
if (dragged) {
e.preventDefault();
percentage = (100 * (e.pageX - slider_offset)) / (slider_width);
percentage = (percentage < 0) ? 0 : percentage;
percentage = (percentage > 100) ? 100 : percentage;
// debug("MousePos:"+e.pageX+"\tSliderWidth:"+slider_width+"\tSliderOffset:"+slider_offset+"\tMove to:"+percentage);
scroller_element.css("left", (percentage) + "%");
methods["trigger"].apply(self, ["slide", methods["calculate"].apply(self, [percentage])]);
}
});
$('*', settings.document).mouseup(function() {
if (dragged) {
dragged = false;
scroller_element.removeClass("ui-state-active");
methods["trigger"].apply(self, ["stop", methods["calculate"].apply(self, [percentage])]);
}
});
this.data('gct_slider', {
target : $(this),
settings : settings
});
return this;
},
calculate : function(percentage) {
var $data = $(this).data('gct_slider'),
max = $data.settings.max,
min = $data.settings.min,
relative_value = (percentage * (max - min)) / 100,
value = min + relative_value;
// log("relative_value"+ relative_value+ "\tvalue:"+value);
return {
percentage : percentage,
value : value
};
},
trigger : function(type, data) {
var $data = $(this).data('gct_slider'),
callback = $data.settings[type],
data = data || {};
return !($.isFunction(callback) &&
callback.apply(this, [data]) === false);
}
};
$.fn.gct_slider = function(method) {
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error('Method ' + method + ' does not exist on jQuery.tooltip');
}
};
})($);
async function getMapElement(mapQuery, newDocument) {
var map_container = createElement('div', {
style : "text-align: center; margin-left: auto; margin-right: auto;"
});
var map_frame = await getMap(mapQuery);
map_container.appendChild(await getMapControl(mapQuery, map_frame, newDocument));
map_container.appendChild(map_frame);
return map_container;
}
/* cache scraper */
// source of all evil asking groundspeak
async function getGeocacheFromElement(element, maxLogsCount) {
var coordinates,
minimal_geocache,
$divCacheDetails,
latlonhref,
geocache = {};
/*
geocache
.gcid
.cacheid
.guid
.name
.type
.image
.sym
.owner
.comment (optional)
.cache_note (optional)
.archived
.available
.hidden
.difficulty
.terrain
.size
.coordinates
.coordinatesisedit (custom edit boolean)
.lat
.lon
.location
.state
.country
.bearing
.distance
.$inventory
.$attributes
.$short_description
.$long_description
.images
.additional_waypoints
.hint
.find_count
.logs
.fav
.favScore
*/
if ($("div.LocationData", element).length === 0 || $("ul.premium-features-list", element).length > 0) {
return "pm only";
}
minimal_geocache = getMinimalGeocacheDetails(element);
geocache.gcid = minimal_geocache.gccode;
geocache.cacheid = minimal_geocache.cacheid;
geocache.guid = minimal_geocache.guid;
geocache.name = minimal_geocache.name;
geocache.type = minimal_geocache.type.split(".")[0];
geocache.image = GS_HOST + "images/wpttypes/" + geocache.type + ".gif";
geocache.sym = "Geocache";
let $logTypeImage = $('img#ctl00_ContentBody_GeoNav_logTypeImage', element);
try {
if ($logTypeImage.length > 0 && $logTypeImage.attr('src').split('/').pop().split('.')[0] === "2") {
geocache.sym = "Geocache Found";
}
} catch (e) {
error('src attribute missing - ' + e);
}
let owner = [
$('a[href*="' + GS_HOST + 'p/"]', element).first().text(),
$('a[href*="' + GS_HOST + 'profile/"]', element).first().text() // fallback
];
geocache.owner =
(owner[0] && $.trim(owner[0])) ||
(owner[1] && $.trim(owner[1])) ||
"";
//geocache.owner = $.trim($('a[href*="' + GS_HOST + 'p/?guid="]', element).first().text());
if (unsafeWindow.getGCComment) {
var comment = unsafeWindow.getGCComment(geocache.guid);
if (comment) {
geocache.comment = comment;
}
}
var usernote = $("div#srOnlyCacheNote", element);
if (usernote.length > 0) {
geocache.cache_note = usernote.html();
}
// check availability
var warning_element = $("ul.OldWarning", element).first(); // contains text like
//This cache is temporarily unavailable. Read the logs below to read the status for this cache.
//This cache has been archived, but is available for viewing for archival purposes.
if (warning_element.length > 0) {
geocache.archived = (warning_element.text().indexOf("archived") != -1);
geocache.available = false;
} else {
geocache.archived = false;
geocache.available = true;
}
$divCacheDetails = $('#ctl00_ContentBody_mcd2', element).first();
geocache.hidden = await parseDate($.trim($divCacheDetails.text().split(':').pop()));
geocache.difficulty = $.trim($("span#ctl00_ContentBody_uxLegendScale > img", element).first().attr("alt").split(" out of ")[0]);
geocache.terrain = $.trim($("span#ctl00_ContentBody_Localize12 > img", element).first().attr("alt").split(" out of ")[0]);
geocache.size = $.trim($('img[src*="/images/icons/container/"]', element).first().attr("src").split("/")[4].split(".")[0]);
geocache.coordinates = $('span#uxLatLon', element).first().text();
// get userDefinedCoords from GS Javascript
// example string: var userDefinedCoords = {"status":"success","data":{"isUserDefined":false,"oldLatLngDisplay":"N 52° 31.268' E 013° 21.255'"}};
var patt = /var userDefinedCoords = {*([\s\S]*?)}[;]+/; // search for "var userDefinedCoords = {" until "};"
var r;
var userDefinedCoordsString = ((r = patt.exec($(element).text())) != null) ? r[1] : "";
var userDefinedCoords = jQuery.parseJSON('{' + userDefinedCoordsString + '}');
geocache.coordinatesisedit = (userDefinedCoords && userDefinedCoords.status == "success" && userDefinedCoords.data.isUserDefined == true); // false = original
// get cache coordinates
latlonhref = $("span#ctl00_ContentBody_MapLinks_MapLinks a", element).map(function(i,el) {
return $(el).attr('href');
}).get();
geocache.lat = 0.0;
geocache.lon = 0.0;
for (let i = 0; i < latlonhref.length; ++i) {
if (latlonhref[i].includes("geocaching")) {
geocache.lat = latlonhref[i].split("lat=")[1].split("&")[0];
geocache.lon = latlonhref[i].split("lng=")[1];
break;
} else if (latlonhref[i].includes("mapquest")) {
geocache.lat = latlonhref[i].split("latitude=")[1].split("&")[0];
geocache.lon = latlonhref[i].split("longitude=")[1].split("&")[0];
break;
} else if (latlonhref[i].includes("bing")) {
geocache.lat = latlonhref[i].split("point")[1].split("_")[0];
geocache.lon = latlonhref[i].split("point")[1].split("_")[1];
break;
} else if (latlonhref[i].includes("opencyclemap")) {
geocache.lat = latlonhref[i].split("lat=")[1].split("&")[0];
geocache.lon = latlonhref[i].split("lon=")[1];
break;
} else if (latlonhref[i].includes("openstreetmap")) {
geocache.lat = latlonhref[i].split("mlat=")[1].split("&")[0];
geocache.lon = latlonhref[i].split("mlon=")[1].split("&")[0];
break;
}
}
// if the user moved the coordinates of this geocache by GCTour
if (GM_getValue('coords_' + geocache.gcid, "null") != "null") { // use it
coordinates = GM_getValue('coords_' + geocache.gcid, "null").split("#");
geocache.lat = coordinates[0];
geocache.lon = coordinates[1];
geocache.coordinates = new LatLon(geocache.lat, geocache.lon).toString();
geocache.coordinatesisedit = true;
}
geocache.location = $("span#ctl00_ContentBody_Location", element).first().text();
try {
// get the country and (if exists) the state!
if (geocache.location.indexOf(",") < 0) { // if the index of "," < 0 then the state is not given!
geocache.state = "";
geocache.country = $.trim(geocache.location.split("In ")[1]);
} else {
geocache.state = $.trim(geocache.location.split("In ")[1].split(',')[0]);
geocache.country = $.trim(geocache.location.split("In ")[1].split(',')[1]);
}
} catch (e) { // something went wrong - write the whole location to country
geocache.state = "";
geocache.country = $.trim(geocache.location);
}
try {
// ToDo check distance
geocache.bearing = $('span#lblDistFromHome > img', element).first().attr("alt");
var distanceTemp = $('span#lblDistFromHome', element).first().text().split(" ");
geocache.distance = distanceTemp[0] + " " + distanceTemp[1];
} catch (e) {
// if homecoordinates are not set
geocache.bearing = "";
geocache.distance = "";
}
geocache.$inventory = $('span#ctl00_ContentBody_uxTravelBugList_uxInventoryLabel', element).parent().parent().find('img');
geocache.$attributes = $('div#ctl00_ContentBody_detailWidget > div.WidgetBody > img', element);
geocache.attributes_array = [];
geocache.$attributes.each(function(index, Element) {
// remove garbage from source address and split at "-"
// (special care for "Special Tool Required" since the image name is "s-tool")
var attribute_array = this.src.replace(GS_HOST + "images/attributes/", "").replace(".png", "").replace("-y", ";y").replace("-n", ";n").split(";");
// iterate over every attribute defined in the global attributes array
for (var attributesDef_i = 0; attributesDef_i < ATTRIBUTES_ARRAY.length; attributesDef_i++) {
// ... and check whether the image is equal to the definition
if (attribute_array[0] == ATTRIBUTES_ARRAY[attributesDef_i][1]) {
// add this attribute as array with id-0, image-1, name-2 and yes/no-4
geocache.attributes_array.push([ATTRIBUTES_ARRAY[attributesDef_i][0], ATTRIBUTES_ARRAY[attributesDef_i][1], ATTRIBUTES_ARRAY[attributesDef_i][2], ((attribute_array[1] == "yes") ? 1 : 0)]);
}
}
});
geocache.$short_description = $('span#ctl00_ContentBody_ShortDescription', element).first();
geocache.$long_description = $('span#ctl00_ContentBody_LongDescription', element).first();
geocache.images = $('a[rel="lightbox"]', element);
geocache.additional_waypoints = [];
var additional_waypoints = $('table.Table > tbody > tr', element);
for (var i = 0; i < additional_waypoints.length; i = i + 2) {
var row1 = additional_waypoints[i];
var row2 = additional_waypoints[i + 1];
var row1_tds = row1.getElementsByTagName('td');
var row2_tds = row2.getElementsByTagName('td');
var waypoint = {};
waypoint.symbol = row1_tds[1].childNodes[1].src;
waypoint.prefix = $.trim(row1_tds[2].textContent);
waypoint.lookup = $.trim(row1_tds[3].textContent);
waypoint.name = row1_tds[4].childNodes[1].textContent;
//waypoint.url = row1_tds[4].childNodes[1].href.split('&')[0]; // just in case...
waypoint.coordinates = $.trim(row1_tds[5].textContent);
coordinates = await parseCoordinates(row1_tds[5].textContent);
waypoint.latitude = coordinates._lat;
waypoint.longitude = coordinates._lon;
waypoint.note = $.trim(row2_tds[2].innerHTML); // HTML in waypoint description
// Final Location https://www.geocaching.com/images/WptTypes/sm/flag.jpg
// Parking Area https://www.geocaching.com/images/WptTypes/sm/pkg.jpg
// Question to Answer https://www.geocaching.com/images/WptTypes/sm/puzzle.jpg
// Stages of a Multicache https://www.geocaching.com/images/WptTypes/sm/stage.jpg
// Trailhead https://www.geocaching.com/images/WptTypes/sm/trailhead.jpg
// Reference Point https://www.geocaching.com/images/WptTypes/sm/waypoint.jpg
var sym = waypoint.symbol.toLowerCase().split(GS_HOST + GS_WPT_IMAGE_PATH)[1];
switch (sym) {
case "flag.jpg":
waypoint.symbol_groundspeak = "Final Location";
waypoint.type_groundspeak = "Waypoint|Final Location";
break;
case "pkg.jpg":
waypoint.symbol_groundspeak = "Parking Area";
waypoint.type_groundspeak = "Waypoint|Parking Area";
break;
case "puzzle.jpg":
waypoint.symbol_groundspeak = "Question to Answer";
waypoint.type_groundspeak = "Waypoint|Question to Answer";
break;
case "stage.jpg":
waypoint.symbol_groundspeak = "Stages of a Multicache";
waypoint.type_groundspeak = "Waypoint|Stages of a Multicache";
break;
case "trailhead.jpg":
waypoint.symbol_groundspeak = "Trailhead";
waypoint.type_groundspeak = "Waypoint|Trailhead";
break;
case "waypoint.jpg":
waypoint.symbol_groundspeak = "Reference Point";
waypoint.type_groundspeak = "Waypoint|Reference Point";
break;
default:
waypoint.symbol_groundspeak = "Unknown Type";
waypoint.type_groundspeak = "Waypoint|Unknown Type";
break;
}
geocache.additional_waypoints.push(waypoint);
}
var hints_element = $('div#div_hint', element).first();
geocache.hint = (hints_element.length > 0) ? convertROTStringWithBrackets($.trim(hints_element.html())) : "";
// numbers of finds, DNFs, notes etc.
geocache.find_count = $('span#ctl00_ContentBody_lblFindCounts > p.LogTotals', element).html();
// total number of logged visits (e.g. "8,507 Logged Visits"; order can vary for different languages)
var nLoggedVisits = parseInt( $('div.InformationWidget.Clear', element).children().first().text().replace(/[^0-9]/g,'') );
// favorite points
geocache.fav = $('span.favorite-value', element).text().trim();
// user token for fetching logs and favorite score
var userToken = element.innerHTML.split("userToken = '")[1].split("'")[0];
try {
// fetch logs
geocache.logs = await getLogs(userToken, maxLogsCount, nLoggedVisits, element);
// fav score only if favorite points are necessary and available (e.g. not for events)
if (FAVSCORE && geocache.fav) {
// fetch favorite score
try {
let url = GS_WEB_API + 'geocache/' + geocache.gcid + '/favoritepoints/score';
let method = "GET";
var response = await promiseRequest(method, url);
} catch (e) { // 500 error from GS
response = {};
response.responseText = 'ERROR';
}
// check for a string "between" 0 and 100, thereby exclude that content is a web page
if (response.responseText.length<4) {
var favScore = response.responseText;
if (favScore>100) {
favScore = '(100%)';
} else if (favScore<1) {
favScore = '(<1%)';
} else {
favScore = '('+favScore+'%)';
}
geocache.favScore = favScore;
} else {
geocache.favScore = '';
}
}
//debug('getGeocacheFromElement -\n' + JSON.stringify(geocache));
return geocache;
}
catch(e) {
throw "fn getGeocacheFromElement - " + e;
}
}
async function getGeocache(gcid, maxLogsCount) {
try {
var response = await promiseRequest('GET', GS_HOST + 'geocache/' + gcid, {}, {}, true);
// after execution parse the result
var response_div = createElement('div');
response_div.innerHTML = response.responseText;
return await getGeocacheFromElement(response_div, maxLogsCount);
} catch(e) {
if (e.indexOf('404') > 0) return 404; // invalid GC code
throw "fn getGeocache - " + e;
}
}
/* cache scraper utilities */
// return an object with these attributes: gccode, cacheid, name, guid, type
function getMinimalGeocacheDetails(detailsPage) {
/* gccode, cacheid, name, guid, type */
var geocache_details = {};
var $obj = {}; // temp jquery container
/* GCCode
* <span id="ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode" class="CoordInfoCode">GC2HFRB</span>
* <title>GC2HFRB 3, 2, 1 ... Lift-Off (Traditional Cache) in Thüringen, Germany created by Astronaut Hoffi1986</title>
*/
$obj.gcc = [
$('.CoordInfoCode', detailsPage).first().text(),
$('title', detailsPage).first().text()
];
geocache_details.gccode =
(findGCCodeFromString($obj.gcc[0])) ||
(findGCCodeFromString($obj.gcc[1])) ||
null;
if (!geocache_details.gccode) {
throw "fn getMinimalGeocacheDetails - Error getting GCCode!";
} else {
debug(
"getMinimalGeocacheDetails - GCCode: " + geocache_details.gccode + "\n" +
"\t1: " + findGCCodeFromString($obj.gcc[0]) + "\n" +
"\t2: " + findGCCodeFromString($obj.gcc[1]));
}
/* CacheId:
* HTML REGEXP Quelle
* ccid=1957539" ccid=(\d+) "View all Trackables" Link
* "CacheID":1957539 \"CacheID\":(\d+) teil der vorgeladenen Logs
* w=1957539" \Ww=(\d+) "Watch Listing" link
* log.aspx?id=1957539&LogType= log\.aspx\?id=\d+ "Archive Listing" link (owned listings)
*/
try {
var cacheid_regex = /ccid=\d+|\"CacheID\":\d+|\Ww=\d+|log\.aspx\?id=\d+/;
var cacheid_arr = cacheid_regex.exec(detailsPage.innerHTML);
geocache_details.cacheid = cacheid_arr[0].split(/:|=/)[1];
debug("getMinimalGeocacheDetails - CacheID: " + geocache_details.cacheid);
} catch (e) {
throw "fn getMinimalGeocacheDetails - Error getting 'cacheid' from " + geocache_details.gccode;
}
/* Cachename:
* <span id="ctl00_ContentBody_CacheName">3, 2, 1 ... Lift-Off</span></h2>
* <meta name="og:title" content="3, 2, 1 ... Lift-Off" property="og:title" />
*/
$obj.name = [
$('span#ctl00_ContentBody_CacheName', detailsPage).first().text(),
$('meta[name="og:title"]', detailsPage).first().attr('content') // Fallback #1
];
geocache_details.name =
($obj.name[0] && $.trim($obj.name[0])) ||
($obj.name[1] && $.trim($obj.name[1])) ||
null;
if (!geocache_details.name) {
throw "fn getMinimalGeocacheDetails - Error getting 'cacheName' from " + geocache_details.gccode;
} else {
debug(
"getMinimalGeocacheDetails - Name: " + geocache_details.name + "\n" +
"\t1: " + (($obj.name[0]) ? $obj.name[0] : "null") + "\n" +
"\t2: " + (($obj.name[1]) ? $obj.name[1] : "null"));
}
/* guid
* <form method="post" action="/geocache/GC2HFRB_3-2-1-lift-off?guid=712fed16-77ab-48f4-a269-18cc27bb2a14" id="aspnetForm">
* <a id="ctl00_ContentBody_lnkPrintFriendly5Logs" href="cdpf.aspx?guid=712fed16-77ab-48f4-a269-18cc27bb2a14&amp;lc=5" target="_blank">5 Logs</a>&nbsp;
* <a id="ctl00_ContentBody_uxTravelBugList_uxTrackableItemsHistory" href="../track/search.aspx?wid=712fed16-77ab-48f4-a269-18cc27bb2a14">View past Trackables</a>
* <a id="ctl00_ContentBody_uxLogbookLink" href="cache_logbook.aspx?guid=712fed16-77ab-48f4-a269-18cc27bb2a14">View Logbook</a>
* <a href="/seek/gallery.aspx?guid=712fed16-77ab-48f4-a269-18cc27bb2a14">View Gallery</a>
*/
$obj.guid = [
$("form[id='aspnetForm'][action*='guid=']", detailsPage).first().attr("action"),
$("a#ctl00_ContentBody_lnkPrintFriendly[href*='guid=']", detailsPage).first().attr("href"),
$("a#ctl00_ContentBody_uxTravelBugList_uxTrackableItemsHistory[href*='wid=']", detailsPage).first().attr("href"),
$("a#ctl00_ContentBody_uxLogbookLink[href*='guid=']", detailsPage).first().attr("href"),
$("div.CacheDetailNavigation a[href*='guid=']", detailsPage).first().attr("href")
];
geocache_details.guid =
($obj.guid[0] && $.trim($obj.guid[0].split("guid=")[1])) ||
($obj.guid[1] && $.trim($obj.guid[1].split("guid=")[1])) ||
($obj.guid[2] && $.trim($obj.guid[2].split("wid=")[1])) ||
($obj.guid[3] && $.trim($obj.guid[3].split("guid=")[1])) ||
($obj.guid[4] && $.trim($obj.guid[4].split("guid=")[1]))
null;
if (!geocache_details.guid) {
throw "fn getMinimalGeocacheDetails - Error getting 'guid' from " + geocache_details.gccode;
} else {
debug(
"getMinimalGeocacheDetails - Guid: " + geocache_details.guid + "\n" +
"\t1: " + (($obj.guid[0]) ? $obj.guid[0].split("guid=")[1].split("&")[0] : "null") + "\n" +
"\t2: " + (($obj.guid[1]) ? $obj.guid[1].split("guid=")[1].split("&")[0] : "null") + "\n" +
"\t3: " + (($obj.guid[2]) ? $obj.guid[2].split("wid=")[1].split("&")[0] : "null") + "\n" +
"\t4: " + (($obj.guid[3]) ? $obj.guid[3].split("guid=")[1].split("&")[0] : "null") + "\n" +
"\t5: " + (($obj.guid[4]) ? $obj.guid[4].split("guid=")[1] : "null"));
}
/* type
* <use xlink:href="/app/ui-icons/sprites/cache-types.svg#icon-137-disabled"></use>
* <span class="btn-add-to-list" data-gcrefcode="GC3Y9WC" data-href="/bookmarks/mark.aspx?view=legacy&guid=e36a3706-8336-4071-b14e-d04537a4bfa0&amp;WptTypeID=137">Add to list</a>
* <a href="/bookmarks/ignore.aspx?guid=e36a3706-8336-4071-b14e-d04537a4bfa0&amp;WptTypeID=137">Ignore</a>
* // GCLH2 modification of add to ignore list button:
* <a href="javascript:void(0);" data-url="https://www.geocaching.com/bookmarks/ignore.aspx?guid=e36a3706-8336-4071-b14e-d04537a4bfa0&amp;WptTypeID=137" style="background-image: url(&quot;/images/icons/16/ignore.png&quot;);">Ignore</a>
*/
$obj.type = [
$('svg.cache-icon > use', detailsPage)[0], // starting at 2018-08-18
$('li#ctl00_ContentBody_GeoNav_uxAddToListBtn > span', detailsPage).attr('data-href'),
$('li#ctl00_ContentBody_GeoNav_uxIgnoreBtn > a[href*="ignore.aspx"]', detailsPage).attr("href"),
$('li#ctl00_ContentBody_GeoNav_uxIgnoreBtn > a[data-url*="ignore.aspx"]', detailsPage).attr("data-url")
];
geocache_details.type =
($obj.type[0] && $obj.type[0].href.baseVal.split("#")[1].split("-")[1] + ".gif") ||
($obj.type[1] && $obj.type[1].split("=")[3] + ".gif") ||
($obj.type[2] && $obj.type[2].split("=")[2] + ".gif") ||
($obj.type[3] && $obj.type[3].split("=")[2] + ".gif")
null;
if (!geocache_details.type) {
throw "fn getMinimalGeocacheDetails - Error getting 'type' from " + geocache_details.gccode;
} else {
debug(
"getMinimalGeocacheDetails - Type: " + geocache_details.type + "\n" +
"\t1: " + (($obj.type[0]) ? $obj.type[0].href.baseVal.split("#")[1].split("-")[1] + ".gif" : "null") + "\n" +
"\t2: " + (($obj.type[1]) ? $obj.type[1].split("=")[3] + ".gif" : "null") + "\n" +
"\t3: " + (($obj.type[2]) ? $obj.type[2].split("=")[2] + ".gif" : "null") + "\n" +
"\t4: " + (($obj.type[3]) ? $obj.type[3].split("=")[2] + ".gif" : "null"));
}
return geocache_details;
}
async function getLogs(userToken, maxLogsCount, nLoggedVisits, element) {
//~ LogID 273160821
//~ CacheID 2436701
//~ LogGuid "8fd33a36-bb44-40ed-9b8b-41737e2d0c6a"
//~ Latitude null
//~ Longitude null
//~ LatLonString ""
//~ LogType "Found it"
//~ LogTypeImage "2.png"
//~ LogText "Schönes Versteck, süße ...>Lisa, Yvonne und Frank"
//~ Created "10/25/2012"
//~ Visited "10/14/2012"
//~ UserName "sweet cats"
//~ MembershipLevel "1"
//~ AccountID 6385212
//~ AccountGuid "0260fb1b-7cf1-4ef5-a3b6-6257276e3962"
//~ Email ""
//~ AvatarImage "99ff8cf2-7b7a-49a9-bb90-a38448158223.jpg"
//~ GeocacheFindCount 33
//~ GeocacheHideCount 0
//~ ChallengesCompleted 0
//~ IsEncoded false
//~ creator Object { GroupTitle="Member", GroupImageUrl="/images/icons/reg_user.gif"}
//~ GroupTitle "Member"
//~ GroupImageUrl "/images/icons/reg_user.gif"
//~ Images []
try {
maxLogsCount = $.isNumeric(maxLogsCount) ? maxLogsCount : 0;
nLoggedVisits = $.isNumeric(nLoggedVisits) ? nLoggedVisits : 0;
if (maxLogsCount == 0 || nLoggedVisits == 0) { // no logs
return [];
}
var nLogs = Math.min(maxLogsCount,nLoggedVisits), // number of required logs
logs = [],
fetch = true;
// up to 25 logs are already inside fetched listing, no need to fetch again
if (nLogs < 26) {
try {
var initialLogs = '{"' + element.innerHTML.split('initialLogs = {"')[1].split('};')[0] + '}';
logs = JSON.parse(initialLogs).data;
fetch = false;
} catch(e) { // if something went wrong give it a 2nd try and fetch the logs
error(e);
}
}
// fetch logs
if (fetch) {
var i,
// max possible number of logs by a single request: 100
nMax = 100,
nLogsByRequest = Math.min(nLogs,nMax),
// number of pages to be fetched
nPages = Math.ceil(nLogs/nLogsByRequest),
// idx: page index, num: number of logs by page (max:100)
// num=100,nLogs=200: --> idx=[1,2]: [1,100],[101,200]
// num=50, nLogs=200: --> idx=[1,2,3,4] [1,50],[51,100],[101,150],[151,200]
urlTemplate = GS_HOST + 'seek/geocache.logbook?tkn=' + userToken + '&idx=#PAGE#&num=' + nLogsByRequest + '&decrypt=false',
url,
log_obj = {},
log_objects,
promises = [];
// fetch all logs in parallel
for (i=1; i<=nPages; i++) {
url = urlTemplate.replace("#PAGE#", i);
promises.push(promiseRequest('GET', url));
}
log_objects = await Promise.all(promises);
for (i=0; i<log_objects.length; i++) {
// parse the result
log_obj = JSON.parse(log_objects[i].responseText);
// append new logs
logs = logs.concat(log_obj.data);
}
}
// truncate log array if necessary
if (logs.length > nLogs) {
logs = logs.slice(0, nLogs-logs.length);
}
return logs;
} catch(e) {
throw 'fn getLogs - ' + e;
}
}
/* gpx geocache */
function getAttributeXML(attribute_a) {
return ' <groundspeak:attribute id="' + attribute_a[0] + '" inc="' + attribute_a[3] + '">' + attribute_a[2] + '</groundspeak:attribute>\n';
}
function getGPXfromMarker(marker) {
var gpx = '';
gpx += ' <wpt lat="' + marker.latitude + '" lon="' + marker.longitude + '">\n';
gpx += ' <time>' + xsdDateTime(new Date()) + '</time>\n';
gpx += ' <name>' + escapeHTML(marker.name) + '</name>\n';
gpx += ' <cmt>' + escapeHTML(marker.content) + '</cmt>\n';
gpx += ' <sym>' + marker.symbol + '</sym>\n';
gpx += ' </wpt>';
return gpx;
}
function getWaypointsGPXFromGeocache(waypoint, geocache) {
var waypointName = waypoint.prefix + geocache.gcid.replace(/GC/, '');
var gpx = '';
gpx += ' <wpt lat="' + waypoint.latitude + '" lon="' + waypoint.longitude + '">\n';
gpx += ' <time>' + xsdDateTime(geocache.dateHidden) + '</time>\n';
gpx += ' <name>' + escapeHTML(waypointName) + '</name>\n';
gpx += ' <cmt>' + escapeHTML(waypoint.note) + '</cmt>\n';
gpx += ' <desc>' + escapeHTML(waypoint.name) + '</desc>\n';
gpx += ' <sym>' + waypoint.symbol_groundspeak + '</sym>\n';
gpx += ' <type>' + waypoint.type_groundspeak + '</type>\n';
gpx += ' </wpt>';
return gpx;
}
async function getGPXGeoCache(gcid) {
/*
geocache
.gcid
.guid
.cacheid
.name
.type
.owner
.hidden
.coordinates
.lat
.lon
.location
.state
.country
.bearing
.distance
.$inventory
.size
.difficulty
.terrain
.$attributes
.$short_description
.$long_description
.hint
.images
.additional_waypoints
.find_count
.logs
.favscore
*/
try {
var i, // for ()
geocache = {},
maxGPXLogs = parseInt(GM_getValue('maxGPXLogs', 10), 10),
geocache_obj = await getGeocache(gcid, maxGPXLogs);
if (geocache_obj === "pm only" || geocache_obj === 404) { // basic member and pm only cache or retracted
return geocache_obj;
}
geocache.gcid = geocache_obj.gcid;
if (GM_getValue('gpxstripgc', false)) {
geocache.gcid = geocache.gcid.replace(/GC/, '');
}
geocache.guid = geocache_obj.guid;
geocache.cacheid = geocache_obj.cacheid;
geocache.archived = (geocache_obj.archived) ? "True" : "False";
geocache.available = (geocache_obj.available) ? "True" : "False";
geocache.cacheName = geocache_obj.name;
geocache.cacheOwner = geocache_obj.owner;
geocache.cacheSym = geocache_obj.sym;
switch (geocache_obj.size) {
case "micro":
geocache.cacheSize = "Micro";
break;
case "small":
geocache.cacheSize = "Small";
break;
case "regular":
geocache.cacheSize = "Regular";
break;
case "large":
geocache.cacheSize = "Large";
break;
case "other":
geocache.cacheSize = "Other";
break;
case "not_chosen":
geocache.cacheSize = "Not chosen";
break;
case "virtual":
geocache.cacheSize = "Virtual";
break;
default:
geocache.cacheSize = "";
break;
}
i = WPT_ARRAY.findIndex(obj => obj.wptTypeId == geocache_obj.type);
geocache.cacheType = WPT_ARRAY[i].name;
geocache.attributes_array = geocache_obj.attributes_array;
geocache.difficulty = geocache_obj.difficulty;
geocache.terrain = geocache_obj.terrain;
var summary = geocache_obj.$short_description,
description = geocache_obj.$long_description;
if (GM_getValue('gpxhtml', true)) {
geocache.shortDescription = (summary.length === 1) ? summary.html() : "";
geocache.longDescription = (description.length === 1) ? description.html() : "";
} else {
geocache.shortDescription = (summary.length === 1) ? summary.text() : "";
geocache.longDescription = (description.length === 1) ? description.text() : "";
}
geocache.hint = geocache_obj.hint;
geocache.state = geocache_obj.state;
geocache.country = geocache_obj.country;
geocache.dateHidden = geocache_obj.hidden;
// logs
geocache.logs = [];
for (i = 0; i < geocache_obj.logs.length; i++) {
var logObj = {};
// cacherName: "user"
// type: "Found It", "Didn't find it", "Temporarily Disable Listing", "Write note", "Enable Listing",...
// foundDate: "August 18" oder "February 17, 2007"
// id: 12345679
// content: "Netter Log eintrag."
var gc_log = geocache_obj.logs[i];
logObj.cacherName = gc_log.UserName;
logObj.type = gc_log.LogType;
logObj.foundDate = await parseDate(gc_log.Visited);
logObj.id = gc_log.LogID;
// handling of HTML code in logs (since GS change to Markdown logs), e.g.
// <p> One, two &amp; three</p>
// in a log becomes
// &lt;p&gt; One, two &amp;amp; three&lt;/p&gt;
// to parse
var textarea = document.createElement("textarea");
// gc_log.LogText = &lt;p&gt; One, two &amp;amp; three&lt;/p&gt;
// unescaped = <p> One, two &amp; three</p>
var unescaped = $('<textarea>').html(gc_log.LogText).val(); // unescape HTML
// logObj.content = One, two & three
logObj.content = $(unescaped).text(); // no HTML in logs
geocache.logs.push(logObj);
}
geocache.additionalWaypoints = geocache_obj.additional_waypoints;
geocache.latitude = geocache_obj.lat;
geocache.longitude = geocache_obj.lon;
geocache.favScore = geocache_obj.favScore;
return geocache;
} catch(e) {
throw 'fn getGPXGeoCache - ' + e;
}
}
async function getGPX() {
try {
var i, ii, iii; // for ()
var gpxHeader =
'<?xml version="1.0" encoding="utf-8"?>\n' +
'<gpx xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" creator="GCTour" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.groundspeak.com/cache/1/0/1 http://www.groundspeak.com/cache/1/0/1/cache.xsd" xmlns="http://www.topografix.com/GPX/1/0">\n' +
' <name>' + escapeHTML(CURRENT_TOUR.name) + '</name>\n' +
// do not change <desc> content, otherwise GSAK does not handle additional cache waypoints as child waypoints during GPX import
' <desc>This is an individual cache generated from Geocaching.com</desc>\n' +
' <author>GCTour ' + VERSION + '</author>\n' +
' <url>' + GS_HOST + '</url>\n' +
' <urlname>Geocaching - High Tech Treasure Hunting</urlname>\n' +
' <time>' + (new Date()).toISOString() + '</time>\n' +
' <bounds minlat="##MINLAT##" minlon="##MINLON##" maxlat="##MAXLAT##" maxlon="##MAXLON##" />\n' +
'##GEOCACHES##\n' +
'##WAYPOINTS##\n' +
'</gpx>';
var geocacheTemplate =
' <wpt lat="##LAT##" lon="##LON##">\n' +
' <time>##TIME##</time>\n' +
' <name>##GCID##</name>\n' +
' <desc>##CACHENAME## by ##OWNER##, ##TYPE## (##DIFFICULTY##/##TERRAIN##)</desc>\n' +
' <url>http://coord.info/##GCID##</url>\n' +
' <urlname>##CACHENAME##</urlname>\n' +
' <sym>##CACHESYM##</sym>\n' +
' <type>Geocache|##TYPE##</type>\n' +
' <groundspeak:cache id="##CACHEID##" available="##AVAILABLE##" archived="##ARCHIVED##" xmlns:groundspeak="http://www.groundspeak.com/cache/1/0/1">\n' +
' <groundspeak:name>##CACHENAME##</groundspeak:name>\n' +
' <groundspeak:placed_by>##OWNER##</groundspeak:placed_by>\n' +
' <groundspeak:owner>##OWNER##</groundspeak:owner>\n' +
' <groundspeak:type>##TYPE##</groundspeak:type>\n' +
' <groundspeak:container>##CONTAINER##</groundspeak:container>\n' +
' <groundspeak:attributes>\n##ATTRIBUTES## </groundspeak:attributes>\n' +
' <groundspeak:difficulty>##DIFFICULTY##</groundspeak:difficulty>\n' +
' <groundspeak:terrain>##TERRAIN##</groundspeak:terrain>\n' +
' <groundspeak:country>##COUNTRY##</groundspeak:country>\n' +
' <groundspeak:state>##STATE##</groundspeak:state>\n' +
' <groundspeak:short_description html="True">##SUMMARY## </groundspeak:short_description>\n' +
' <groundspeak:long_description html="True">##DESCRIPTION## </groundspeak:long_description>\n' +
' <groundspeak:encoded_hints>##HINT##</groundspeak:encoded_hints>\n' +
' <groundspeak:logs>\n##LOGS##\n </groundspeak:logs>\n' +
' </groundspeak:cache>\n' +
' </wpt>';
var geocacheLogTemplate =
' <groundspeak:log id="##LOGID##">\n' +
' <groundspeak:date>##TIME##</groundspeak:date>\n' +
' <groundspeak:type>##LOGTYPE##</groundspeak:type>\n' +
' <groundspeak:finder>##CACHERNAME##</groundspeak:finder>\n' +
' <groundspeak:text encoded="False">##LOGTEXT##</groundspeak:text>\n' +
' </groundspeak:log>';
var gcStrArray = [],
wptStrArray = [],
minLat,
minLon,
maxLat,
maxLon,
nCaches = CURRENT_TOUR.geocaches.length;
// for progress bar update
PROGRESS_BAR.progress = 0;
PROGRESS_BAR.total = nCaches;
// fetch all caches in parallel, not one by one
var promises = [];
for (i = 0; i < nCaches; i++) {
var costumMarker = (typeof(CURRENT_TOUR.geocaches[i].latitude) != "undefined");
if (costumMarker) {
wptStrArray.push(getGPXfromMarker(CURRENT_TOUR.geocaches[i]));
updateProgressBar();
} else {
promises.push(getGPXGeoCache(CURRENT_TOUR.geocaches[i].id));
}
}
// fav score only needed if prefix option in GPX settings is active
if (!GM_getValue('gpxprefixfavscore', false)) {
FAVSCORE = false;
}
var cache_objects = await Promise.all(promises);
FAVSCORE = true;
var pmo = "", retracted = "";
for (i = 0; i < cache_objects.length; i++) {
// if the cancel button is pressed...
if (GM_getValue("stopTask", false)) {
GM_setValue("stopTask", false);
return "canceled"; // ...then return!
}
var geocache = cache_objects[i];
if (geocache === "pm only") { // pm only: not available for basic members
pmo += "#" + (i+1) + ": " + CURRENT_TOUR.geocaches[i].name + " (" + CURRENT_TOUR.geocaches[i].id + ")<br>";
} else if (geocache === 404) { // retracted
retracted += "#" + (i+1) + ": " + CURRENT_TOUR.geocaches[i].name + " (" + CURRENT_TOUR.geocaches[i].id + ")<br>";
}
else {
var logs = geocache.logs,
logsStringArray = [],
attributeLog,
attributeLogtext;
// create log with attributes!
if (GM_getValue('gpxattributestolog', false)) {
attributeLogtext = $.map(geocache.attributes_array, function(row, i) {
return row[2] + ": " + ((row[3] === 1) ? "yes" : "no");
}).join("\n");
attributeLog = geocacheLogTemplate
.replace('##LOGID##', geocache.cacheid)
.replace('##TIME##', xsdDateTime(new Date()))
.replace('##CACHERNAME##', "GCTour")
.replace('##LOGTYPE##', "Write note")
.replace('##LOGTEXT##', attributeLogtext);
logsStringArray.push(attributeLog);
}
// for removing all emoji codes in logs
var emoji_ranges = [
'\ud83c[\udf00-\udfff]', // U+1F300 to U+1F3FF
'\ud83d[\udc00-\ude4f]', // U+1F400 to U+1F64F
'\ud83d[\ude80-\udeff]' // U+1F680 to U+1F6FF
];
for (ii = 0; ii < logs.length; ii++) {
var geocacheLogMapping = [
['LOGID', logs[ii].id],
['TIME', xsdDateTime(logs[ii].foundDate)],
['CACHERNAME', escapeHTML(logs[ii].cacherName)],
['LOGTYPE', logs[ii].type],
// remove ASCII control codes and escape HTML entities
['LOGTEXT', escapeHTML(stripASCIIcodes(logs[ii].content))]
// for removing all emoji codes in logs
//['LOGTEXT', escapeHTML( stripASCIIcodes(logs[ii].content).replaceAll(emoji_ranges.join('|'),'') )]
];
var cacheWaypointLog = geocacheLogTemplate;
for (iii = 0; iii < geocacheLogMapping.length; iii++) {
cacheWaypointLog = cacheWaypointLog.replaceAll("##" + geocacheLogMapping[iii][0] + "##", geocacheLogMapping[iii][1]);
}
logsStringArray.push(cacheWaypointLog);
}
var attributesString = "";
for (ii = 0; (ii < geocache.attributes_array.length); ii++) {
attributesString += getAttributeXML(geocache.attributes_array[ii]);
}
var geocacheMapping = [
['LAT', geocache.latitude],
['LON', geocache.longitude],
['TIME', xsdDateTime(geocache.dateHidden)],
['GCID', geocache.gcid],
['CACHEID', geocache.cacheid],
['GUID', geocache.guid],
['AVAILABLE', geocache.available],
['ARCHIVED', geocache.archived],
['CACHENAME', escapeHTML(geocache.cacheName)],
['CACHESYM', geocache.cacheSym],
['OWNER', escapeHTML(geocache.cacheOwner)],
['STATE', escapeHTML(geocache.state)],
['COUNTRY', escapeHTML(geocache.country)],
['TYPE', geocache.cacheType],
['CONTAINER', geocache.cacheSize],
['ATTRIBUTES', attributesString],
['DIFFICULTY', geocache.difficulty],
['TERRAIN', geocache.terrain],
['SUMMARY', escapeHTML(stripASCIIcodes(geocache.shortDescription))],
['DESCRIPTION', escapeHTML(stripASCIIcodes(geocache.longDescription))],
['HINT', escapeHTML(geocache.hint)],
['LOGS', logsStringArray.join("\n")]
];
// add favorite score in front of cache name (visible only in Geocaching menu of GPSr)
if (GM_getValue('gpxprefixfavscore', false)) {
// e.g. favscore = (<1%) --> remove "(", ")" and escape "<" to "&lt;"
var favScore = geocache.favScore ? geocache.favScore.replace(/[()]/g,'').replace(/</g,'&lt;') : '';
geocacheMapping.push(['FAVSCORE', favScore]);
geocacheTemplate = geocacheTemplate.replace('<groundspeak:name>##CACHENAME##</groundspeak:name>','<groundspeak:name>##FAVSCORE####CACHENAME##<\/groundspeak:name>');
}
// bounds for caches
minLat = (!minLat) ? geocache.latitude : Math.min(geocache.latitude, minLat);
maxLat = (!maxLat) ? geocache.latitude : Math.max(geocache.latitude, maxLat);
minLon = (!minLon) ? geocache.longitude : Math.min(geocache.longitude, minLon);
maxLon = (!maxLon) ? geocache.longitude : Math.max(geocache.longitude, maxLon);
var cacheWaypoint = geocacheTemplate;
for (ii = 0; ii < geocacheMapping.length; ii++) {
cacheWaypoint = cacheWaypoint.replaceAll('##' + geocacheMapping[ii][0] + '##', geocacheMapping[ii][1]);
}
gcStrArray.push(cacheWaypoint);
if (GM_getValue('gpxwpts', true)) {
for (iii = 0; iii < geocache.additionalWaypoints.length; iii++) {
if (geocache.additionalWaypoints[iii].coordinates != "???") {
wptStrArray.push(getWaypointsGPXFromGeocache(geocache.additionalWaypoints[iii], geocache));
}
}
}
}
} // iteration end
// info of skipped PM only caches for BM (if any)
if (pmo.length > 0) {
pmo = $.gctour.lang('container.tourHeader.upload.tourUploadPMO') + ':<br>' + pmo;
pmo = '<small><i>' + pmo + '</i></small>';
showNotification({ text: pmo, style: "yellow", timeout: 20000 });
}
// info of retracted caches (if any)
if (retracted.length > 0) {
retracted = $.gctour.lang('container.tourHeader.upload.tourUploadRetracted') + ':<br>' + retracted;
retracted = '<small><i>' + retracted + '</i></small>';
showNotification({ text: retracted, style: "yellow", timeout: 20000 });
}
// bounds for cache waypoints + custom waypoints
var lat, lon;
for (i = 0; i < wptStrArray.length; ++i) {
lat = wptStrArray[i].split('lat="')[1].split('"')[0];
lon = wptStrArray[i].split('lon="')[1].split('"')[0];
minLat = (!minLat) ? lat : Math.min(lat, minLat);
maxLat = (!maxLat) ? lat : Math.max(lat, maxLat);
minLon = (!minLon) ? lon : Math.min(lon, minLon);
maxLon = (!maxLon) ? lon : Math.max(lon, maxLon);
}
var str = gpxHeader
.replaceAll('##GEOCACHES##', gcStrArray.join("\n"))
.replaceAll('##WAYPOINTS##', wptStrArray.join("\n"))
.replaceAll('##MINLAT##', minLat)
.replaceAll('##MINLON##', minLon)
.replaceAll('##MAXLAT##', maxLat)
.replaceAll('##MAXLON##', maxLon);
return str;
} catch (e) {
throw 'fn getGPX - ' + e;
}
}
async function downloadGPXFunction() {
try {
if (isEmptyTour(CURRENT_TOUR) || !isLoggedIn()) {
return;
}
var tourName,
currentDate,
currentDateString,
gpxString,
filename;
// add progressbar while loading
GM_setValue("stopTask", false);
addProgressbar({
closeCallback: function() {
return function() {
if (confirm($.gctour.lang('general.cancel') + "?") == true) {
window.location.reload();
}
};
}
});
tourName = CURRENT_TOUR.name.replace(/\s+/g, "_").replace(/[^A-Za-z0-9_ÄäÖöÜüß-]*/g, "");
currentDate = new Date();
currentDateString = currentDate.getFullYear() + "-" + (currentDate.getMonth() + 1) + "-" + currentDate.getDate() + "_" + currentDate.getHours() + "-" + currentDate.getMinutes() + "-" + currentDate.getSeconds();
filename = 'GCTour.' + tourName + '.' + currentDateString + '.gpx';
gpxString = await getGPX();
// if the cancel button is pressed the gpxString just contains canceled
if (gpxString == "canceled") {
closeOverlay();
return;
}
// open save file dialog
var file = new File([gpxString], filename, {
type: "application/gpx;charset=utf-8"
});
saveAs(file);
// all done - remove the overlay
closeOverlay();
} catch (e) {
addErrorDialog({
caption: "downloadGPXFunction error",
_exception: e
});
}
}
/* setting utilities */
function setLanguage(l) {
return function() {
GM_setValue('language', l);
window.location.reload();
};
}
function toggleBoolValue(valueName, defaultValue) {
return function() {
GM_setValue(valueName, !GM_getValue(valueName, defaultValue));
};
}
function setPrintFontSize(fontSize) {
return function() {
GM_setValue('printFontSize', fontSize);
};
}
function setPrintMapType(mapType) {
return function() {
GM_setValue('printOutlineMapType', mapType);
};
}
function setPrintMapSize(mapSize) {
return function() {
GM_setValue('defaultMapSize', mapSize);
};
}
/* settings jqUI prototype: properties and methods */
function Settings_jqUI() {
// checkbox settings
this.settings_printview_cb = [
['settings.printview.printMinimal', 'printMinimal', false],
['settings.printview.decryptHints', 'decryptPrintHints', true],
['settings.printview.editDescription', 'printEditMode', true],
['settings.printview.showSpoiler', 'printSpoilerImages', true],
['settings.printview.additionalWaypoints', 'printAdditionalWaypoints', true],
['settings.printview.additionalWaypoints2', 'addCustomMarkerToCacheTable', true],
['settings.printview.loggedVisits', 'printLoggedVisits', false],
['settings.printview.pageBreak', 'printPageBreak', false],
['settings.printview.pageBreakAfterMap', 'printPageBreakAfterMap', true],
['settings.printview.frontPage', 'printFrontpage', true],
['settings.printview.outlineMap', 'printOutlineMap', true],
['settings.printview.outlineMapSingle', 'printOutlineMapSingle', false],
['settings.printview.showCacheDetails', 'showCacheDetails', true],
['settings.printview.printCacheTableD', 'printCacheTableD', true],
['settings.printview.printCacheTableT', 'printCacheTableT', true],
['settings.printview.printCacheTableS', 'printCacheTableS', true],
['settings.printview.printCacheTableL4L', 'printCacheTableL4L', true],
['settings.printview.printCacheTableFav', 'printCacheTableFav', true],
['settings.printview.printCacheTableFound', 'printCacheTableFound', true],
['settings.printview.printCacheTableNote', 'printCacheTableNote', true]
];
this.settings_map_cb = [
['settings.map.geocacheid', 'settings_map_geocacheid', true],
['settings.map.geocachename', 'settings_map_geocachename', true],
['settings.map.geocacheindex', 'settings_map_geocacheindex', true],
['settings.map.awpts', 'settings_map_awpts', true],
['settings.map.awpt_name', 'settings_map_awpt_name', true],
['settings.map.awpt_lookup', 'settings_map_awpt_lookup', true],
['settings.map.owpts', 'settings_map_owpts', true],
['settings.map.owpt_name', 'settings_map_owpt_name', true]
];
this.settings_gpx_cb = [
['settings.gpx.html', 'gpxhtml', true],
['settings.gpx.wpts', 'gpxwpts', true],
['settings.gpx.attributesToLog', 'gpxattributestolog', false],
['settings.gpx.stripGC', 'gpxstripgc', false],
['settings.gpx.prefixFavScore', 'gpxprefixfavscore', false]
];
// menu structure
this.tabs =
'<div id="tabs">' +
' <ul>' +
' <li><a href="#tabs-1">' + $.gctour.lang('settings.language.header') + '</a></li>' +
' <li><a href="#tabs-2">' + $.gctour.lang('settings.printview.header') + '</a></li>' +
' <li><a href="#tabs-3">' + $.gctour.lang('settings.map.header') + '</a></li>' +
' <li><a href="#tabs-4">' + $.gctour.lang('settings.gpx.header') + '</a></li>' +
' <li><a href="#tabs-5">' + $.gctour.lang('settings.theme.header') + '</a></li>' +
' <li><a href="#tabs-6">' + $.gctour.lang('settings.exportimport.header') + '</a></li>' +
' </ul>' +
' <div id="tabs-1">' + this.getLanguage() + '</div>' +
' <div id="tabs-2">' + this.getPrintview() + '</div>' +
' <div id="tabs-3">' + this.getMap() + '</div>' +
' <div id="tabs-4">' + this.getGpx() + '</div>' +
' <div id="tabs-5">' + this.getThemes() + '</div>' +
' <div id="tabs-6">' + this.getExportImport() + '</div>' +
'</div>';
}
Settings_jqUI.prototype.getLanguage = function() {
var language =
'<div id="lang">' +
' <label for="selLang" class="gctour-label ui-widget-header ui-corner-all" style="padding: .1em .5em;">' + $.gctour.lang('settings.language.select') + '</label>' +
' <select name="selLang" id="selLang" class="ui-widget ui-corner-all">';
$.each($.gctour.i18n, function(l, o) {
language += ' <option value="' + l + '">' + o.name + '</option>';
});
language +=
' </select>' +
'</div>';
return language;
};
Settings_jqUI.prototype.getPrintview = function() {
// first checkbox
var printview = this.cbLayout(this.settings_printview_cb[0][0]);
// log count
printview +=
'<div style="border-bottom:1px solid;padding-bottom:10px;padding-top:10px">' +
' <b>' + $.gctour.lang('settings.printview.logCount') + '</b><br>' +
' <div id="settingsLogCount">' +
' <input type="radio" name="radio-1" id="radio-1" value="0">' +
' <label for="radio-1" class="ui-button ui-widget-header ui-corner-all" style="margin: 2px; padding: .1em .5em;">' + $.gctour.lang('settings.printview.logCounts')[0] + '</label><br>' +
' <input type="radio" name="radio-1" id="radio-2" value="3">' +
' <input type="text" style="width: 2em;" class="gctour-input-text" maxlength="3">' +
' <label for="radio-2" class="ui-button ui-widget-header ui-corner-all" style="margin: 2px; padding: .1em .5em;">' + $.gctour.lang('settings.printview.logCounts')[2] + '</label><br>' +
' </div>' +
'</div>';
// font size
printview +=
'<div id="selectmenu" style="border-bottom:1px solid;padding-bottom:10px;padding-top:10px">' +
' <b>' + $.gctour.lang('settings.printview.fontSize') + '</b><br>' +
' <select name="settingsFontSize" id="settingsFontSize" class="ui-widget ui-corner-all">';
$.each($.gctour.lang('settings.printview.fontSizes'), function(i, val) {
printview += ' <option value="' + val + '">' + val + '</option>';
});
printview +=
' </select>' +
'</div>';
// remaining checkboxes
for (var i = 1; i < this.settings_printview_cb.length; i++) { // checkboxes
printview += this.cbLayout(this.settings_printview_cb[i][0]);
}
return printview;
};
Settings_jqUI.prototype.getMap = function() {
var map =
'<div style="border-bottom:1px solid;padding-bottom:10px;padding-top:10px">' +
' <b>' + $.gctour.lang('settings.map.type') + '</b><br>' +
' <select name="settingsMapType" id="settingsMapType" class="ui-widget ui-corner-all">';
$.each($.gctour.lang('settings.map.types'), function(key,val) {
map += ' <option value="' + val + '">' + key + '</option>';
});
map +=
' </select>' +
'</div>' +
'<div style="border-bottom:1px solid;padding-bottom:10px;padding-top:10px">' +
' <b>' + $.gctour.lang('settings.map.size') + '</b><br>' +
' <select name="settingsMapSize" id="settingsMapSize" class="ui-widget ui-corner-all">';
$.each($.gctour.lang('settings.map.sizes'), function(i,val) {
map += ' <option value="' + val + '">' + val + '</option>';
});
map +=
' </select>' +
'</div>';
for (var i = 0; i < this.settings_map_cb.length; i++) { // checkboxes
map += this.cbLayout(this.settings_map_cb[i][0]);
}
return map;
};
Settings_jqUI.prototype.getGpx = function() {
var gpx = '';
for (var i = 0; i < this.settings_gpx_cb.length - 2; i++) { // checkboxes
gpx += this.cbLayout(this.settings_gpx_cb[i][0]);
}
gpx +=
'<div id="maxLogCount" style="border-bottom:1px solid;padding-bottom:10px;padding-top:10px">' +
' <b>' + $.gctour.lang('settings.gpx.maxLogCount') + '</b><br>' +
' <input type="text" style="width: 2em;" class="gctour-input-text" maxlength="3">' +
'</div>';
gpx += this.cbLayout(this.settings_gpx_cb[this.settings_gpx_cb.length - 2][0]);
gpx += this.cbLayout(this.settings_gpx_cb[this.settings_gpx_cb.length - 1][0]);
return gpx;
};
Settings_jqUI.prototype.getThemes = function() {
var themes =
'<div id="ThemeSwitcher">' +
' <label for="selTheme" class="gctour-label ui-widget-header ui-corner-all" style="padding: .1em .5em;">' + $.gctour.lang('settings.theme.select') + '</label>' +
' <select id="selTheme" name="selTheme" class="ui-widget ui-corner-all">';
var themeArray = ["black-tie", "blitzer", "cupertino", "dark-hive", "dot-luv", "eggplant",
"excite-bike", "flick", "hot-sneaks", "humanity", "le-frog", "mint-choc", "overcast",
"pepper-grinder", "redmond", "smoothness", "south-street", "start", "sunny", "swanky-purse",
"trontastic", "ui-darkness", "ui-lightness", "vader"];
$.each(themeArray, function(i, theme) {
themes += ' <option value="' + theme + '">' + theme + '</option>';
});
themes +=
' </select>' +
'</div>';
return themes;
};
Settings_jqUI.prototype.getExportImport = function() {
var exp_imp =
'<div style="border-bottom:1px solid;padding-bottom:10px;padding-top:10px">' +
'<b>' + $.gctour.lang('settings.exportimport.export') + '</b><br>' +
'<button id="ExportButton">Export</button>' +
'</div>' +
'<div style="border-bottom:1px solid;padding-bottom:10px;padding-top:10px">' +
'<b>' + $.gctour.lang('settings.exportimport.import') + '</b><br>' +
'<input id="ImportButton" type="file" accept=".json" style="display:none;">' +
'<button onclick="document.getElementById(\'ImportButton\').click();">Import</button>' +
'</div>';
return exp_imp;
};
Settings_jqUI.prototype.show = function() {
// jQuery UI new settings menu
$(this.tabs).dialog($.gctour.dialog.info(), {
title : $.gctour.lang('settings.caption'),
width : '75%',
maxHeight : $(window).height() - 20,
resizable : false,
dialogClass : 'gct_dialog',
buttons : [{
text : $.gctour.lang('general.close'),
icons : {
primary : "ui-icon-closethick"
},
click : function() {
$(this).dialog("close");
}
}
],
beforeClose: function(event, ui) {
// remove dialog leftovers
$("div.gct_dialog").remove();
}
});
// tabs menu
$("div#tabs").tabs({
heightStyle : "content"
});
// pre-selections
this.getCurrentSettings();
// import/export settings
$("button").button();
$('#ImportButton').on("change", importGCTourSettings);
$('#ExportButton').on("click", exportGCTourSettings);
reduceCacheTableSettings();
};
// pre-selection of current settings
Settings_jqUI.prototype.getCurrentSettings = function() {
var thiz = this;
// language
$("select#selLang").change(function(e) {
GM_setValue('language', $(this).val());
window.location.reload();
}).children("[value=" + GM_getValue('language', $.gctour.defaultLang) + "]").prop("selected", true);
// printview
var $radio = $('div#settingsLogCount input[type="radio"]'),
$text = $('div#settingsLogCount input[type="text"]'),
nLogs = GM_getValue('maxPrintLogs', 3);
if (nLogs === 0) { // no logs
$radio.eq(0).prop("checked", true);
} else { // fixed number of logs
$radio.eq(1).prop("checked", true);
$text.prop("value", nLogs);
}
$radio.eq(0).click(function(e) {
GM_setValue('maxPrintLogs', 0);
});
$radio.eq(1).click(function(e) {
GM_setValue('maxPrintLogs', $text.prop("value"));
});
$text.click(function(e) {
$radio.eq(1).prop("checked", true);
});
$text.keyup(function(e) {
thiz.checkInput($(this), 'maxPrintLogs');
});
$("select#settingsFontSize").change(function(e) {
GM_setValue('printFontSize', $(this).val());
}).children("[value=" + GM_getValue('printFontSize', 'x-small') + "]").prop("selected", true);
// maps
$("select#settingsMapType").change(function(e) {
GM_setValue('printOutlineMapType', $(this).val());
}).children("[value=" + GM_getValue('printOutlineMapType', 'roadmap') + "]").prop("selected", true);
$("select#settingsMapSize").change(function(e) {
GM_setValue('defaultMapSize', $(this).val());
}).children("[value=" + GM_getValue('defaultMapSize', 'large') + "]").prop("selected", true);
// gpx
var $text1 = $('div#maxLogCount input[type="text"]');
$text1.prop("value", GM_getValue('maxGPXLogs', 10));
$text1.keyup(function(e) {
thiz.checkInput($(this), 'maxGPXLogs');
});
// themes
$("select#selTheme").change(function(e) {
addJqUiTheme($(this).val());
GM_setValue('theme', $(this).val());
}).children("[value=" + GM_getValue('theme', 'smoothness') + "]").prop("selected", true);
// checkboxes
var settings_array = this.settings_printview_cb.concat(this.settings_map_cb).concat(this.settings_gpx_cb);
thiz = this;
$("input.gct-ui-checkbox").each(function(i) {
var item = settings_array[i];
thiz.createCheckBox($(this), item[0], item[1], item[2]);
// pre-selection
if (GM_getValue(item[1], item[2])) { // is checked
$(this).prop('checked', true)
.button("option", {
icons : {
primary : "ui-icon-check"
}
}).button("refresh");
}
});
$("input.gct-ui-checkbox+label").css({
'float' : 'right',
'border-radius' : '3px',
'width' : '1em',
'height' : '1em',
'vertical-align' : 'middle'
});
};
// create checkboxes in jQuery UI style
Settings_jqUI.prototype.createCheckBox = function(elem, id, gmValue, dValue) {
elem.attr({
"id" : id
})
.prop({
"type" : "checkbox",
"checked" : false
})
.after($("<label>").attr({
for : id
}))
.button({
text : false
})
.click(function() {
var isChecked = GM_getValue(gmValue, dValue);
GM_setValue(gmValue, !isChecked); // toggle value
$(this).button("option", {
icons : {
primary : !isChecked ? "ui-icon-check" : ""
}
})
});
};
// layout template for checkboxes
Settings_jqUI.prototype.cbLayout = function(setting) {
return '<div style="border-bottom:1px solid;padding-bottom:10px;padding-top:10px">' +
' <input class="gct-ui-checkbox">' +
' <b>' + $.gctour.lang(setting) + '</b><br>' +
$.gctour.lang(setting + "Desc") +
'</div>'
};
// check for int values in input fields
Settings_jqUI.prototype.checkInput = function(elem, ident) {
var value = elem.prop("value"),
intOnly = new RegExp(/^\d+$/);
if (intOnly.test(value)) {
elem.css("backgroundColor", '');
GM_setValue(ident, value);
} else {
elem.css("backgroundColor", '#ff7f7f');
}
};
// adding a jQuery UI theme to the end of document's head section
function addJqUiTheme(theme) {
var thmURL = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/" + theme + "/jquery-ui.css",
thmLink = $("<link>", {
id : "gct-ui-theme-link",
href : thmURL,
rel : "stylesheet",
type : "text/css"
});
$("head link#gct-ui-theme-link").remove(); // remove other theme(s) first
$("head").append(thmLink);
}
// export GCTour settings (including all tours)
function exportGCTourSettings() {
let settings = {};
for (let val of GM_listValues()) {
settings[val] = GM_getValue(val);
}
let file = new File([JSON.stringify(settings)], 'GCTour_Settings.json', {
type: "text/plain;charset=utf-8"
});
saveAs(file);
}
// import GCTour settings (including all tours)
function importGCTourSettings(evt) {
// check for the various File API support
if (window.File && window.FileReader && window.FileList && window.Blob) {
// Great success! All the File APIs are supported.
} else {
alert('Sorry, the File APIs are not fully supported in your browser. Please update your browser.');
return;
}
let f = evt.target.files[0],
reader = new FileReader();
// closure to capture the file information
reader.onload = (function(theFile) {
return function(e) {
// here comes the file content!
let content = e.target.result;
try {
let parsed = JSON.parse(content);
$.each(parsed, function(key, value) {
if (parsed[key]) {
GM_setValue(key, value);
}
});
if (console && console.table) { console.table(parsed); }
window.location.reload();
} catch (e) {
alert('File content not valid:\n' + e);
}
};
})(f);
reader.readAsText(f, "UTF-8");
}
function reduceCacheTableSettings() {
var $parent = $("label[for='settings.printview.printCacheTableD']").parent();
$parent.append('<br>');
var cols = ["D","T","S","L4L","Fav","Found","Note"];
var $parent2;
$parent.append(" || ");
for (var i=0; i<cols.length; ++i) {
$parent2 = $('input[id="settings.printview.printCacheTable'+cols[i]+'"]').parent();
// input
$parent.append($('input[id="settings.printview.printCacheTable'+cols[i]+'"]'));
// label
$parent.append($('label[for="settings.printview.printCacheTable'+cols[i]+'"]'));
// text
if (i>4) $parent.append(" "+$.gctour.lang('printview.'+cols[i].toLowerCase())+" || ");
else $parent.append(" "+cols[i]+" || ");
// remove floating right
$('label[for="settings.printview.printCacheTable'+cols[i]+'"]').css('float','');
// remove (now) empty part
if (i>0) $parent2.remove();
}
}
/* autoTour */
// autoTour gui
async function updateAutoTourMap(lat, lon) {
// make the container visible
$('#autoTourContainer').show();
// this is necessary if Leaflet map was hidden first and got visible later
LM._lm.invalidateSize();
var radiusOrg = $.trim($("input#markerRadius").val());
if (isNaN(radiusOrg) || radiusOrg == "") { // please break if radius is no number
return;
}
var kmMiles = $("select#markerRadiusUnit").prop("selectedIndex");
// 0: km, 1: miles
var radiusMiles = parseFloat(radiusOrg) * ((kmMiles == 1) ? 1 : 0.621371);
if (radiusMiles == "") {
return;
}
// add circle
let radiusMeter = parseFloat(radiusOrg) / ((kmMiles == 0) ? 1 : 0.621371)*1000;
let circle = {};
circle.center = [lat,lon];
circle.radius = radiusMeter;
LM.removeLayer();
LM.addCircle(circle);
var url = GS_HOST + "seek/nearest.aspx?lat=" + lat + "&lng=" + lon + "&dist=" + radiusMiles;
$('b#markerCoordsPreview').empty().append(
$("<a>", {
href : url,
title : url,
text : new LatLon(lat, lon).toString()
})
.click(function() {
window.open(this.href);
return false;
}));
$('b#markerRadiusPreview').html(parseFloat(radiusOrg) + " " + ((kmMiles == 1) ? "mi" : "km"));
$("b#markerCoordsPreview, b#markerRadiusPreview")
.css("background-color", "#FFE000")
.animate({
"background-color" : "transparent"
}, 2000);
// get how many caches are in this area
$('b#markerCountPreview, b#markerDurationMin, b#markerDurationSec').html("<img src='" + $.gctour.img.loader3 + "'>");
var loadingTime1 = new Date();
var response = await promiseRequest('GET', url);
var dummyDiv = $(response.responseText),
color,
pagesSpan = $("td.PageBuilderWidget", dummyDiv).first();
if (pagesSpan.length > 0) {
var cacheCount = $("b", pagesSpan).first().text(),
nCalls = Math.ceil(cacheCount/200); // max. 200 caches per call
// time for single search call
var miliseconds = new Date() - loadingTime1;
// projected time for all search calls
var seconds = Math.ceil((miliseconds * parseFloat(nCalls)) / 1000);
// additional time for search page calls (e.g. waiting time)
seconds = seconds + parseFloat(nCalls) * 2;
var secondsMod = seconds % 60;
var minutes = (seconds - secondsMod) / 60;
$("b#markerCountPreview").html(cacheCount);
$("b#markerDurationMin").html(minutes);
$("b#markerDurationSec").html(secondsMod);
color = (cacheCount<1001) ? "#FFE000" : "#FF0000";
} else {
$("b#markerCountPreview, b#markerDurationMin, b#markerDurationSec").html("0");
color = "#FF0000";
}
$("b#markerCountPreview, b#markerDurationMin, b#markerDurationSec").css("background-color", color);
if (cacheCount<1001) {
$("b#markerCountPreview, b#markerDurationMin, b#markerDurationSec")
.animate({
"background-color" : "transparent"
}, 2000);
} else {
$("b#markerDurationMin, b#markerDurationSec")
.animate({
"background-color" : "transparent"
}, 2000);
}
// last, save the values
$('input#coordsDivLat').val(lat);
$('input#coordsDivLon').val(lon);
$('input#coordsDivRadius').val(radiusMiles);
// enable the startQuery button
$('button#startQuery').removeAttr('disabled').css({
"opacity" : 1,
"cursor" : "pointer"
});
}
async function updateAutoTourMapWebAPI(lat, lon) {
// make the container visible
$('#autoTourContainer').show();
// no duration estimate required anymore
$("b#markerDurationMin").parent().remove();
// this is necessary if Leaflet map was hidden first and got visible later
LM._lm.invalidateSize();
var radiusOrg = $.trim($("input#markerRadius").val());
if (isNaN(radiusOrg) || radiusOrg == "") { // break if radius is no number
return;
}
var kmMiles = $("select#markerRadiusUnit").prop("selectedIndex");
// 0: km, 1: miles
var radiusMiles = parseFloat(radiusOrg) * ((kmMiles == 1) ? 1 : 0.621371);
if (radiusMiles == "") {
return;
}
// add circle
let radiusMeter = parseFloat(radiusOrg) / ((kmMiles == 0) ? 1 : 0.621371)*1000;
let circle = {};
circle.center = [lat,lon];
circle.radius = radiusMeter;
LM.removeLayer();
LM.addCircle(circle);
// new search link
var url = GS_HOST + "play/results/?st=" + Geo.toLat(lat) + "+" + Geo.toLon(lon) + "&ot=query&r=" + ((kmMiles == 1) ? radiusMiles : radiusMeter / 1000) + "&asc=true&sort=distance";
$('b#markerCoordsPreview').empty().append(
$("<a>", {
href : url,
title : url,
text : new LatLon(lat, lon).toString()
})
.click(function() {
window.open(this.href);
return false;
}));
$('b#markerRadiusPreview').html(radiusOrg + " " + ((kmMiles == 1) ? "mi" : "km"));
$("b#markerCoordsPreview, b#markerRadiusPreview")
.css("background-color", "#FFE000")
.animate({
"background-color" : "transparent"
}, 2000);
// get how many caches are in this area
$('b#markerCountPreview')
.css("background-color", "transparent")
.html("<img src='" + $.gctour.img.loader3 + "'>");
url = GS_HOST + 'api/proxy/web/search/v2?origin='+lat+','+lon+'&rad='+radiusMeter+'&take=0&sort=distance&asc=true&skip=0';
var response = await promiseRequest('GET', url);
var cacheCount = JSON.parse(response.responseText).total;
if (cacheCount > 0) {
$("b#markerCountPreview").html(cacheCount);
} else {
$("b#markerCountPreview").html("0");
}
if (cacheCount<=AUTOTOUR_MAX_CACHES) {
$("b#markerCountPreview")
.css("background-color", "#FFE000")
.animate({
"background-color" : "transparent"
}, 2000);
} else {
$("b#markerCountPreview").css("background-color", "#FF0000");
}
// last, save the values
$('input#coordsDivLat').val(lat);
$('input#coordsDivLon').val(lon);
$('input#coordsDivRadius').val(radiusMiles);
// enable the startQuery button
$('button#startQuery').removeAttr('disabled').css({
"opacity" : 1,
"cursor" : "pointer"
});
}
function startAutoTour() {
var typeFilter = {},
sizeFilter = {},
dFilter = {},
tFilter = {},
specialFilter = {},
ele = $("#autoTourContainer"),
lat,
lon,
radius,
url;
ele.find("input[name='type']").each(function(index) {
typeFilter[$(this).val()] = $(this).is(':checked');
});
ele.find("input[name='size']").each(function(index) {
sizeFilter[$(this).val()] = $(this).is(':checked');
});
ele.find("input[name='Difficulty']").each(function(index) {
dFilter[$(this).val()] = $(this).is(':checked');
});
ele.find("input[name='Terrain']").each(function(index) {
tFilter[$(this).val()] = $(this).is(':checked');
});
ele.find("input[name='special']").each(function(index) {
specialFilter[$(this).val()] = $(this).is(':checked');
});
ele.find("div[id='special_pm']").children().each(function() {
if ($(this).is(':checked')) specialFilter['pm'] = $(this).val();
});
specialFilter['minFavorites'] = ele.find("input[id='special_favorites']").val();
lat = ele.find("input#coordsDivLat").val();
lon = ele.find("input#coordsDivLon").val();
radius = ele.find("input#coordsDivRadius").val();
url = GS_HOST + "seek/nearest.aspx?lat=" + lat + "&lon=" + lon + "&dist=" + radius;
if (specialFilter["I haven't found "]) {
url += "&f=1";
}
specialFilter["minFavorites"] = specialFilter["minFavorites"] || 0;
GM_setValue('tq_url', url);
GM_setValue('tq_typeFilter', JSON.stringify(typeFilter));
GM_setValue('tq_sizeFilter', JSON.stringify(sizeFilter));
GM_setValue('tq_dFilter', JSON.stringify(dFilter));
GM_setValue('tq_tFilter', JSON.stringify(tFilter));
GM_setValue('tq_specialFilter', JSON.stringify(specialFilter));
GM_setValue('tq_StartUrl', document.location.href);
debug("fn startAutoTour GM_setValue: " +
"\n\tq_url:" + url +
"\n\tq_typeFilter:" + JSON.stringify(typeFilter) +
"\n\tq_sizeFilter:" + JSON.stringify(sizeFilter) +
"\n\tq_dFilter:" + JSON.stringify(dFilter) +
"\n\tq_tFilter:" + JSON.stringify(tFilter) +
"\n\tq_specialFilter:" + JSON.stringify(specialFilter) +
"\n\tq_StartUrl:" + document.location.href);
document.location.href = "https://www.geocaching.com/seek/nearest.aspx";
}
async function startAutoTourWebAPI() {
try {
var typeFilter = {},
sizeFilter = {},
dFilter = {},
tFilter = {},
specialFilter = {},
ele = $("#autoTourContainer"),
nHits = Number(ele.find("#markerCountPreview").text());
if (nHits>AUTOTOUR_MAX_CACHES) {
showNotification({
text: $.gctour.lang('autoTour.maxCaches').replace('###NHITS###',nHits),
style: "yellow"
});
nHits = Math.min(nHits,AUTOTOUR_MAX_CACHES);
}
// get current filter settings
ele.find("input[name='type']").each(function(index) {
typeFilter[$(this).val()] = $(this).is(':checked');
});
ele.find("input[name='size']").each(function(index) {
sizeFilter[$(this).val()] = $(this).is(':checked');
});
ele.find("input[name='Difficulty']").each(function(index) {
dFilter[$(this).val()] = $(this).is(':checked');
});
ele.find("input[name='Terrain']").each(function(index) {
tFilter[$(this).val()] = $(this).is(':checked');
});
ele.find("input[name='special']").each(function(index) {
specialFilter[$(this).val()] = $(this).is(':checked');
});
ele.find("div[id='special_pm']").children().each(function() {
if ($(this).is(':checked')) specialFilter['pm'] = $(this).val();
});
specialFilter['minFavorites'] = ele.find("input[id='special_favorites']").val();
// store current filter settings for re-use
GM_setValue('tq_typeFilter', JSON.stringify(typeFilter));
GM_setValue('tq_sizeFilter', JSON.stringify(sizeFilter));
GM_setValue('tq_dFilter', JSON.stringify(dFilter));
GM_setValue('tq_tFilter', JSON.stringify(tFilter));
GM_setValue('tq_specialFilter', JSON.stringify(specialFilter));
var lat = ele.find("input#coordsDivLat").val();
var lon = ele.find("input#coordsDivLon").val();
var radius = ele.find("input#coordsDivRadius").val(); // miles
radius = Math.round(radius*1.609344*1000); // m
addProgressbar({
caption : $.gctour.lang('autoTour.wait'),
closeCallback : function() {
return function() {
closeOverlayRemote(document)();
};
}
});
var origin = lat+','+lon;
var take = 1000;
var url = GS_HOST + 'api/proxy/web/search/v2?origin='+origin+'&rad='+radius+'&take='+take+'&sort=distance&asc=true&skip=';
var skip = 0;
// number of calls
var nCalls = Math.ceil(nHits/take);
// for progress bar update
PROGRESS_BAR.progress = 0;
PROGRESS_BAR.total = nCalls;
var promises = [];
var url_fetchHits;
for (let i=0; i<nCalls; i++) {
skip = i*take;
url_fetchHits = url + skip;
promises.push(promiseRequest('GET', url_fetchHits, {}, {}, true));
}
var res = await Promise.all(promises);
// return all results, either resolved or rejected (https://davidwalsh.name/promise-allsettled)
//var res = await Promise.allSettled(promises);
var caches = [], cache, addBool, ind;
for (let i=0; i<res.length; i++) {
var hits = JSON.parse(res[i].responseText).results;
// loop through all hits
$.each(hits, function(j, hit) {
// map numerical to textual size
ind = SIZES_ARRAY.findIndex(obj => obj.newSearchId==hit.containerType);
if (ind != -1) hit.containerType = SIZES_ARRAY[ind].sizeTypeId;
else hit.containerType = "other"; // if numerical size is unknown, set size to other
// autoTour magic starts here (filter)
// check whether the cache matches the given type, size and D/T values
addBool = typeFilter[hit.geocacheType] &&
sizeFilter[hit.containerType] &&
dFilter[hit.difficulty] &&
tFilter[hit.terrain];
if (specialFilter["I haven't found "]) {
addBool = addBool && !hit.userFound;
}
if (specialFilter['is Active']) {
addBool = addBool && (hit.cacheStatus===0 ? true : false);
}
if (specialFilter['pm'] == "premium") { // PM only
addBool = addBool && hit.premiumOnly;
} else {
if (specialFilter['pm'] == "basic") { // basic
addBool = addBool && !hit.premiumOnly;
}
}
addBool = addBool &&
(parseInt(((specialFilter['minFavorites']) ? specialFilter['minFavorites'] : 0), 10) <= parseInt(hit.favoritePoints, 10)); // minimal Favorites
// if all parameters match - add the cache
if (addBool) {
cache = {};
cache.name = hit.name;
cache.id = hit.code;
cache.image = GS_HOST + GS_WPT_IMAGE_PATH + hit.geocacheType + '.gif';
caches.push(cache);
}
/*debug(hit.code + " " + hit.name + " filter:" +
"\n\ttype:" + hit.geocacheType + " = " + typeFilter[hit.geocacheType] +
"\n\tsize:" + hit.containerType + " = " + sizeFilter[hit.containerType] +
"\n\tdifficulty:" + hit.difficulty + " = " + dFilter[hit.difficulty] +
"\n\tterrain:" + hit.terrain + " = " + tFilter[hit.terrain] +
"\n\thaven't found: " + !hit.userFound +
"\n\tactive: " + (hit.cacheStatus===0 ? true : false) +
"\n\tpm only: " + hit.premiumOnly +
"\n\t ==> Add to tour: " + addBool);*/
}); // END for each cache
}
CURRENT_TOUR = {};
CURRENT_TOUR.id = getNewTourId();
CURRENT_TOUR.name = "autoTour " + CURRENT_TOUR.id;
CURRENT_TOUR.geocaches = caches;
TOURS.push(CURRENT_TOUR);
log("autoTour done - create new Tour: " + CURRENT_TOUR.id + " ; " + CURRENT_TOUR.name);
saveCurrentTour();
updateTour();
closeOverlay();
showNotification({
text: $.gctour.lang('notifications.addgeocache.success.caption').format(CURRENT_TOUR.name),
style: "green",
timeout: 3000
});
} catch(e) {
closeOverlayRemote(document)();
if (e.includes("429")) var exc = 'message from Groundspeak: "too many requests"<br><br>Please decrease the radius.';
addErrorDialog({
caption: "error in startAutoTourWebAPI",
_exception: exc
});
}
}
// fetch and loop through results on old search page and save autoTour
async function processAutoTour() {
// progress bar
addProgressbar({
caption: $.gctour.lang('autoTour.wait'),
closeCallback: function() {
return function() {
if ( confirm($.gctour.lang('general.cancel')) ) {
GM_deleteValue('tq_url');
closeOverlayRemote(document)();
document.location.href = GM_getValue('tq_StartUrl', GS_HOST);
}
};
}
});
// search url
var tq_url = GM_getValue('tq_url');
// filter
var tq_typeFilter = JSON.parse(GM_getValue('tq_typeFilter')),
tq_sizeFilter = JSON.parse(GM_getValue('tq_sizeFilter')),
tq_dFilter = JSON.parse(GM_getValue('tq_dFilter')),
tq_tFilter = JSON.parse(GM_getValue('tq_tFilter')),
tq_specialFilter = JSON.parse(GM_getValue('tq_specialFilter'));
// get pages
// - to start, get page 1 of old search page
// - fetch all available pages from there (2 to max. 10)
// - if more pages are available, fetch the 11th
// - fetch all available pages from there (12 to max. 20)
// - ... and so on
var pages = [];
// get very first page
var page1 = await promiseRequest('GET',tq_url);
pages = [page1];
// if search is empty then finish
var timeout = 3000;
if ($("td.PageBuilderWidget > span:first",page1.responseText).length <= 0) {
closeOverlay();
showNotification({
text: "No caches here :-(",
style: "yellow",
timeout: timeout
});
GM_deleteValue('tq_url');
setTimeout(function() {
document.location.href = GM_getValue('tq_StartUrl', GS_HOST);
},timeout);
return;
}
// set progress bar counter
var cacheCount = Number($("td.PageBuilderWidget b",page1.responseText).first().text());
var count = 0;
PROGRESS_BAR.progress = Math.min(cacheCount,++count*200)-1;
PROGRESS_BAR.total = cacheCount;
setProgress(PROGRESS_BAR.progress,PROGRESS_BAR.total,document);
// get all remaining pages
var next10Pages = false,
res = [];
do {
// fetch next (max.) 10 pages
[res,next10Pages] = await fetchNextPages(page1);
pages = pages.concat(res); // add pages
if (next10Pages) {
page1 = pages[pages.length-1];
}
// update progress bar counter
PROGRESS_BAR.progress = Math.min(cacheCount, ++count * 200) - 1;
setProgress(PROGRESS_BAR.progress,PROGRESS_BAR.total,document);
} while (next10Pages);
closeOverlay();
// loop through all found caches
var addBool,
tq_caches = [],
entries = [],
len = pages.length;
for (let i=0; i<len; i++) {
// get all caches from page
entries = getEntriesFromOldSearchpage(pages[i].responseText);
// log("entries: " + JSON.stringify(entries));
// loop through all caches from page
$.each(entries, function(i, entry) {
//debug("entry[" + i + "]: " + JSON.stringify(entry));
// autoTour magic starts here (filter)
// check whether the caches match against the given type, size and D/T values
addBool = tq_typeFilter[entry.type] &&
tq_sizeFilter[entry.size] &&
tq_dFilter[entry.difficulty] &&
tq_tFilter[entry.terrain];
if (tq_specialFilter['is Active']) {
log("Check if " + entry.name + " is active:\n" +
"available: " + entry.available);
addBool = addBool && (entry.available); // only add if active!
}
if (tq_specialFilter['pm'] == "premium") { // PM only
addBool = addBool && entry.pm_only;
} else {
if (tq_specialFilter['pm'] == "basic") { // basic
addBool = addBool && !entry.pm_only;
}
}
// autoTour parameter "haven't found" is not checked here because of URL parameter
addBool = addBool &&
(parseInt(((tq_specialFilter['minFavorites']) ? tq_specialFilter['minFavorites'] : 0), 10) <= parseInt(entry.favorites, 10)); // minimal Favorites
// if all parameters match - add the cache
if (addBool) {
// 8.gif --> https://www.geocaching.com/images/wpttypes/sm/8.gif
entry.image = GS_HOST + GS_WPT_IMAGE_PATH + entry.image;
let tmp = {};
tmp.id = entry.id; tmp.guid = entry.guid; tmp.name = entry.name; tmp.image = entry.image;
tq_caches.push(tmp);
}
debug(entry.id + " " + entry.name + " filter:" +
"\n\ttype:" + entry.type + " = " + tq_typeFilter[entry.type] +
"\n\tsize:" + entry.size + " = " + tq_sizeFilter[entry.size] +
"\n\tdifficulty:" + entry.difficulty + " = " + tq_dFilter[entry.difficulty + ""] +
"\n\tterrain:" + entry.terrain + " = " + tq_tFilter[entry.terrain + ""] +
"\n\tavailable:" + entry.available +
"\n\tpm only:" + entry.pm_only +
"\n\t ==> Add to tour: " + addBool);
}); // END for each cache
}
// save as new tour
CURRENT_TOUR = {};
CURRENT_TOUR.id = getNewTourId();
CURRENT_TOUR.name = "autoTour " + CURRENT_TOUR.id;
CURRENT_TOUR.geocaches = tq_caches;
TOURS.push(CURRENT_TOUR);
log("autoTour done - create new Tour: " + CURRENT_TOUR.id + " ; " + CURRENT_TOUR.name);
saveCurrentTour();
// clean up and return to start url
showNotification({
text: $.gctour.lang('notifications.addgeocache.success.caption').format(CURRENT_TOUR.name),
style: "green",
timeout: timeout
});
GM_deleteValue('tq_url');
setTimeout(function() {
document.location.href = GM_getValue('tq_StartUrl', GS_HOST);
},timeout);
// help function: fetch next (max.) 10 pages
async function fetchNextPages(startPage) {
startPage = startPage.responseText;
// get form element from startPage
var theForm = $("input[name='__VIEWSTATE']",startPage).parent().parent()[0];
// top page links
var $href = $('a[href*="ctl00$ContentBody$pgrTop$lbGoToPage_"]',startPage);
var first = $href.length>0 ? parseInt( $href[0].href.split("_")[3].split(",")[0] ) : 0;
var last = $href.length>0 ? parseInt( $href.last()[0].href.split("_")[3].split(",")[0] ) : -1;
var clone,
$form,
promises = [];
var headers = {'Content-type' : 'application/x-www-form-urlencoded'};
for (let i=first; i<=last; i++) {
clone = theForm.cloneNode(true); // deep copy is important (reference is not enough!)
clone[0].value = "ctl00$ContentBody$pgrTop$lbGoToPage_"+i;
$form = $(clone);
promises.push( promiseRequest('POST', $form.prop('action'), headers, $form.serialize()) );
}
var next10Pages = false;
// check for link to next 10 pages
if ($('a[href*="ctl00$ContentBody$pgrTop$ctl06"]',startPage).length>0) {
next10Pages = true;
clone = theForm.cloneNode(true); // deep copy is important (reference is not enough!)
clone[0].value = "ctl00$ContentBody$pgrTop$ctl06";
$form = $(clone);
promises.push( promiseRequest('POST', $form.prop('action'), headers, $form.serialize()) );
}
var cache_objects = await Promise.all(promises);
return [cache_objects,next10Pages];
}
}
async function getMarkerCoordsAndUpdateMap() {
var markerCoords = $("input#markerCoords").val();
var coords = await parseCoordinates(markerCoords, true);
if (coords) {
if (AUTOTOUR_WEBAPI) {
await updateAutoTourMapWebAPI(coords._lat, coords._lon);
} else {
await updateAutoTourMap(coords._lat, coords._lon);
}
} else { // even a geocoding service cannot determine the coordinates
alert("'" + markerCoords + "' cannot be recognized as address.");
}
}
function addCheckUncheckAllLinks($div) {
var checkboxes = $div.find('input[type=checkbox]'),
$all_none = $('<span>')
.append(
$('<a style="cursor:pointer;">').html('<i>' + $.gctour.lang('settings.printview.logCounts')[1] + '</i>').click(function() {
checkboxes.prop('checked', true);
}))
.append(' / ')
.append(
$('<a style="cursor:pointer;">').html('<i>' + $.gctour.lang('settings.printview.logCounts')[0] + '</i>').click(function() {
checkboxes.prop('checked', false);
}))
.append($('<br>'));
$all_none.insertBefore($div.find('span:first'));
$div.find('a')
.css({
'color' : '#00447c',
'text-decoration' : 'underline'
})
.hover(function() {
$(this).css("color", "#6c8e10");
}, function() {
$(this).css("color", "#00447c");
});
}
function getSpecialFilter() {
var $div,
$checkbox,
$favorites,
attributs,
checkbox_specials = {
'I haven\'t found ' : $.gctour.lang('autoTour.filter.special.notfound'),
'is Active' : $.gctour.lang('autoTour.filter.special.isActive')
},
initial = '{"I haven\'t found ":false,"is Active":false,"pm":"all","minFavorites":"0"}',
tq_filter = JSON.parse(GM_getValue('tq_specialFilter', initial));
$div = $('<div>')
.html("<b>" + $.gctour.lang('autoTour.filter.special.caption') + "</b><br/>")
.css({
"padding-right" : "10px"
});
// PM
let $radio = $(
'<div id="special_pm">' +
' <input type="radio" id="all" name="membership" value="all">' +
' <label for="all">' + $.gctour.lang('autoTour.filter.special.pm.all')+'</label>' +
' <input type="radio" id="basic" name="membership" value="basic">' +
' <label for="basic">' + $.gctour.lang('autoTour.filter.special.pm.basic')+'</label>' +
' <input type="radio" id="premium" name="membership" value="premium">' +
' <label for="premium">' + $.gctour.lang('autoTour.filter.special.pm.premium')+'</label>' +
'</div>'
);
// mapping of old filter ids to new ids
if (!tq_filter["pm"]) tq_filter["pm"] = "all"; // no filter for PM available, use default value
else {
let idMap = { "ignore": "all", "not": "basic", "only": "premium" };
for (let key in idMap) {
if (key == tq_filter["pm"]) {
tq_filter["pm"] = idMap[key];
break;
}
}
}
$('#' + tq_filter["pm"], $radio).prop("checked", true);
$div.append($radio, $('<br>'));
// not found, active
$.each(checkbox_specials, function(key, value) {
attributs = {
type : 'checkbox',
name : "special",
class : "gctour-input-checkbox",
id : "special" + key,
value : key,
checked : tq_filter[key] ? 'checked' : false
};
$checkbox = $('<span>')
.css({
"margin" : "2px",
"vertical-align" : "middle"
})
.append(
$('<input/>', attributs).css({
"margin" : "0 4px 0 0"
}),
$('<label>')
.attr({
"for" : "special" + key,
"class" : "gctour-label"
})
.text(value));
$div.append(
$checkbox,
$('<br>'));
});
// min favorites
$favorites = $('<input>', {
type : 'text',
id : 'special_favorites',
class : 'gctour-input-text',
value : tq_filter['minFavorites']
}).css({
'margin' : '4px 0 0 4px',
'width' : '40px'
});
$div.append(
$('<span>').text($.gctour.lang('autoTour.filter.special.minFavorites')),
$favorites,
$('<br>'));
return $div;
}
function getDtFilter(boxName) {
var $div,
$checkbox,
attributs,
tq_filter,
initial = '{"1":true,"2":true,"3":true,"4":true,"5":true,"1.5":true,"2.5":true,"3.5":true,"4.5":true}',
title;
if (boxName == 'Difficulty') {
tq_filter = JSON.parse(GM_getValue('tq_dFilter', initial));
title = $.gctour.lang('autoTour.filter.difficulty');
} else { // terrain
tq_filter = JSON.parse(GM_getValue('tq_tFilter', initial));
title = $.gctour.lang('autoTour.filter.terrain');
}
$div = $('<div>')
.html("<b>" + title + "</b><br/>");
for (var i = 1; i <= 5; i = i + 0.5) {
attributs = {
type : 'checkbox',
name : boxName,
class : "gctour-input-checkbox",
id : boxName + "" + i,
value : i,
checked : tq_filter["" + i] ? 'checked' : false
};
$checkbox = $('<span>')
.css({
"margin" : "2px",
"vertical-align" : "middle"
})
.append(
$('<input/>', attributs).css({
"margin" : "0 2px 0 0"
}),
$('<label>').attr({
"for" : boxName + "" + i,
"class" : "gctour-label"
})
.append(
$('<img>').attr("src", GS_HOST + "images/stars/stars" + ("" + i).replace(/\./g, "_") + ".gif").css({
"vertical-align" : "unset"
})));
$div.append(
$checkbox,
$('<br>'));
}
addCheckUncheckAllLinks($div);
return $div;
}
function getSizeFilter() {
var $div,
$checkbox,
attributs,
initial = '{"micro":true,"small":true,"regular":true,"large":true,"other":true,"not_chosen":true,"virtual":true}',
tq_filter = JSON.parse(GM_getValue('tq_sizeFilter', initial));
$div = $('<div>')
.html("<b>" + $.gctour.lang('autoTour.filter.size') + "</b><br/>");
$.each(SIZES_ARRAY, function(index, size) {
attributs = {
type : 'checkbox',
name : "size",
class : "gctour-input-checkbox",
id : "size" + size.sizeTypeId,
value : size.sizeTypeId,
checked : tq_filter[size.sizeTypeId] ? 'checked' : false
};
$checkbox = $('<span>')
.css({
"margin" : "2px",
"vertical-align" : "middle"
})
.append(
$('<input/>', attributs).css({
"margin" : "0 2px 0 0"
}),
$('<label>').attr({
"for" : "size" + size.sizeTypeId,
"class" : "gctour-label"
})
.append(
$('<img>').attr({
"src": GS_HOST + 'images/icons/container/' + size.sizeTypeId + '.gif',
"title": size.name
}).css({
"vertical-align" : "unset"
})));
$div.append(
$checkbox,
$('<br>'));
});
addCheckUncheckAllLinks($div);
return $div;
}
function getTypeFilter() {
var $div,
$checkbox,
attributs,
boo,
initial = '{"2":true,"3":true,"4":true,"5":true,"6":true,"8":true,"9":true,"11":true,"12":true,"13":true,"137":true,"453":true,"1304":true,"1858":true,"3653":true,"3773":true,"3774":true,"4738":true,"7005":true}',
tq_filter = JSON.parse(GM_getValue('tq_typeFilter', initial));
$div = $('<div>')
.html("<b>" + $.gctour.lang('autoTour.filter.type') + "</b><br/>")
.css({
"padding-left" : "10px"
});
$.each(WPT_ARRAY, function(index, wpt) {
attributs = {
type : 'checkbox',
name : "type",
class : "gctour-input-checkbox",
id : "type" + wpt.wptTypeId,
value : wpt.wptTypeId,
checked : tq_filter[wpt.wptTypeId] ? 'checked' : false
};
boo = ((index + 1) % 2 === 0); // letzter in seiner Spalte ?
$checkbox = $('<span>')
.css("padding-left", boo ? "10px" : "0px")
.append(
$('<input/>', attributs).css({
"margin" : "0 2px 0 0"
}),
$('<label>').attr({
"for" : "type" + wpt.wptTypeId,
"class" : "gctour-label"
})
.append(
$('<img>').attr({
"src": GS_HOST + GS_WPT_IMAGE_PATH + wpt.wptTypeId + '.gif',
"title": wpt.name
}).css({
"vertical-align" : "unset"
})));
$div.append(
$checkbox,
(boo ? $('<br>') : ""));
});
addCheckUncheckAllLinks($div);
return $div;
}
function getCoordinatesTab() {
var coordsDiv = $("<div>", {
id : "coordsDiv"
});
// km or miles
let km_selected = 'selected="selected"';
let miles_selected = '';
if (GS_USERINFO.unitSetName === "Imperial") {
km_selected = '';
miles_selected = 'selected="selected"';
}
var grid =
'<div style="display: grid;grid-template-columns: 13% auto auto;grid-template-rows: 18px auto auto;">' +
' <div><b>' + $.gctour.lang('autoTour.center') + ':</b></div>' +
' <div>' +
' <input type="text" id="markerCoords" class="gctour-input-text" style="width:200px;margin:0;" placeholder="Coordinates, address">' +
' <button id="autoTour_locateme" style="font-size: 12px; cursor: pointer; height: 18px;">' +
' <img id="locateImage" src="'+$.gctour.img.locateMe+'" style="height: 12px;">' +
' <span style="vertical-align:top;margin-left:3px;">'+$.gctour.lang('general.findMe')+'</span>' +
' </button>' +
' </div>' +
' <div style="justify-self: end;" id="divStartQuery">'+
' <button id="autoTour_refresh" style="display: none; font-size: 12px; cursor: pointer; height: 35px;">' +
' <img src="'+$.gctour.img.update+'" style="height: 12px;">' +
' <span style="vertical-align:top;margin-left:3px;">'+$.gctour.lang('autoTour.refresh')+'</span>' +
' </button>' +
' </div>' +
' <div style="grid-column: 1 / 4;margin-top: 7px;"></div>' + // empty row for some space
' <div><b>' + $.gctour.lang('autoTour.radius') + ':</b></div>' +
' <div>' +
' <input type="text" id="markerRadius" class="gctour-input-text" maxlength="4" value="2" style="width:40px;margin-right:5px;margin-top:0;margin-bottom:0;">' +
' <select id="markerRadiusUnit">' +
' <option value="km" ' + km_selected + '>' + $.gctour.lang('units.km') + '</option>' +
' <option value="mi" ' + miles_selected + '>' + $.gctour.lang('units.mi') + '</option>' +
' </select>' +
' </div>' +
'</div>';
coordsDiv.append(grid);
// add autoTour start button
$('div#divStartQuery',coordsDiv).append(getAutoTourSubmit());
// toggle visibility of start and update buttons
$('input#markerCoords, input#markerRadius, select#markerRadiusUnit',coordsDiv).on('input', function() {
$('button#startQuery').css('display','none');
$('button#autoTour_refresh').css('display','block');
});
// add click events to buttons
$('button#autoTour_refresh',coordsDiv).on('click', function() {
getMarkerCoordsAndUpdateMap();
// toggle visibility of start and update buttons
$('button#startQuery').css('display','block');
$('button#autoTour_refresh').css('display','none');
});
$('button#autoTour_locateme',coordsDiv).on('click', function() {
if (navigator.geolocation) {
$('locateImage').attr("src", $.gctour.img.loader3);
navigator.geolocation.getCurrentPosition(
function(position) {
$('locateImage').attr("src", $.gctour.img.locateMe);
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
$("input#markerCoords").val(new LatLon(latitude, longitude).toString()).trigger('input');
},
function(error) {
$('locateImage').attr("src", $.gctour.img.locateMe);
log('Unable to get current location: ' + error.message);
},
{ timeout: 10000 }
);
} else {
alert("Sorry, your browser does not support geolocation.");
}
});
// add syntax check for radius input
$('input#markerRadius',coordsDiv).on('keydown keypress keyup paste input', function() {
this.value = this.value.replace(/,/g,".").replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');
});
return coordsDiv;
}
function getMapPreviewTab() {
// parent div
var previewDiv = createElement('div');
// hidden child items
var coordsInputLat = createElement('input', {
type : 'hidden',
id : "coordsDivLat"
});
previewDiv.appendChild(coordsInputLat);
var coordsInputLon = createElement('input', {
type : 'hidden',
id : "coordsDivLon"
});
previewDiv.appendChild(coordsInputLon);
var coordsInputRadius = createElement('input', {
type : 'hidden',
id : "coordsDivRadius"
});
previewDiv.appendChild(coordsInputRadius);
// center, radius, cache count and duration preview
var grid = createElement('div', {
style: "display: grid;grid-template-columns: auto auto auto auto;"
});
var center = createElement('div');
center.innerHTML = $.gctour.lang('marker.coord') + ": <b id='markerCoordsPreview'>???</b>";
grid.appendChild(center);
var radius = createElement('div');
radius.innerHTML = $.gctour.lang('autoTour.radius') + ": <b id='markerRadiusPreview'>???km</b>";
grid.appendChild(radius);
var cacheCount = createElement('div');
cacheCount.innerHTML = $.gctour.lang('autoTour.cacheCounts') + ": <b id='markerCountPreview'>???</b>";
grid.appendChild(cacheCount);
var duration = createElement('div');
duration.innerHTML = $.gctour.lang('autoTour.duration') + ": <b id='markerDurationMin'>???</b> min <b id='markerDurationSec'>???</b> s";
grid.appendChild(duration);
previewDiv.appendChild(grid);
// previewMap
var leafletMap = createElement('div', {
style: "margin-bottom: 10px;"
});
leafletMap.id = 'gct-leafletMap';
previewDiv.appendChild(leafletMap);
return previewDiv;
}
function getAutoTourSubmit() {
var $submit = $("<button>", {
id: "startQuery",
title: "start autoTour",
css: {
"opacity": "0.4",
"margin": "auto",
"display": "block"
},
"disabled": "disabled",
html: "<img src ='" + $.gctour.img.startAutoTour + "'>"
})
.on('click', (AUTOTOUR_WEBAPI ? startAutoTourWebAPI : startAutoTour));
return $submit;
}
async function showAutoTourDialog(center, radius) {
var overLay = getOverlay({
caption : '<b>' + $.gctour.lang('autoTour.title') + '</b>',
minimized : true
});
$(overLay).append(
getCoordinatesTab(),
$("<div>", {
id : "autoTourContainer",
css : {
"display" : "none",
"clear" : "both",
"border-top" : "2px dashed #B2D4F3",
"margin-top" : 5
}
}).append(
getMapPreviewTab(),
$("<div>", {
css : {
"display": "grid",
"background": "lightgrey"
}
}).append(
$("<div>", {
css : {
"justify-self": "center"
}
}).html('<b style="font-size: 1.2em;">'+$.gctour.lang('autoTour.filterLabel')+'</b>')
),
$('<div>', {
css : {
"background-color": "lightyellow",
"display": "grid",
"grid-template-columns": "auto auto auto auto auto",
"grid-column-gap": "10px"
}
}).append(
getTypeFilter(),
getSizeFilter(),
getDtFilter('Difficulty'),
getDtFilter('Terrain'),
getSpecialFilter())
));
if (center && radius) {
$("input#markerCoords").val(new LatLon(center.lat, center.lng).toString());
if (GS_USERINFO.unitSetName === "Imperial") {
radius *= 0.621371; // miles
}
$("input#markerRadius").val(Math.round((Number(radius) + Number.EPSILON) * 100) / 100); // restrict to 2 decimals
} else {
$("input#markerRadius").val(2);
// on cache page get center point from cache coordinates, else from profile settings
var latlon;
if (!(latlon = $('span#uxLatLon').text()))
latlon = await getHomeCoords();
$('input#markerCoords').val(latlon);
}
// create map
let $map = $('div#gct-leafletMap');
let options = {};
options.id = 'gct-autoTour-map',
options.center = [0,0];
options.height = '350px';
options.map = 'gm';
options.anchor = $map;
LM = new LeafletMap(options);
getMarkerCoordsAndUpdateMap();
}
// waypoint projection, earth approx. as sphere (now working in northern and southern hemisphere)
function CalcPrjWP(lat, lon, dist, angle) {
var lat1 = parseFloat(lat), // degree
lon1 = parseFloat(lon), // degree
Dist = parseFloat(dist), // miles
Angle = parseFloat(angle), // degree
d,
R,
mile,
lat2,
lon2;
while (Angle > 360) {
Angle = Angle - 360;
}
while (Angle < 0) {
Angle = Angle + 360;
}
// calculations in rad
lat1 = lat1 / 180 * Math.PI;
lon1 = lon1 / 180 * Math.PI;
Angle = Angle / 180 * Math.PI;
R = 6371.0; // mean earth radius in km
mile = 1.609344;
d = Dist * mile / R; // distance in km
lat2 = Math.asin(Math.sin(lat1) * Math.cos(d) + Math.cos(lat1) * Math.sin(d) * Math.cos(-Angle));
if (Math.cos(lat1) == 0) {
lon2 = lon1;
} else {
lon2 = (lon1 - Math.asin(Math.sin(-Angle) * Math.sin(d) / Math.cos(lat1)) + Math.PI) % (2 * Math.PI) - Math.PI;
}
// results in deg
lat2 = lat2 / Math.PI * 180;
lon2 = lon2 / Math.PI * 180;
return [Math.round(lat2 * 100000) / 100000, Math.round(lon2 * 100000) / 100000];
}
// get home coordinates from GS Web API
async function getHomeCoords() {
try {
let url = GS_WEB_API + 'webuser';
let headers = { 'Accept': 'application/json' };
let response = await promiseRequest("GET", url, headers);
let obj = JSON.parse(response.responseText);
let latLon = new LatLon(obj.homeCoordinate.latitude, obj.homeCoordinate.longitude);
let homeCoords = latLon.toString("dm");
return homeCoords;
} catch(e) {
// fallback
log('getHomeCoords error: "' + e + '"\nusing default coordinates');
return "N 49°26.082 E 007°46.587";
}
};
// compare script version strings: if a > b return true else return false
function isNewVersion(a, b) {
if (a === b) {
return false;
}
var a_components = a.split(".");
var b_components = b.split(".");
var len = Math.min(a_components.length, b_components.length);
// loop while the components are equal
for (var i = 0; i < len; i++) {
// A bigger than B
if (parseInt(a_components[i]) > parseInt(b_components[i])) {
return true;
}
// B bigger than A
if (parseInt(a_components[i]) < parseInt(b_components[i])) {
return false;
}
}
// if one is a prefix of the other, the longer one is bigger
if (a_components.length > b_components.length) {
return true;
}
if (a_components.length < b_components.length) {
return false;
}
}
// Show changelog hint
function changelog() {
let div = '<div id="gct_changelog" style="width:100vw;background-color:#e0b70a;vertical-align:middle;text-align:center;display:table-cell;font-size:0.8rem;">'
+ $.gctour.lang('dlg.newVersion.changelog')
+ '<a href="https://gist.github.com/DieBatzen/5814dc7368c1034470c8/raw/gctour.zChangelog.txt" target="_blank">Changelog</a>'
+ '<img id="gct_close_changelog" title="' + $.gctour.lang('general.close') + '" style="cursor: pointer;float: right;margin-right: 10px;margin-top: 5px;" src="' + $.gctour.img.closebutton + '">'
+ '</div>';
$('body').prepend(div);
$('nav#gcNavigation').attr('style', 'position:static !important;font-size: 0.8rem;');
$('img#gct_close_changelog').click(function() {
$('div#gct_changelog').remove();
});
}
// installation counter and Changelog (idea from GC little helper II: https://github.com/2Abendsegler/GClh)
function instCount() {
let ver = GM_getValue("version","0");
if (isNewVersion(VERSION, ver)) { // script has been updated
GM_setValue("version",VERSION);
// show Changelog hint
setTimeout(function() { changelog(); }, 5000);
// counter
//$(document.body).append('<div id="gct_counter1"><img src="https://www.worldflagcounter.com/dVE" style="visibility:hidden;"></div>');
//setTimeout(function() { $("#gct_counter1").remove(); }, 3000);
$(document.body).append('<div id="gct_counter2"><img referrerpolicy="no-referrer" src="https://s01.flagcounter.com/count2/JuKQ/bg_FFFFFF/txt_000000/border_CCCCCC/columns_2/maxflags_250/viewers_4.30/labels_1/pageviews_1/flags_0/percent_0/" style="visibility:hidden;"></div>');
setTimeout(function() { $("#gct_counter2").remove(); }, 3000);
}
}
// update notifier for Gist repository
async function update(force) {
var updateURL = GM_info.scriptMetaStr.split('updateURL')[1].split('// @')[0].trim();
var downloadURL = GM_info.scriptMetaStr.split('downloadURL')[1].split('// @')[0].trim();
var updateDate = new Date(GM_getValue('updateDate'));
if (!updateDate || updateDate == "Invalid Date") {
updateDate = new Date();
GM_setValue('updateDate', updateDate.toString());
}
instCount();
var currentDate = new Date();
// if the last update check is more than 86 400 000 msec (1 day) ago - check for updates
if ((currentDate.getTime() - updateDate.getTime() > 86400000) || (force === true)) {
// set the new updateDate
GM_setValue('updateDate', currentDate.toString());
var response = await promiseRequest('GET', updateURL);
var text = response.responseText;
var ver_gist = text.split("version")[1].split("//")[0].trim();
if (!isNewVersion(ver_gist,VERSION)) { // no update available
log("update check: version " + VERSION + " is up to date");
if (force === true) {
alert($.gctour.lang('update.upToDate'));
}
return;
}
var overlayBody = getOverlay({
caption : $.gctour.lang('dlg.newVersion.caption'),
minimized : true
});
var updateMapping = [
['VERSION_OLD', VERSION],
['VERSION_NEW', ver_gist]
];
var confirmString = $.gctour.lang('update.dialog');
var update_dom = fillTemplate(updateMapping, confirmString);
var footer = update_dom.getElementsByTagName('div')[update_dom.getElementsByTagName('div').length - 1];
// if install is pressed set the document.location to the update url
var install_button = document.createElement('input');
install_button.type = "button";
install_button.value = $.gctour.lang('general.install');
install_button.style.backgroundImage = "url(" + $.gctour.img.userscript + ")";
install_button.addEventListener('click', function() {
setTimeout(closeOverlay, 500);
document.location = downloadURL;
}, true);
var close_button = document.createElement('input');
close_button.type = "button";
close_button.value = $.gctour.lang('general.cancel');
close_button.style.backgroundImage = "url(" + $.gctour.img.closebutton + ")";
close_button.addEventListener('click', closeOverlay, false);
footer.appendChild(close_button);
footer.appendChild(install_button);
overlayBody.appendChild(update_dom);
}
}
/* helper */
// Funktion, die in einem String die Wildcard {0},{1},{2}... mit den Paramtern von String.format ersetzt!
String.prototype.format = function() {
var s = this;
for (var i = 0; i < arguments.length; i++) {
var reg = new RegExp("\\{" + i + "\\}", "gm");
s = s.replace(reg, arguments[i]);
}
return s;
}
// Convert HTML breaks to spaces
String.prototype.br2space = function() {
return this.replace(/<br\s*\/?>/mg, " ");
}
// Return a new string without leading and trailing whitespace
// Double spaces within the string are removed as well
String.prototype.trimAll = function() {
return this.replace(/^\s+|(\s+(?!\S))/mg, "");
}
// replace all occurrences of str1 by str2 inside a string; optionally ignore case
// (http://dumpsite.com/forum/index.php?topic=4.msg29#msg29)
String.prototype.replaceAll = function(str1, str2, ignoreCase) {
return this.replace(new RegExp(str1.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g,"\\$&"),(ignoreCase?"gi":"g")),(typeof(str2)=="string")?str2.replace(/\$/g,"$$$$"):str2);
}
function gmNotice() {
let str_DE =
'<span>' +
'Ab Firefox Version 57, die Mitte November 2017 ansteht, wird GCTour mit Greasemonkey nicht mehr funktionieren. Den Grund dafür kann man hier nachlesen: ' +
'<a href="http://www.greasespot.net/2017/09/greasemonkey-4-announcement.html" target="_blank">Link.</a><br><br>' +
'Einfache Lösung: in Firefox eine andere Erweiterung für Userskripte verwenden, z.B. <a href="https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/" target="_blank">Tampermonkey</a>. ' +
'Damit läuft GCTour weiterhin einwandfrei.<br>' +
'<ol><li>Zuerst alle GCTour-Einstellungen, inklusive aller Touren sichern (NEU): "Einstellungen - Export/Import - Export"' +
'<li>Greasemonkey deinstallieren oder deaktivieren ("about:addons")' +
'<li>Tampermonkey installieren: <a href="https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/" target="_blank">Tampermonkey</a>' +
'<li>GCTour neu installieren: <a href="' + GCTOUR_HOST + 'files/gctour.user.js" target="_blank">GCTour</a>' +
'<li>Alle GCTour-Einstellungen, inklusive aller Touren wiederherstellen (NEU): "Einstellungen - Export/Import - Import"' +
'</ol>' +
'</span>';
let str_EN =
'<span>' +
'As of Firefox version 57 in mid-November 2017, GCTour will no longer work with Greasemonkey. The reason for this can be read here: ' +
'<a href="http://www.greasespot.net/2017/09/greasemonkey-4-announcement.html" target="_blank">Link.</a><br><br>' +
'Simple solution: in Firefox use another extension for user scripts, for example <a href="https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/" target="_blank">Tampermonkey</a>. ' +
'Thus GCTour continues to run flawlessly.<br>' +
'<ol><li>First save all GCTour settings, including all tours (NEW): "Settings - Export/Import - Export".' +
'<li>Uninstall or deactivate Greasemonkey ("about:addons")' +
'<li>Install Tampermonkey: <a href="https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/" target="_blank">Tampermonkey</a>' +
'<li>Reinstall GCTour: <a href="' + GCTOUR_HOST + 'files/gctour.user.js" target="_blank">GCTour</a>' +
'<li>Restore all GCTour settings, including all tours (NEW): "Settings - Export/Import - Import"' +
'</ol>' +
'</span>';
let str = str_DE + '<hr>' + str_EN;
$('<div>'+str+'</div>').dialog($.gctour.dialog.info(),{title: 'Hinweis / Notice',width: '75%',maxHeight: $(window).height() - 50});
$(".ui-button span").text($.gctour.lang('general.close'));
}
// try to get GS user info in that order:
// 1) if user info is embedded in page, no need to fetch:
// i) serverParameters["user:info"] (old pages)
// ii) _gcUser (new pages)
// 2) fetch by webAPI (identical info as 1ii)
// 3) fetch from play/serverparameters/params (identical info as 1i)
// 4) fetch from play/dataparameters/datalayer and account/settings/preferences
// 5) if 1-4 all fail set default values
async function getGSUserInfo() {
log_timeStart('getGSUserInfo');
try { // 1i)
GS_USERINFO = unsafeWindow.serverParameters["user:info"];
} catch (e) { // 1ii)
try {
GS_USERINFO = unsafeWindow._gcUser;
GS_USERINFO.userType = GS_USERINFO.membershipLevel === 1 ? "Basic" : "Premium";
GS_USERINFO.isLoggedIn = true;
GS_USERINFO.unitSetName = GS_USERINFO.distanceUnit === 2 ? "Imperial" : "Metric";
} catch (e) { // 2)
log("fn getGSUserInfo - user info not embedded in page --> fetch from webAPI");
GS_USERINFO = {};
try {
let url = GS_WEB_API + 'webuser',
header = { 'Content-Type': 'application/json' };
let response = await promiseRequest("GET", url, header);
let obj = JSON.parse(response.responseText);
GS_USERINFO.dateFormat = obj.dateFormat;
GS_USERINFO.userType = obj.membershipLevel === 1 ? "Basic" : "Premium";
GS_USERINFO.isLoggedIn = true;
GS_USERINFO.unitSetName = obj.distanceUnit === 2 ? "Imperial" : "Metric";
} catch (e) { // 3)
log("fn getGSUserInfo - fetching from webAPI unsuccessful --> fetch from play/serverparameters/params");
try {
let response = await promiseRequest('GET', GS_HOST + 'play/serverparameters/params');
let serverParameters = response.responseText.split("=")[1].split(";")[0].trim();
GS_USERINFO = JSON.parse(serverParameters)["user:info"];
} catch (e) { // 4)
log("fn getGSUserInfo - fetching from play/serverparameters/params unsuccessful --> fetch from play/dataparameters/datalayer");
try {
let response = await promiseRequest('GET', GS_HOST + 'play/dataparameters/datalayer');
let datalayer = response.responseText.split("=")[1].split(";")[0].trim();
GS_USERINFO.userType = JSON.parse(datalayer)[0].membershipLevel;
GS_USERINFO.isLoggedIn = GS_USERINFO.userType != null ? true : false;
// dateFormat and unitSetName need to be fetched separately
response = await promiseRequest('GET', GS_HOST + 'account/settings/preferences');
GS_USERINFO.dateFormat = $('select#SelectedDateFormat option:selected', response.responseText).val();
GS_USERINFO.unitSetName = $('input#DistanceUnits:checked', response.responseText).val();
} catch (e) { // 4)
log("fn getGSUserInfo - failed to retrieve user info");
GS_USERINFO.dateFormat = "";
GS_USERINFO.userType = "";
GS_USERINFO.isLoggedIn = "";
GS_USERINFO.unitSetName = "";
}
}
}
}
}
log_timeEnd('getGSUserInfo');
}
// when uploading to GCTour server in order to store into db, then
// - replace all empty string entries by " "
// - replace all empty float entries by "0.0"
// - replace all int index entries by corresponding string
// - remove all emojis from name entries
// otherwise GCTour server tries to insert NULL into db or values get invalid --> error
function handleEmptyValuesForUpload(obj) {
// see gctour.sql for all available db entries
let strArr = ["id","gcid","guid","name","type","wptcode","lookup","note","content","image","symbol","prefix"];
let floatArr = ["difficulty","terrain","latitude","longitude"];
let intArr = ["index"];
// see https://www.regextester.com/106421
let emojiRange = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g;
for (var k in obj) {
if (typeof obj[k] == "object" && obj[k] !== null) handleEmptyValuesForUpload(obj[k]); // recursion
else if (!obj[k] && strArr.includes(k)) obj[k] = " ";
else if (!obj[k] && floatArr.includes(k)) obj[k] = "0.0";
else if (intArr.includes(k)) obj[k] = obj[k].toString();
else if (k === "name") {
obj[k] = obj[k].replace(emojiRange,'').trim(); // remove all emojis from names
if (obj[k].length === 0) obj[k] = " "; // special case: name was all emojis
}
}
return obj;
}
// copy to clipboard
function copyToClipboard(str) {
const el = document.createElement('textarea');
el.value = str;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
}
// delay code execution: await sleep(1000)
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
// main
// don't run on frames or iframes
if (window.top !== window.self) {
return;
}
(async function main() {
try {
// load time
log_timeStart('init main');
// wait until retrieval of user info is finished
await getGSUserInfo();
// still necessary to check for Opera???
if (IS_OPERA) {
// wait until document is loaded and init the core components (first tour, current tour)
window.addEventListener('DOMContentLoaded', function() {
initCore();
init();
}, true);
} else {
// init the core components (first tour, current tour)
initCore();
init();
}
// load time
log_timeEnd('init main');
// check for script update
update();
// get token for the WebAPI
// - either from current page (cache listings contain the token)
// - or from account settings page
TOKEN = $('input[name=__RequestVerificationToken]').val();
if (!TOKEN) {
let resp = await promiseRequest('GET', GS_HOST + 'account/settings/profile');
TOKEN = $('input[name=__RequestVerificationToken]', resp.responseText).val();
}
if (IS_GREASEMONKEY && GM_getValue('gm_notice', 'null') === 'null') { // not set
GM_setValue('gm_notice', false);
gmNotice();
};
} catch (e) {
addErrorDialog({
caption: "error in main",
_exception: e
});
}
})();
})(); // end of of immediately-invoked function expression
// ==UserScript==
// @version 4.30
// ==/UserScript==
4.30
FIX:
- Bookmark lists: fix missing add to tour buttons after GS tech migrations
- New search page: fix nonfunctional add to tour buttons after GS tech migrations
CHANGE:
- Various small code improvements
4.29
NEW:
- Settings: New map "OSM Outdoors" available as default map type
FIX:
- New search page: if the result sorting is changed then the "add to tour" buttons add wrong caches to the tour
CHANGE:
- autoTour: distance unit (Metric/Imperial) now automatically selected according to GS profile setting
- Various small code improvements
4.28
NEW:
- Tour header: button to sort tour alphabetically by name
CHANGE:
- Bookmark lists: a changed tour name now gets synchronized to the bookmark list name when updating the list
4.27.1
CHANGE:
- Improvement in handling bookmark lists
4.27
FIX:
- Bookmark lists in main menu don't work anymore
- add own waypoints to tour nonfunctional
- send2Garmin nonfunctional
CHANGE:
- small layout improvements
4.26.1
FIX:
- Print preview: favorite scores are missing
4.26
FIX:
- Print preview:
- error when fetching favorite score (caused by a Groundspeak bug) prevents print preview generation;
now print preview is generated nevertheless and missing favorite scores are skipped
- Bookmark lists:
- add2tour buttons for single caches are missing
- add all selected caches to new/current tour doesn't work anymore
- Search map:
- buttons to add caches to new/current tour vanish on map layer change
- adding caches from bookmark lists causes error
(switch to My Lists, select a list, switch back to Search, add all caches to new/current)
CHANGE:
- some minor changes
4.25
NEW:
- New search page: add caches to current or new tour
FIX:
- Update bookmark list: better handling of own marker
CHANGE:
- Download tour: local tour now gets updated if it already exists (before tour got duplicated)
4.24
FIX:
- Browse map: add to tour from cache pop-up not working when cachetur script running in parallel
- Print preview and GPX download: missing logs
4.23
FIX:
- handling of caches with invalid GC code (probably retracted listing)
- some minor improvements
4.22
FIX:
- Browse map: autoTour button was sometimes missing
- Print preview: personal cache note was missing
CHANGE:
- autoTour: switch of PM filter option from select to radio buttons
- other small code improvements
4.21
FIX:
- search and browse map: autoTour button was missing on map view
- GPX export: DNF logs counted as Found
CHANGE:
- search Map: do not show buttons "add to new/current tour" in My Lists view
- other small improvements
4.20
FIX:
- owner names were missing in print preview and GPX download
CHANGES:
- overlay dialogs (e.g. autoTour) are now draggable and can be closed by ESC button
4.19
- FIX: on search map, add all caches to new or current tour didn't work anymore
- FIX: on search map, when running GC little helper script in parallel, two autoTour buttons were shown from time to time
(thanks to 2Abendsegler for the catch and fix)
- CHANGE: autoTour
- code refactoring, much faster now
- all filters functional again
- max. 1000 caches possible (GS restriction)
- CHANGE: show tour on map: if tour has already been uploaded to GCTour server, show on map now makes use of existing tour link
(instead of uploading tour again); map is shown much faster now
4.18
- NEW: four new cache attributes added by GS (Bonus cache, Power trail, Challenge cache, Geocaching.com solution checker) are available in Printview and GPX download
- NEW: optional removal of several cache table columns (D/T/S/L4L/Fav/Found/Note) in print preview; can be specified in GCTour Settings - Printview (last entry)
- FIX: missing "add2tour buttons" in bookmark lists if script "send2cgeo" is running in parallel
4.17
- FIX: search map (https://www.geocaching.com/play/map): autoTour and add to tour buttons were missing
- CHANGE: autoTour: layout improvements
4.16
- NEW: button to copy webcode of uploaded tour to clipboard
- FIX: autoTour didn't work when send2cgeo script is active in parallel
- FIX: Bookmark lists, autoTour from pages other than maps and send to garmin didn't work anymore after GS website update
- CHANGE: notification dialogs unified to the "add cache to tour" notification format
4.15
- FIX: autoTour didn't always work after GS website update
- FIX: Print View didn't always work after GS website update
- FIX: Search Map: autoTour button wasn't visible anymore
- FIX: Main Window: shortcut for saving GCTour settings didn't work
- FIX: sometimes GS pop-ups were not clickable
- CHANGE: Print View: keep line breaks in geocache hints
- CHANGE: code cleaning
4.14.1
- FIX: revert option to show 1000 caches in bookmark lists
(reason: GS now limits the number to 500 on the server side)
4.14
- NEW: Existing bookmark lists for a tour can now be updated from within tour list
- pressing "Save as bookmark list" either creates a new or updates an already existing bookmark list
- NEW: In bookmark lists it's now possible to show 1000 (=all) caches at once
- FIX: Necessary adaptations to new GS bookmark lists pages (GS is still making changes but seems to be almost finished):
- buttons to add all/selected caches to new/current tour didn't work anymore
- layout adaptations
- CHANGE: send2garmin improvements (under the hood)
- CHANGE: more small improvements and code cleaning
4.13
- FIX: necessary changes after GCTour server update for
- tour upload
- print preview
- show tour on map
- CHANGE: some code cleaning
4.12
- FIX: GCTour server moved
- FIX: character "%" in cache names caused an error in "send2GPS" and "createBookmarklist"
- CHANGE: other small improvements
4.11
- FIX: GPX download and tour print didn't work anymore after Groundspeak retired the old search page
- FIX: Firefox update broke autoTour
- FIX: in GPX download PMO caches caused an error for BM
- CHANGE: improved buttons to add all/marked caches to current/new tour on bookmark and old search lists
4.10
- NEW: GCTour now supports the new search map: https://www.geocaching.com/play/map
(Note: Groundspeak is still working on the new search map, therefore changes may occur at any time)
- autoTour
- add all search results to new or current tour
- add cache to current tour from cache details view in sidebar
- FIX: unpublished own cache listings: print preview didn't work properly
- CHANGE: code cleaning and minor improvements throughout many functions
4.9.1
- FIX: timeout issue for some requests (e.g. GPX download)
4.9
- CHANGE: Google changed their license model for several services (e.g. maps and geocoding). Therefore it was necessary to replace them:
- static maps: now Leaflet (open-source JavaScript library for interactive maps)
- affected functions: autoTour, change coordinates in cache listings, create own waypoints in tours
- Geocoding: now OSM based
- affected function: autoTour
- CHANGE: bookmark list: "add to tour" button now in 1st column; thus the same as in old search page
- FIX: PRINTVIEW: personal cache note was missing (reason: GS changes is cache listings)
- FIX: old search page: "add to tour" button now in 1st column (GS removed the "Send To GPS column")
- MISC: improved error handling
4.8.2
- FIX: GS changed cache type images in listings to svg (previously: gif)
- CHANGE: Improved handling of special HTML chars (<,&) in cache names
4.8.1
Due to GS changes on the website, confirmation dialogs were partly ill formatted
4.8
PRINTVIEW:
- NEW: for cache waypoints the waypoint code is now shown in front of the name
- NEW: page width can now be changed with a slider interactively
- FIX: font size of noprint parts wasn't always appropriate
- CHANGE: minor layout optimizations
GPX:
- FIX: no logs when website language was set to Czech; now more robust and should work for all languages
MAP:
- FIX: add to tour did not work anymore when GCLH2 option "Enhanced Map Popup" was active
LISTING:
- FIX: add to tour didn't work anymore in unpublished cache listings
4.7
- NEW: tours can now be saved as bookmark list (https://www.geocaching.com/account/lists) from the GCTour main window
- by that, all apps that support bookmark lists (e.g. Groundspeak app, Geocaching4Locus) can transfer tours directly as lists
- links to bookmark lists (and thus tours) can be shared among users
- lists feature is sadly PMO (Groundspeak decision)
- NEW: after script update a notification and link to the Changelog is shown at the top of each page once
- CHANGE: Changelog removed from script; now available in Gist repository
- CHANGE: GPX download: fav score now only gets downloaded if really necessary (i.e. if the prefix option in GPX settings is active)
- CHANGE: printPreview
- listing waypoints now aligned properly in table of cache listing
- print preview could have been completely empty if caches and own waypoints were suppressed at the same time - not anymore
- now it's ensured that images and cache notes always fit in preview page
- in print settings, improved explanation for option to suppress caches and own waypoints
- MISC: some code refactoring
4.6.4
- FIX: GPX download stopped working due to changes in required external script "FileSaver.min.js" (only newer GCTour installations are affected)
4.6.3
- CHANGE: results from old search (seek/nearest.aspx) are now handled more robust - preparation for future changes (credits to 2Abendsegler)
- FIX: GPX: waypoint types were not correct anymore due to a change by GS (wpttypes is now WptTypes)
- MISC: some small code changes
4.6.2
- CHANGE: unneeded login-check removed
- FIX: if third-party cookies are not accepted by Firefox, GCTour does not work as expected
--> the error message now gives the user a hint
4.6.1
- FIX: a Groundspeak update changed the table structure of additional waypoints in listings slightly
--> GPX download and print didn't work anymore
4.6
- NEW: export/import of settings and tours in tab Preferences - Export/Import
- UPDATED: save settings info now redirects to export/import section in preferences
- FIX: autoTour: did not work properly for Tampermonkey in Firefox
- MISC: GCTour will not work anymore for the combination Firefox >= 57 and Greasemonkey >= 4
(http://www.greasespot.net/2017/09/greasemonkey-4-announcement.html)
- if you continue to run earlier versions of Firefox ensure that Greasemonkey version is less than 4.0
- however, GCTour is working flawlessly in Tampermonkey for both, Firefox and Chrome
- GCTour 4.6 shows a notice once
- new exclamation mark icon in GCTour main window to open notice again, only visible when running Greasemonkey
- GCTour icon changed to exclamation mark, only visible when running Greasemonkey
4.5.2
- FIX: autoTour: GS changed the header layout back ... now both, new and old layout should work
4.5.1
- FIX: autoTour: GS changed the way how home coordinates are stored in the user profile. Therefore autoTour didn't work any more as expected on sites other than the map site.
- FIX: autoTour: on maps page the autoTour button was missing (cause: GS changed the header of all pages)
4.5
- NEW: caches and own waypoints can now be moved to another tour
- NEW: GPX: option to show the favorite score in front of the cache name (when in Geocaching menu of GPSr)
- UPDATE: new tabs opened by GCTour will now be opened in foreground (FF+Chrome)
- FIX: tour upload: PMO caches were deleted from tour when user is basic member; now they stay in tour (still don't get uploaded) and user gets notification
- FIX: sometimes GCTour main window not resized correctly
- FIX: GPX: ASCII control codes in short and long description could result in invalid GPX files; they are now removed from descriptions
- FIX: GPX and printview: log dates now show visited date (before: created date):
a log can be created today but the cache has been visited 2 weeks ago
- FIX: GPX: in header, time is now correct UTC time (before: UTC was stated but local time was used)
4.4.1
- FIX: exception "Permission denied to access property Symbol.toPrimitive" (reason: simultaneous calls of loadValue/saveValue; credits to 2Abendsegler for figuring out)
4.4
- NEW: GCTour now supports Chrome
- UPDATED: new async/await feature replaces all spawn/function generator functions; now we really can write asynchronous code as it were synchronous!
- UPDATED: enhanced error handling
- FIX: printview: favorite scores were not displayed completely
4.3.1
- FIX: after bulk deleting caches from a bookmark list the add to tour buttons were missing (credits to 2Abendsegler for the fix)
- FIX: cancel of a tour upload did not always close the progress bar (especially if something went wrong)
4.3
- NEW: sending a tour to GPS receiver is now possible in 2 ways (can be configured in GCTour settings):
1) using Garmin Communicator Plugin (old)
2) using Garmin Express (new)
- FIX: GPX: attribute "Special Tool Required" was missing
4.2
- NEW: tours can now be sorted by drag and drop
- NEW: tour list window can now be moved
- UPDATED: improved handling for cache logs: fetching in parallel and fetching only if more than 25 logs are requested
- UPDATED: GPX: "new Blob([gpxString]" replaced by "new File([gpxString]"
- UPDATED: Send2GPS: Beginning in Firefox version 52, support for Garmin Communicator Plugin in Firefox has ended
- FIX: in stored tours, own waypoint icons could still point to madd.in's original GCTour web page;
meanwhile the pages are no longer accessible and therefore the icons were not shown any more
- MISC: some code polishing
4.1.4
- FIX: GPX: HTML code in cache logs (leftover from GS change to Markdown logs) caused an error
4.1.3
- FIX: GPX: GSAK did not handle additional cache waypoints as child waypoints during import of GPX files
- FIX: GPX: dollar sign in cache descriptions could cause ill formatted GPX files
4.1.2
- FIX: preview tour on map: changed cache coordinates were not always updated in map preview
- FIX: GPX: ASCII control codes in logs resulted in invalid GPX files; they are now removed from logs
4.1.1
- FIX: Map: adding caches from the map to a tour didn't work any more due to the new cache icons
4.1
- NEW: printview: favorite points available as both, absolute and relative value
- NEW: printview settings: option to enable/disable printing for all cache listings and own waypoints
- FIX: sendToGPS: GS layout change
4.0.2
- FIXED: tour upload: did not work due to changes in 4.0.1
4.0.1
- FIXED: printview: did not work for tours with (approx.) more than 40 caches
4.0
- NEW: printview: favorite points available
- NEW: most data now fetched in parallel (as opposed to one by one) --> much faster
print preview, GPX download, send to GPS, upload tour, map preview
- FIXED: printview: prevent cache table getting too wide for large font sizes
- MISC: exchanged positions of GCTour Home and Save Settings Info buttons
3.2
- FIXED: Main menu: GCTour settings now work on new search page
- FIXED: Main menu: immediate numbering update when deleting a cache from a tour
- FIXED: info dialogs were not displayed properly on map and new search page (stylesheet was missing)
- FIXED: GPX: German umlauts, 'ß' and '-' now allowed in file names
- FIXED: autoTour: now works on new search page
- NEW: autoTour: check/uncheck all switch for filters
- NEW: Main menu: new info button on how to backup the complete GCTour settings, all tours and moved coordinates
- NEW: Main settings menu: layout change to jQuery UI dialog
- NEW: Main settings menu: theme roller (individual layout for all dialogs)
3.1
- FIXED: autoTour: map preview with circle now works on southern hemisphere, too
- FIXED: Main menu: immediate numbering update when adding new cache(s)
- FIXED: GPX: coord.info links reset to http from https
- FIXED: GPX: "<sym>Geocache Found</sym>" for Geocaches already found (thanks to Vasek)
- FIXED: printview: closing the progress bar now opens a confirmation dialog to cancel the print process
- UPDATED: autoTour: all filters are now enabled on first use
- UPDATED: Upload/Download Tour: new confirmation dialogs
- NEW: autoTour: filter option for Giga events
- NEW: GPX: new attribute "Geotour"
3.0.1
- FIXED: icons of own waypoints not displayed on downloaded tour
- FIXED: when editing own waypoints they lost their position inside the tour
- FIXED: when sorting a tour by drag and drop numbering did not update automatically
- NEW: check and notification for Chrome browser which is currently not supported
3.0
- FIXED: in printview, description formatting (line breaks etc) is preserved for additional cache waypoints
- FIXED: pm only caches for non-pm member are now detected properly
- FIXED: missing translations for "reload map" in printview
- UPDATED: switch of external Web server (preservation of main GCTour functionality); credits to Mark
- UPDATED: size of GCTour main window increased slightly
- UPDATED: update of get/post methods
- NEW: in printview, own waypoints can be added to cache table as opposed to a separate table (user option in main printview menu)
- MISC: new main version
- MISC: some code review
2.3.14271, revision 9
- FIXED: GPX file download was broken (missing file on external Web server); now independent of an external Web server
- NEW: update notifier for Gist repository; update check once a day
- MISC: some code review
2.3.14271, revision 8
- FIXED: display of last 4 logs in print preview is now independent of max. number of logs
- MISC: option "all" in Settings - Printview - Number of logs... disabled (didn't work anyway)
- MISC: some code review
2.3.14271, revision 7
- FIXED: autoTour didn't work from map when called from http (as opposed to https)
- NEW: automatic updates from Gist repository (probably checked once a week)
- MISC: improved code readability by applying a code beautifier
2.3.14271, revision 6
- FIXED: print issue in Firefox
- FIXED: number of logs in print preview was dependent of max. number of logs in GPX files
- NEW: GCTour now supports unpublished listings
- NEW: revision number in GPX files
2.3.14271, revision 5
- FIXED: adding caches to tour from bookmark and search lists: single, marked, all
- FIXED: completion of autoTour re-design part: German translations in dialog were missing
- FIXED: on GS public profile page boxes with owned caches/trackables were shown at the bottom of the page
- FIXED: route menu from "show caches on map" page removed (not working as expected)
- UPDATED: most links now use https instead of http
- UPDATED: improved visibility of buttons for adding all or marked caches from search/bookmark lists
- UPDATED: autoTour dialog now shows a center point on all pages (cache coordinates on cache pages and home coordinates from GS profile settings else)
- NEW: GitHub link to GCTour footer added
- NEW: revision to GCTour identifier added
- NEW: changelog for revisions added
2.3.14271, revision 4
- FIXED: GS layout changes
2.3.14271, revision 3
- FIXED: GS layout changes
- FIXED: send to GPS
- FIXED: change coordinates didn't work due to a conflict with script "Geocaching.com + Project-GC 1.4.9"
- FIXED: now all GS date formats work
2.3.14271, revision 2
- FIXED: GS layout changes
2.3.14271, revision 1
- MISC: initial import to https://gist.github.com/DieBatzen/5814dc7368c1034470c8
2.3.14271
- FIXED: "Add to tour" is now working from the map
- FIXED: Setting the default width of the print view
- FIXED: Printview is now working again if you generate it from the gc.com map
- UPDATED: autoTour dialog -> Coordinates are taken from geocache detail page
- UPDATED: autoTour dialog -> special filter extended with "Only PM cache"
2.3.14249
- FIXED: Printview is now working _AGAIN_
- FIXED: Printview now contains travelbugs again
- NEW: "send message to the author" now contains a response email address
2.3.14198
- FIXED: Printview is now working again
2.3.13263
- FIXED: gc.com update
2.3.13241
- NEW: Notifications with proper localisations and look
- FIXED: Issue 50 (Send to GPS always sends GC14PCD)
2.3.13239
- FIXED: Issue 45, 47 and 49
2.3.13018
- FIXED: Tour upload is working again
2.3.12356
- FIXED: Issue 31
- FIXED: wrong geocaches size in languages other than english
- FIXED: wrong geocache location in languages other than english/german
- FIXED: Bug on map that you need to log in
- FIXED: Issue 42 "Add to tour" button on map
- FIXED: Some minor CSS glitches
2.3.12147
- FIXED: Issue 37 and 39
- UPDATED: buttons of searchpage and bookmarkpage adjusted
- UPDATED: jquery to 1.7.2 and jquery-ui to 1.8.18
- UPDATED: GPX -> cache-attributes to log settings, default = false
- NEW: printview -> icon to add and underline if user has changed the coordinates
2.2.12059
- FIXED: autoTour menu button
- NEW: maps show now details if you click on a marker
2.2.12058
- FIXED: new geocaching.com maps are now supported again
2.2.12043
- FIXED: autoTour - but still issues with GCVote, please disable this to use autoTour!
- FIXED: OwnWaypoints and moveCoordinates
- REMOVED: annoying alert on search page
2.2.12042
- FIXED: printview -> Bug with GCComment version
- FIXED: searchpage in-use with Userscript GCVote
- FIXED: Issue 22, 32 and 33
- REMOVED: dojo completely removed
2.2.12003
- FIXED: GPX -> ALL caches were either not found or found
- FIXED: printview -> Unsupported type for GM_setValue (Your Account Details -> Date Format)
2.2.12002
- FIXED: Map issues
- FIXED: Upload Tour
- FIXED: exception SyntaxError JSON.parse unexpected character by download tour
- FIXED: exception TypeError progressBar is undefined
- FIXED: function getlogs
- FIXED: GPX found Caches from "<sym>Geocache</sym>" to "<sym>Geocache Found</sym>" (big thanks to Vasek)
- UPDATED: French translation - thanks pascal
- UPDATED: css adjustments
- NEW: Map height is now variable
- REMOVED: geocaching.com.au Type -> Groundspeak is now the only GPX Type
2.1.11313
- FIXED: GPX Download bug "...ctl00_hlSignOut... is undefined"
- FIXED: Issue 18
- FIXED: Update bug
- NEW: Update added link in the error-Dialog
- NEW: User can write a message in the error-Dialog
2.1.11293
- FIXED: <=3 Logs in printout -> "Last4Logs" (L4L) in the printout
- FIXED: Logs in GPX (Unicode hexadez.)
- UPDATED: dutch translation
- Add jQuery (1.6.4) and jQuery-ui (1.8.16)
2.1.11285
- FIXED: autoTour
- FIXED: GCTour on the search page
- FIXED: Logs in printout
- FIXED: Logs in GPX
- UPDATED: french translation
- GPX: New Groundspeak implementation to prevent XML errors
- NEW: Titlepage in the printview now contains coordinates and basic informations
- NEW: printview contains now the PM cache note!
- NEW: delete button for current tour
- NEW: "Last4Logs" (L4L) has been added to the printout - similar to http://www.gsak.net/help/hs11980.htm
2.0.11280
- FIXED: silent update changes from gc.com
2.0.11239
- FIXED: GPX bug
2.0.11206
- FIXED: GPX bug after gc.com update
- FIXED: Printview after gc.com update
2.0.11158
- FIXED: scrollbar bug Firefox 3.6
- FIXED: "Search For Geocaches" page in Firefox 3.6
- FIXED: Bug with new GCComment version
- FIXED: bug in popup after uploading an tour
- UPDATED: french translation
2.0.11158
- FIXED: Event-Cache bug
- FIXED: Printout need some work
- FIXED: Update dialog bug
- FIXED: autoTour dialog
- FIXED: Layout modifications from gc.com
- FIXED: autoTour find now earthcaches
- FIXED: own waypoints coordinates were sometimes wrong rounded
- GPX: Logs does now have an unique id
- GPX: Archived/Unavailable geocaches are marked so
- MAP: Tweak code on the map site. The use of the map will now be much faster.
- NEW: Coordinates of geocaches can now be moved.
- NEW: Added a dialog to send me a message.
- NEW: Geocaches can now printed directly from their detailspage
- NEW: Tour upload has been completly redesigned
- NEW: Support for the new beta Maps
- NEW: Dutch translation (thanks to searchjaunt)
- NEW: Portuguese translation (thanks to Ruben)
- NEW: French translation (thanks to flashmoon)
- NEW: Added support for all GC.com date formats
- NEW: GCComment print view implementation
- ... and much more i already forgot
1.97.11033
- FIXED: gccom layout change.
1.97.10361
- FIXED: autotour with new OCR program
- FIXED: GPX/Print now contains correct hidden date
- FIXED: geocaches lists now are shown correctly again
- NEW: Google-Appengine program to decode D/T/Size images
1.97.10356
- FIXED: GCTour is now working after gc.com update #2
1.97.10313
- FIXED: GCTour is now working after gc.com update
1.97
- GPX: add <groundspeak:name> to GPX
- GPX: Additional Waypoints now named - Waypoint.Prefix + (GCID without leading GC)
- GPX: changed Groundspeak "Multi-Cache" to "Multi-cache"
- GPX: fixed earthcache type
- GPX: changed log id to a usable value - Issue3
- GPX: added attributes to Groundspeak GPX
- FIXED: caches can remain in watchlist without error
- FIXED: that a tour remains in list after deleting
- FIXED: autoTour is working after update 7/28/10
- FIXED: superscript text is now shown correct in printview
- NEW: Bookmark Lists now have "add to tour" buttons
- NEW: Tour can now sorted via drag n' drop
- NEW: Add check on Firefox >= 3.5
- NEW: Minimal-printview containing cacheheader, hint and spoiler images
- NEW: Recode the complete update routine
- NEW: Add check whether the script is still logged on when scraping data
- CHANGED: Renew the buttons
- MISC: Code Review
- MISC: Create repository at http://code.google.com/p/gctour/
- MISC: Start implementing http://gctour-spot.appspot.com/
1.96
- gc.com layout update 6/29/10 fixed
- new groundspeak GPX implementation
- close-window-button get a function in printview
- removing annoying debug messages on maps
- add an check after 20sec if gctour is loaded - important for no script users
- caches on printview are now numbered
- own waypoints are now uploaded again
- tour uploads had now a map on gctour.madd.in
- autoTour gets an option to filter PM-Only caches
- update to dojo 1.4
1.95
- gc.com layout fixes
- repair the "add selected caches"-to-tour button
1.94
- hints are now in the printout again
1.93
- fixed major functions after layout update
- new code for the printview
- remove the download-complete-map-button from maps page - please use autotour instead
- some minor bugfixes
1.92
- add gpx option - old groundspeak schema or new geocaching.com.au schema
- autoTour now part of GcTour
- GUI improvements - now every tab is up-to-date
- strip 'GC'-Option for GPX-Files
- add OSM-Maps to the overview maps
- append OSM and Topo Germany to default Maptype-Option
1.91
- Fast GPX-File bugfix! Type of caches is now correctly set!
1.9
- New-GcTour-GPX with geocaching.com.au/opencaching.de schema! Contains now logs and description for _ALL_ users.
- Add dojo to make some DOM operations MUCH faster. Printview e.g. is now MUCH faster.
- GUI improvments
- Attributes are now shown in the printview
1.85
- fixed bug that own marker have wrong coordinates in printview
- redesign of the cache list
- redesign of "create new marker"-dialog
- adding preview map to "create new marker"-dialog
- adding "move to top/bottom" button to cache list - thanks to adam r
- adding map size control in printview maps
1.8
- adding overview page to printpage
- creating map with all caches on it
- outline map for every cache + additional waypoints
- adding costum waypoints
- the GPX contains now the current date
- adding information button to show which cache is in tour before loading
1.7
- adding upload feature
- removed bug, that gctour is not able to handle multiple tabs
- implement sorting
- adding text size option for the printview
1.6
- fixed downloaded gpxfile - html-/ no-html-mode
- add some fancy sliding effects
- add multiple tour function
- add trackables to printview
- some minor bugfix (e.g. extended table on gc.com map)
1.5
- add download GPX-button
- add additional waypoints to printview
- add an add all button to the map. thx atornedging
- fixed some mutated vowel bugs in GPX
- tweak update function
- adding changelog to updatedialog
1.4
- fixing bug, that premiummembers dont have coordinates in the printview
- adding logcounter to printview
1.3
- adding buttons to the search tables
- progress is now displayed in the print view and GPS Export
- adding language support
1.2
- optimizing printview
- add the possibility to export the spoiler images to the printview
- add an add-to-tour-button in the GC-Table on the right side of the map view
- fixed minor bug in the settings
1.1
- extended printview - it is now possible export logs and remove images/logs
- update function is now working ...
1.0
- initial release
@ThomDietrich
Copy link

Hello,
you should seriously think about switching over to a github repository for this project. It would definitely benefit from PullRequests and Issues. Thanks for carrying on this project!

@mkael29
Copy link

mkael29 commented Oct 31, 2016

Hello,

I change line 9752 to this:

['LOGTEXT', encodeHtml($("

").html(logs[ii].content.br2space().replace(/[^\x20-\x7E]+/g, '')).text().trimAll())]

because i found unprintable characters in certains logs and the GPX file not work with my GPS.

Thanks.
MKael

@DieBatzen
Copy link
Author

Hi MKael,

could you provide a link for a cache or log where that happens?

Regards,
Thomas

@mkael29
Copy link

mkael29 commented Dec 18, 2016

Hi,
sorry for the delay.
Look this cache GC6Q0PB and the log of Chup'a (10/14/2016). There many unprintable characters and my GPS isn't happy with this characters !

Bye

@DieBatzen
Copy link
Author

Hi mkael29,

thanks a lot for the example, that helped.
As you already mentioned, that log contains ASCII control codes that cannot be displayed properly.
Your regex expression solves this issue but with a drawback: it also removes valid characters outside the 32-126 range, e.g. German umlauts äöü.
Therefore, I would prefer to just remove the range 0-31 characters and keep the rest.

If you want to test, here's a code snippet:

  1. add this function to the code
    // strip all ASCII control codes below charCode 32, except LF and CR
    function strip(s) {
    return s.split('').filter(function(x) {
    var n = x.charCodeAt(0);
    return n==10 || n==13 || n>31;
    }).join('');

    }
  2. and change line 9752 to this:
    ['LOGTEXT', strip( encodeHtml(logs[ii].content) )]

Line feeds and carriage returns are kept while all "evil" control codes are removed.
That should solve the issue.

If it works for you I will include the solution in the next update.

Regards,
Thomas

@mkael29
Copy link

mkael29 commented Dec 26, 2016

Hi Thomas,

good job man. It's ok for me, my GPS can read the GPX file with your code.

Do you projected to add the function to download images in geocaches?

Thanks for all.

@DieBatzen
Copy link
Author

Hi mkael29,

that's good news, the fix will be included in the next update.

By design, Greasemonkey scripts are not allowed to automatically save files to the local file system.
The only possibility is to save a single file (where its content was generated inside the script) by opening the browser's File-Save dialog - this is what is done for the GPX file export in GCTour.
But there are tools around which can download geocache images.
E.g. GSAK or when it comes to spoiler images you may want to have a look at this tool:
http://www.rchnet.ch/spoilertool/

Regards,
Thomas

@GarenKreiz
Copy link

Following the bad use that new versions of Firefox (starting with 57) will drop support of XUL based extensions and thus that GreaseMonkey will stop working, what is the best advice for GCTour's users who want to continue to use this valuable add-on to www.geocaching.com?

For example, is GCTour known to work on Pale Moon?

@DieBatzen
Copy link
Author

DieBatzen commented Jan 28, 2018

Hello GarenKreiz,

sorry for my late response - there are no notifications for new comments, I just stumbled upon yours.

There are good news:
GCTour continues working flawlessly on Firefox and Chrome - the only difference is to use Tampermonkey instead of Greasemonkey as script manager.
Mark wrote a very nice guide on how to do the changes in just a few steps (keeping all your tours and settings):
https://www.schraegstrichpunkt.de/gctour-von-greasemonkey-nach-tampermonkey-umziehen/
Traduction

After the switch GCTour, together with Tampermonkey, will work on "old" Firefox as well as on Firefox 57 or newer.

If you encounter any problems simply post here, I'll be happy to help (and will try to monitor the comments here more regularly ;) ).

Happy caching,
Thomas

@Fettebemmen
Copy link

Nabend, ich störe ja ungern, aber ich bekomme einfach nicht GCTour zum laufen.
Ich benutze Firefox und habe das Skrypt Greasemonkey installiert. Nun wollte ich GCTour installieren aber da kommt folgende Fehler.
Benutzerskript konnte nicht installiert werden

undefined

Ich hoffe Sie können mir helfen.
LG Marko

@DieBatzen
Copy link
Author

Hallo Marko,

wenn du Tampermonkey, statt Greasemonkey als Skiptmanager verwendest, dann sollten die Probleme verschwinden.
Am besten zunächst Greasemonkey entfernen, dann Tampermonkey und zuletzt GCTour installieren.

Gruß,
Thomas

@Primus007
Copy link

Super das ihr gctour weiter entwickelt!
Hätte da noch ein Vorschlag. Wenn man in den Einstellungen für das Ausdrucken noch angeben könnte ob man D/T Wertung, Favoriten und andere Angaben in der Liste möchte oder nicht , wäre das echt klasse. Ich persönlich benötige solche Angaben nicht. Ohne diese Angaben wäre der Kommentarbereich größer, was ich besser fände.

@DieBatzen
Copy link
Author

Hallo Primus007,

da sollte sich was machen lassen, ich schaue mir das mal an.

Gruß,
Thomas

@Primus007
Copy link

Das wäre schön. Danke.

@DieBatzen
Copy link
Author

Hallo Primus007,

ich habe in den Druckeinstellungen eine Option eingebaut um verschiedene Spalten in der Cacheliste zu entfernen:
GCTour-Einstellungen - Druckansicht, letzte Option ganz unten.
Dort kannst du die Spalten D/T-Wertung, Größe, Letzte 4 Logs, Favoriten, Gefunden-Checkbox und Notiz abwählen.

Diese Version kannst du von hier installieren und schauen, ob alles soweit passt:
https://www.dropbox.com/s/r4ptw6yk1c0zyuf/gctour.user.js?dl=1
Sie ist bis auf die neue Option identisch mit der aktuellen Version, inkl. Versionsnummer.

Wenn keine Probleme auftauchen, wird die Option im nächsten Update enthalten sein.

Gruß,
Thomas

@Primus007
Copy link

Primus007 commented Jul 8, 2020

Vielen Dank. Das ging ja schnell.
Leider bekomme ich GCTour gar nicht mehr zum funktionieren. Auch die Originalversion nicht.
Ich nutze Firefox 68.10.0esr (64-Bit). Ich kann mir nicht erklären woran es liegt. Habe in Greasemokey alles deinstalliert und neu von hier auf der RAW Seite installiert. Neu gestartet aber nichts geht. Aktiviert ist das Script natürlch. Es erscheint kein GCTour Symbol.
In Chrome funktioniert es.

@DieBatzen
Copy link
Author

Mit Greasemonkey meinst du aber schon Tampermonkey? :) Denn GCTour läuft nicht unter Greasemonkey...

Gelegentlich zeigt Tampermonkey einfach keine Skripte mehr an (Ursache unbekannt, oft nach Updates). Das lässt sich durch einen Tampermonkey-Neustart lösen:

  • auf das Tampermonkeysymbol oben rechts klicken und "Übersicht" wählen
  • zu "Einstellungen" wechseln und den "Konfigurations-Modus" auf Experte stellen
  • ganz nach unten scrollen und "Neustart"

Hilft das?

@Primus007
Copy link

Danke für die schnelle Hilfe. Funktioniert nun alles wieder. Greasemonkey habe ich deinstalliert.

Wegen den Optionen zum Drucken:
funktioniert soweit. Aber die Spalte Koordinaten kann man nicht ausblenden. Absicht? Man hat ja die Koordinaten im GPS, daher bräuchte man sie eigentlich nicht auf dem Ausdruck.

@DieBatzen
Copy link
Author

Schön zu hören, dass es wieder läuft.

Die Idee dahinter ist, dass zu jedem Cache gewisse elementare Informationen gehören. Das sind aus den vorhandenen Spalten Name, GC-Code und Koordinaten. Der Rest sind Zusatzinformationen.
Elementarinformationen sollten immer sichtbar sein, Zusatzinformationen sind optional.
Darüber kann man natürlich diskutieren...

@Primus007
Copy link

OK. Kein Problem. Nochmal Danke für die schnelle Umsetzung!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment