Created
September 11, 2009 21:18
-
-
Save BrunoCaimar/185589 to your computer and use it in GitHub Desktop.
Dicionário Michaelis - Ubiquity command
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
/* | |
ToDo: | |
- Try to find an icon | |
Release notes | |
v0.0.1 - Versão Inicial | |
v0.0.2 - (bug) Problemas com acentos resolvido ( Issue about special chars solved) | |
- (change) Licença alterada para MIT (License change to MIT) | |
- (change) Remoção códigos duplicados (Few improvements in code) | |
*/ | |
CmdUtils.CreateCommand({ | |
names: ["michaelis"], | |
description: "Michaelis - Moderno Dicionário da Língua Portuguesa v0.0.2.20090914", | |
help: "Procura a definição da palavra informada no Michaelis - Moderno Dicionário da Língua Portuguesa (http://michaelis.uol.com.br/)", | |
author: { | |
name: "Bruno Caimar", | |
email: "[email protected]" | |
}, | |
license: "MIT", | |
homepage: "http://ubiquity.brunocaimar.com/", | |
arguments: [{ | |
role: 'object', | |
nountype: noun_arb_text | |
}], | |
urlMichaelis: "http://michaelis.uol.com.br/moderno/portugues/index.php?lingua=portugues-portugues&palavra=", | |
UrlDicionario: function(p) { return this.urlMichaelis + escape(Utils.trim(p.toLowerCase())); }, | |
preview: function preview(pblock, args) { | |
pblock.innerHTML = "Michaelis - Procura a definição da palavra"; | |
if (Utils.trim(args.object.text) !== "") { | |
CmdUtils.previewGet(pblock, this.UrlDicionario(args.object.text), "", function (retorno) { | |
var result = jQuery('#tdcontents', retorno).html(); | |
pblock.innerHTML += "<br/>" + result + " ".replace(/ /g,"<br/>"); | |
}, | |
"html"); | |
} | |
}, | |
execute: function execute(args) { | |
Utils.openUrlInBrowser(this.UrlDicionario(args.object.text)); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment