Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавлен метод CKEDITOR.config.pastefileCheckIgnorePaste #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@
});
};

/**
* Проверка необходимости проигнорировать вставку.
* К примеру, потому что вставку должен обработать другой плагин.
* @param {CKEDITOR.eventInfo} event
* @returns {boolean}
*/
CKEDITOR.config.pastefileCheckIgnorePaste = function(event) {
return false;
};

var ATTR_PASTE_IGNORE = 'data-cke-pastefile-ignore';
var ATTR_PASTE_INLINE = 'data-cke-pastefile-inline';
var ATTR_PLACEHOLDER = 'data-cke-pastefile-placeholder';
Expand Down Expand Up @@ -301,6 +311,10 @@
return;
}

if (this.config.pastefileCheckIgnorePaste(event)) {
return;
}

var plugin = this.plugins.pastefile;
var clipboardIterator = new ClipboardDataIterator(dataTransfer, this.config.pastefileInlineMaxSize);
clipboardIterator.on('iterator:inline', plugin._onIterateInline, this);
Expand Down