draggingInternally = e.type == 'dragstart';
});
+ function isPlainTextFileUrl(content) {
+ return content['text/plain'].indexOf('file://') === 0;
+ }
+
editor.on('drop', function(e) {
var dropContent, rng;
dropContent = getDataTransferItems(e.dataTransfer);
- if (!hasHtmlOrText(dropContent) && pasteImageData(e, rng)) {
+ if ((!hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && pasteImageData(e, rng)) {
return;
}
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);
+ }
+ });
});
}
}
});
// 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();