CSSToolTipsToGo-Talk

Summary: Talk page for CSSToolTipsToGo.
Maintainer: Joan Vilaseca
Users: +1 (View / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.

Comments

Sorry for the long delay.

Last version (v.0.5) updated to use the current pmwiki Markup syntax and php7 & php8 function calls.

PHP 7.2

I am not an expert, but this works for me:

  • line 51-52

from:
Markup_e("TTTGDEF","fulltext","/\\(:tooltips (.*?):\\)/s", "cttgd(\$m[1])");
function cttgd($a) { return CSSToolTipsToGoDefine($a); }

to:
Markup("TTTGDEF","fulltext","/\\(:tooltips (.*?):\\)/s", "cttgd");
function cttgd($m) { $a = "$m[1]"; return CSSToolTipsToGoDefine($a); }

  • line 99-100

from:
reset($t);
while(list($k,$v) = each($t))

to:
foreach($t as $k => $v)

  • line 124-125

from:
Markup("CSSTTTG", "_begin", "/\\[\\|(.*?)\\|\\|(.*?)\\|\\|(.*?)\\|\\]/s", "cttgw(\$m[1],\$m[2],\$m[3])");
function cttgw($a,$b,$c) { return Keep(CSSToolTipsToGo($a,PSS($b),PSS($c))); }

to:
Markup("CSSTTTG", "_begin", "/\\[\\|(.*?)\\|\\|(.*?)\\|\\|(.*?)\\|\\]/s", "ToolTipTextMarkup");
function ToolTipTextMarkup($m) { return cttgw($m[1], $m[2], $m[3]); }
function cttgw($a,$b,$c) { return Keep(CSSToolTipsToGo($a,PSS($b),PSS($c))); }

  • line 173 (I use a few classes with fixed parameters in css)

from:
CSSToolTipsToGoDefine('');
to:
if ($classname='S') { CSSToolTipsToGoDefine('class=S'); }
else if ($classname='T') { CSSToolTipsToGoDefine('class=T'); }
...

In local css (example class=S)

span.tttgS { line-height: 1em; } span.PtttgS { display: none; } span.LtttgS { display: inline; color: #7388b4; } span.tttgS:hover span.PtttgS div { display: inline; padding: 0; margin: 0; } /* for images wrapped in a div */ span.tttgS:hover span.PtttgS { display: inline; color: #000; padding: 5px; font-size: 90%; overflow: auto; top: 0.4em; line-height: 1.2em; z-index: 100; text-align: center; left: 1.5em; min-width: 2em; max-width: 19em; min-height: 1em; max-height: 10em; border: 1px solid #79aea7; background: #939499; background-image: linear-gradient(top, #FCFCFC, #939499); background-image: -webkit-gradient(linear, left top, left bottom, from(#FCFCFC), to(#939499)); background-image: -moz-linear-gradient(top, #FCFCFC, #939499); background-image: -o-linear-gradient(top, #FCFCFC, #939499); }

Markup example:
[|S||hover here||to make appear this tooltip|]

Frank July 04, 2020, at 10:55 PM


PHP5.5 Compatibility Issue

M. Denning, 20170729: Ruleset is throwing the following compatibility error. Please, can this be addressed ASAP? Base site is battzion.org and WebMaster contact is at the bottom. Thanks!

CSSTTTG   _begin    B=   ! file: /cookbook/csstooltipstogo.php, line: 121, pat: /\[\|(.*?)\|\|(.*?)\|\|(.*?)\|\]/se
TTTGDEF   fulltext  B>=  ! file: /cookbook/csstooltipstogo.php, line: 49, pat: /\(:tooltips (.*?):\)/se
Update: I have updated lines 49 and 121
FROM049: Markup("TTTGDEF","fulltext","/\\(:tooltips (.*?):\\)/se", "CSSToolTipsToGoDefine('$1')");
TO049: Markup_e("TTTGDEF","fulltext","/\\(:tooltips (.*?):\\)/s", "CSSToolTipsToGoDefine(\$m[1])");
FROM121:
Markup("CSSTTTG", "_begin", "/\\[\\|(.*?)\\|\\|(.*?)\\|\\|(.*?)\\|\\]/se", 
"Keep(CSSToolTipsToGo('$1',PSS('$2'),PSS('$3')))");
TO121:
Markup_e("CSSTTTG", "_begin", "/\\[\\|(.*?)\\|\\|(.*?)\\|\\|(.*?)\\|\\]/s", 
"Keep(CSSToolTipsToGo(\$m[1],PSS(\$m[2]),PSS(\$m[3])))");
TakeAway:This seems to have taken away the error generated in Rule Table.
AfterThought:However, I would still be more comfortable if I obtained positive word from the other developers that this was the only updated necessary.

Typo?

Hi Joan, I am not an expert, but I think there is a typo on line 124. The recipe works for me just if I change

from -> Markup("CSSTTTG", "_begin", ...

to -> Markup_e("CSSTTTG", "_begin", ...

- Frank September 06, 2016, at 11:02 PM

Problems with Safari

Hi Joan, your recipe is really wonderful, I would like to use it, but it doesn't work with my browser (safari 6.0.2), I don't understand why, since LinkCSSToolTip (inspired by this recipe) works fine. Do you think there is a solution? Thanks in advance. -- Frank January 17, 2013 at 11:05 PM

  • Sorry, I can't help on this I am not using safari, so can't say what's going wrong. -- Joan Vilaseca 26 febrer 2013

Hello Joan, sorry, my mistake (probably I messed with config.php), the recipe works well on safari. Thank you. -- Frank June 9, 2014 at 01:57 AM

Talk page for the CSSToolTipsToGo recipe (users).