(js) Fix pasting images in CKEditor

Fixes #3986
pull/232/head
Francis Lachapelle 2017-01-16 15:31:12 -05:00
parent ba12c14a1d
commit 5f2a6c53c4
3 changed files with 11 additions and 1 deletions

1
NEWS
View File

@ -7,6 +7,7 @@ Enhancements
Bug fixes
- [core] remove all alarms before sending IMIP replies (#3925)
- [web] fixed rendering of forwared HTML message with inline images (#3981)
- [web] fixed pasting images in CKEditor using Chrome (#3986)
3.2.5 (2017-01-10)
------------------

View File

@ -71,6 +71,15 @@
});
});
ck.on('paste', function(event) {
var html;
if (event.data.type == 'html') {
html = event.data.dataValue;
// Remove images to avoid ghost image in Firefox; images will be handled by the Image Upload plugin
event.data.dataValue = html.replace(/<img( [^>]*)?>/gi, '');
}
});
// Intercept the request when an image is pasted, keep an inline base64 version only.
ck.on('fileUploadRequest', function(event) {
var data, img;

File diff suppressed because one or more lines are too long