Created
September 15, 2009 02:44
-
-
Save BrunoCaimar/187073 to your computer and use it in GitHub Desktop.
iDicionário Aulete da língua portuguesa - 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
/* | |
Release notes | |
v0.0.1.20090914 - Versão Inicial | |
*/ | |
CmdUtils.CreateCommand({ | |
names: ["aulete", "iDicionario"], | |
title: "iDicionário Aulete da língua portuguesa", | |
icon: "http://aulete.uol.com.br/favicon.ico", | |
description: "iDicionário Aulete da língua portuguesa v0.0.1.20090914", | |
help: "Procura a definição da palavra informada no iDicionário Aulete da língua portuguesa (http://aulete.uol.com.br/)", | |
author: { | |
name: "Bruno Caimar", | |
email: "[email protected]" | |
}, | |
license: "MIT", | |
homepage: "http://ubiquity.brunocaimar.com/", | |
arguments: [{ | |
role: 'object', | |
nountype: noun_arb_text | |
}], | |
urlAulete: "http://aulete.uol.com.br/site.php?mdl=aulete_digital&op=loadVerbete&pesquisa=1&palavra=", | |
UrlDicionario: function(p) { return this.urlAulete + escape(Utils.trim(p.toLowerCase())); }, | |
preview: function preview(pblock, args) { | |
pblock.innerHTML = this.title + " - Procura a definição da palavra<br/>" + Utils.escapeHtml(args.object.html); | |
if (Utils.trim(args.object.text) !== "") { | |
CmdUtils.previewGet(pblock, this.UrlDicionario(args.object.text), "", function (retorno) { | |
var result = jQuery('#definicao_verbete_homologado > form', 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