From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/38776 Path: news.gmane.org!not-for-mail From: "Zhichu Chen" Newsgroups: gmane.comp.tex.context Subject: JavaScript conflicts Date: Wed, 23 Jan 2008 12:00:23 +0800 Message-ID: <769ba7780801222000g384dd9a0h2a4820f86e091f4@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1597021865==" X-Trace: ger.gmane.org 1201060913 28784 80.91.229.12 (23 Jan 2008 04:01:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Jan 2008 04:01:53 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 23 05:02:09 2008 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1JHWoT-00017a-Bk for gctc-ntg-context-518@m.gmane.org; Wed, 23 Jan 2008 05:02:09 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6FB431FB9F; Wed, 23 Jan 2008 05:01:40 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 08602-03; Wed, 23 Jan 2008 05:01:01 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2160A1FB7F; Wed, 23 Jan 2008 05:01:01 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9A6A71FB7F for ; Wed, 23 Jan 2008 05:00:59 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 09630-02-2 for ; Wed, 23 Jan 2008 05:00:27 +0100 (CET) Original-Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.180]) by ronja.ntg.nl (Postfix) with ESMTP id C12EC1FB74 for ; Wed, 23 Jan 2008 05:00:26 +0100 (CET) Original-Received: by wa-out-1112.google.com with SMTP id m16so6229820waf.14 for ; Tue, 22 Jan 2008 20:00:24 -0800 (PST) Original-Received: by 10.115.90.1 with SMTP id s1mr6852278wal.50.1201060823608; Tue, 22 Jan 2008 20:00:23 -0800 (PST) Original-Received: by 10.114.107.16 with HTTP; Tue, 22 Jan 2008 20:00:23 -0800 (PST) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:38776 Archived-At: --===============1597021865== Content-Type: multipart/alternative; boundary="----=_Part_10219_14221344.1201060823587" ------=_Part_10219_14221344.1201060823587 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ---------------------------------------------------------------- ------=_Part_10219_14221344.1201060823587 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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
---------------------------------------------------------------- ------=_Part_10219_14221344.1201060823587-- --===============1597021865== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============1597021865==--