From d4e376992aae213eb44a4c95aba7f615eb436d9a Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Wed, 23 Dec 2015 20:48:30 +0100
Subject: [PATCH] [BUGFIX] Re-add deprecated but used JS code from
 EXT:rtehtmlarea

This reverts part of commit
"eeecf013ddd871e4a7d32fc44670245dd08fe364".

Change-Id: I0ce4b53cd1e1707b2acc6466eed7c1b5deb331a8
Resolves: #72423
Releases: master
Reviewed-on: https://review.typo3.org/45428
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
---
 .../Public/JavaScript/Modules/SelectImage.js  | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Modules/SelectImage.js b/typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Modules/SelectImage.js
index aa1d0c2b90b3..640bd1a23025 100644
--- a/typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Modules/SelectImage.js
+++ b/typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Modules/SelectImage.js
@@ -39,6 +39,26 @@ define(function () {
 		// Some labels localized on the server side
 		labels: {},
 
+		/**
+		 * Initialize an event handler for dropping an image in WebKit browsers
+		 *
+		 * @return void
+         * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
+		 */
+		initEventListeners: function() {
+			if (typeof console !== 'undefined') {
+				console.log('SelectImage.initEventListeners() is deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8');
+			}
+			require(
+				['TYPO3/CMS/Rtehtmlarea/HTMLArea/UserAgent/UserAgent', 'TYPO3/CMS/Rtehtmlarea/HTMLArea/Event/Event'],
+				function (UserAgent, Event) {
+					if (UserAgent.isWebKit) {
+						Event.one(window.document.body, 'dragend.TYPO3Image', function (event) { SelectImage.Plugin.get().onDrop(event); });
+					}
+				}
+			);
+		},
+
 		/**
 		 * Jump to the specified url after adding some parameters specific to the RTE context
 		 *
-- 
GitLab