[Mozile] notification on change

James A. Overton james at overton.ca
Wed Dec 13 13:50:15 PST 2006


This would be a great feature.

The place to look is event.js -> mozile.event.handled(). The state  
that is returned from a successful command has a state.changesMade  
property. The event.node property holds the node which triggered the  
command.

You could fire a "mozileChange" (or just "change") event from handled 
() using event.node as the event.target. Then you can add your  
listener at the document's root to listen for "mozileChange" events.  
This wouldn't require specifying a listener with mozile.editElement 
(). The only trick is firing the event in a cross-browser way:  
mozile.event.dispatch() is an incomplete attempt.

There are other ways it could be done, but this should give you what  
you need to start. I look forward to seeing a patch :^)

James


On 2006-Dec-13, at 4:29 AM, Reto Bachmann-Gmür wrote:

> I'm looking for a way for a script which marks some elements as  
> editable
> using mozile.editElement() to get notified when the element has been
> changed. Ideally I'd like to pass a ChangeListener as second  
> argument to
> mozile.editElement().
>
> Any suggestion on how to do this?
>
> Cheers,
> Reto
>
> _______________________________________________
> Mozile mailing list
> Mozile at mozdev.org
> http://mozdev.org/mailman/listinfo/mozile



More information about the Mozile mailing list