diff --git a/etemplate/js/et2_widget_htmlarea.js b/etemplate/js/et2_widget_htmlarea.js
index 1c53d51535..57aab079d3 100644
--- a/etemplate/js/et2_widget_htmlarea.js
+++ b/etemplate/js/et2_widget_htmlarea.js
@@ -139,6 +139,7 @@ var et2_htmlarea = et2_inputWidget.extend(
if(this.ckeditor && this.options.config.preference_style)
{
+ var editor = this.ckeditor;
this.ckeditor.on('instanceReady', function(e) {
// Add in user font preferences
@@ -161,6 +162,33 @@ var et2_htmlarea = et2_inputWidget.extend(
range.collapse(true);
range.select();
});
+
+ // Drag & drop of images inline won't work, because of database
+ // field sizes. For some reason FF ignored just changing the cursor
+ // when dragging, so we replace dropped images with error icon.
+ var replaceImgText = function(html) {
+ var ret = html.replace( /]*src="(data:.*;base64,.*?)"[^>]*>/gi, function( img, src ){
+ return img.replace(src,egw.image('error'));
+ });
+ return ret;
+ }
+
+ var chkImg = function() {
+ // don't execute code if the editor is readOnly
+ if (editor.readOnly)
+ return;
+
+ setTimeout( function() {
+ editor.document.$.body.innerHTML = replaceImgText(editor.document.$.body.innerHTML);
+ },200);
+ };
+
+ editor.on( 'contentDom', function() {
+ // For Firefox
+ editor.document.on('drop', chkImg);
+ // For IE
+ editor.document.getBody().on('drop', chkImg);
+ });
}
},