[BUGFIX] Improve rendering of long text 44/52144/3
authorMarkus Sommer <markussom@posteo.de>
Fri, 24 Mar 2017 14:56:50 +0000 (15:56 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 30 Mar 2017 21:07:04 +0000 (23:07 +0200)
Resolves: #79670
Release: master
Change-Id: I63e0edc5785b1bb81fcaeb9009b0844056c922f0
Reviewed-on: https://review.typo3.org/52144
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Form/Element/InputLinkElement.php
typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js

index f1442d9..5594610 100644 (file)
@@ -210,7 +210,7 @@ class InputLinkElement extends AbstractFormElement
         $expansionHtml[] =      '<div class="form-wizards-element">';
         $expansionHtml[] =          '<div class="input-group t3js-form-field-inputlink">';
         $expansionHtml[] =              '<span class="input-group-addon">' . $linkExplanation['icon'] . '</span>';
-        $expansionHtml[] =              '<div class="form-control form-field-inputlink-explanation t3js-form-field-inputlink-explanation" data-toggle="tooltip" data-title="' . $explanation . '">' . $explanation . '</div>';
+        $expansionHtml[] =              '<input class="form-control form-field-inputlink-explanation t3js-form-field-inputlink-explanation" data-toggle="tooltip" data-title="' . $explanation . '" value="' . $explanation . '" readonly>';
         $expansionHtml[] =              '<input type="text"' . GeneralUtility::implodeAttributes($attributes, true) . ' />';
         $expansionHtml[] =              '<span class="input-group-btn">';
         $expansionHtml[] =                  '<button class="btn btn-default t3js-form-field-inputlink-explanation-toggle" type="button" title="' . htmlspecialchars($toggleButtonTitle) . '">';
@@ -339,7 +339,7 @@ class InputLinkElement extends AbstractFormElement
                 break;
             case LinkService::TYPE_URL:
                 $data = [
-                    'text' => $linkData['url'],
+                    'text' => $this->getDomainByUrl($linkData['url']),
                     'icon' => $this->iconFactory->getIcon('apps-pagetree-page-shortcut-external', Icon::SIZE_SMALL)->render()
 
                 ];
@@ -409,6 +409,17 @@ class InputLinkElement extends AbstractFormElement
     }
 
     /**
+     * @param string $uriString
+     *
+     * @return string
+     */
+    protected function getDomainByUrl(string $uriString): string
+    {
+        $data = parse_url($uriString);
+        return $data['host'] ?? '';
+    }
+
+    /**
      * @return LanguageService
      */
     protected function getLanguageService()
index 0923267..2c622e0 100644 (file)
@@ -1007,7 +1007,7 @@ define(['jquery',
 
                // if empty, show input field
                $(explanationClass).filter(function () {
-                       return !$.trim($(this).html());
+                       return !$.trim($(this).val());
                }).each(function () {
                        var $group = $(this).closest('.t3js-form-field-inputlink'),
                                $inputField = $group.find(inputFieldClass),