Skip to content

Instantly share code, notes, and snippets.

@redbmk
Created May 13, 2009 05:12
Show Gist options
  • Save redbmk/110888 to your computer and use it in GitHub Desktop.
Save redbmk/110888 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "find-synonyms",
synonyms: ["thesaurus"],
icon: "http://thesaurus.reference.com/favicon.ico",
takes: {"word": noun_arb_text},
preview: function(pblock, word){
var display = word.text;
if (display == "") display = "a word";
else display = "'" + word.text + "'";
pblock.innerHTML = "Finds synonyms for " + display + ".";
browse(word.text);
function browse(word){
if (word != "")
jQuery.get("http://thesaurus.reference.com/browse/" + word, function( synonyms ) {
pblock.innerHTML = jQuery(".the_content", synonyms)
.find("tr")
.after("<br/><br/>")
.end()
.html();
});
}
},
execute: function(word) {
Utils.openUrlInBrowser( "http://thesaurus.reference.com/browse/" + word.text );
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment