summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-11-25 23:59:32 +0000
committerKarl Berry <karl@freefriends.org>2014-11-25 23:59:32 +0000
commit718ff5f822b1b65939aa42f0ebcb4e5ace3fdc11 (patch)
treea9eabb628e07ce00511b4f961584d83b32280a11 /Master
parentcdad9a2fcebdd52be366ba6ac0ae65557b1b3c70 (diff)
animate (25nov14)
git-svn-id: svn://tug.org/texlive/trunk@35664 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/animate/ChangeLog4
-rw-r--r--Master/texmf-dist/doc/latex/animate/README8
-rw-r--r--Master/texmf-dist/doc/latex/animate/animate.pdfbin3728261 -> 3728405 bytes
-rw-r--r--Master/texmf-dist/doc/latex/animate/animate.tex8
-rw-r--r--Master/texmf-dist/tex/latex/animate/animate.sty315
5 files changed, 197 insertions, 138 deletions
diff --git a/Master/texmf-dist/doc/latex/animate/ChangeLog b/Master/texmf-dist/doc/latex/animate/ChangeLog
index 57b76557b00..da057819230 100644
--- a/Master/texmf-dist/doc/latex/animate/ChangeLog
+++ b/Master/texmf-dist/doc/latex/animate/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-25
+ * New: In addition to `first', `last' and `none', the `poster' option also
+ takes an integer number to specify the default poster frame.
+
2014-11-11
* Fix: (work-around for) JavaScript NotAllowedError in AR-9 when skimming
over pages with icon-based animations
diff --git a/Master/texmf-dist/doc/latex/animate/README b/Master/texmf-dist/doc/latex/animate/README
index 8dd40522376..4ac4cc09b13 100644
--- a/Master/texmf-dist/doc/latex/animate/README
+++ b/Master/texmf-dist/doc/latex/animate/README
@@ -38,7 +38,8 @@ Usage:
keepaspectratio, scale=<factor>, nomouse,
autopause, autoplay, autoresume, controls, final, draft,
buttonsize=<size>, buttonbg=<colour>, buttonfg=<colour>,
- loop, palindrome, step, poster[=first | none | last],
+ loop, palindrome, step,
+ poster[=first | <num> | last | none],
method=icon | widget | ocg, dvipdfmx, xetex
@@ -61,8 +62,9 @@ Usage:
autopause, autoplay, autoresume, final,
draft, controls, buttonsize=<size>, buttonbg=<colour>,
buttonfg=<colour>, loop, palindrome, step, measure,
- poster[=first | none | last], begin={<begin text>},
- end={<end text>}, timeline=<timeline file>,
+ poster[=first | <num> | last | none],
+ begin={<begin text>}, end={<end text>},
+ timeline=<timeline file>,
method=icon | widget | ocg,
every=<number>, bb=<llx> <lly> <urx> <ury>,
viewport=<llx> <lly> <urx> <ury>,
diff --git a/Master/texmf-dist/doc/latex/animate/animate.pdf b/Master/texmf-dist/doc/latex/animate/animate.pdf
index 5d808b4f97a..12f10863d3c 100644
--- a/Master/texmf-dist/doc/latex/animate/animate.pdf
+++ b/Master/texmf-dist/doc/latex/animate/animate.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/animate/animate.tex b/Master/texmf-dist/doc/latex/animate/animate.tex
index 89937dea5a8..998d666028c 100644
--- a/Master/texmf-dist/doc/latex/animate/animate.tex
+++ b/Master/texmf-dist/doc/latex/animate/animate.tex
@@ -157,7 +157,7 @@ buttonfg=<colour>
step
nomouse
method=icon | widget | ocg
-poster[=first | none | last]
+poster[=first | <num> | last | none]
\end{verbatim}
Except for `\verb+dvipdfmx+' and `\verb+xetex+', the options above are also available (among others) as command options and will be explained shortly. However, if used as package options they have global scope, taking effect on all animations in the document. In turn, command options locally override global settings. Options without an argument are boolean options and can be negated, with the exception of package-only options `\verb+dvipdfmx+' and `\verb+xetex+', by appending `\verb+=false+'.
@@ -231,9 +231,9 @@ label=<label text>
\end{verbatim}
The animation is given a label, \verb+<label text>+, which should be unique. Labelling an animation enables its JavaScript programming interface by defining \verb+anim['<label text>']+, which is a JavaScript reference to the animation object. The animation object provides a number of properties and methods that can be used for controlling the animation playback from within user defined JavaScript. For details, see Sect.~\ref{sect:api}.
\begin{verbatim}
-poster[=first | none | last]
+poster[=first | <num> | last | none]
\end{verbatim}
-Specifies which frame (first, last or none) to display and print if the animation is not activated. The first frame is shown by default. Thus `\verb+poster+' or `\verb+poster=first+' need not be explicitly set.
+Specifies which frame to display and print if the animation is not activated. The first frame is shown by default. Thus `\verb+poster+' or `\verb+poster=first+' need not be explicitly set. A frame number \verb+<num>+ may as well be given; \verb+<num>+ is zero-based, that is, the first frame has number `0'.
\begin{verbatim}
every=<num>
\end{verbatim}
@@ -301,7 +301,7 @@ By default, control button widgets are drawn with black strokes on transparent b
draft
final
\end{verbatim}
-With `\verb+draft+' the animation is not embedded. Instead, a box with the exact dimensions of the animation is inserted. Option `\verb+final+' does the opposite as it forces the animation to be built and embedded. Both options can be used to reduce compilation time during authoring of a document. To get the most out of them it is recommended to set `\verb+draft+' globally as a package or class option and to set `\verb+final+' locally as a command option of the animation that is currently worked on. After the document has been finished, the global `\verb+draft+' option can be removed to embed all animations.
+With `\verb+draft+' the animation is not embedded. Instead, a box with the exact dimensions of the animation is inserted. Option `\verb+final+' does the opposite as it forces the animation to be built and embedded. Both options can be used to reduce compilation time during authoring of a document. To get the most out of them it is recommended to set `\verb+draft+' globally as a package or class option and to set `\verb+final+' locally as a command option of the animation that is currently being worked on. After the document has been finished, the global `\verb+draft+' option can be removed to embed all animations.
\begin{verbatim}
nomouse
\end{verbatim}
diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty
index 6d67ab9816b..f53bf7a190b 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{2014/11/11}
+\def\@anim@version{2014/11/25}
\ProvidesPackage{animate}
[\@anim@version\space PDF animations from files and inline graphics]
@@ -830,10 +830,6 @@
\fi%
}
-\def\@anim@posterlast{last}% helper macros
-\def\@anim@posterfirst{first}%
-\def\@anim@posternone{none}%
-
%creates OCG
\def\@anim@newocg#1#2{%#1:@anim@num, #2:@anim@curframe@zb
\@anim@dictobj{/Type/OCG /Name (#1.#2)}%
@@ -858,15 +854,14 @@
\ifcase\@anim@method% icon based
\@anim@xform{0}{1}{\@anim@box}%
%initial visibility
- \ifx\@anim@poster\@anim@posternone\else%
- \ifnum#2=\z@%
- \ifx\@anim@poster\@anim@posterfirst%
+ \ifnum\@anim@poster>\@anim@mtwo% insert poster frame
+ \ifnum#2=\@anim@poster%
+ \edef\@anim@posterap{\@anim@lastxform}%
+ \else%
+ \ifnum\@anim@poster=\@anim@mone% use last frame as poster
\edef\@anim@posterap{\@anim@lastxform}%
\fi%
\fi%
- \ifx\@anim@poster\@anim@posterlast%
- \edef\@anim@posterap{\@anim@lastxform}%
- \fi%
\fi%
%build appearance name tree
\xdef\@anim@appearances{%
@@ -876,19 +871,18 @@
}%
\or% widget based
%initial visibility
- \def\@anim@annotflag{/F 6}% default: hidden (2) + print (4)
- \ifx\@anim@poster\@anim@posternone\else%
- \ifnum#2=\z@%
- \ifx\@anim@poster\@anim@posterfirst%
- \def\@anim@annotflag{/F 4}%
+ \def\@anim@annotflag{/F 2}% default: hidden
+ \ifnum\@anim@poster>\@anim@mtwo% insert poster frame
+ \ifnum#2=\@anim@poster%
+ \def\@anim@annotflag{/F 4}% not hidden + print (4)
+ \else%
+ \ifnum\@anim@poster=\@anim@mone% use last frame as poster
+ \@anim@keytoaux{a#1.poster}{#2}%
+ \ifthenelse{\equal{\@anim@getkeyval{a#1.poster}}{#2}}{%
+ \def\@anim@annotflag{/F 4}%
+ }{}%
\fi%
\fi%
- \ifx\@anim@poster\@anim@posterlast%
- \@anim@keytoaux{a#1.poster}{#2}%
- \ifthenelse{\equal{\@anim@getkeyval{a#1.poster}}{#2}}{%
- \def\@anim@annotflag{/F 4}%
- }{}%
- \fi%
\fi%
%frame insertion
\@anim@xform{0}{1}{\@anim@box}%
@@ -904,17 +898,13 @@
\or% ocg based
\@anim@newocg{#1}{#2}%
%initial visibility
- \ifx\@anim@poster\@anim@posterlast%
+ \ifnum\@anim@poster=\@anim@mone% use last frame as poster
\@anim@keytoaux{a#1.poster}{#2}%
\ifthenelse{\equal{\@anim@getkeyval{a#1.poster}}{#2}}{}{%
\xdef\@anim@offocgs{\@anim@offocgs\space\@anim@curocg}%
}%
\else%
- \ifnum#2=\z@%
- \ifx\@anim@poster\@anim@posternone%
- \xdef\@anim@offocgs{\@anim@offocgs\space\@anim@curocg}%
- \fi%
- \else%
+ \ifnum#2=\@anim@poster\else%
\xdef\@anim@offocgs{\@anim@offocgs\space\@anim@curocg}%
\fi%
\fi%
@@ -1628,19 +1618,32 @@
\xdef\@anim@animtotalheight{\strip@pt\dimexpr\ht#1+\dp#1\relax}%
}
-%interactive Widget annotation that is overlayed on the
-%non-interactive frame Widgets / page content with frame OCGs
+%interactive Widget annotation serving as animation frame container / that is
+%overlayed on the non-interactive frame Widgets or on the page content with
+%frame OCGs
\def\@anim@animwidget#1{%
\@anim@pojscript{#1}%
\@anim@otherjscript{#1}%
\def\@anim@annotflag{}%
+ \ifnum\@anim@poster>\@anim@maxframe%
+ \PackageError{animate}{%
+ Poster frame `\@anim@poster' is out-of-bounds\MessageBreak%
+ on input line \the\inputlineno.\MessageBreak%
+ Try option `poster=last'%
+ }{}%
+ \fi%
\ifnum\@anim@method=\z@%
\def\@anim@annotflag{/F 4}% 4=allow printing
- \ifx\@anim@poster\@anim@posternone%
+ \ifnum\@anim@poster=\@anim@mtwo%
\ifdefined\@anim@apdummy\else% empty appearance dummy
\setbox\@anim@box=\hbox{\phantom{x}}%
\@anim@xform{0}{0}{\@anim@box}%
\xdef\@anim@apdummy{\@anim@lastxform}%
+ \xdef\@anim@appearances{%
+ (0000)
+ \@anim@refobj{\@anim@lastxform}
+ \@anim@appearances%
+ }%
\fi%
\def\@anim@apmk{\@anim@refobj{\@anim@apdummy}}%
\else%
@@ -2096,11 +2099,11 @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%
}
\xdef\@anim@icondvipswarning{%
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak%
- @_Icon-based_animation_method_(``useicon'')_breaks_@\MessageBreak%
- @_all_hyperref-inserted_links_in_the_final_PDF_____@\MessageBreak%
- @_produced_via_the_Dvips_route!____________________@\MessageBreak%
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak%
+ @_Icon-based_animation_method_(`method=icon')_____@\MessageBreak%
+ @_breaks_all_hyperref-inserted_links_in_the_final_@\MessageBreak%
+ @_PDF_produced_via_the_Dvips_route!_______________@\MessageBreak%
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
}
\endgroup
@@ -2551,13 +2554,33 @@
\define@key{anim@user}{palindrome}[true]{%
\setboolean{@anim@palindrome}{#1}%
}
-\define@key{anim@user}{poster}[first]{% | none | last
- \ifthenelse{% correct wrong input to `none'
- \equal{#1}{first}\OR\equal{#1}{last}%
+\def\@anim@mone{-1}\def\@anim@mtwo{-2}
+\define@key{anim@user}{poster}[first]{% <num> | first | last | none
+ \ifthenelse{%
+ \equal{#1}{first}%
}{%
- \gdef\@anim@poster{#1}%
+ \gdef\@anim@poster{0}%
}{%
- \gdef\@anim@poster{none}%
+ \ifthenelse{%
+ \equal{#1}{last}%
+ }{%
+ \gdef\@anim@poster{-1}%
+ }{%
+ \ifthenelse{%
+ \equal{#1}{none}%
+ }{%
+ \gdef\@anim@poster{-2}%
+ }{%
+ \ifnum#1<\z@%
+ \PackageError{animate}{%
+ Poster frame `#1' is out-of-bounds on\MessageBreak%
+ input line \the\inputlineno.\MessageBreak%
+ Try one of `poster=first' or `poster=none'%
+ }{}%
+ \fi%
+ \gdef\@anim@poster{#1}%
+ }%
+ }%
}%
}
\newboolean{@anim@step}
@@ -2641,15 +2664,6 @@
Use `method=ocg' instead%
}{}%
}
-%\define@key{anim@user}{firstframejs}{%
-% \@anim@firstjs{#1}%
-%}
-%\define@key{anim@user}{lastframejs}{%
-% \@anim@lastjs{#1}%
-%}
-%\define@key{anim@user}{otherframejs}{%
-% \@anim@otherjs{#1}%
-%}
%macro to reset macros and booleans
\def\@anim@reset{%
@@ -2688,9 +2702,6 @@
\gdef\@anim@nfpsat{}%
\gdef\@anim@pfpsat{}%
\gdef\@anim@usrjsat{}%
-% \gdef\@anim@firstjs{}%
-% \gdef\@anim@lastjs{}%
-% \gdef\@anim@otherjs{}%
\gdef\@anim@tmlnfile{}%
\setboolean{@anim@timeline}{false}%
\global\@anim@begin={}%
@@ -2835,14 +2846,33 @@
\define@key{anim@pkg}{palindrome}[true]{%
\setboolean{@anim@@palindrome}{#1}%
}
-\gdef\@anim@@poster{first}%
+\gdef\@anim@@poster{0}%
\define@key{anim@pkg}{poster}[first]{%
\ifthenelse{%
- \equal{#1}{first}\OR\equal{#1}{last}%
+ \equal{#1}{first}%
}{%
- \gdef\@anim@@poster{#1}%
+ \gdef\@anim@@poster{0}%
}{%
- \gdef\@anim@@poster{none}%
+ \ifthenelse{%
+ \equal{#1}{last}%
+ }{%
+ \gdef\@anim@@poster{-1}%
+ }{%
+ \ifthenelse{%
+ \equal{#1}{none}%
+ }{%
+ \gdef\@anim@@poster{-2}%
+ }{%
+ \ifnum#1<\z@%
+ \PackageError{animate}{%
+ Poster frame `#1' is out-of-bounds on\MessageBreak%
+ input line \the\inputlineno.\MessageBreak%
+ Try one of `poster=first' or `poster=none'%
+ }{}%
+ \fi%
+ \gdef\@anim@@poster{#1}%
+ }%
+ }%
}%
}
\newboolean{@anim@@step}
@@ -2916,7 +2946,7 @@
% console.clear();%
var curdoc=this;%
var a#1,a#1_int;%
- if(typeof(a#1)==='undefined'){% initialize animation
+ if(typeof a#1==='undefined'){% initialize animation
a#1=new Object();% animation object
%takes references to frame ocgs/Field objects belonging to the current
%animation
@@ -2924,7 +2954,7 @@
%initialize fr properties
\ifcase\@anim@method %icon based
var spc=String.fromCharCode(32);%
- if(typeof(this.getIcon)==='undefined'){%
+ if(typeof this.getIcon==='undefined'){%
app.alert('Icon-based'+spc+'animation'+spc+'is'+spc+'not'+spc+%
'supported'+spc+'by'+spc+'this'+spc+'Reader.'+spc+'Try'+spc+%
'one'+spc+'of'+spc+'"method=widget"'+spc+'or'+spc+%
@@ -2934,6 +2964,11 @@
for(i=0;i<=\@anim@maxframe;i++){%
a#1.fr[i]=this.getIcon(util.printf('\@anim@pad{1234}{#1}.\%04d',i));%
}%
+ \ifnum\@anim@poster=\@anim@mtwo
+ if(typeof blnk==='undefined'){% blank poster
+ blnk=this.getIcon('0000');%
+ }%
+ \fi%
\or %widget based
%get array of animation frames
for(i=0;i<=\@anim@maxframe;i++){%
@@ -2958,17 +2993,11 @@
a#1.btnPauseRight=this.getField('#1.PauseRight');%
a#1.btnPlayRight=this.getField('#1.PlayRight');%
\fi\fi%
- \ifx\@anim@poster\@anim@posterlast % set default frame
- %holds index of the frame to be displayed
- a#1.on=a#1.idx=\@anim@maxframe;%
- \else % first & none
- a#1.on=a#1.idx=0;%
- \fi%
%playing state and direction
\if@anim@morejs a#1.playsRight=true;\fi%
+ a#1.isPaused=false;%
\if@anim@step\else
a#1.playing=false;%
- a#1.isPaused=false;%
\if@anim@pauseframes
%this array takes the frame numbers at which to pause playback
a#1.pauseAt=new Array();%
@@ -2997,8 +3026,24 @@
\fi%
%actions
a#1.seekFrame=function(f){%
+ \ifnum\@anim@poster=\@anim@mtwo
+ if(f<-1){%
+ \ifcase\@anim@method %icon based
+ a#1.wid.buttonSetIcon(blnk);%
+ curdoc.dirty=false;%
+ \or %widget based
+ a#1.on=0;%
+ a#1.fr[0].display=display.hidden;%
+ curdoc.dirty=false;%
+ \or %ocg based
+ a#1.on=0;%
+ a#1.fr[0].state=false;%
+ \fi
+ a#1.idx=-1;%
+ }%
+ \fi
if(f>\@anim@maxframe||f<0){return -1;}%
- var old=a#1.idx;a#1.idx=f;%
+ a#1.idx=f;%
\if@anim@usrjs
if(a#1.usrJSat[f]){%
var cmd='try{a#1.usrJSat['+f+']();}catch(e){console.println(e);}';%
@@ -3007,15 +3052,17 @@
\fi%
\ifcase\@anim@method %icon based
a#1.wid.buttonSetIcon(a#1.fr[f]);%
+ curdoc.dirty=false;%
\or %widget based
a#1.fr[a#1.on].display=display.hidden;%
a#1.fr[f].display=display.visible;%
+ a#1.on=f;%
curdoc.dirty=false;%
\or %ocg based
a#1.fr[a#1.on].state=false;%
a#1.fr[f].state=true;%
+ a#1.on=f;%
\fi
- a#1.on=f;%
\if@anim@step\else%
\if@anim@chfps
if(a#1.nFpsAt[f]!=a#1.fps){%
@@ -3023,20 +3070,22 @@
}%
\fi%
\fi%
- \if@anim@step\else\if@anim@meas a#1.frcnt++;\fi\fi
- return old;%
+ \if@anim@step\else\if@anim@meas a#1.frcnt++;\fi\fi%
+ return 0;%
};%
a#1.stopFirst=function(){%
- \if@anim@step\else
- a#1.pause();%
- a#1.isPaused=false;% because it has been explicitly stopped
+ \if@anim@step
+ a#1.isPaused=false;% stop
+ \else
+ a#1.pause(true);% stop
\fi
a#1.seekFrame(0);%
};%
a#1.stopLast=function(){%
- \if@anim@step\else
- a#1.pause();%
- a#1.isPaused=false;%
+ \if@anim@step
+ a#1.isPaused=false;% stop
+ \else
+ a#1.pause(true);% stop
\fi
a#1.seekFrame(\@anim@maxframe);%
};%
@@ -3110,10 +3159,10 @@
};%
\fi%
\if@anim@step\else
- a#1.pause=function(){%
+ a#1.pause=function(stop){%
try{app.clearInterval(a#1_int);}catch(e){}%
a#1.playing=false;%
- a#1.isPaused=true;%
+ a#1.isPaused=!stop;%
\if@anim@controls
a#1.btnPauseLeft.display=display.hidden;%
a#1.btnPlayLeft.display=display.visible;%
@@ -3190,11 +3239,23 @@
\fi%
\if@anim@morejs%
\if@anim@step
- a#1.stepBwd=function(){a#1.seekFrame(a#1.idx-1);};%
- a#1.stepFwd=function(){a#1.seekFrame(a#1.idx+1);};%
+ a#1.stepBwd=function(){%
+ a#1.seekFrame(a#1.idx-1);%
+ a#1.isPaused=true;%
+ };%
+ a#1.stepFwd=function(){%
+ a#1.seekFrame(a#1.idx+1);%
+ a#1.isPaused=true;%
+ };%
\else
- a#1.stepBwd=function(){if(!a#1.playing){a#1.seekFrame(a#1.idx-1);}};%
- a#1.stepFwd=function(){if(!a#1.playing){a#1.seekFrame(a#1.idx+1);}};%
+ a#1.stepBwd=function(){if(!a#1.playing){%
+ a#1.seekFrame(a#1.idx-1);%
+ a#1.isPaused=true;%
+ }};%
+ a#1.stepFwd=function(){if(!a#1.playing){%
+ a#1.seekFrame(a#1.idx+1);%
+ a#1.isPaused=true;%
+ }};%
a#1.playBwd=function(){%
if(a#1.idx==0){a#1.stopLast();}%
a#1.playLeft();%
@@ -3206,8 +3267,8 @@
\fi%
\fi%
\ifx\empty\@anim@label\empty\else
- if(typeof(anim)==='undefined'){anim=new Array();}%
- if(typeof(anim['\@anim@label'])==='undefined'){%
+ if(typeof anim==='undefined'){anim=new Array();}%
+ if(typeof anim['\@anim@label']==='undefined'){%
anim['\@anim@label']={%
\if@anim@step\else
playBwd:a#1.playBwd,%
@@ -3231,12 +3292,12 @@
throw new RangeError('Frame_number_not_in_allowed_range');%
}%
\if@anim@step
- a#1.seekFrame(f);%
+ if(a#1.seekFrame(f)>-1)a#1.isPaused=true;%
\else
if(a#1.playing){%
a#1.pause();a#1.seekFrame(f);%
if(a#1.playsRight){a#1.playRight();}else{a#1.playLeft();}%
- }else{a#1.seekFrame(f);}%
+ }else{if(a#1.seekFrame(f)>-1)a#1.isPaused=true;}%
\fi%
},%
stopFirst:a#1.stopFirst,%
@@ -3244,11 +3305,17 @@
};%
}%
\fi%
- \ifnum\@anim@method>\z@%
- \ifx\@anim@poster\@anim@posternone\else a#1.seekFrame(a#1.on);\fi%
+ \ifnum\@anim@poster=\@anim@mtwo %poster=none
+ a#1.idx=-1;\ifnum\@anim@method>\z@ a#1.on=0;\fi%
+ \fi%
+ \ifnum\@anim@poster>\@anim@mone %poster=<num>|first
+ a#1.idx=\ifnum\@anim@method>\z@ a#1.on=\fi\@anim@poster;%
+ \fi%
+ \ifnum\@anim@poster=\@anim@mone %poster=last
+ a#1.idx=\ifnum\@anim@method>\z@ a#1.on=\fi\@anim@maxframe;%
\fi%
}%
- curdoc.dirty=false;%
+ %curdoc.dirty=false;%
\if@anim@step\else%
\if@anim@autoplayorresume%
\if@anim@autoresume
@@ -3271,49 +3338,43 @@
\xdef\@anim@otherjscriptkey{%
/PC <</S/JavaScript/JS (% PageClose
\if@anim@step\else
- if(%
+ if(a#1.playing){
\if@anim@autopause
- a#1.playing||%
+ a#1.pause();%
+ \else
+ a#1.pause(true);% stop
\fi
- a#1.isPaused%
- ){a#1.pause();}%
- else{%
- \if@anim@controls
- a#1.playsRight=true;%
- \else%
- \if@anim@palindrome
- a#1.playsRight=true;%
- \fi%
- \fi%
- \fi%
- \ifx\@anim@poster\@anim@posterlast
- %using app.setTimeOut as a workaround for NotAllowedError in AR-9
- var ret=app.setTimeOut('a#1.stopLast()',1);%
- \else
- var ret=app.setTimeOut('a#1.stopFirst()',1);%
- \fi%
- \if@anim@step\else%
}%
- \fi%
+ \fi
+ %re-display poster frame
+ if(!a#1.isPaused){% i.e. if stopped
+ \ifnum\@anim@poster=\@anim@mtwo %poster=none
+ var ret=app.setTimeOut('a#1.seekFrame(-2)',1);%
+ \fi%
+ \ifnum\@anim@poster>\@anim@mone%poster=<num>|first
+ var ret=app.setTimeOut('a#1.seekFrame(\@anim@poster)',1);%
+ \fi%
+ \ifnum\@anim@poster=\@anim@mone %poster=last
+ var ret=app.setTimeOut('a#1.seekFrame(\@anim@maxframe)',1);%
+ \fi%
+ }%
)>>%
- \if@anim@step\else%
- /D <</S/JavaScript/JS (% pause on MouseDown
- %disable focus rectangle
- app.focusRect=false;%
+ /D <</S/JavaScript/JS (%
+ app.focusRect=false;% disable focus rectangle
+ \if@anim@step\else % pause on MouseDown
try{if(a#1.playing){a#1.pause();}}catch(e){}%
- )>>%
- \fi%
+ \fi%
+ )>>%
/U <</S/JavaScript/JS (% play/resume on MouseUp
try{%
\if@anim@step%
\if@anim@palindrome
if(a#1.idx==\@anim@maxframe){%
a#1.playsRight=false;%
- a#1.gotoPrev();%
}else if(a#1.idx==0){%
a#1.playsRight=true;%
- a#1.gotoNext();%
- }else if(a#1.playsRight){%
+ }%
+ if(a#1.playsRight){%
a#1.gotoNext();%
}else{%
a#1.gotoPrev();%
@@ -3324,20 +3385,12 @@
}else{%
a#1.gotoNext();%
}%
- \fi%
+ \fi
+ a#1.isPaused=true;%
\else%
- \if@anim@palindrome
- if(a#1.idx==\@anim@maxframe){%
- a#1.playLeft();%
- }else if(a#1.idx==0){%
- a#1.playRight();%
- }else if(a#1.playsRight){%
- a#1.playRight();%
- }else{%
- a#1.playLeft();%
- }%
+ \if@anim@morejs
+ if(a#1.playsRight){a#1.playRight();}else{a#1.playLeft();}%
\else
- if(a#1.idx==\@anim@maxframe){a#1.stopFirst();}%
a#1.playRight();%
\fi%
\fi%