Project

General

Profile

Bug #23806 ยป tooltip_improvements.patch

Administrator Admin, 2010-12-09 18:32

View differences:

t3lib/extjs/dataprovider/class.extdirect_dataprovider_contexthelp.php (revision )
*/
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']
);
}
}
t3lib/class.t3lib_befunc.php (revision )
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 self::wrapInHelp($table, $field);
}
}
return '<a class="typo3-csh-link" href="#" rel="' . $table . '.' . $field . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-help-open', array('class' => 'typo3-csh-icon')) . $text . '</a>';
}
}
}
/**
* Returns CSH help text (description), if configured for, as an array (title, description)
......
// 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;
}
typo3/sysext/t3skin/stylesheets/visual/element_csh.css (revision )
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;
}
t3lib/js/extjs/contexthelp.js (revision )
function updateTip(response) {
tip.body.dom.innerHTML = response.description;
tip.cshLink = response.id;
tip.moreInfo = response.moreInfo;
tip.setTitle(response.title);
tip.syncShadow();
}
......
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) {
......
scope: this
}
});
Ext.select('div').on('click', TYPO3.ContextHelp.openHelpWindow, TYPO3.ContextHelp, {delegate: 'a.t3-help-link'});
},
    (1-1/1)