From 31bc7ec841f8eb808947a04579a8bca470e353e4 Mon Sep 17 00:00:00 2001
From: Piotr Jasiun
Date: Wed, 23 Sep 2015 17:22:43 +0200
Subject: [PATCH 1/4] Add image paste support on Edge.
---
plugins/clipboard/plugin.js | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/plugins/clipboard/plugin.js b/plugins/clipboard/plugin.js
index a9fe0fa63f7..0f157d1ad58 100644
--- a/plugins/clipboard/plugin.js
+++ b/plugins/clipboard/plugin.js
@@ -2044,7 +2044,8 @@
*/
initPasteDataTransfer: function( evt, sourceEditor ) {
if ( !this.isCustomCopyCutSupported ) {
- return new this.dataTransfer( null, sourceEditor );
+ // Edge does not support custom copy/cut, but it have some useful data in the clipboardData (#13755).
+ return new this.dataTransfer( evt.data.$ && evt.data.$.clipboardData || null, sourceEditor );
} else if ( evt && evt.data && evt.data.$ ) {
var dataTransfer = new this.dataTransfer( evt.data.$.clipboardData, sourceEditor );
@@ -2361,8 +2362,11 @@
if ( ( this.$ && this.$.files ) || file ) {
this._.files = [];
- for ( i = 0; i < this.$.files.length; i++ ) {
- this._.files.push( this.$.files[ i ] );
+ // Edge have empty files property with no length (#13755).
+ if ( this.$.files && this.$.files.length ) {
+ for ( i = 0; i < this.$.files.length; i++ ) {
+ this._.files.push( this.$.files[ i ] );
+ }
}
// Don't include $.items if both $.files and $.items contains files, because,
From 8780cae5bb1b25f990de38a7477aaa8e9b830ce5 Mon Sep 17 00:00:00 2001
From: "m.lewandowski"
Date: Mon, 22 Aug 2016 07:46:42 +0200
Subject: [PATCH 2/4] Adjusted clipboard code for Edge, so that tests are not
failing.
---
plugins/clipboard/plugin.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/clipboard/plugin.js b/plugins/clipboard/plugin.js
index 0f157d1ad58..6ba3b1485ca 100644
--- a/plugins/clipboard/plugin.js
+++ b/plugins/clipboard/plugin.js
@@ -2045,7 +2045,7 @@
initPasteDataTransfer: function( evt, sourceEditor ) {
if ( !this.isCustomCopyCutSupported ) {
// Edge does not support custom copy/cut, but it have some useful data in the clipboardData (#13755).
- return new this.dataTransfer( evt.data.$ && evt.data.$.clipboardData || null, sourceEditor );
+ return new this.dataTransfer( ( CKEDITOR.env.edge && evt && evt.data.$ && evt.data.$.clipboardData ) || null, sourceEditor );
} else if ( evt && evt.data && evt.data.$ ) {
var dataTransfer = new this.dataTransfer( evt.data.$.clipboardData, sourceEditor );
From 3cfb027a74036cb56b3b28c95e7cd572b142baf2 Mon Sep 17 00:00:00 2001
From: "m.lewandowski"
Date: Mon, 22 Aug 2016 07:59:13 +0200
Subject: [PATCH 3/4] Tagged manual test for the ticket.
---
tests/plugins/uploadwidget/manual/image2.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/plugins/uploadwidget/manual/image2.md b/tests/plugins/uploadwidget/manual/image2.md
index 90134554007..80c9be79faf 100644
--- a/tests/plugins/uploadwidget/manual/image2.md
+++ b/tests/plugins/uploadwidget/manual/image2.md
@@ -1,4 +1,4 @@
-@bender-tags: 4.5.0, tc, clipboard, widget, filetools
+@bender-tags: 4.5.0, 4.5.11, tc, clipboard, widget, filetools, 13755
@bender-ui: collapsed
@bender-ckeditor-plugins: wysiwygarea, toolbar, undo, uploadwidget, basicstyles, image2, uploadimage, font, stylescombo, basicstyles, format, maximize, blockquote, list, table, resize, elementspath, justify
@bender-include: _helpers/xhr.js
From db0a51ab37c036d76d0c8b08c518e9c4817fabdc Mon Sep 17 00:00:00 2001
From: "m.lewandowski"
Date: Mon, 22 Aug 2016 08:17:23 +0200
Subject: [PATCH 4/4] Changelog entry.
---
CHANGES.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/CHANGES.md b/CHANGES.md
index 7b5c9082d35..938ba104abb 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -3,6 +3,10 @@ CKEditor 4 Changelog
## CKEditor 4.5.11
+Fixed Issues:
+
+* [#13755](http://dev.ckeditor.com/ticket/13755): [Edge] Fixed: Pasting images in Edge does not work.
+
## CKEditor 4.5.10
Fixed Issues: