-
-
Save redbmk/110888 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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