Skip to content

Instantly share code, notes, and snippets.

@wafitz
Created November 14, 2009 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wafitz/234537 to your computer and use it in GitHub Desktop.
Save wafitz/234537 to your computer and use it in GitHub Desktop.
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