Created
November 14, 2009 12:56
-
-
Save wafitz/234537 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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