I'm trying to manipulate a lot of data before it's pasted into the editor. How would I start a plugin that I want to fire on the paste event and have it bypass the default paste command.
Wed, 05/08/2013 - 22:49
#1

Nevermind, figured it out.
Nevermind, figured it out. Here's what I found in case someone else needs it.
(function() {
CKEDITOR.plugins.add( 'pasteclean', { init : function( editor ) {
editor.on('instanceReady', function(event) {
editor.on('paste', function(evt) {
//get data from clipboard
data = evt.data.dataValue;
//enter code to manipulate data
//insert cleaned data into eitor
editor.insertHtml(cleanPaste);
//stop normal paste execution
return false;
});
});
}});
})();
Adam
It would be better if you
It would be better if you update the evt.data.dataValue with your cleaned data, rather than block paste event. This is how it is supposed to be used.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Ok. Thanks.
Ok. Thanks.
Processing Clipboard Data on paste event
Hello reinmar and Friends
Your help is appreciated if possible. I am trying to retrieve the clipboard and I am struck below is the url in which I have provided the detailed explanation of the issue.
http://ckeditor.com/forums/CKEditor/Help-required-to-process-Clipboard-data-On-CntrlV-using-either-afterpaste-or-paste