configure toolbar to paste plain text django-ckeditor

Can anyone tell me how to paste plain text in ckeditor using django's admin? Everytime that I try to paste something from my clipboard it pops that message.

Press Ctrl+V to paste. Your browser doesn‘t support pasting with the toolbar button or context menu option.

Upvotes: 2

Views: 538

Answers (1)

Add the following code at the bottom of the template templates/admin/base.html:

<script>
    CKEDITOR.on("instanceReady", function(event) {
        event.editor.on("beforeCommandExec", function(event) {
            // Show the paste dialog for the paste buttons and right-click paste
            if (event.data.name == "paste") {
                event.editor._.forcePasteDialog = true;
            }
            // Don't show the paste dialog for Ctrl+Shift+V
            if (event.data.name == "pastetext" && event.data.commandData.from == "keystrokeHandler") {
                event.cancel();
            }
        })
    });
</script>

Upvotes: 0

Related Questions