From: Alexander Ebert Date: Mon, 29 Jul 2013 15:40:17 +0000 (+0200) Subject: Preventing drag&drop of images X-Git-Tag: 2.0.0_Beta_6~21 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6414c2f10fc2b9a56ef8925526946fc6ea536a1f;p=GitHub%2FWoltLab%2FWCF.git Preventing drag&drop of images --- diff --git a/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js b/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js index 384b12a4b0..780a8dc1a0 100644 --- a/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js +++ b/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js @@ -13,6 +13,7 @@ * Fixes issues with pasted html. */ event.editor.on('paste', function(ev) { + console.debug("currentValue = " + ev.data.dataValue); if (ev.data.type == 'html') { var $value = ev.data.dataValue; @@ -28,19 +29,31 @@ // convert lists into new lines $value = $value.replace(/<\/li>/gi, "\n"); - + console.debug($value); // remove html tags $value = $value.replace(/<[^>]+>/g, ''); // fix multiple new lines $value = $value.replace(/\n{3,}/gi,"\n\n"); + window.dtdesign = $value; + ev.data.dataValue = $value; $pasted = true; } }, null, null, 9); + // prevent drag and drop of images in Firefox + event.editor.document.on('drop', function(ev) { + if (ev.data.$.dataTransfer) { + var $html = ev.data.$.dataTransfer.getData('text/html'); + if (/').hide().appendTo($(event.editor.document.$).find('html')); + $('