Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var noun_type_geocaching = {
name: "Geocaching.com Search",
homepage: "http://wafitz.blogspot.com/",
author: { name: "Wes Fitzpatrick", email: "wafitzpatrick@gmail.com"},
license: "MPL",
label: "geocache",
suggest: function geocaching_suggest(text) {
return [
CmdUtils.makeSugg(text)
];
}
};
CmdUtils.CreateCommand({
names: ["geocaching", "geo", "geocache", "coords"],
arguments: {object: noun_type_geocaching},
icon: "http://www.geocaching.com/favicon.ico",
description: "Search for a Geocache page by entering the GC code.",
help: "Enter a valid GC Code to be directed to the cache page. e.g. \"GC123456\"" +
"<br/>You can also search for Waymarking or Travel bugs.",
preview: function gl_preview(pblock, {object: {text}}) {
if (!text) {
this.previewDefault(pblock);
return;
}
pblock.innerHTML = _("Find Geocache (GC Code): <b>${query}</b>.",
{query: Utils.escapeHtml(text)});
},
execute: function gl_execute(args) {
Utils.openUrlInBrowser(
"http://www.geocaching.com/seek/cache_details.aspx?wp=" +
encodeURIComponent(args.object.text));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.