I've tryed a little more, and i came up with this:
CmdUtils.CreateCommand ( {
name: "tryhard",
takes: {"input": noun_arb_text},
preview: function ( pblock ) {
var books = Application.bookmarks.menu.children;
var stringa = "Hey ";
var temp;
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;
displayMessage(into.length);
for ( var j = 0; j < into.length; j++ ) {
Utils.openUrlInBrowser(into[j].uri.spec);
}
}
else {
Utils.openUrlInBrowser(books[i].uri.spec);
}
}
}
}
});
The preview just write down the name of every bookmark/bookmark folder
in the root ( useless, actually, i'll see what's more useful ) , while
the execute opens all the bookmarks in a folder ( if you have named a
folder ) or just the bookmark you have inserted. I'm working for a
system to include a search into subfolders ( because this system only
works with the book/folders at the top of the hierarchy ), and i also
wanted to include a suggesting system. Any suggestions/help?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---