[BUGFIX] Correctly apply titleText set in RTE TSconfig 93/48693/2
authorJorgen van der Kroon <jurgen@alternet.nl>
Mon, 27 Jun 2016 10:41:23 +0000 (12:41 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 28 Jun 2016 17:22:13 +0000 (19:22 +0200)
With the changes of the new formEngine the names of forms and
elements must be adjusted to make the Page TSconfig options
RTE.classesAnchor.[id].titleText work again.

Resolves: #75804
Releases: master, 7.6
Change-Id: I92b2c6d0dcb959834db3bb8868beab55b627abac
Reviewed-on: https://review.typo3.org/48693
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/RteLinkBrowser.js

index 60b54d4..b43c6eb 100644 (file)
@@ -31,35 +31,29 @@ define(['jquery', 'TYPO3/CMS/Recordlist/LinkBrowser'], function($, LinkBrowser)
        };
 
        RteLinkBrowser.changeClassSelector = function() {
-               // @todo totally non-working code. just copied that over as a first step
-
-               if (document.ltargetform.anchor_class) {
-                       document.ltargetform.anchor_class.value = document.ltargetform.anchor_class.options[document.ltargetform.anchor_class.selectedIndex].value;
-                       if (document.ltargetform.anchor_class.value && RteLinkBrowser.HTMLArea.classesAnchorSetup) {
+               if (document.lclassform.lclass) {
+                       document.lclassform.lclass.value = document.lclassform.lclass.options[document.lclassform.lclass.selectedIndex].value;
+                       if (document.lclassform.lclass.value && RteLinkBrowser.HTMLArea.classesAnchorSetup) {
                                for (var i = RteLinkBrowser.HTMLArea.classesAnchorSetup.length; --i >= 0;) {
                                        var anchorClass = RteLinkBrowser.HTMLArea.classesAnchorSetup[i];
-                                       if (anchorClass['name'] === document.ltargetform.anchor_class.value) {
-                                               if (anchorClass['titleText'] && document.ltargetform.ltitle) {
-                                                       document.ltargetform.anchor_title.value = anchorClass['titleText'];
+                                       if (anchorClass['name'] === document.lclassform.lclass.value) {
+                                               if (anchorClass['titleText'] && document.ltitleform.ltitle) {
+                                                       document.ltitleform.ltitle.value = anchorClass['titleText'];
                                                        document.getElementById('rtehtmlarea-browse-links-title-readonly').innerHTML = anchorClass['titleText'];
-                                                       browse_links_setTitle(anchorClass['titleText']);
                                                }
                                                if (typeof anchorClass['target'] !== 'undefined') {
                                                        if (document.ltargetform.ltarget) {
                                                                document.ltargetform.ltarget.value = anchorClass['target'];
                                                        }
-                                                       browse_links_setTarget(anchorClass['target']);
                                                } else if (document.ltargetform.ltarget && document.getElementById('ltargetrow').style.display === 'none') {
                                                        // Reset target to default if field is not displayed and class has no configured target
                                                        document.ltargetform.ltarget.value = RteLinkBrowser.defaultLinkTarget;
-                                                       browse_links_setTarget(document.ltargetform.ltarget.value);
                                                }
                                                break;
                                        }
 
                                }
                        }
-                       browse_links_setClass(document.ltargetform.anchor_class.value);
                }
        };