Skip to content

Commit

Permalink
(js) Fix pasting images in CKEditor
Browse files Browse the repository at this point in the history
Fixes #3986
  • Loading branch information
cgx committed Jan 16, 2017
1 parent ba12c14 commit 5f2a6c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -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)
------------------
Expand Down
9 changes: 9 additions & 0 deletions UI/WebServerResources/js/vendor/ckeditor/ck.js
Expand Up @@ -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;
Expand Down

Large diffs are not rendered by default.

0 comments on commit 5f2a6c5

Please sign in to comment.