Hi,
I'm developping a little plugin for my ckeditor. For the moment I try to catch an event so that I can fire an "alert(...)". In the documentation, I see 'eventName' which is ... the event name. Ok but what if I want to know those names... is there a list out there ?
I'd like to listen to events like key press/up/down. I tried the following event names but none of them seem to work : keyup, keypress, keydown
I tried the event name 'contentDom' to check if my code was OK and my alert works correctly with this event. What about the others ?
Seems that my question has been already posted but the replies are always quite the same : in a future documentation.
Could someone give me the names of events corresponding to a content change into the editor area :
- keyboard key press
- keyboard key up
- keyboard key down
- maybe others ?
Better would be to provide a link where I can find the complete list of available events
Here is my code for the moment :
(function() { CKEDITOR.plugins.add( 'plug', { init : function( editor ) { editor.on( 'contentDom', my_func, this); // Works but not useful for me editor.on( 'keyup', my_func, this); // Doesn't work editor.on( 'keydown', my_func, this); // Doesn't work editor.on( 'keypress', my_func, this); // Doesn't work editor.on( 'click', my_func, this); // Doesn't work } }); function my_func(domObj) { alert(domObj.editor.getData().length); } })();
Re: Available events list
Would be better if I could listen to an event like 'after content modification'. This would include the cut/paste actions, text added by keyboard, and so on.
Any help would be greatly appreciated.
Re: Available events list
I am using something similar to catch the keyup event
Re: Available events list
Seems to work fine but 'event.data.length' is undefined in my code.
Re: Available events list
or you can try
Re: Available events list
I greped the source and came up with the following list of events. It's likely no where near definitive. Note that you can probably add the before or after words to any of these events.
http://diffpaste.com/#/340/