aboutsummaryrefslogtreecommitdiffstats
path: root/send2cgeo
diff options
context:
space:
mode:
Diffstat (limited to 'send2cgeo')
-rw-r--r--send2cgeo/send2cgeo.user.js20
-rw-r--r--send2cgeo/send2cgeoOc.user.js14
2 files changed, 23 insertions, 11 deletions
diff --git a/send2cgeo/send2cgeo.user.js b/send2cgeo/send2cgeo.user.js
index bd20f3a..3a7f6c7 100644
--- a/send2cgeo/send2cgeo.user.js
+++ b/send2cgeo/send2cgeo.user.js
@@ -5,9 +5,11 @@
// @include http://www.geocaching.com/seek/cache_details*
// @include http://www.geocaching.com/map/*
// @include http://www.geocaching.com/geocache/*
+// @include http://www.geocaching.com/my/recentlyviewedcaches*
+// @include http://www.geocaching.com/seek/nearest*
// @icon http://send2.cgeo.org/content/images/logo.png
// @updateURL http://send2.cgeo.org/send2cgeo.user.js
-// @version 0.27
+// @version 0.29
// ==/UserScript==
// Inserts javascript that will be called by the s2cgeo button. The closure
@@ -32,7 +34,7 @@ s.textContent = '(' + function() {
// hide "please wait text" and show iframe
$('#send2cgeo div').hide();
// hide box after 3 seconds
- $(this).show().parent().delay(3000).fadeOut();
+ $(this).css('display', 'block').parent().delay(3000).fadeOut();
});
};
@@ -70,7 +72,7 @@ s.textContent = '(' + function() {
+ '<span>Send to c:geo</span>';
map.innerHTML = map.innerHTML.replace('Log Visit</span>', html);
- } else {
+ } else if(document.getElementById('ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode') != null){
// geocaching.com cache detail page
var GCCode = $('#ctl00_ContentBody_CoordInfoLinkControl1_uxCoordInfoCode')
.html();
@@ -83,6 +85,18 @@ s.textContent = '(' + function() {
$('#Download p:last').append(html);
$('#Download dd:last').append(html);
+ } else {
+ // geocaching.com recentlyviewed
+ $('img[src="/images/icons/16/send_to_gps.png"]').each(function(){
+ $(this).attr('alt', "Send to c:geo").attr('title', "Send to c:geo");
+ });
+ $('a[title="Send to GPS"]').each(function(){
+ var text = $(this).parent().parent().find(".Merge").last().find(".small").first().text().split("|");
+ var GCCode = text[text.length - 2].trim();
+ this.href="javascript:window.s2geo('"+GCCode+"')";
+ this.title = "Send to c:geo";
+ });
+
}
} + ')();';
diff --git a/send2cgeo/send2cgeoOc.user.js b/send2cgeo/send2cgeoOc.user.js
index abf4707..f4bea85 100644
--- a/send2cgeo/send2cgeoOc.user.js
+++ b/send2cgeo/send2cgeoOc.user.js
@@ -4,13 +4,11 @@
// @description Add button "Send to c:geo" to opencaching.de
// @include http://www.opencaching.de/viewcache.php*
// @icon http://send2.cgeo.org/content/images/logo.png
-// @version 0.1
+// @version 0.2
// ==/UserScript==
// Inserts javascript that will be called by the s2cgeo button. The closure
-// look strange, but avoids having to escape the code. Almost everything
-// is put into that script element so that geocaching.com's jQuery may be
-// accessed.
+// look strange, but avoids having to escape the code.
var s = document.createElement('script');
s.type = 'text/javascript';
@@ -59,7 +57,7 @@ document.getElementsByTagName("head")[0].appendChild(s);
document.getElementsByTagName("body")[0].appendChild(b);
// Append to send2cgeo links/buttons /////////////////////////////////////////
- var oc = document.getElementById('SendToGPS').parentNode.parentNode;
+ var oc = document.getElementsByClassName('exportbutton')[0].parentNode.parentNode;
if(oc !== null) {
@@ -70,9 +68,9 @@ document.getElementsByTagName("head")[0].appendChild(s);
+ '<a class="send-to-gps" '
+ 'href="#" '
+ 'onclick="s2cgeo(\''+occode+'\'); return false;" >'
- + '<input id="SendToGPS" type="button" value="An c:geo senden"'
+ + '<input class="exportbutton" type="button" value="An c:geo senden"'
+ 'name="SendToCgeo" /></a> '
- + '<br><br>';
+ + '</p>';
- oc.innerHTML = oc.innerHTML.replace('<br><br>', html);
+ oc.innerHTML = oc.innerHTML.replace('</p>', html);
};