开发者

CKeditor 3.0 - How to know which toolbar button is clicked

开发者 https://www.devze.com 2022-12-10 06:06 出处:网络
I want to update few variables when any of the toolbar button (like bold, italic etc) is cl开发者_Go百科icked. I\'m unable to trap \'click\' event on any of these buttons. Could somebody give me an e
  1. I want to update few variables when any of the toolbar button (like bold, italic etc) is cl开发者_Go百科icked. 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消