if (!data.pre && !data.text) {
elBySelAll('img', div, (function(img) {
var src = img.src;
- if (src.indexOf('data:image') === 0 && src !== transparentGif) {
+ if ((src.indexOf('data:image') === 0 | src.indexOf("blob:") === 0) && src !== transparentGif) {
img.src = transparentGif;
var uuid = WCF.getUUID();
img.parentNode.removeChild(img);
}
else {
- WCF.System.Event.fireEvent('com.woltlab.wcf.redactor2', 'pasteFromClipboard_' + this.$element[0].id, {
- blob: this.utils.dataURItoBlob(imgData.src),
- replace: img
- });
+ if (imgData.src.indexOf("blob:") === 0) {
+ window.fetch(imgData.src)
+ .then(function (response) {
+ return response.blob();
+ })
+ .then((function (blob) {
+ WCF.System.Event.fireEvent('com.woltlab.wcf.redactor2', 'pasteFromClipboard_' + this.$element[0].id, {
+ blob: blob,
+ replace: img
+ });
+ }).bind(this));
+ }
+ else {
+ WCF.System.Event.fireEvent('com.woltlab.wcf.redactor2', 'pasteFromClipboard_' + this.$element[0].id, {
+ blob: this.utils.dataURItoBlob(imgData.src),
+ replace: img
+ });
+ }
}
}
}
// word
'application/msword': 'doc',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'docx',
- 'application/vnd.oasis.opendocument.text': 'odt'
+ 'application/vnd.oasis.opendocument.text': 'odt',
+
+ // iOS
+ 'public.jpeg': 'jpeg',
+ 'public.png': 'png',
+ 'com.compuserve.gif': 'gif',
+ 'org.webmproject.webp': 'webp'
});
return {