From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- .../contrib/fitr/examples/restoreHookBlink.js | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 macros/latex/contrib/fitr/examples/restoreHookBlink.js (limited to 'macros/latex/contrib/fitr/examples/restoreHookBlink.js') diff --git a/macros/latex/contrib/fitr/examples/restoreHookBlink.js b/macros/latex/contrib/fitr/examples/restoreHookBlink.js new file mode 100644 index 0000000000..77f6077ee4 --- /dev/null +++ b/macros/latex/contrib/fitr/examples/restoreHookBlink.js @@ -0,0 +1,33 @@ +% +% 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}[overlayRestoreHook]{rfitr}{Blink border on restore} +function overlayRestoreHook(event,bRestore) { + if (!bRestore) return; + toggleBC.field=event.target; + toggleBC.startColor=event.target.strokeColor; + toggleBC.altColor=(color.equal(toggleBC.startColor,color.transparent))?% +color.red:color.transparent; + oSIR=app.setInterval("toggleBC();",250); + oTOR=app.setTimeOut("app.clearInterval(oSIR); 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,color.transparent))?color.red:color.transparent; +} -- cgit v1.2.3