Fixed bug #16084: Clicking a label should set the focus on the input field
authorSteffen Kamper <info@sk-typo3.de>
Fri, 17 Dec 2010 10:24:09 +0000 (10:24 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Fri, 17 Dec 2010 10:24:09 +0000 (10:24 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9817 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php
t3lib/extjs/dataprovider/class.extdirect_dataprovider_contexthelp.php
t3lib/js/extjs/contexthelp.js
typo3/sysext/t3skin/stylesheets/structure/element_csh.css
typo3/sysext/t3skin/stylesheets/visual/element_csh.css

index 88ecb74..77fe099 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-12-17   Steffen Kamper  <steffen@typo3.org>
+
+       * Fixed bug #16084: Clicking a label should set the focus on the input field
+
 2010-12-17  Steffen Gebert  <steffen@steffen-gebert.de>
 
        * Fixed bug #16725: Wrong translation markers in Content Element Image (Thanks to Thomas Kieslich)
@@ -9,7 +13,7 @@
 
 2010-12-17  Jigal van Hemert <jigal@xs4all.nl>
 
-       * Fixed bug #16724: List Module -> field selector: the table has a wrong background color in current trunk (thanks to Peter Foerger) 
+       * Fixed bug #16724: List Module -> field selector: the table has a wrong background color in current trunk (thanks to Peter Foerger)
 
 2010-12-16  Jigal van Hemert <jigal@xs4all.nl>
 
index 2a7dd27..dde5276 100644 (file)
@@ -2621,11 +2621,7 @@ final class t3lib_BEfunc {
                global $TCA_DESCR, $BE_USER;
 
                if (is_array($TCA_DESCR[$table]) && is_array($TCA_DESCR[$table]['columns'][$field]) && (isset($BE_USER->uc['edit_showFieldHelp']) || $force)) {
-                       if ($BE_USER->uc['edit_showFieldHelp'] == 'icon') {
-                               $text = self::helpText($table, $field);
-                               $text = '<span class="typo3-csh-inline">' . $GLOBALS['LANG']->hscAndCharConv($text, FALSE) . '</span>';
-                       }
-                       return '<a class="typo3-csh-link" href="#" rel="' . $table . '.' . $field . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-help-open', array('class' => 'typo3-csh-icon')) . $text . '</a>';
+                       return self::wrapInHelp($table, $field);
                }
        }
 
@@ -2721,13 +2717,15 @@ final class t3lib_BEfunc {
                        // get the help text that should be shown on hover
                $GLOBALS['LANG']->loadSingleTableDescription($table);
                $helpText = self::helpText($table, $field);
+               $abbrClassAdd = '';
                if ($helpText) {
                                // if no text was given, just use the regular help icon
                        if ($text == '') {
                                $text = t3lib_iconWorks::getSpriteIcon('actions-system-help-open');
+                               $abbrClassAdd = '-icon';
                        }
-                       $text = '<abbr class="t3-help-teaser">' . $text . '</abbr>';
-                       $text = '<a class="t3-help-link" href="#" data-table="' . $table . '" data-field="' . $field . '">' . $text . '</a>';
+                       $text = '<abbr class="t3-help-teaser' . $abbrClassAdd . '">' . $text . '</abbr>';
+                       $text = '<span class="t3-help-link" href="#" data-table="' . $table . '" data-field="' . $field . '">' . $text . '</span>';
                }
                return $text;
        }
@@ -4700,4 +4698,4 @@ final class t3lib_BEfunc {
        }
 }
 
-?>
\ No newline at end of file
+?>
index b16bb88..046c67d 100644 (file)
@@ -39,10 +39,13 @@ class extDirect_DataProvider_ContextHelp {
         */
        public function getContextHelp($table, $field) {
                $helpTextArray = t3lib_befunc::helpTextArray($table, $field);
+               $moreIcon = $helpTextArray['moreInfo'] ? t3lib_iconWorks::getSpriteIcon('actions-view-go-forward') : '';
                return array(
                        'title' => $helpTextArray['title'],
-                       'description' => '<p class="t3-help-short">' . nl2br(strip_tags($helpTextArray['description'])) . '</p>',
+                       'description' => '<p class="t3-help-short' . ($moreIcon ? ' tipIsLinked' : '') . '">' .
+                                       $helpTextArray['description'] . $moreIcon . '</p>',
                        'id' => $table . '.' . $field,
+                       'moreInfo' =>  $helpTextArray['moreInfo']
                );
        }
 }
index be62ab8..7755dcf 100644 (file)
@@ -70,6 +70,7 @@ TYPO3.ContextHelp = function() {
        function updateTip(response) {
                tip.body.dom.innerHTML = response.description;
                tip.cshLink = response.id;
+               tip.moreInfo = response.moreInfo;
                tip.setTitle(response.title);
                tip.syncShadow();
        }
@@ -87,18 +88,25 @@ TYPO3.ContextHelp = function() {
                                minWidth: 160,
                                maxWidth: 240,
                                target: Ext.getBody(),
-                               delegate: 'a.t3-help-link',
+                               delegate: 'span.t3-help-link',
                                renderTo: Ext.getBody(),
                                cls: 'typo3-csh-tooltip',
                                dismissDelay: 0, // tooltip stays while mouse is over target
-                               showDelay: 1500, // show after 1.5 seconds
-                               hideDelay: 1500, // hide after 1.5 seconds
+                               showDelay: 500, // show after 0.5 seconds
+                               hideDelay: 3000, // hide after 3 seconds
+                               closable: true,
                                listeners: {
                                        beforeshow: showToolTipHelp,
                                        render: function(tip) {
                                                tip.body.on('click', function(event){
                                                        event.stopEvent();
-                                                       top.TYPO3.ContextHelpWindow.open(this.cshLink);
+                                                       if (tip.moreInfo)
+                                                               try {
+                                                                       top.TYPO3.ContextHelpWindow.open(tip.cshLink);
+                                                               } catch(e) {
+                                                                       // do nothing
+                                                               }
+
                                                });
                                        },
                                        hide: function(tip) {
@@ -108,7 +116,6 @@ TYPO3.ContextHelp = function() {
                                        scope: this
                                }
                        });
-                       Ext.select('div').on('click', TYPO3.ContextHelp.openHelpWindow, TYPO3.ContextHelp, {delegate: 'a.t3-help-link'});
                },
 
 
index e2a3902..97aa7f7 100644 (file)
@@ -123,9 +123,6 @@ div.typo3-view-help img.c-inlineimg  {
 
 
 /*** new help code ***/
-.t3-help-teaser {
-       border-bottom: 1px dotted #434343;
-}
 table.t3-help-inline {
        margin: 3px 4px 20px 0px;
        padding: 0;
@@ -241,4 +238,4 @@ div.t3-view-help .introduction {
 
 div.t3-view-help img.c-inlineimg  {
        margin-left: 10px;
-}
\ No newline at end of file
+}
index 97d6e2a..7e20a0a 100644 (file)
@@ -59,10 +59,15 @@ div.t3-help-inline p.t3-help-short {
        border-top: none;
 }
 
-p.t3-help-short {
+p.t3-help-short.tipIsLinked {
        cursor: pointer;
 }
 
+.t3-help-teaser,
+.t3-help-teaser-icon {
+       cursor: help;
+}
+
 img.t3-help-icon {
        cursor: help;
 }
@@ -114,4 +119,4 @@ div.typo3-view-help .manual-title a,
 div.typo3-view-help div.c-toc a,
 div.typo3-view-help p a {
        text-decoration: underline;
-}
\ No newline at end of file
+}