From 6414c2f10fc2b9a56ef8925526946fc6ea536a1f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 29 Jul 2013 17:40:17 +0200 Subject: [PATCH] Preventing drag&drop of images --- .../ckeditor/plugins/wbbcode/plugin.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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')); + $('