summaryrefslogtreecommitdiff
path: root/texmf-dist/source
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2018-06-16 14:45:29 +0900
committerNorbert Preining <norbert@preining.info>2018-06-16 14:45:29 +0900
commitadaabf093fe9a662e25c7fca1d4e18bf3a59e566 (patch)
tree703052958331a7859fead5c27a04ad6021aca8ac /texmf-dist/source
parenta343e3a55036d618f1ebcc52b94838a6d9ba352f (diff)
add mkstmpdad
Diffstat (limited to 'texmf-dist/source')
-rw-r--r--texmf-dist/source/latex/mkstmpdad/aeb_dad.dtx600
-rw-r--r--texmf-dist/source/latex/mkstmpdad/aeb_dad.ins63
-rw-r--r--texmf-dist/source/latex/mkstmpdad/mkstmp_pro.dtx167
-rw-r--r--texmf-dist/source/latex/mkstmpdad/mkstmp_pro.ins63
4 files changed, 893 insertions, 0 deletions
diff --git a/texmf-dist/source/latex/mkstmpdad/aeb_dad.dtx b/texmf-dist/source/latex/mkstmpdad/aeb_dad.dtx
new file mode 100644
index 00000000..1cc8231c
--- /dev/null
+++ b/texmf-dist/source/latex/mkstmpdad/aeb_dad.dtx
@@ -0,0 +1,600 @@
+% \iffalse
+% makeindex -s gglo.ist -o aeb_dad.gls aeb_dad.glo
+% makeindex -s gind.ist -o aeb_dad.ind aeb_dad.idx
+%<*copyright>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% aeb_dad package %%
+%% Copyright (C) 2012--2016 D. P. Story %%
+%% dpstory@uakron.edu %%
+%% %%
+%% This program can redistributed and/or modified under %%
+%% the terms of the LaTeX Project Public License %%
+%% Distributed from CTAN archives in directory %%
+%% macros/latex/base/lppl.txt; either version 1 of the %%
+%% License, or (at your option) any later version. %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%</copyright>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{aeb_dad}
+%<package> [2016/10/26 v1.2b Drag and drop stamps matching game (dps)]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[colorlinks,hyperindex=false]{hyperref}[2012/10/12] % to support calculate for pdfyrc
+\pdfstringdefDisableCommands{\let\\\textbackslash}
+\OnlyDescription
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\def\ltag{<}\def\rtag{>}
+\InputIfFileExists{aebdocfmt.def}{\PackageInfo{aeb_dad}{Inputting aebdocfmt.def}}
+ {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro} \let\setupFullwidth\relax
+ \PackageInfo{aeb_dad}{aebdocfmt.def cannot be found}}
+\begin{document}
+ \GetFileInfo{aeb_dad.sty}
+ \title{\textsf{aeb\_dad}: Drag and drop stamps in a game or learning setting}
+ \author{D. P. Story\\
+ Email: \texttt{dpstory@uakron.edu}}
+ \date{processed \today}
+ \maketitle
+ \tableofcontents
+ \let\Email\texttt
+ \DocInput{aeb_dad.dtx}
+\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute
+ \texttt{makeindex -s gind.ist -o aeb\_dad.ind aeb\_dad.idx} on the command line and recompile
+ \texttt{aeb\_dad.dtx}.}
+\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute
+ \texttt{makeindex -s gglo.ist -o aeb\_dad.gls aeb\_dad.glo} on the command line and recompile
+ \texttt{aeb\_dad.dtx}.}
+\end{document}
+%</driver>
+% \fi
+%
+% \MakeShortVerb{|}
+% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{aeb_dad}{Inputting aebdonotindex.def}}
+% {\PackageInfo{aeb_dad}{aebdonotindex.def cannot be found}}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \paragraph*{Description.}
+% The \textsf{aeb\_dad} package consists of {\LaTeX} commands and JavaScript for creating a
+% \underbar{d}rag \underbar{a}nd \underbar{d}rop ``game'' of matching. The
+% user drags and drops an icon image and drops it into a target region (a
+% push button), then clicks on the button. If the placement is correct, the
+% image centers itself in the target region and the border changes color.
+% If the user drops the image in the wrong region, the icon is returned to
+% its initial position. In each case an alert message appears and announces
+% ``Right'' or ``Wrong''.
+%
+% Generally, \textsf{AA} and \textsf{AR} do not support drag and
+% drop. In version 11 (XI) of \textsf{AR}, you can move a stamp around on a page.
+% This opens a number of possibilities. \textsf{aeb\_dad} uses a (rubber)
+% stamp as the icons that can be move around in \textsf{ARXI} (and
+% \textsf{AAXI}). You cannot attach JS to a stamp, however, that is why the
+% target of the drop is a push button. The user drops the stamp on a target
+% and presses the underlying button. The JS associated with the button then
+% determines whether the stamp that is within its bounding rectangle is the
+% correct one.
+%
+% \paragraph*{Documentation and Code.}\strut\par\medskip\noindent
+% The \textsf{eforms} package is also required, but it is not listed here. Include
+% \textsf{eforms} prior to this package. The \textsf{web} package is encourage, but
+% not required.
+% \begin{macrocode}
+\RequirePackage{annot_pro}[2012/11/10]
+\RequirePackage{xkeyval}
+\RequirePackage{calc}
+\RequirePackage{refcount}
+\newcounter{aebdadcnt}
+\edef\dad@subCat{\the\catcode`\_}
+\def\dd@csarg#1#2{\expandafter#1\csname#2\endcsname}
+\@makeother\_
+% \end{macrocode}
+% \DescribeMacro{\ddDimens} is a macro to set the dimensions of
+% the stamp icons and the push buttons.
+% \begin{macrocode}
+\newcommand{\ddDimens}[1]{\setkeys{ddm}{#1}}
+% \end{macrocode}
+% The width of the icon stamp. (Height appropriately scaled)
+% \begin{macrocode}
+\define@key{ddm}{iconwidthTo}[]{{%
+ \def\ddm@argi{#1}\ifx\ddm@argi\@empty
+ \global\let\ddm@iconwidthTo\@empty
+ \else
+ \setlength{\dimen@}{#1}%
+ \xdef\ddm@iconwidthTo{\the\dimen@}%
+ \fi
+}}
+\define@key{ddm}{iconwidth}[\defaultStampWidth]{{%
+ \setlength{\dimen@}{#1}%
+ \xdef\ddm@iconwidth{\the\dimen@}%
+}}
+\define@key{ddm}{iconheight}[\defaultStampHeight]{{%
+ \setlength{\dimen@}{#1}%
+ \xdef\ddm@iconheight{\the\dimen@}%
+}}
+% \end{macrocode}
+% The width of the target button.
+% \begin{macrocode}
+\define@key{ddm}{targetwidth}{{%
+ \setlength{\dimen@}{#1}%
+ \xdef\ddm@targetwidth{\the\dimen@}%
+}}
+% \end{macrocode}
+% The height of the target button.
+% \begin{macrocode}
+\define@key{ddm}{targetheight}{{%
+ \setlength{\dimen@}{#1}%
+ \xdef\ddm@targetheight{\the\dimen@}%
+}}
+% \end{macrocode}
+% We set some reasonable defaults for \cs{ddDimens}.
+% \begin{macrocode}
+\ddDimens{iconwidth,iconheight,iconwidthTo,%
+ targetwidth=1.25in,targetheight=1.25in}
+% \end{macrocode}
+% \DescribeMacro{\ddGameIcon} is a convenience command for placing
+% the icon stamps. The one required argument is the name associated
+% with the stamp.
+% \begin{macrocode}
+\newcommand{\ddGameIcon}[1]{%
+ \expandafter\if\csname\thisDDNAME-init\endcsname0\relax
+ \refstepcounter{aebdadcnt}\phantomsection
+ \edef\@currentlabelname{Beginning of DAD Game: \thisDDNAME}%
+ \label{aebdadcnt\theaebdadcnt}%
+ \dd@EmitPageAction
+ \global\dd@csarg\let{\thisDDNAME-init}=1\relax
+ \fi
+ \ifx\ddm@iconwidthTo\@empty
+ \def\ddGameIconArgs{type=stamp,name=\##1,%
+ width=\ddm@iconwidth,%
+ height=\ddm@iconheight}%
+ \else
+ \def\ddGameIconArgs{type=stamp,name=\##1,%
+ width=\ddm@iconwidth,%
+ height=\ddm@iconheight,
+ widthTo=\ddm@iconwidthTo}%
+ \fi
+% \end{macrocode}
+% Finally we use \cs{annotpro} to create the stamp.
+% \begin{macrocode}
+ \expandafter\annotpro\expandafter[\ddGameIconArgs]{}%
+}
+% \end{macrocode}
+% \DescribeMacro{\ddBtnAppr} is the preset button appearance for the
+% target buttons.
+% \begin{macrocode}
+\newcommand{\ddBtnAppr}{\S{S}\BG{}
+ \AA{\AAMouseEnter{%
+ \JS{btnMouseUpAction(event,this.pageNum,"\thisDDNAME");}}}%
+}
+% \end{macrocode}
+% \DescribeMacro{\ddTargetOfIcon} is a convenience command for placing
+% a push button. The two are arguments, the first is the name of the stamp
+% associated with this target, the second is the caption that is to go beneath
+% the button.
+% \begin{macrocode}
+\newcommand{\ddTargetOfIcon}[2]{%
+ \expandafter\if\csname\thisDDNAME-init\endcsname0\relax
+ \refstepcounter{aebdadcnt}\phantomsection
+ \edef\@currentlabelname{Beginning of DAD Game: \thisDDNAME}%
+ \label{aebdadcnt\theaebdadcnt}%
+ \dd@EmitPageAction
+ \global\dd@csarg\let{\thisDDNAME-init}=1\relax
+ \fi
+ \parbox[t]{\ddm@targetwidth}
+ {\kern0pt\pushButton[\presets{\ddBtnAppr}
+ ]{\thisDDNAME @\##1}{\ddm@targetwidth}{\ddm@targetheight}%
+ \ddTargetCaption{#2}}%
+}
+\newcommand{\ddTargetFmt}[1]{\def\ddm@targetfmt{#1}}
+\ddTargetFmt{}
+\newcommand{\ddTargetCaption}[1]{\\[3pt]%
+ \parbox[t]{\linewidth}{\centering\ddm@targetfmt#1}}
+% \end{macrocode}
+% \paragraph*{Page and Document JavaScript}\strut\par\medskip\noindent
+% As of this writing, only one drag and drop stamp game per page. The
+% \DescribeMacro{\initDDGame}\cs{initDDGame} macro should appear on that page.
+% \begin{macrocode}
+\newcommand{\thisDDName}[1]{%
+ \setAnnotOptions{subject={#1}}%
+ \gdef\thisDDNAME{#1}%
+}
+\newcount\dd@GameCnt \dd@GameCnt=0
+\newcommand{\initDDGame}[1]{\thisDDName{#1}%
+ \global\advance\dd@GameCnt1\relax
+ \global\dd@csarg\let{#1-init}0\relax
+}
+% \end{macrocode}
+% \changes{v1.2b}{2016/10/26}{Removed \string\cs{thisPageAction} in favor of a push button action}
+% Removed \cs{thisPageAction} in favor of a page open action of a push button. This is to
+% cover the case where the begins on the first page.
+% \begin{macrocode}
+\def\dd@EmitPageAction{%
+ \@ifundefined{ddEmitOnPage\getpagerefnumber{aebdadcnt\theaebdadcnt}}
+ {\global\dd@csarg
+ \let{ddEmitOnPage\getpagerefnumber{aebdadcnt\theaebdadcnt}}\@empty
+ \pushButton[\F{\FHidden}\BG{}\BC{}\S{S}
+ \AApageopen{ddPageOpen(this.pageNum);}
+ ]{btnEmitPA-\theaebdadcnt}{0bp}{0bp}%
+ }{}%
+}
+% \end{macrocode}
+% \DescribeMacro{\ddReset} is the reset button for the drag and drop matching game.
+%
+% It is recommended that the reset button be between the icons and the
+% target buttons. The game executes a \texttt{Field.setFocus()} method to take the focus
+% off of the stamps when they are dropped. The focus goes on the reset button.
+% If the reset button is out of the user's sight, AA or AR will scroll the page
+% to place the reset button in the (middle of the) viewing area
+% \begin{macrocode}
+\newcommand{\ddReset}[1][]{\def\dd@arg{#1}%
+ \ifx\dd@arg\@empty\else\thisDDName{#1}\fi
+ \mbox{\makebox[0pt][l]{%
+ \pushButton[\W0\BC{}\BG{}\S{S}]{ddHReset\thisDDNAME}{0bp}{0bp}}%
+ \pushButton[\CA{Reset}\A{\JS{%
+ resetDDM(this.pageNum,"\thisDDNAME");}}
+ \AA{\AAOnFocus{\JS{%
+ this.getField("ddHReset\thisDDNAME").setFocus();
+ }}}]{ddReset\thisDDNAME}{}{11bp}}%
+}
+% \end{macrocode}
+% Open action, to warn user that XI is required for reader.
+% \begin{macrocode}
+\OpenAction{\JS{ddOpenDocAction();}}
+% \end{macrocode}
+% \paragraph*{Document JavaScript.}
+% The JavaScript function called by the target push buttons.
+% \begin{macrocode}
+\newcommand{\ddRightMsg}{"Right!"}
+\newcommand{\ddWrongMsg}{"Wrong!"}
+\newcommand{\ddDragOnlyOne}{"Drag one icon at a time"}
+\newcommand{\ddExternalMsg}{"Drag and Drop of icons does not work "
+ + "in a browser. Save this file to your computer and view it in "
+ + "Adobe Reader XI or later, or in the Acrobat application."}
+\newcommand{\ddBadAppMsg}{"Any version of Adobe Acrobat, "
+ +"or Adobe Reader XI is required!"}
+% \end{macrocode}
+% \cmd\ddTrueName\DescribeMacro{\ddTrueName} is a convenience command for referencing
+% the \texttt{ddTrueName} JavaScript function, defined below. There must be no spurious spaces
+% in the argument of \cs{ddTrueNaqme}. The first argument is the name of the DD Game as set in the document
+% by \cs{initDDGame}; the second argument is a name of a stamp (excluding \texttt{\#}).
+% \changes{v1.2}{2016/08/22}{Added \string\cs{ddTrueName}}
+% \begin{macrocode}
+\def\ddTrueName(#1,#2){ddTrueName("#1","#2")}
+% \end{macrocode}
+% Now for the document JavaScript.
+% \begin{macrocode}
+\begin{insDLJS}{dadjs}{AcroTeX Stamp Game JavaScript}
+var oDADStamp=new Object();
+var oDADCnt=new Object();
+var aDDPageCtrl=new Array(this.numPages);
+var oDADAlerts=new Object();
+var ddTO;
+% \end{macrocode}
+% \texttt{activeStampName} holds the name of the stamp that is being moved around.
+% \changes{v1.2}{2016/08/22}{Added JS variable activeStampName}
+% \begin{macrocode}
+var activeStampName="";
+% \end{macrocode}
+% \texttt{ddTrueName} is a JS function that returns the ``true'' (internal) name of the game/stamp
+% combination.
+% \changes{v1.2}{2016/08/22}{Added JS function ddTrueName}
+% \begin{macrocode}
+function ddTrueName (ddName,stampName) {
+ return ddName+"@#"+stampName;
+}
+function btnMouseUpAction(event,page,ddName)
+{
+ var stamps;
+ var aBtnRect=event.target.rect;
+ var cBtnName=event.target.name;
+ var l = cBtnName.indexOf("@#");
+ cBtnName = cBtnName.substring(1+l);
+ // convert to rotated user coordinates
+ var mxToDefault=(new Matrix2D()).fromRotated(this,page);
+ var mxToRotated=mxToDefault.invert();
+ var aBtnRectRot=mxToRotated.transform(aBtnRect);
+% \end{macrocode}
+% Format for Default User Space: \texttt{[left,bottom,right,top]}
+% \begin{macrocode}
+ var btnWidth=aBtnRect[2]-aBtnRect[0];
+ var btnHeight=aBtnRect[3]-aBtnRect[1];
+% \end{macrocode}
+% Originally, we gathered all annots on this page,
+%\begin{verbatim}
+% stamps=this.getAnnots(page);
+%\end{verbatim}
+% Now we gather the selected annots (throughout the entire document)
+% \begin{macrocode}
+ stamps=this.selectedAnnots;
+ if (typeof stamps == "undefined") return;
+ if (stamps.length>1) {
+ app.alert({cMsg: \ddDragOnlyOne,
+ nIcon: 3, cTitle: "AcroTeX Drag and Drop"});
+ for (var i=0; i<stamps.length; i++) {
+ var index=stamps[i].subject+page;
+ stamps[i].rect=oDADStamp[index][stamps[i].AP][0];
+ stamps[i].setProps({rotate:0})
+ }
+ resetFocus("ddReset"+ddName);
+ this.dirty=false;
+ return;
+ }
+ for (var i=0; i<stamps.length; i++) {
+ var aStmpRect=stamps[i].rect;
+ var index=stamps[i].subject+page;
+% \end{macrocode}
+% Format for Rotated User Space: \texttt{[left,top,right,bottom]}
+% \begin{macrocode}
+ var stmpWidth=aStmpRect[2]-aStmpRect[0];
+ var stmpHeight=aStmpRect[3]-aStmpRect[1];
+ var nHorzCenter=(aStmpRect[2]+aStmpRect[0])/2;
+ var nVertCenter=(aStmpRect[3]+aStmpRect[1])/2;
+% \end{macrocode}
+% See if the center of this stamp is in the button rect
+% \begin{macrocode}
+ if ( (nHorzCenter >= aBtnRectRot[0] )%
+&&(nHorzCenter<=aBtnRectRot[2]) ) {
+ if ( (nVertCenter>=aBtnRectRot[3])%
+&& (nVertCenter<=aBtnRectRot[1]) ) {
+% \end{macrocode}
+% Now see if it is the correct one, and center the stamp inside the rectangle.
+% \begin{macrocode}
+ if (( (cBtnName==stamps[i].AP)%
+&& (stamps[i].subject==ddName))%
+&& (!oDADStamp[index][stamps[i].AP][1]) ) {
+% \end{macrocode}
+% center stamp on button face\\
+% Field: \texttt{[left,bottom,right,top]}\\
+% Annot: \texttt{[left,top,right,bottom]}\\
+% We get the original rectangle, and use it to calculate the width and height.
+% \begin{macrocode}
+ activeStampName=stamps[i].AP.substring(1);
+ var aStmpRect=oDADStamp[index][stamps[i].AP][0];
+ var stmpWidth=aStmpRect[2]-aStmpRect[0];
+ var stmpHeight=aStmpRect[3]-aStmpRect[1];
+ oDADStamp[index][stamps[i].AP][1]=true;
+ var deltaX=(btnWidth-stmpWidth)/2;
+ var deltaY=(btnHeight-stmpHeight)/2;
+% \end{macrocode}
+% We calculate the dimensions of the centered icon. If the user rescaled the icon
+% it will be locked in at its original scale.
+% \begin{macrocode}
+ aCenterStamp=[
+ aBtnRectRot[0]+deltaX,
+ aBtnRectRot[3]-deltaY,
+ aBtnRectRot[0]+deltaX+stmpWidth,
+ aBtnRectRot[3]-deltaY-stmpHeight];
+ ddCorrectAction(event,ddName);
+ event.target.strokeColor=color.green;
+% \end{macrocode}
+% Correct stamp in the correct target field. We want to center the stamp, make sure
+% the user did not rotate it, or resize it.
+% \begin{macrocode}
+ stamps[i].setProps({rotate:0});
+ stamps[i].rect=aCenterStamp;
+ event.target.readonly=true;
+ resetFocus("ddReset"+ddName);
+ break;
+ } else {
+% \end{macrocode}
+% Attach the stamp name to the \texttt{stampName} property of \texttt{ddWrongAction} so we can
+% conveniently reference it when using custom a wrong actions.
+% \begin{macrocode}
+% ddWrongAction.stampName=stamps[i].AP;
+ activeStampName=stamps[i].AP.substring(1);
+ ddWrongAction(event,ddName);
+ if (!oDADAlerts[ddName].oAlrtChk.bAfterValue)
+ ddReturnStamp(page,ddName,stamps[i]);
+ else {
+ ddReturnStamp.o=stamps[i];
+ ddTO=app.setTimeOut("ddReturnStamp("
+ +page+",\""+ddName
+ +"\",ddReturnStamp.o);",250);
+ }
+ break;
+ }
+ } else {
+ // too high or two low.
+ if(!oDADStamp[index][stamps[i].AP][1])
+ ddReturnStamp(page,ddName,stamps[i]);
+ }
+ } else {
+ // outside left or right of button
+ if(!oDADStamp[index][stamps[i].AP][1])
+ ddReturnStamp(page,ddName,stamps[i]);
+ }
+ }
+ this.dirty=false;
+}
+function ddReturnStamp(page,ddName,oStamp) {
+ var index=oStamp.subject+page;
+ oStamp.setProps({rotate:0})
+ oStamp.rect=oDADStamp[index][oStamp.AP][0];
+ resetFocus("ddReset"+ddName);
+}
+function resetDDM(page,ddName) {
+ var stamps=this.getAnnots(page);
+ for (var i=0; i<stamps.length; i++) {
+ if ( stamps[i].subject == ddName ) {
+ stamps[i].rect=oDADStamp[ddName+page][stamps[i].AP][0];
+ stamps[i].setProps({rotate:0})
+ oDADStamp[ddName+page][stamps[i].AP][1]=false;
+ }
+ }
+ oDADCnt[ddName+page]=[0,0];
+ for (var i=0; i<this.numFields; i++) {
+ var fname=this.getNthFieldName(i);
+% \end{macrocode}
+% All fields have the two character sequence \texttt{"@\#"} in it.
+% We search for this, if not found, it is an ordinary field.
+% \begin{macrocode}
+ var getIndexOf = fname.indexOf("@#");
+ if ( (getIndexOf!=-1) %
+&& (fname.substring(0,getIndexOf)==ddName) ) {
+ var f=this.getField(fname);
+ if (f.readonly) {
+ f.readonly=false;
+ f.strokeColor=color.black;
+ }
+ }
+ }
+ if (typeof ddCustomResetAction=="function")
+ ddCustomResetAction(page,ddName);
+ this.dirty=false;
+}
+var ddGoodVersion=true;
+var ddNotification=false;
+function ddAlertInBrowser() {
+ app.alert({cMsg:\ddExternalMsg,
+ nIcon: 3, cTitle: "AeB DAD Match"});
+}
+function ddAlertBadApp() {
+ app.alert({cMsg:\ddBadAppMsg,
+ nIcon: 3, cTitle: "AeB DAD Match"});
+}
+function ddOpenDocAction() {
+ if (this.external) {
+% \end{macrocode}
+% \changes{v1.0a}{2012/11/14}{Stamps cannot be moved in a browser, even
+% when using the Acrobat plug-in.}
+% Stamps cannot be moved in a browser, even
+% when using the Acrobat plug-in.
+% \begin{macrocode}
+ if (!ddNotification) {
+ ddNotification=true;
+ ddTO=app.setTimeOut("ddAlertInBrowser()",250);
+ }
+ ddGoodVersion=false;
+ } else {
+ if (app.viewerType == "Reader" && app.viewerVersion<11) {
+ if (!ddNotification) {
+ ddNotification=true;
+ ddTO=app.setTimeOut("ddAlertBadApp()",250);
+ }
+ ddGoodVersion=false;
+ }
+ }
+}
+function ddPageOpen(page) {
+% \end{macrocode}
+% We want to execute the stamp code only once, the first time the page
+% is opened. The array \texttt{aDDPageCtrl} keeps track of whether this
+% \changes{v1.2a}{2016/08/22}{Fixed issue with reset button not working as expected when
+% there are more than one reset buttons on different pages.}
+% Fixed issue with reset button not working as expected when
+% there are more than one reset buttons on different pages.
+% page has been already opened. Traced problem to the assignment of \texttt{bDDInit}, using
+% array \texttt{aDDPageCtrl} to track the pages.
+% \begin{macrocode}
+ var bDDInit=false;
+ if (!aDDPageCtrl[page]) {
+ var bDDInit=true;
+ aDDPageCtrl[page]=true;
+ }
+ if (bDDInit) {
+console.println("Executing ddPageOpen for page "+(page+1));
+ this.syncAnnotScan();
+% \end{macrocode}
+% We get the array of all annots on this page.
+% \begin{macrocode}
+ var stamps=this.getAnnots(page);
+ if (stamps==null) return;
+ for (var i=0; i<stamps.length; i++) {
+ var si=stamps[i];
+ if ( si.type=="Stamp") {
+% \end{macrocode}
+% We store only annots of type Stamp.
+% \begin{macrocode}
+ var index=si.subject+page;
+% \end{macrocode}
+% If \texttt{oDADStamp[stamps[i].subject+this.pageNum]}, is undefined,
+% we define it.
+% \begin{macrocode}
+ if (typeof oDADStamp[index]=="undefined" ) {
+ oDADStamp[index]=new Array();
+% \end{macrocode}
+% \texttt{oDADCnt} will keep track of the score. The first entry
+% is the number correct, the second entry is the number of tries.
+% \begin{macrocode}
+ oDADCnt[index]=[0,0];
+% \end{macrocode}
+% Grant user right to permanently dismiss alert box.
+% \begin{macrocode}
+ oDADAlerts[si.subject]=new Object();
+ oDADAlerts[si.subject].oAlrtChk={bAfterValue:false};
+ }
+% \end{macrocode}
+% Stamp data is stored by \texttt{<subject><page>}, a particular stamp
+% is referenced by its \texttt{AP} name. We save the original rectangle
+% and a boolean \texttt{false}. When the stamp is placed correctly, we
+% change this to \texttt{true}.
+% \begin{macrocode}
+ oDADStamp[index][si.AP]=[si.rect, false];
+ }
+ }
+ } else console.println("Bypassing ddPageOpen for page "+page);
+}
+function resetFocus(fname) {
+ this.getField(fname).setFocus();
+}
+var gDDStats=new Object();
+var ddStats=new Object();
+function ddCorrectAction(event,ddName) {
+ var page = event.target.page;
+ oDADCnt[ddName+page][0] += 1;
+ oDADCnt[ddName+page][1] += 1;
+ gDDStats[ddName]={nCorrect: oDADCnt[ddName+page][0],
+ nTries: oDADCnt[ddName+page][1]};
+ ddStats=gDDStats[ddName];
+ if (typeof ddCustomCorrectAction == "function")
+% \end{macrocode}
+% Customization: If \texttt{ddCustomCorrectAction()} is defined, we use it.
+% \begin{macrocode}
+ ddCustomCorrectAction(event,ddName);
+ else
+ ddCorrectActionDef(event,ddName);
+}
+% \end{macrocode}
+% Added JavaScript functions \texttt{ddCorrectActionDef()} and
+% \texttt{ddWrongActionDef()}, these are used to create both custom and default response actions.
+% \changes{v1.2}{2016/08/22}{Added ddCorrectActionDef and
+% ddWrongActionDef}
+% \begin{macrocode}
+function ddCorrectActionDef(event,ddName) {
+ if (!oDADAlerts[ddName].oAlrtChk.bAfterValue)
+ app.alert({cMsg: \ddRightMsg, nIcon: 3,
+ cTitle: "AeB DAD Matching",
+ oCheckbox:oDADAlerts[ddName].oAlrtChk});
+}
+function ddWrongAction(event,ddName) {
+ var page = event.target.page;
+ oDADCnt[ddName+page][1] += 1;
+ gDDStats[ddName]={nCorrect: oDADCnt[ddName+page][0],
+ nTries: oDADCnt[ddName+page][1]};
+ ddStats=gDDStats[ddName];
+ if (typeof ddCustomWrongAction == "function")
+% \end{macrocode}
+% Customization: If \texttt{ddCustomWrongAction()} is defined, we use it.
+% \begin{macrocode}
+ ddCustomWrongAction(event,ddName);
+ else
+ ddWrongActionDef(event,ddName);
+}
+function ddWrongActionDef(event,ddName) {
+ if (!oDADAlerts[ddName].oAlrtChk.bAfterValue)
+ app.alert({cMsg: \ddWrongMsg, nIcon:0,
+ cTitle: "AeB DAD Matching",
+ oCheckbox:oDADAlerts[ddName].oAlrtChk});
+ else
+ app.beep(4);
+}
+\end{insDLJS}
+% \end{macrocode}
+% \begin{macrocode}
+\catcode`\_=\dad@subCat
+%</package>
+% \end{macrocode}
+%\Finale
diff --git a/texmf-dist/source/latex/mkstmpdad/aeb_dad.ins b/texmf-dist/source/latex/mkstmpdad/aeb_dad.ins
new file mode 100644
index 00000000..9e5337e0
--- /dev/null
+++ b/texmf-dist/source/latex/mkstmpdad/aeb_dad.ins
@@ -0,0 +1,63 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1999-2006 D. P. Story
+%%
+%% This file is part of the `AcroTeX eDucation Bundle'.
+%% -------------------------------------------
+%%
+%% It may be distributed under the conditions of the LaTeX Project Public
+%% License, either version 1.2 of this license or (at your option) any
+%% later version. The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.2 or later is part of all distributions of LaTeX
+%% version 1999/12/01 or later.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2008/04/22}
+\def\batchfile{aeb_dad.ins}
+%
+% If you can assume that the target audience for the document all have
+% Acrobat Reader 5.0 or later, then chance the following switch to true,
+% else, leave it as false.
+
+\input docstrip
+\ifx\generate\undefined
+ \Msg{**********************************************}
+ \Msg{*}
+ \Msg{* This installation requires docstrip}
+ \Msg{* version 2.4 or later.}
+ \Msg{*}
+ \Msg{* An older version of docstrip has been input}
+ \Msg{*}
+ \Msg{**********************************************}
+ \errhelp{Move or rename old docstrip.tex and get a newer one.}
+ \errmessage{Old docstrip in input path}
+ \batchmode
+ \csname @@end\endcsname\end
+\fi
+
+\keepsilent
+\askforoverwritefalse
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\preamble
+\endpreamble
+
+\generate{
+ \file{\jobname.sty}{\from{\jobname.dtx}{copyright,package}}
+}
+
+\Msg{***************************************************************}
+\Msg{*}
+\Msg{* \space To finish the installation you have to copy the files }
+\Msg{*}
+\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX}
+\Msg{*}
+\Msg{***************************************************************}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\endinput
diff --git a/texmf-dist/source/latex/mkstmpdad/mkstmp_pro.dtx b/texmf-dist/source/latex/mkstmpdad/mkstmp_pro.dtx
new file mode 100644
index 00000000..bcffd9cb
--- /dev/null
+++ b/texmf-dist/source/latex/mkstmpdad/mkstmp_pro.dtx
@@ -0,0 +1,167 @@
+% \iffalse
+% makeindex -s gglo.ist -o mkstmp_pro.gls mkstmp_pro.glo
+% makeindex -s gind.ist -o mkstmp_pro.ind mkstmp_pro.idx
+%<*copyright>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% mkstmp_pro package %%
+%% Copyright (C) 2012-2016 D. P. Story %%
+%% dpstory@uakron.edu %%
+%% %%
+%% This program can redistributed and/or modified under %%
+%% the terms of the LaTeX Project Public License %%
+%% Distributed from CTAN archives in directory %%
+%% macros/latex/base/lppl.txt; either version 1 of the %%
+%% License, or (at your option) any later version. %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%</copyright>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{mkstmp_pro}
+%<package> [2016/08/21 v1.1 Make Stamps for stamp annotations (dps)]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[colorlinks,hyperindex=false]{hyperref}[2012/10/12] % to support calculate for pdfyrc
+\pdfstringdefDisableCommands{\let\\\textbackslash}
+\OnlyDescription
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\def\ltag{<}\def\rtag{>}
+\InputIfFileExists{aebdocfmt.def}{\PackageInfo{mkstmp_pro}{Inputting aebdocfmt.def}}
+ {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro} \let\setupFullwidth\relax
+ \PackageInfo{mkstmp_pro}{aebdocfmt.def cannot be found}}
+\begin{document}
+ \GetFileInfo{mkstmp_pro.sty}
+ \title{\textsf{mkstmp\_pro}: Create stamps for \textsf{AA/AAR}}
+ \author{D. P. Story\\
+ Email: \texttt{dpstory@uakron.edu}}
+ \date{processed \today}
+ \maketitle
+ \tableofcontents
+ \let\Email\texttt
+ \DocInput{mkstmp_pro.dtx}
+\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute
+ \texttt{makeindex -s gind.ist -o mkstmp\_pro.ind mkstmp\_pro.idx} on the command line and recompile
+ \texttt{mkstmp\_pro.dtx}.}
+\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute
+ \texttt{makeindex -s gglo.ist -o mkstmp\_pro.gls mkstmp\_pro.glo} on the command line and recompile
+ \texttt{mkstmp\_pro.dtx}.}
+\end{document}
+%</driver>
+% \fi
+%
+% \MakeShortVerb{|}
+% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{mkstmp_pro}{Inputting aebdonotindex.def}}
+% {\PackageInfo{mkstmp_pro}{aebdonotindex.def cannot be found}}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \paragraph*{Description.}
+% \textsf{mkstmp\_pro} is a package for making a (rubber) stamp file.
+% A person using this package requires \textsf{aeb\_pro} and \textsf{Adobe Acrobat} (\texttt{AA}).
+% After you create a stamp file, move it to the user stamp folder of your \textsf{Acrobat}
+% distribution and the stamps will be available for use.
+%
+% \paragraph*{Documentation and Code.}\strut\par\medskip\noindent
+% We require the \textsf{aeb\_pro} and \textsf{xkeyval} packages.
+% \begin{macrocode}
+\RequirePackage{aeb_pro}[2012/11/09]
+\RequirePackage{xkeyval}
+% \end{macrocode}
+% A command taken from \textsf{eforms} that can be used to define
+% \cs{setStampPath}.
+% \begin{macrocode}
+\providecommand{\definePath}[1]{\def\ef@ctrlName{#1}%
+ \hyper@normalise\ef@definePath}
+\def\ef@definePath#1{\expandafter\xdef\ef@ctrlName{#1}}
+% \end{macrocode}
+% \DescribeMacro{\setStampPath} is used to define the path to the icon
+% file. It is a declaration that uses \cs{definePath} to define the
+% macro \cs{stampPath}. If used, then the \texttt{path} key is not used (defined below).
+% \begin{macrocode}
+\newcommand{\setStampPath}[1]{\definePath{\msp@stampPath}{#1}}
+% \end{macrocode}
+% Key value pairs for the \texttt{makeStamp} family.\par\medskip\noindent
+% \DescribeMacro{name} is the name you are giving the stamp.
+% \begin{macrocode}
+\define@key{makeStamp}{name}[]{\def\makeStamp@name{\##1}}
+\let\msp@stampPath\@empty
+% \end{macrocode}
+% \DescribeMacro{path} is the path to the PDF file containing the image
+% to be used for a stamp. The default is \cs{msp@stampPath}, defined separately
+% using \cs{setStampPath}.
+% \begin{macrocode}
+\define@key{makeStamp}{path}[\msp@stampPath]{\edef\makeStamp@path{#1}}
+% \end{macrocode}
+% \DescribeMacro{page} is the page in the PDF file that corresponds to the
+% image you want to use as a stamp.
+% \begin{macrocode}
+\define@key{makeStamp}{page}[0]{\def\aeb@stamp@page{#1}}
+% \end{macrocode}
+% \DescribeMacro{\makeStamps} is the only command of this package. Its only
+% argument is a list of tokens.
+%\begin{verbatim}
+% \setStampPath{C:/Users/Public/Documents/%
+% My TeX Files/tex/latex/aeb/aebpro/aeb_dad/images/juergen.pdf}
+% \makeStamps{%
+% {name=Touches Hat,page=0}
+% {name=Doffs Hat,page=1}
+% {name=Movie Star,page=2}
+% {name=Running Man,page=3}
+% }
+% \begin{docassembly}
+% \insertPreDocAssembly
+% \end{docassembly}
+% \begin{document}
+% ...
+%\end{verbatim}
+% There are three key-value pairs. name, path, and page. The path key is not really
+% needed if the command \cs{setStampPath} is used.
+% \begin{macrocode}
+\newcommand{\makeStamps}[1]{%
+ \edef\@tforExp{\noexpand\@tfor\noexpand\msp@Args:=#1}%
+ \@tforExp\do{\expandafter\ms@makeStamp
+ \expandafter{\msp@Args}%
+ }%
+}
+% \end{macrocode}
+% \cs{makeStamp} is a loop that calls \cs{ms@makeStamp}. A typical call
+% is
+%\begin{verbatim}
+% \ms@makeStamp{name=Touches Hat,page=0}
+%\end{verbatim}
+% \begin{macrocode}
+\newcommand{\ms@makeStamp}[1]{%
+ \setkeys{makeStamp}{name,path,page,#1}%
+ \ifx\make@Stamps@name\@empty
+ \PackageError{mkstmp_pro}{The `name' key is required}
+ {Please give the path of the stamp image.}\fi
+ \ifx\makeStamp@path\@empty
+ \PackageError{mkstmp_pro}{The `path' key is required}
+ {Please give the path of the stamp image, or \MessageBreak
+ use \string\setStampPath.}\fi
+% \end{macrocode}
+% We work things so that the pages are added in the same order that they
+% are listed in the arguments of \cs{makeStamp}.
+%
+% We create a command \cs{predocassemJS} that is designed for use in the
+% \texttt{docassembly} environment of \textsf{aeb\_pro}.
+% \begin{macrocode}
+ \xdef\predocassemJS{%
+ var retn=\insertPages({nPage:0, cPath:"\makeStamp@path",%
+ nStart:\aeb@stamp@page});^^J%
+ if ( retn==-1 ) console.println("The file
+ \string\"\makeStamp@path\string\" could not be opened.");^^J%
+ if ( retn==-2 ) console.println("Selected page
+ (page=\aeb@stamp@page) for \string\"\makeStamp@path\string\"
+ is invalid.");^^J%
+ \createTemplate({cName:"\makeStamp@name",nPage:1});^^J%
+ \predocassemJS%
+ }%
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%\Finale
diff --git a/texmf-dist/source/latex/mkstmpdad/mkstmp_pro.ins b/texmf-dist/source/latex/mkstmpdad/mkstmp_pro.ins
new file mode 100644
index 00000000..cf9326f3
--- /dev/null
+++ b/texmf-dist/source/latex/mkstmpdad/mkstmp_pro.ins
@@ -0,0 +1,63 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1999-2006 D. P. Story
+%%
+%% This file is part of the `AcroTeX eDucation Bundle'.
+%% -------------------------------------------
+%%
+%% It may be distributed under the conditions of the LaTeX Project Public
+%% License, either version 1.2 of this license or (at your option) any
+%% later version. The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.2 or later is part of all distributions of LaTeX
+%% version 1999/12/01 or later.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2008/04/22}
+\def\batchfile{mkstmp_pro.ins}
+%
+% If you can assume that the target audience for the document all have
+% Acrobat Reader 5.0 or later, then chance the following switch to true,
+% else, leave it as false.
+
+\input docstrip
+\ifx\generate\undefined
+ \Msg{**********************************************}
+ \Msg{*}
+ \Msg{* This installation requires docstrip}
+ \Msg{* version 2.4 or later.}
+ \Msg{*}
+ \Msg{* An older version of docstrip has been input}
+ \Msg{*}
+ \Msg{**********************************************}
+ \errhelp{Move or rename old docstrip.tex and get a newer one.}
+ \errmessage{Old docstrip in input path}
+ \batchmode
+ \csname @@end\endcsname\end
+\fi
+
+\keepsilent
+\askforoverwritefalse
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\preamble
+\endpreamble
+
+\generate{
+ \file{\jobname.sty}{\from{\jobname.dtx}{copyright,package}}
+}
+
+\Msg{***************************************************************}
+\Msg{*}
+\Msg{* \space To finish the installation you have to copy the files }
+\Msg{*}
+\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX}
+\Msg{*}
+\Msg{***************************************************************}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\endinput