diff options
author | Karl Berry <karl@freefriends.org> | 2018-11-29 23:19:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-11-29 23:19:26 +0000 |
commit | 67346dfe318b0d3d08c7104eefd0a5bc34a84996 (patch) | |
tree | c1e6b7b92c82d3ba834a8014af594d7248d9d6fe /Master/texmf-dist/tex/latex/animate | |
parent | 62fd2d08a3db1709b036e097b68370d78ab5b5c7 (diff) |
animate (29nov18)
git-svn-id: svn://tug.org/texlive/trunk@49273 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/animate')
-rw-r--r-- | Master/texmf-dist/tex/latex/animate/animate.sty | 69 |
1 files changed, 52 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty index 4d107b7a83d..17ce7587acf 100644 --- a/Master/texmf-dist/tex/latex/animate/animate.sty +++ b/Master/texmf-dist/tex/latex/animate/animate.sty @@ -13,7 +13,7 @@ \NeedsTeXFormat{LaTeX2e} -\def\@anim@version{2018/11/20} +\def\@anim@version{2018/11/29} \ProvidesPackage{animate} [\@anim@version\space PDF & SVG animations from files and inline graphics] @@ -1334,6 +1334,8 @@ \IfFileExists{#1\@anim@ext}{}{% \gdef\@anim@ext{.ps}% \IfFileExists{#1\@anim@ext}{}{% + \gdef\@anim@ext{.mps}% + \IfFileExists{#1\@anim@ext}{}{% \gdef\@anim@ext{.svg}% \IfFileExists{#1\@anim@ext}{}{% \gdef\@anim@ext{.png}% @@ -1346,6 +1348,7 @@ None of the files\MessageBreak% `#1.eps',\MessageBreak% `#1.ps',\MessageBreak% + `#1.mps',\MessageBreak% `#1.svg',\MessageBreak% `#1.png',\MessageBreak% `#1.jpg',\MessageBreak% @@ -1353,7 +1356,7 @@ could be found.\MessageBreak% Wrong file type? Mis-spelled file name?% }{}% - }}}}}}% + }}}}}}}% \else% \gdef\@anim@ext{.#2}% \IfFileExists{#1\@anim@ext}{}{% @@ -1877,10 +1880,6 @@ id='anm#1' \if@anim@nomouse\else cursor='pointer' - onmousedown='onMouseDownWdgt();' - % not working in FF while doing so in Chrome; FF fails to pass - % MouseEvent to handler; bug? will use addEventListener() - %onmouseup='onMouseUpWdgt(event);' \fi% }% \@anim@updatebbox{\@anim@animwidth}{\@anim@animheight}{\@anim@animdepth}% @@ -1958,8 +1957,8 @@ /PI <</S/JavaScript/JS \@anim@pcjscriptobj>>% PageInvisible /PC <</S/JavaScript/JS \@anim@pcjscriptobj>>% PageClose \if@anim@nomouse\else% - /D <</S/JavaScript/JS (\@anim@wdgtDownJSString{#1})>>% mouse-down - /U <</S/JavaScript/JS (\@anim@wdgtUpJSString{#1})>>% mouse-up + /D <</S/JavaScript/JS (\@anim@wdgtDownJS{#1})>>% mouse-down + /U <</S/JavaScript/JS (\@anim@wdgtUpJS{#1})>>% mouse-up \fi% >>% /AP <</N \@anim@apmk>>% @@ -2009,7 +2008,7 @@ % insert widget \if@anim@js% \@anim@annot{\@anim@btnsize}{\@anim@btnsize}{\z@}{% - cursor='pointer' onmouseup='\@anim@btnUpJSString{#1}{\@anim@arg}'% + cursor='pointer' onmousedown='\@anim@btnJS{#1}{\@anim@arg}'% }% \@anim@updatebbox{\@anim@btnsize}{\@anim@btnsize}{}% \hbox to \@anim@btnsize {% @@ -2020,7 +2019,7 @@ } \else \def\@anim@buttonwidget#1#2#3{%#1:@anim@num, #2:action, - % #3:button face and colour combination + %#3:button face and colour combination \edef\@anim@arg{#2}\@anim@jstrue\@anim@mktrue% \def\@anim@annotflag{/F 0}% visible, but don't print \ifx\@anim@PlayLeft\@anim@arg\@anim@jsfalse\fi% %hidden, don't print | @@ -2052,7 +2051,8 @@ /T (#1.#2)% \@anim@tooltip% \if@anim@js% - /A <</S/JavaScript/JS (\@anim@btnUpJSString{#1}{\@anim@arg})>>% + %/A <</S/JavaScript/JS (\@anim@btnJS{#1}{\@anim@arg})>>% + /AA <</D <</S/JavaScript/JS (\@anim@btnJS{#1}{\@anim@arg})>>>>% \fi% }% \if@anim@js% @@ -4047,7 +4047,7 @@ } %other trigger events in the anim widget's AA dictionary -\gdef\@anim@wdgtDownJSString#1{% +\gdef\@anim@wdgtDownJS#1{% \if@anim@dvisvgm\else app.focusRect=false;$% disable focus rectangle \fi% @@ -4055,7 +4055,7 @@ try{if(a#1_playing){a#1_pause();}}catch(e){}$% \fi% }% -\gdef\@anim@wdgtUpJSString#1{% +\gdef\@anim@wdgtUpJS#1{% try{$% \if@anim@step% \if@anim@palindrome @@ -4120,7 +4120,7 @@ \gdef\@anim@Plus{Plus}% %actions for control buttons -\gdef\@anim@btnUpJSString#1#2{% +\gdef\@anim@btnJS#1#2{% \if@anim@dvisvgm\else app.focusRect=false;% \fi% @@ -4165,6 +4165,14 @@ \if@anim@nomouse\else document.getElementById('anm#1').addEventListener('mouseup',% onMouseUpWdgt);$% + document.getElementById('anm#1').addEventListener('mousedown',% + onMouseDownWdgt);$% + document.getElementById('anm#1').addEventListener('touchend',% + onTouchEndWdgt);$% + document.getElementById('anm#1').addEventListener('touchstart',% + onTouchStartWdgt);$% + document.getElementById('anm#1').addEventListener('touchmove',% + onTouchMove);$% \fi% onvisible();$% in case of `autoplay' option }$% @@ -4184,11 +4192,38 @@ document.addEventListener('visibilitychange',onVisibilityChange);$% window.addEventListener('load',onload);$% \if@anim@nomouse\else - function onMouseDownWdgt(){$% - \@anim@wdgtDownJSString{#1}% + var permPause#1=false; + function onWidgetUpAction(event){$% + \@anim@wdgtUpJS{#1}% + }$% + function onTouchStartWdgt(event){$% + event.preventDefault();$% + event.stopPropagation();$% + permPause#1=false; + \@anim@wdgtDownJS{#1}% + }$% + function onTouchEndWdgt(event){$% + event.preventDefault();$% + event.stopPropagation();$% + if(event.targetTouches.length>0){permPause#1=true;}$% + else{$% + if(permPause#1){permPause#1=false;}$% + else{onWidgetUpAction(event);}$% + }$% + }$% + function onTouchMove(event){$% + event.preventDefault();$% + event.stopPropagation();$% + }$% + function onMouseDownWdgt(event){$% + event.preventDefault();$% + event.stopPropagation();$% + \@anim@wdgtDownJS{#1}% }$% function onMouseUpWdgt(event){$% - \@anim@wdgtUpJSString{#1}% + event.preventDefault();$% + event.stopPropagation();$% + onWidgetUpAction(event);$% }$% \fi% ]]>$% |