loopindex / ckeditor-track-changes

Track changes plugin for CKEditor, based on ICE (track changes for TinyMCE).
www.loopindex.com
Other
51 stars 55 forks source link

Basic Deletion tracking missing after insertion #144

Open dhanayanshankar opened 6 years ago

dhanayanshankar commented 6 years ago

We have checked the demo on your site link https://www.loopindex.com/lance/demo/

Steps : on Windows machine (Chrome browser)

demo text on screen : Welcome

Step 1 : place the cursor before the word 'Welcome' and insert the new word 'loopindex'. Step 2 : use delete key to remove the word 'Welcome' without making any screen selection.

There is no track for the deletion event .

jamesey2001 commented 4 years ago

There is a simple fix for this.

open ice.js and go to line 491 with the return false; line,

add this line of code before it.

if(!( right && range.startOffset == range.endOffset && range.startContainer.length == range.startOffset))

if you have the minified sources with the lite plugin embedded in the ckeditor.js, search for

if(this._isCurrentUserIceNode(this._getIceNode(b.startContainer,"insertType")))return!1;

and replace it with:

if(this._isCurrentUserIceNode(this._getIceNode(b.startContainer,"insertType"))){if(!(a&&b.startOffset==b.endOffset&&b.startContainer.length==b.startOffset))return!1;}