[Mozile] notification on change

James A. Overton james at overton.ca
Sat Dec 16 08:25:55 PST 2006


All right, the other place to look is mozile.execCommand() in  
edit.js, which also checks the state.changesMade property. That's  
what buttons and menu items use.

James


On 2006-Dec-16, at 10:31 AM, Reto Bachmann-Gmür wrote:

> Hi James
>
> mozile.event.handled() gets invokes when the user types something,  
> but doesnt seem to be invoked when the user justs changes the style  
> with the toolbar. Is there another place to look at?
>
> Cheers,
> reto
>
>
> James A. Overton wrote:
>> 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
>>>
>>
>> _______________________________________________
>> Mozile mailing list
>> Mozile at mozdev.org
>> http://mozdev.org/mailman/listinfo/mozile
>>
>
>
> _______________________________________________
> Mozile mailing list
> Mozile at mozdev.org
> http://mozdev.org/mailman/listinfo/mozile



More information about the Mozile mailing list