[BUGFIX] Re-add deprecated but used JS code from EXT:rtehtmlarea 28/45428/3
authorBenni Mack <benni@typo3.org>
Wed, 23 Dec 2015 19:48:30 +0000 (20:48 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 24 Dec 2015 10:17:28 +0000 (11:17 +0100)
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>
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Modules/SelectImage.js

index aa1d0c2..640bd1a 100644 (file)
@@ -40,6 +40,26 @@ define(function () {
                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
                 *
                 * @return bool