I've worked on this a little more and i've came up with this:
CmdUtils.CreateCommand ( {
name: "tryhard",
takes: {"input": noun_arb_text},
preview: function ( pblock ) {
var books = Application.bookmarks.menu.children;
var stringa = "";
for ( var i = 0; i < books.length; i++ ) {
stringa += books[i].title + ",\n";
}
pblock.innerHTML = CmdUtils.renderTemplate(stringa);
},
execute: function (input) {
var books = Application.bookmarks.menu.children;
for ( var i = 0; i < books.length; i++ ) {
if ( input.text.match (books[i].title, "i" )) {
var fol = "folder";
if ( fol.match ( books[i].type, "i") ) {
var into = books[i].children;
for ( var j = 0; j < into.length; j++ )
Utils.openUrlInBrowser(into[j].uri.spec);
}
else Utils.openUrlInBrowser(books[i].uri.spec);
}
}
}
});
Preview is kinda useless ( just shows the name of all the book/folders
in your root ), i'll see what to insert later. I'm working to
including subfolders and sub-bookmarks in the search, and I also
wanted to include a suggesting system. Any suggestion/help?
Hope this is useful for someone ^_^
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---