Reputation: 1798
I'm using CKEditor and recently i've got a task to intercept it's onchange event. There is a plugin for it at blogspot
the problem is that event object i get does not contain a DATA what has been appended or removed to(from) editor. Did anybody have a deal with it. Thanks!
Upvotes: 1
Views: 368
Reputation: 12690
You can do it using Mutation Observers as I started adding in some of the latest versions (note: the implementation that I used is not correct and it's one/the basic problem with inline editors in CKEditor 4). That gives you notifications about anything changing in the editor and you have to filter out other changes that you are not interested about.
Please, note that your workaround using DOMNodeInserted means that you're using Mutation Events, that have been deprecated due to their very poor performance.
Upvotes: 2
Reputation: 22023
It's impossible (or rather - it would be a waste of time and computing power) to extract differences between change
events. And how would you use such information? It's not a plain text, so it cannot be easily diffed and merged.
You should be interested in saving (or whatever you want to do) the full editor data, which you can get by editor.getData()
.
Upvotes: 1