X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/784f914b1e4b1c62d6657e86397c2e83bcee4295..446fc046ca303b25776b07134407239bdeafa3e6:/wp-includes/js/tinymce/plugins/paste/plugin.js diff --git a/wp-includes/js/tinymce/plugins/paste/plugin.js b/wp-includes/js/tinymce/plugins/paste/plugin.js index 249f0cc3..7ecf23a4 100644 --- a/wp-includes/js/tinymce/plugins/paste/plugin.js +++ b/wp-includes/js/tinymce/plugins/paste/plugin.js @@ -818,6 +818,10 @@ define("tinymce/pasteplugin/Clipboard", [ draggingInternally = e.type == 'dragstart'; }); + function isPlainTextFileUrl(content) { + return content['text/plain'].indexOf('file://') === 0; + } + editor.on('drop', function(e) { var dropContent, rng; @@ -829,7 +833,7 @@ define("tinymce/pasteplugin/Clipboard", [ dropContent = getDataTransferItems(e.dataTransfer); - if (!hasHtmlOrText(dropContent) && pasteImageData(e, rng)) { + if ((!hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && pasteImageData(e, rng)) { return; } @@ -839,20 +843,23 @@ define("tinymce/pasteplugin/Clipboard", [ if (content) { e.preventDefault(); - editor.undoManager.transact(function() { - if (dropContent['mce-internal']) { - editor.execCommand('Delete'); - } + // FF 45 doesn't paint a caret when dragging in text in due to focus call by execCommand + Delay.setEditorTimeout(editor, function() { + editor.undoManager.transact(function() { + if (dropContent['mce-internal']) { + editor.execCommand('Delete'); + } - editor.selection.setRng(rng); + editor.selection.setRng(rng); - content = Utils.trimHtml(content); + content = Utils.trimHtml(content); - if (!dropContent['text/html']) { - pasteText(content); - } else { - pasteHtml(content); - } + if (!dropContent['text/html']) { + pasteText(content); + } else { + pasteHtml(content); + } + }); }); } } @@ -1670,7 +1677,7 @@ define("tinymce/pasteplugin/Plugin", [ }); // Block all drag/drop events - if (editor.paste_block_drop) { + if (editor.settings.paste_block_drop) { editor.on('dragend dragover draggesture dragdrop drop drag', function(e) { e.preventDefault(); e.stopPropagation();