summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-02-24 22:59:05 +0000
committerKarl Berry <karl@freefriends.org>2014-02-24 22:59:05 +0000
commit2c19ae5fd0501fc4bdeac0b5f393b35e30bc489f (patch)
tree78db9f01352b3a3ef549f74132b27cbb888070fc /Master/texmf-dist/tex
parentcdbe684fed9995963330693c394c781dd5baf285 (diff)
tdclock (23feb14)
git-svn-id: svn://tug.org/texlive/trunk@33043 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/tdclock/tdclock.sty130
1 files changed, 90 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/latex/tdclock/tdclock.sty b/Master/texmf-dist/tex/latex/tdclock/tdclock.sty
index 3608eb4c534..e70e6747ef1 100644
--- a/Master/texmf-dist/tex/latex/tdclock/tdclock.sty
+++ b/Master/texmf-dist/tex/latex/tdclock/tdclock.sty
@@ -1,4 +1,4 @@
-\ProvidesPackage{tdclock} [2009/06/01 v2.2 clock accessory]
+\ProvidesPackage{tdclock} [2014/02/21 v2.5 clock accessory]
%
% Luis Randez randez@unizar.es
@@ -27,7 +27,9 @@
\ifdefined\clock@fontsize\else\newdimen\clock@fontsize\clock@fontsize=\f@size pt\fi
\ifdefined\clock@height\else\newdimen\clock@height\fi
%\ifdefined\clock@fontcolor\else\newcommand{\clock@fontcolor}{0 0 0}\fi
-
+%
+\ifdefined\clock@resetatpages\else\def\clock@resetatpages{none}\fi
+\ifdefined\clock@pdfpagetype\else\def\clock@pdfpagetype{pdfpagelabels}\fi
\DeclareOptionX{font}{\def\clock@font{"font.#1"}}
\DeclareOptionX{timeinterval}{\renewcommand{\clock@interval}{#1}}
@@ -39,9 +41,15 @@
\DeclareOptionX{colorwarningsecond}{\renewcommand{\clock@colorwarningsecond}{#1}}
\DeclareOptionX{fillcolorwarningfirst}{\renewcommand{\clock@fillcolorwarningfirst}{#1}}
\DeclareOptionX{fillcolorwarningsecond}{\renewcommand{\clock@fillcolorwarningsecond}{#1}}
+\DeclareOptionX{resetatpages}{\renewcommand{\clock@resetatpages}{#1}}
+\DeclareOptionX{pageresetcontrol}{\renewcommand{\clock@pdfpagetype}{#1}}
+
+%
\ProcessOptionsX
+%\def\resetatthispage{\def\clock@resetatpages{\clock@resetatpages,\HyPL@thisLabel}}
+
\def\a@a{1.0}
\def\b@b{1.080}
\def\a@one{1.1}
@@ -154,21 +162,21 @@
\def\tdyear{%
\clock@setfonsize\clock@setheight\clock@setfontcolor%\clock@setwidth
-\setbox\sizebox=\hbox{\TextField[name=year, width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize]{}}%
+\setbox\sizebox=\hbox{\TextField[readonly=true,name=year, width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize]{}}%
\vrule width 0pt height 2pt\kern-1pt\kern-\wd\sizebox\kern 60pt{\raisebox{-\b@h\clock@fontsize}{\raisebox{-\a@h pt}{\mbox{\TextField[name=year, width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,readonly=true,
value={}]{}\kern-60pt\kern \a@a pt\kern \b@b\clock@fontsize\kern \b@b\clock@fontsize\vrule width 0pt height 2pt}}}}%
}
\def\pdfslash{%
\clock@setfonsize\clock@setheight\clock@setfontcolor%\clock@setwidth
-\setbox\sizebox=\hbox{\TextField[ width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,value=/]{}}%
+\setbox\sizebox=\hbox{\TextField[readonly=true, width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,value=/]{}}%
\vrule width 0pt height 2pt\kern-0.75pt\kern-\wd\sizebox\kern 60pt{\raisebox{-\b@h\clock@fontsize}{\raisebox{-\a@h pt}{\mbox{\TextField[name=separatordate, width=60pt, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,
readonly=true,value=/]{}\kern-60pt\kern \a@one pt\kern \b@one\clock@fontsize\vrule width 0pt height 2pt}}}}%
}
\def\pdfcolon{%
\clock@setfonsize\clock@setheight\clock@setfontcolor%\clock@setwidth
-\setbox\sizebox=\hbox{\TextField[name=separatortime, width=0.90\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,value=:]{}}%
+\setbox\sizebox=\hbox{\TextField[readonly=true, name=separatortime, width=0.90\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,value=:]{}}%
\vrule width 0pt height 2pt\kern-0.4pt\kern-\wd\sizebox\kern 0.90\clock@fontsize{\raisebox{-\b@h\clock@fontsize}{\raisebox{-\a@h pt}%
{\mbox{\TextField[name=separatortime, width=0.90\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,
readonly=true,value=:]{}\kern-0.90\clock@fontsize\kern\a@one pt\kern \b@one\clock@fontsize\vrule width 0pt height 2pt}}}}%
@@ -176,7 +184,7 @@ readonly=true,value=:]{}\kern-0.90\clock@fontsize\kern\a@one pt\kern \b@one\cloc
\def\clockfield#1{%
\clock@setfonsize\clock@setheight\clock@setfontcolor%\clock@setwidth
-\setbox\sizebox=\hbox{\TextField[name=#1, width=1.31\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize]{}}%
+\setbox\sizebox=\hbox{\TextField[readonly=true, name=#1, width=1.31\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize]{}}%
\vrule width 0pt height 2pt\kern-\a@a pt\kern-\wd\sizebox\kern 1.31\clock@fontsize{\raisebox{-\b@h\clock@fontsize}%
{\raisebox{-\a@h pt}{\mbox{\TextField[name=#1, width=1.31\clock@fontsize, height=\clock@height, align = 0, color =\clock@fontcolor, charsize = \clock@fontsize,readonly=true,
value={}]{}\kern-1.31\clock@fontsize\kern\a@a pt\kern \b@b\clock@fontsize\vrule width 0pt height 2pt}}}}%
@@ -186,7 +194,7 @@ value={}]{}\kern-1.31\clock@fontsize\kern\a@a pt\kern \b@b\clock@fontsize\vrule
\clock@setfonsize\clock@setheight\clock@setfontcolor%
\setbox\sizebox=\hbox{#1}%
\vrule width 0pt height 2pt\kern-2pt\kern-\a@a pt\raisebox{-\dp\sizebox}{\raisebox{-\a@h pt}%
-{\mbox{\TextField[name=cronobox, width=1.01\wd\sizebox, height=1.08\ht\sizebox, align = 0, readonly=true,value= ]{}}}}%
+{\mbox{\TextField[readonly=true, name=cronobox, width=1.01\wd\sizebox, height=1.08\ht\sizebox, align = 0, readonly=true,value= ]{}}}}%
\vrule width 0pt height 2pt\kern0.1pt\kern-1.01\wd\sizebox\vrule width 0pt height 2pt#1\kern 1pt}
\def\initfields{%
@@ -194,22 +202,22 @@ value={}]{}\kern-1.31\clock@fontsize\kern\a@a pt\kern \b@b\clock@fontsize\vrule
\mbox{\TextField[format=\startclock,name=resultado2, hidden=true, width=0truecm, height=0truecm, bordercolor= 1 1 1, backgroundcolor= 1 1 1,value={}]{}}
\end{Form}%
%\TextField[name=resultado1, hidden=true, width=0pt, height=0pt,charsize=0pt]{}
-\TextField[name=hours, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=minutes, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=seconds, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=cronohours, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=cronominutes, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=crseconds, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=day, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=month, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
-\TextField[name=year, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=hours, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=minutes, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=seconds, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=cronohours, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=cronominutes, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=crseconds, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=day, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=month, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
+\TextField[readonly=true,name=year, hidden=true, width=0pt, height=0pt,charsize=0pt]{}%
\PushButton[name=button1, onclick={\auxiliar;},hidden=true]{}%
\PushButton[name=button2, onclick={\resetclock;},hidden=true]{}%
-\TextField[name=separatordate, hidden=true, width=0pt, height=0pt,charsize=0pt, value=/]{}%
-\TextField[name=separatortime, hidden=true, width=0pt, height=0pt,charsize=0pt, value=:]{}%
-\TextField[name=cronobox, hidden=true, width=0pt, height=0pt,charsize=0pt, value= ]{}%
+\TextField[readonly=true,name=separatordate, hidden=true, width=0pt, height=0pt,charsize=0pt, value=/]{}%
+\TextField[readonly=true,name=separatortime, hidden=true, width=0pt, height=0pt,charsize=0pt, value=:]{}%
+\TextField[readonly=true,name=cronobox, hidden=true, width=0pt, height=0pt,charsize=0pt, value= ]{}%
}
-
+%
\def\initclock{%
\setbox\sizebox=\hbox{\initfields}%
\initfields%
@@ -217,24 +225,18 @@ value={}]{}\kern-1.31\clock@fontsize\kern\a@a pt\kern \b@b\clock@fontsize\vrule
\unskip
}
%
-%
\def\resetclock{%
fecha1 = rresett();
-}%
-%
+}
%
\def\auxiliar{%
var iop= -iop;
}%
%
-%
\def\startclock{%
%
-global.iop;
-global.fuente;
-global.interval;
-global.duration;
-global.death;
+%global.page;
+%global.run;
%
var iop=1;
var fuente=eval(\clock@font);
@@ -242,18 +244,34 @@ var duration=eval(\clock@duration)*60;
var firstwarning=eval(\clock@timewarningfirst)/100;
var secondwarning=eval(\clock@timewarningsecond)/100;
var death=eval(\clock@death);
-%var interval=eval(#2);
-%var fuente="clock";
+%
+var page=0;
+var all="all";
+var none="none";
+var resetatpages=[\clock@resetatpages];
+%
fecha1 = rresett();
fecha1 = reloj();
-run = app.setInterval("reloj();",\clock@interval000);
+run = app.setInterval("reloj();",1000*\clock@interval);
+%run= app.setTimeOut("reloj();",\clock@interval020);
+% app.clearTimeOut(global.run);
+%run= app.setTimeOut("reloj();",\clock@interval020);
+%fecha1=b();
+%function b() {
+% run = app.setTimeOut("reloj();app.clearTimeOut(run);b()",\clock@interval000);
+%}
+%
+if (resetatpages[0] !="none")
+{
+ run2 =app.setInterval("pagina(this);",1000);
+}
%
function rresett()
{
var fObj0 = new Date();
-global.horas0 = fObj0.getHours();
-global.minutos0 = fObj0.getMinutes();
-global.segundos0 = fObj0.getSeconds();
+horas0 = fObj0.getHours();
+minutos0 = fObj0.getMinutes();
+segundos0 = fObj0.getSeconds();
}
%
function alerta(kolor,kolorfill)
@@ -268,9 +286,42 @@ this.getField("separatortime").textColor=kolor;
this.getField("cronobox").fillColor=kolorfill;
}
%
-function reloj()
+%
+function pagina(doc)
{
+ var pdfpagelabels=0;
+ var pdfpagenumbers=1;
+ if (\clock@pdfpagetype==0)
+ {
+ labelold=this.getPageLabel(page);
+ labelnew=this.getPageLabel(this.pageNum);
+ }
+ else
+ {
+ labelold=page;
+ labelnew=this.pageNum;
+ }
+ if ( labelold != labelnew)
+ {
+ resethere=0;
+ page=this.pageNum;
+ for (var j=0;j<resetatpages.length;j++)
+ {
+ if (resetatpages[j] == labelnew || resetatpages[j] == "all")
+ {
+ resethere=1;
+ }
+ }
+ if (resethere == 1)
+ {
+ rresett();
+ }
+ }
+}
+%
%
+function reloj()
+{
%
var fObj = new Date();
var dia = formateo(fObj.getDate());
@@ -284,7 +335,8 @@ horas = formateo(horas);
minutos = formateo(minutos);
segundos = formateo(segundos);
%
-resta = (eval(horas1-global.horas0)*60+eval(minutos1-global.minutos0))*60+eval(segundos1-global.segundos0);
+%resta = (eval(horas1-global.horas0)*60+eval(minutos1-global.minutos0))*60+eval(segundos1-global.segundos0);
+resta = (eval(horas1-horas0)*60+eval(minutos1-minutos0))*60+eval(segundos1-segundos0);
h = Math.floor(resta/3600); htexto=formateo(h);
m = Math.floor((resta-3600*h)/60); mtexto=formateo(m);
s = resta-3600*h-60*m; stexto=formateo(s);
@@ -308,7 +360,7 @@ if ( cociente >= firstwarning) {
}
if( (death == 1) && ( resta > duration*1.10 )) { closeDoc();}
%
-console.println("aaa " + fuente+ " " + duration);
+%console.println("aaa " + fuente+ " " + duration);
if (iop == 1)
{fecha1= dia+"/"+mes+"/"+year+ " "+horas + ":"+minutos+":"+segundos;
casio1=horas;casio2=minutos;casio3=segundos;}
@@ -377,7 +429,6 @@ this.getField("button1").strokeColor=["T"];
%this.getField("button2").textFont=fuente;
this.getField("button2").fillColor=["T"];
this.getField("button2").strokeColor=["T"];
-%
}
%
function formateo(uin)
@@ -390,4 +441,3 @@ return uin;
%\initclock
%
\endinput
-