* JavaScript conflicts
@ 2008-01-23 4:00 Zhichu Chen
0 siblings, 0 replies; only message in thread
From: Zhichu Chen @ 2008-01-23 4:00 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 3020 bytes --]
Hi,
I was trying to make a report for my job last year. I did some
javascript things to put a clock at each page of my presentation
to make sure I'll finish it in time.
But I found some tricky conflicting between my script and
the one in java-stp.tex
OK, here is my test file (it's a little too long):
================================
\usemodule [pre-60]
\setuppapersize[S6][S6]
\setuppagenumbering[state=start,location=]
\setuptolerance[verytolerant,stretch]
\setupinteractionscreen [option=max]
\setupinteraction[state=start,click=no,menu=on]
\startJSpreamble functions used now
font.Digital = "Courier-Bold" ;
function start_clock()
{ this.getField("time.clock").value = util.printd("HH:MM:ss", new Date());
this.getField("time.clock").readonly = true ;
this.getField("time.clock").textColor = color.red ;
this.getField("time.clock").textSize = 13 ;
this.getField("time.clock").textFont = font.Digital ;
this.dirty = false }
var timeout = app.setInterval("start_clock()",1000);
\stopJSpreamble
% Field of clock
\useJSscripts[fld]
\definefield [time.clock] [line] [TimeLogo]
\setupfield [TimeLogo] [horizontal,frame]
[width=fit,height=25pt,background=,
backgroundcolor=,frame=off]
[width=5.2cm,frame=off]
[width=5.2cm,frame=off,style=type]
\dorecurse{\totalnumberofpages}{\copyfield[time.clock
][clock::\recurselevel]}
\def\clock{\field[clock::\pagenumber]}
\setupfootertexts[{\color[white]\tfxx \midaligned{\rlap{\currentdate} \hfill
TITLE\hfill \llap{AUTHOR}}}]
\setuplayout[bottomspace=.8cm,
bottom=12pt]
\startinteractionmenu[bottom]
{\interactionbar[alternative=f,width=\makeupwidth,height=1ex]}
\stopinteractionmenu
\setupfooter[state=start]
\starttext
\field[time.clock]
\field[clock::\pagenumber]
page number is \pagenumber.
% \StartSteps
% \starttabulate
% \NC test \FlushStep \NC test \FlushStep \NC \NR
% \NC test \FlushStep \NC test \FlushStep \NC \NR
% \NC test \FlushStep \NC test \FlushStep \NC \NR
% \stoptabulate
% \StopSteps
\page
\field[clock::\pagenumber]
page number is \pagenumber.
\page
\field[clock::\pagenumber]
page number is \pagenumber.
\page
\field[clock::\pagenumber]
page number is \pagenumber.
\stoptext
================================
This is just a test file, I will put those fields into \setupfootertexts
or somewhere else to make every page a clock.
If I uncomment the \StartSteps . . . \StopSteps part, some PDF
layer kind of error will show and nothing is generated.
Do I have to remove the clock to make the fancy stepwise thing
or keep the clock but lost the stepwise function of ConTeXt?
--
Best Regards
Chen
----------------------------------------------------------------
Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
| www.sinap.ac.cn
----------------------------------------------------------------
[-- Attachment #1.2: Type: text/html, Size: 3912 bytes --]
[-- Attachment #2: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-01-23 4:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-23 4:00 JavaScript conflicts Zhichu Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).