[TASK] Remove old JS in page header 13/18313/4
authorGeorg Ringer <georg.ringer@gmail.com>
Sat, 16 Feb 2013 12:05:09 +0000 (13:05 +0100)
committerBenjamin Mack <benni@typo3.org>
Sat, 16 Mar 2013 16:05:03 +0000 (17:05 +0100)
Change-Id: I509ffe2cc3dc37cc08de3633c79127c1f50145a7
Resolves: #45528
Releases: 6.1
Reviewed-on: https://review.typo3.org/18313
Reviewed-by: Oliver Klee
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Markus Klein
Reviewed-by: Henrik Ziegenhain
Reviewed-by: Thomas Loeffler
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
typo3/sysext/frontend/Classes/Page/PageGenerator.php
typo3/sysext/t3editor/res/tsref/tsref.xml

index 078adad..84c58eb 100644 (file)
@@ -718,18 +718,8 @@ class PageGenerator {
                        $GLOBALS['TSFE']->INTincScript_loadJSCode();
                }
                $JSef = self::JSeventFunctions();
-               // Adding default Java Script:
-               $scriptJsCode = '
-               var browserName = navigator.appName;
-               var browserVer = parseInt(navigator.appVersion);
-               var version = "";
-               var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
-               if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror" || browserName=="Opera") {version = "n3";} else {version = "n2";}
-                       // Blurring links:
-               function blurLink(theObject) {  //
-                       if (msie4) {theObject.blur();}
-               }
-               ' . $JSef[0];
+               $scriptJsCode = $JSef[0];
+
                if ($GLOBALS['TSFE']->spamProtectEmailAddresses && $GLOBALS['TSFE']->spamProtectEmailAddresses !== 'ascii') {
                        $scriptJsCode .= '
                        // decrypt helper function
@@ -831,7 +821,9 @@ class PageGenerator {
                        if ($inlineJSint) {
                                $pageRenderer->addJsInlineCode('TS_inlineJSint', $inlineJSint, $GLOBALS['TSFE']->config['config']['compressJs']);
                        }
-                       $pageRenderer->addJsFile(self::inline2TempFile($scriptJsCode . $inlineJS, 'js'), 'text/javascript', $GLOBALS['TSFE']->config['config']['compressJs']);
+                       if (trim($scriptJsCode . $inlineJS)) {
+                               $pageRenderer->addJsFile(self::inline2TempFile($scriptJsCode . $inlineJS, 'js'), 'text/javascript', $GLOBALS['TSFE']->config['config']['compressJs']);
+                       }
                        if ($inlineFooterJs) {
                                $inlineFooterJSint = '';
                                self::stripIntObjectPlaceholder($inlineFooterJs, $inlineFooterJSint);
@@ -1031,4 +1023,4 @@ class PageGenerator {
 }
 
 
-?>
\ No newline at end of file
+?>
index e7bb798..7cbbcef 100644 (file)
@@ -268,10 +268,7 @@ background-color for the gap-tablecells]]></description>
                <property name="ATagParams" type="string">
                        <description><![CDATA[<A>-params
       Additional parameters to all links in TYPO3 (excluding menu-links)
-
-Example:
-To blur links, insert:
-onFocus="blurLink(this)"]]></description>
+]]></description>
                        <default><![CDATA[
 ]]></default>
                </property>
@@ -839,7 +836,7 @@ Keywords are the same as for "xhtml_cleaning", see above.]]></description>
                </property>
                <property name="removeDefaultJS" type="string">
                        <description><![CDATA[If set, the default JavaScript in the header will be removed.
-The default JavaScript is the blurLink function and browser detection variables.
+The default JavaScript is the decryption function for email addresses.
 
 Special case: if the value is "external" then the default JavaScript is written to a temporary file and included from that file. See "inlineStyle2TempFile" below.