Hi everyone!
I desperately need macro functionality in CKEditor (like Auto-replace in Word). I need some predefined keywords being replaced with strings in real time, as the user type, and I cannot make it work.
When I try to do this with get/load Snaphot() and Javascript replace function, strings do get replaced, but the cursor in CKEditor gets either misplaced or lost, and on focus() it goes to the start of the content, not the end. This is how I try to do it now:
I either need advice on how to do these macros other way, or how to put mouse cursor on the end of content. Any help would highly appreciated (also the answer if this is not possible!).
Thank you,
Perica
I desperately need macro functionality in CKEditor (like Auto-replace in Word). I need some predefined keywords being replaced with strings in real time, as the user type, and I cannot make it work.
When I try to do this with get/load Snaphot() and Javascript replace function, strings do get replaced, but the cursor in CKEditor gets either misplaced or lost, and on focus() it goes to the start of the content, not the end. This is how I try to do it now:
editor.on( 'key', function(e) { editor.loadSnapshot( editor.getSnapshot().replace( /keyword/, "replacementstring" ) ); });
I either need advice on how to do these macros other way, or how to put mouse cursor on the end of content. Any help would highly appreciated (also the answer if this is not possible!).
Thank you,
Perica