diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/fancytooltips/fancytooltips.sty | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/fancytooltips/fancytooltips.sty b/Master/texmf-dist/tex/latex/fancytooltips/fancytooltips.sty index a06e2c4292b..3a4011f9c50 100644 --- a/Master/texmf-dist/tex/latex/fancytooltips/fancytooltips.sty +++ b/Master/texmf-dist/tex/latex/fancytooltips/fancytooltips.sty @@ -40,6 +40,9 @@ \newif\ifmovetips\movetipsfalse \DeclareOptionX{movetips}{\movetipstrue} +\newif\ifmouseover\mouseoverfalse +\DeclareOptionX{mouseover}{\mouseovertrue} + \DeclareOptionX{filename}{\xdef\TooltipFilename{#1}} \DeclareOptionX{pages}{\xdef\TooltipPages{#1}} @@ -115,6 +118,20 @@ \AddToShipoutPicture{\hbox to 0 pt{\frametip\hss}} \definecolor{tooltipcolor}{rgb}{0,0,1} \def\TooltipPage#1{\expandafter\gdef\csname TooltipPage#1\endcsname{#1}} +\ifmouseover +\def\tooltip#1#2{% + \write\@auxout{\noexpand\TooltipPage{\thepage}}% + \checkTipNumber{#2}\edef\TipNumber{\FindTipNumber{#2}}% + \leavevmode + \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\hbox to 0 pt{{\copy0\TooltipExtratext\hss}}% + \pushButton[\BC{}\BG{}\S{}\AA{\AAMouseExit{\JS{CloseTooltips();}} + \AAMouseEnter{\JS{this.getField("ikona."+(this.pageNum+1)).hidden=false; + try {app.clearInterval(animace);}catch (e) {} + \ifmovetips nastav(\TipNumber);\fi + zobraz(\TipNumber); + }}}] + {TooltipField}{\wd0}{\ht0}} +\else \def\tooltip#1#2{% \write\@auxout{\noexpand\TooltipPage{\thepage}}% \checkTipNumber{#2}\edef\TipNumber{\FindTipNumber{#2}}% @@ -127,7 +144,31 @@ zobraz(\TipNumber); }}] {TooltipField}{\wd0}{\ht0}} +\fi \def\delayinterval{200} +\ifmouseover +\def\tooltipanim#1#2#3{% + \write\@auxout{\noexpand\TooltipPage{\thepage}}% + \checkTipNumber{#2}\edef\TipNumberA{\FindTipNumber{#2}}% + \checkTipNumber{#3}\edef\TipNumberB{\FindTipNumber{#3}}% + \leavevmode + \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\hbox to 0 pt{{\copy0\TooltipExtratext\hss}}% + \pushButton[\BC{}\BG{}\S{}\AA{\AAMouseExit{\JS{CloseTooltips();}} + \AAMouseEnter{\JS{ + try {app.clearInterval(animace);}catch (e) {} + var cislo=\TipNumberA; + \ifmovetips nastav(\TipNumberA);\fi + function animuj() + { + if (cislo<\TipNumberB) cislo=cislo+1; else {try {app.clearInterval(animace);}catch (e) {};} + this.getField('ikona.'+(this.pageNum+1)).buttonSetIcon(this.getField("animtiph."+cislo).buttonGetIcon()); + }; + this.getField('ikona.'+(this.pageNum+1)).buttonSetIcon(this.getField("animtiph."+\TipNumberA).buttonGetIcon()); + this.getField("ikona."+(this.pageNum+1)).hidden=false; + animace=app.setInterval('animuj();', \delayinterval); + }}} + ]{TooltipField}{\wd0}{\ht0}} +\else \def\tooltipanim#1#2#3{% \write\@auxout{\noexpand\TooltipPage{\thepage}}% \checkTipNumber{#2}\edef\TipNumberA{\FindTipNumber{#2}}% @@ -141,7 +182,7 @@ \ifmovetips nastav(\TipNumberA);\fi function animuj() { - if (cislo<\TipNumberB) cislo=cislo+1; + if (cislo<\TipNumberB) cislo=cislo+1; else {try {app.clearInterval(animace);}catch (e) {};} this.getField('ikona.'+(this.pageNum+1)).buttonSetIcon(this.getField("animtiph."+cislo).buttonGetIcon()); }; this.getField('ikona.'+(this.pageNum+1)).buttonSetIcon(this.getField("animtiph."+\TipNumberA).buttonGetIcon()); @@ -149,6 +190,7 @@ animace=app.setInterval('animuj();', \delayinterval); }} ]{TooltipField}{\wd0}{\ht0}} +\fi \ifTooltip@usepdftex \def\TooltipPageopencloseJS{ \global\pdfpageattr{% /AA << /O << /S /JavaScript /JS (CloseTooltips();) >> >>}% |