diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/fitr/examples/jmpHookBlink.js |
Initial commit
Diffstat (limited to 'macros/latex/contrib/fitr/examples/jmpHookBlink.js')
-rw-r--r-- | macros/latex/contrib/fitr/examples/jmpHookBlink.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/macros/latex/contrib/fitr/examples/jmpHookBlink.js b/macros/latex/contrib/fitr/examples/jmpHookBlink.js new file mode 100644 index 0000000000..c6ea043e77 --- /dev/null +++ b/macros/latex/contrib/fitr/examples/jmpHookBlink.js @@ -0,0 +1,41 @@ +% +% This script hooks into the DLJS of fitr to blink the field +% border when the user clicks in it. Length of the blink +% is 1250 milli-seconds. +% +\begin{insDLJS}[overlayJmpHook]{jfitr}{Blink border after jump} +function overlayJmpHook(event) { + toggleBC.field=event.target; + toggleBC.field=event.target; + toggleBC.startColor=event.target.strokeColor; + toggleBC.altColor=(color.equal(toggleBC.startColor,color.transparent))?% +color.red:color.transparent; + oSIJ=app.setInterval("toggleBC();",250); + oTOJ=app.setTimeOut("app.clearInterval(oSIJ); resetBC();",1250); +} +if (typeof toggleBC != "function" ) { + function toggleBC() { + var oField=toggleBC.field; + oField.strokeColor=% + (color.equal(oField.strokeColor,toggleBC.startColor))?% +toggleBC.altColor:toggleBC.startColor; + } + function resetBC() { + toggleBC.field.strokeColor=toggleBC.startColor; + } +} +\end{insDLJS} +\endinput + +function toggleBC() { + var oField=toggleBC.field; + oField.strokeColor=% +(color.equal(oField.strokeColor,toggleBC.startColor))?% +toggleBC.altColor:toggleBC.startColor; +} + +%function toggleBC() { +% var oField=toggleBC.field; +% oField.strokeColor=% +%(color.equal(oField.strokeColor,color.transparent))?color.red:color.transparent; +%} |