August 28, 2008, 9:37 am by Alex
|
Comment | 790 views
Mozilla Labs have just launched the Ubiquity plugin for Firefox and to me it looks fantastic. The plugin makes it really easy to embed a map say into an email – without all the faffing around of cutting and pasting URLs from Google Maps into emails etc – it also does much more than this – but I’ve only just started to play!
Even though I’m not generally one for command-line type interfaces, this one works for me. Will be interesting to see how many developers jump on this to create new commands. I can see how you might want to add an IM command (for MSG of course) or one for Cohere. Also, how will this affect some other Firefox plugins, for example if Delicious wrote a set of commands for this (maybe they already have?) then would you really need the Delicious Firefox plugin?
August 5, 2008, 4:15 pm by Alex
|
Comment | 707 views
When you’re trying to use XUL. I’ve just been working on enhancing the Cohere Firefox plugin/extension/add-on so that you can optionally show a toolbar, this toolbar will also show the ideas from Cohere which are linked to the webpage you’re currently looking at (quick screengrab below):

Anyway, getting back to my original point, I needed to be able to dynamically change this drop down list whenever you browse to another page, or select another tab. Getting my plugin to go off and query the Cohere webservice to find the relevant ideas all worked fine, the problem I had was being able to remove the current items from this drop down list.
The documentation seemed to show that I can use ‘removeelement’ to remove the element from the list by setting the removeelement attribute to true (though does seem to be bit of an odd way to do things – setting an attribute to remove an element), but it didn’t work and I spent a little while figuring out why .
In the end it turned out that setting the removeelement attribute to true only means that the element is removable, so you can create the following:
<menulist id="menulist">
<menupopup id="menupopup">
<menuitem label="my label" value="a value" removeelement="true"/>
</menupopup>
</menulist>
but the item “my label” will appear in the drop down list, to actually remove the item you need to do something like this in your javascript:
var ilist = document.getElementById('menupopup');
for (var i=0; i<ilist.childNodes.length;i++ ){
ilist.removeChild(ilist.childNodes[i]);
}
Thought I’d post it up here as it confused me and might save others struggling to figure out what’s going on