From 1f3bc40112b9bdaeeccec1a1260216ed62936121 Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Tue, 28 Mar 2017 13:08:37 +0200
Subject: [PATCH] [TASK] Deprecate config.setJS_mouseOver and
 config.setJS_openPic

The TypoScript properties config.setJS_mouseOver and config.setJS_openPic
have been marked as deprecated.

Resolves: #80516
Releases: master
Change-Id: Ida5de8b3e873adfe7e27decf6e43813e7dc5cc2e
Reviewed-on: https://review.typo3.org/52213
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 ...gsetJS_mouseOverAndConfigsetJS_openPic.rst | 34 +++++++++++++++++++
 .../TypoScriptFrontendController.php          |  8 +++++
 .../frontend/Classes/Page/PageGenerator.php   |  8 +++++
 .../t3editor/Resources/Private/tsref.xml      | 10 ------
 .../parse_typoscript/tokenizetyposcript.js    |  2 --
 5 files changed, 50 insertions(+), 12 deletions(-)
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-80516-TypoScriptConfigsetJS_mouseOverAndConfigsetJS_openPic.rst

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80516-TypoScriptConfigsetJS_mouseOverAndConfigsetJS_openPic.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80516-TypoScriptConfigsetJS_mouseOverAndConfigsetJS_openPic.rst
new file mode 100644
index 000000000000..66a17e6ff092
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80516-TypoScriptConfigsetJS_mouseOverAndConfigsetJS_openPic.rst
@@ -0,0 +1,34 @@
+.. include:: ../../Includes.txt
+
+================================================================================
+Deprecation: #80516 - TypoScript config.setJS_mouseOver and config.setJS_openPic
+================================================================================
+
+See :issue:`80516`
+
+Description
+===========
+
+The TypoScript properties `config.setJS_mouseOver` and `config.setJS_openPic` have been marked
+as deprecated.
+
+
+Impact
+======
+
+Setting any of the TypoScript properties will trigger a deprecation log entry.
+
+
+Affected Installations
+======================
+
+Any installation using these TypoScript options.
+
+
+Migration
+=========
+
+Include the small JavaScript files directly in your custom JavaScript file or inline via
+`page.inlineJS`.
+
+.. index:: TypoScript
\ No newline at end of file
diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
index 8a25201cbe3a..5afbc40be69c 100644
--- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
+++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
@@ -3238,9 +3238,17 @@ class TypoScriptFrontendController
         $GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_allowUpscaling'] = (bool)(isset($this->config['config']['noScaleUp']) ? !$this->config['config']['noScaleUp'] : $GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_allowUpscaling']);
         $this->ATagParams = trim($this->config['config']['ATagParams']) ? ' ' . trim($this->config['config']['ATagParams']) : '';
         if ($this->config['config']['setJS_mouseOver']) {
+            $this->logDeprecatedTyposcript(
+                'config.setJS_mouseOver',
+                'The TypoScript property "config.setJS_mouseOver" is deprecated since TYPO3 v8 and will be removed in TYPO3 v9. Please include the JavaScript snippet directly via TypoScript page.jsInline.'
+            );
             $this->setJS('mouseOver');
         }
         if ($this->config['config']['setJS_openPic']) {
+            $this->logDeprecatedTyposcript(
+                'config.setJS_openPic',
+                'The TypoScript property "config.setJS_openPic" is deprecated since TYPO3 v8 and will be removed in TYPO3 v9. Please include the JavaScript snippet directly via TypoScript page.jsInline.'
+            );
             $this->setJS('openPic');
         }
         $this->initializeSearchWordDataInTsfe();
diff --git a/typo3/sysext/frontend/Classes/Page/PageGenerator.php b/typo3/sysext/frontend/Classes/Page/PageGenerator.php
index 311ca3a6b81f..f860b862457d 100644
--- a/typo3/sysext/frontend/Classes/Page/PageGenerator.php
+++ b/typo3/sysext/frontend/Classes/Page/PageGenerator.php
@@ -112,9 +112,17 @@ class PageGenerator
         $GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_allowUpscaling'] = (bool)(isset($tsfe->config['config']['noScaleUp']) ? !$tsfe->config['config']['noScaleUp'] : $GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_allowUpscaling']);
         $tsfe->ATagParams = trim($tsfe->config['config']['ATagParams']) ? ' ' . trim($tsfe->config['config']['ATagParams']) : '';
         if ($tsfe->config['config']['setJS_mouseOver']) {
+            $tsfe->logDeprecatedTyposcript(
+                'config.setJS_mouseOver',
+                'The TypoScript property "config.setJS_mouseOver" is deprecated since TYPO3 v8 and will be removed in TYPO3 v9. Please include the JavaScript snippet directly via TypoScript page.jsInline.'
+            );
             $tsfe->setJS('mouseOver');
         }
         if ($tsfe->config['config']['setJS_openPic']) {
+            $tsfe->logDeprecatedTyposcript(
+                'config.setJS_openPic',
+                'The TypoScript property "config.setJS_openPic" is deprecated since TYPO3 v8 and will be removed in TYPO3 v9. Please include the JavaScript snippet directly via TypoScript page.jsInline.'
+            );
             $tsfe->setJS('openPic');
         }
         static::initializeSearchWordDataInTsfe();
diff --git a/typo3/sysext/t3editor/Resources/Private/tsref.xml b/typo3/sysext/t3editor/Resources/Private/tsref.xml
index 0d5fe821b962..6fc1a26a050e 100644
--- a/typo3/sysext/t3editor/Resources/Private/tsref.xml
+++ b/typo3/sysext/t3editor/Resources/Private/tsref.xml
@@ -769,16 +769,6 @@ The background problem is this: In TYPO3 the same URL can show different content
 
 Another way to solve the problem is using this option in combination with disabling and enabling logins in various sections of the site. In the page records ("Advanced" page types) you can disable frontend user logins for branches of the page tree. Since many sites only needs the login in a certain branch of the page tree, disabling it in all other branches makes it much easier to use cache-headers in combination with logins; Cache-headers should simply be sent when logins are not allowed and never be send when logins are allowed! Then there will never be problems with logins and same-URLs.]]></description>
 			<default><![CDATA[
-]]></default>
-		</property>
-		<property name="setJS_mouseOver" type="boolean">
-			<description><![CDATA[If set, the over() and out() JavaScript functions are forced to be included]]></description>
-			<default><![CDATA[
-]]></default>
-		</property>
-		<property name="setJS_openPic" type="boolean">
-			<description><![CDATA[If set, the openPic JavaScript function is forced to be included]]></description>
-			<default><![CDATA[
 ]]></default>
 		</property>
 		<property name="spamProtectEmailAddresses" type="string">
diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/parse_typoscript/tokenizetyposcript.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/parse_typoscript/tokenizetyposcript.js
index 60a4f11fbe14..4a99b8d234f6 100644
--- a/typo3/sysext/t3editor/Resources/Public/JavaScript/parse_typoscript/tokenizetyposcript.js
+++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/parse_typoscript/tokenizetyposcript.js
@@ -781,8 +781,6 @@ var typoscriptWords = {
 	'setContentToCurrent': 'reserved',
 	'setCurrent': 'reserved',
 	'setfixed': 'reserved',
-	'setJS_mouseOver': 'reserved',
-	'setJS_openPic': 'reserved',
 	'setOnly': 'reserved',
 	'setup': 'keyword2',
 	'shadow': 'reserved',
-- 
GitLab