diff options
author | bananeweizen <bananeweizen@gmx.de> | 2011-09-29 13:09:23 +0200 |
---|---|---|
committer | bananeweizen <bananeweizen@gmx.de> | 2011-09-29 13:09:23 +0200 |
commit | 16585e2619b7a1c2aed17f43d7c77fb742be97c9 (patch) | |
tree | ca8a0ea28a0d901b55b3b2030303cd5ec192b409 /send2cgeo | |
parent | 0f3046f378a4847cdfb09fd2bc3f6daf31a8bf37 (diff) | |
download | cgeo-16585e2619b7a1c2aed17f43d7c77fb742be97c9.zip cgeo-16585e2619b7a1c2aed17f43d7c77fb742be97c9.tar.gz cgeo-16585e2619b7a1c2aed17f43d7c77fb742be97c9.tar.bz2 |
new Eclipse project with initial send2cgeo sources
* as discussed in forum
* You need the Eclipse Javascript development tools installed in
Eclipse, if you want to have more than a pure text editor...
Diffstat (limited to 'send2cgeo')
-rw-r--r-- | send2cgeo/.project | 17 | ||||
-rw-r--r-- | send2cgeo/.settings/.jsdtscope | 8 | ||||
-rw-r--r-- | send2cgeo/.settings/org.eclipse.wst.jsdt.ui.superType.container | 1 | ||||
-rw-r--r-- | send2cgeo/.settings/org.eclipse.wst.jsdt.ui.superType.name | 1 | ||||
-rw-r--r-- | send2cgeo/send2cgeo.user.js | 47 |
5 files changed, 74 insertions, 0 deletions
diff --git a/send2cgeo/.project b/send2cgeo/.project new file mode 100644 index 0000000..17ac1eb --- /dev/null +++ b/send2cgeo/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>send2cgeo</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ </natures>
+</projectDescription>
diff --git a/send2cgeo/.settings/.jsdtscope b/send2cgeo/.settings/.jsdtscope new file mode 100644 index 0000000..bf2cc95 --- /dev/null +++ b/send2cgeo/.settings/.jsdtscope @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path=""/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.FireFoxBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
diff --git a/send2cgeo/.settings/org.eclipse.wst.jsdt.ui.superType.container b/send2cgeo/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/send2cgeo/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file diff --git a/send2cgeo/.settings/org.eclipse.wst.jsdt.ui.superType.name b/send2cgeo/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/send2cgeo/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window
\ No newline at end of file diff --git a/send2cgeo/send2cgeo.user.js b/send2cgeo/send2cgeo.user.js new file mode 100644 index 0000000..fad0a07 --- /dev/null +++ b/send2cgeo/send2cgeo.user.js @@ -0,0 +1,47 @@ +// ==UserScript== +// @name sendToCgeo +// @namespace http://send2.cgeo.org/ +// @description Add Send to c:geo button to geocaching.com +// @include http://www.geocaching.com/seek/cache_details* +// @include http://www.geocaching.com/map/beta* +// @version 0.23 +// ==/UserScript== + +// Inserts javascript that will be called by the s2cgeo button +var s = document.createElement('script'); +s.type = 'text/javascript'; +s.innerHTML = 'function s2cgeo(code) {' + + 'window.open(\'http://send2.cgeo.org/add.html?cache=\'+code,' + + '\'cgeo\',\'height=50,width=50\'); }'; +document.getElementsByTagName("head")[0].appendChild(s); + +var map = document.getElementById('cacheDetailsTemplate'); + +if( map != null ) +{ + var html = 'Log Visit</span></a> <br /> ' + + '<a href="javascript:s2cgeo(\'${cache.gc}\');" ' + + 'class="lnk">' + + '<img src="/images/sendtogps/sendtogps_icon.png" ' + + 'align="absmiddle" border="0"> ' + + '<span>Send to c:geo</span></a>'; + + map.innerHTML = map.innerHTML.replace('Log Visit</span></a>', html); +} +else +{ + var d = document.getElementById('Download'); + var m = d.children; + var last = m.item(m.length-1); + var GCElement = document.getElementById('ctl00_ContentBody_uxWaypointName'); + var GCCode = GCElement.innerHTML; + + var html = '| <input type="button" ' + + 'name="ctl00$ContentBody$btnSendTocgeo" ' + + 'value="Send to c:geo" ' + + 'onclick="s2cgeo(\''+GCCode+'\'); ' + + 'return false;" ' + + 'id="ctl00_ContentBody_btnSendTocgeo" />'; + + last.innerHTML = last.innerHTML + html; +}
\ No newline at end of file |