Created
September 11, 2009 19:37
-
-
Save BrunoCaimar/185521 to your computer and use it in GitHub Desktop.
DLPO - Dicionário Priberam de Lingua Portuguesa On-Line - 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
CmdUtils.CreateCommand({ | |
names: ["dlpo"], | |
icon: "http://www.priberam.pt/favicon.ico", | |
description: "DLPO - Dicionário Priberam de Lingua Portuguesa On-Line v0.0.3.20090917", | |
help: "Procura a definição da palavra informada no DLPO - Dicionário Priberam de Língua Portuguesa On-Line (http://www.priberam.pt/dlpo/)", | |
author: { | |
name: "Bruno Caimar", | |
email: "[email protected]" | |
}, | |
license: "MIT", | |
homepage: "http://ubiquity.brunocaimar.com/", | |
arguments: [{ | |
role: 'object', | |
nountype: noun_arb_text | |
}], | |
preview: function preview(pblock, args) { | |
pblock.innerHTML = "DLPO - Procura a definição para a palavra <b>" + args.object.html + "</b>"; | |
var urlPreview = "http://www.priberam.pt/dlpo/verbeteacel.aspx"; | |
var data = { | |
pal: args.object.text | |
}; | |
if (Utils.trim(args.object.text) !== "") { | |
CmdUtils.previewGet(pblock, urlPreview, data, function (retorno) { | |
pblock.innerHTML += retorno; | |
}, | |
"html"); | |
} | |
}, | |
execute: function execute(args) { | |
var urlExecute = "http://www.priberam.pt/dlpo/default.aspx"; | |
urlExecute += "?pal=" + args.object.text; | |
Utils.openUrlInBrowser(urlExecute); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment