Hi, I'm trying to write a quick/simple command to perform a search on
a couple of sites using a given search term/id number from selected
text or input, however my command wont work if I use tab to complete
the full command name.
Another thing I wanted to do but can't work out how to implement is I
would like to specify what to search by, like normal query or id
search, so invoke the command like 'quick-example-search query blah'
or 'quick-example-search id 12345'
Wondering if someone could point me in the right direction... and of
course any help is greatly appreciated.
/* This is a template command. */
CmdUtils.CreateCommand({
names: ["quick-search-example"],
icon: "http://www.mozilla.com/favicon.ico",
description: "Quick & dirty search.",
help: "How to use your command.",
author: {name: "Your Name", email: "[email protected]"},
license: "GPL",
homepage: "http://labs.mozilla.com/",
arguments: [{role: 'object', nountype: noun_arb_text, label: "search
string"}],
preview: function preview(pblock, arguments) {
pblock.innerHTML = "Your input is <b>" + arguments.object.html +
"</b>.";
},
execute: function execute(arguments) {
//displayMessage("You selected: " + arguments.object.text, this);
var search_term = arguments.object.text;
var url1 = "http://example1.com/search/" + search_term;
var url2 = "http://example2.com/search/" + search_term;
//open the url's
Utils.openUrlInBrowser(url1);
Utils.openUrlInBrowser(url2);
}
});
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---