paste image on chrome
This commit is contained in:
@ -281,7 +281,6 @@ define("tinymce/pasteplugin/Clipboard", [
|
|||||||
}
|
}
|
||||||
// load image if there is a pasted image
|
// load image if there is a pasted image
|
||||||
if (blob) {
|
if (blob) {
|
||||||
log(blob);
|
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.onload = function(event) {
|
reader.onload = function(event) {
|
||||||
// 上传之
|
// 上传之
|
||||||
@ -323,10 +322,14 @@ define("tinymce/pasteplugin/Clipboard", [
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
reader.readAsDataURL(blob);
|
reader.readAsDataURL(blob);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.on('paste', function(e) {
|
editor.on('paste', function(e) {
|
||||||
|
|
||||||
|
|
||||||
var clipboardContent = getClipboardContent(e);
|
var clipboardContent = getClipboardContent(e);
|
||||||
var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp < 100;
|
var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp < 100;
|
||||||
var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState;
|
var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState;
|
||||||
@ -378,13 +381,18 @@ define("tinymce/pasteplugin/Clipboard", [
|
|||||||
pasteHtml(html, clipboardContent['text/plain']);
|
pasteHtml(html, clipboardContent['text/plain']);
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
|
//-----------
|
||||||
|
// paste image
|
||||||
|
try {
|
||||||
|
if(pasteImage(e)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch(e) {};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//-----------
|
|
||||||
// paste image
|
|
||||||
try {
|
|
||||||
pasteImage(e);
|
|
||||||
} catch(e) {};
|
|
||||||
|
|
||||||
self.pasteHtml = pasteHtml;
|
self.pasteHtml = pasteHtml;
|
||||||
self.pasteText = pasteText;
|
self.pasteText = pasteText;
|
||||||
|
@ -117,4 +117,4 @@
|
|||||||
writeScripts();
|
writeScripts();
|
||||||
})(this);
|
})(this);
|
||||||
|
|
||||||
// $hash: 5b06d9e98fb338fd1b0ff7ee116ca480
|
// $hash: cbcf61872b3ecc41bd22dcf691e2e4dd
|
@ -466,7 +466,6 @@ define("tinymce/pasteplugin/Clipboard", [
|
|||||||
}
|
}
|
||||||
// load image if there is a pasted image
|
// load image if there is a pasted image
|
||||||
if (blob) {
|
if (blob) {
|
||||||
log(blob);
|
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.onload = function(event) {
|
reader.onload = function(event) {
|
||||||
// 上传之
|
// 上传之
|
||||||
@ -508,10 +507,14 @@ define("tinymce/pasteplugin/Clipboard", [
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
reader.readAsDataURL(blob);
|
reader.readAsDataURL(blob);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.on('paste', function(e) {
|
editor.on('paste', function(e) {
|
||||||
|
|
||||||
|
|
||||||
var clipboardContent = getClipboardContent(e);
|
var clipboardContent = getClipboardContent(e);
|
||||||
var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp < 100;
|
var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp < 100;
|
||||||
var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState;
|
var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState;
|
||||||
@ -563,13 +566,18 @@ define("tinymce/pasteplugin/Clipboard", [
|
|||||||
pasteHtml(html, clipboardContent['text/plain']);
|
pasteHtml(html, clipboardContent['text/plain']);
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
|
//-----------
|
||||||
|
// paste image
|
||||||
|
try {
|
||||||
|
if(pasteImage(e)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch(e) {};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//-----------
|
|
||||||
// paste image
|
|
||||||
try {
|
|
||||||
pasteImage(e);
|
|
||||||
} catch(e) {};
|
|
||||||
|
|
||||||
self.pasteHtml = pasteHtml;
|
self.pasteHtml = pasteHtml;
|
||||||
self.pasteText = pasteText;
|
self.pasteText = pasteText;
|
||||||
|
2
public/tinymce/plugins/paste/plugin.min.js
vendored
2
public/tinymce/plugins/paste/plugin.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user