tags:

views:

252

answers:

1

Hi,

  1. I want to update few variables when any of the toolbar button (like bold, italic etc) is clicked. I'm unable to trap 'click' event on any of these buttons. Could somebody give me an example when clicking on 'bold' button would also pop up an alert box?

  2. How can I trap 'paste' event?

I've googled a lot and searched ckeditor forum but couldn't find any solution. Any pointer would be really helpful.

Thanks.

A: 

I found out how to catch the paste event:

editor.on('paste', your_cb_fn);

However this doesn't seem to work for the button actions:

// does nothing
editor.on('Bold', your_cb_fn);
editor.on('bold', your_cb_fn);

The solution may be to edit the plugins in _source/plugins to create triggers, though that is not ideal.

Plumo