How to listen to basic events in CKEditor?

后端 未结 2 1457
北恋
北恋 2020-12-10 02:48

I can\'t figure out how to listen to focus, click, onKeyUp and other basic dom events in ckeditor. In the events summary there is only a few events regarding the lifecycle o

2条回答
  •  佛祖请我去吃肉
    2020-12-10 02:59

    CKEditor actually has built-in event handling in the object. See this article for an explanation: http://alfonsoml.blogspot.com/2009/09/ckeditor-events.html

    So, to catch a modification in a CKEditor instance you could do this:

    CKEDITOR.on('currentInstance', function(){modified = true;});
    

    Also, it appears that version 3 has an event processor built into it that's more straightforward: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.file.html#eventProcessors

    CK is a bit convoluted and documentation has holes, but based on its ability to gracefully handle Word generated HTML it gets my vote as the best option out there.

提交回复
热议问题