From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30644 Path: news.gmane.org!not-for-mail From: "Zhichu Chen" Newsgroups: gmane.comp.tex.context Subject: How to display JavaScript's values in ConTeXt Date: Tue, 5 Sep 2006 12:56:24 +0800 Message-ID: <769ba7780609042156u73f92c2etf317b250759ab1d8@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1157432204 23751 80.91.229.2 (5 Sep 2006 04:56:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Sep 2006 04:56:44 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 05 06:56:42 2006 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 ciao.gmane.org with esmtp (Exim 4.43) id 1GKSzI-0002cF-Hj for gctc-ntg-context-518@m.gmane.org; Tue, 05 Sep 2006 06:56:40 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D63F81FCB7; Tue, 5 Sep 2006 06:56:37 +0200 (CEST) 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 26886-03; Tue, 5 Sep 2006 06:56:29 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 26FD61FC0D; Tue, 5 Sep 2006 06:56:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4AACA1FC0D for ; Tue, 5 Sep 2006 06:56:27 +0200 (CEST) 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 26885-03 for ; Tue, 5 Sep 2006 06:56:26 +0200 (CEST) Original-Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by ronja.ntg.nl (Postfix) with SMTP id 01BFE1FBD9 for ; Tue, 5 Sep 2006 06:56:25 +0200 (CEST) Original-Received: by py-out-1112.google.com with SMTP id m51so3531837pye for ; Mon, 04 Sep 2006 21:56:24 -0700 (PDT) Original-Received: by 10.35.61.2 with SMTP id o2mr9252896pyk; Mon, 04 Sep 2006 21:56:24 -0700 (PDT) Original-Received: by 10.35.29.7 with HTTP; Mon, 4 Sep 2006 21:56:24 -0700 (PDT) Original-To: ntg-context@ntg.nl Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:30644 Archived-At: Hello everybody, I want to add a clock which shows the system time to a pdf file. And I have read the ``art-calc.pdf'' and ``mwidget-p.pdf'' to find some approaches but failed shamely. I am indeed new at ConTeXt and JavaScript. Before I'm shocked by ConTeXt, I used LaTeX for about 2 years, so I'm confused with the conventions between ConTeXt and LaTeX. My code is here: ---------------------------------------------------------------------------------- \setupinteraction[state=start] \startJSpreamble functions used now function do_digit(d) { Stack[Level] += String(d); do_refresh(Level) } \stopJSpreamble \startJScode{digit} do_digit(JS_S_1); \stopJScode \definefield[Stack.1][line][Results][][ \setupfield [Results] [horizontal,frame] [width=fit, height=2cm, frame=on] [height=18pt,width=80pt,align=middle,frame=off] [height=18pt,width=80pt,color=red,align=right,style=type,frame=off] \setupbuttons [background=infobutton] \starttext Click \button{7}[JS(digit{7})] will get \field[Stack.1] \stoptext -------------------------------------------------------------------------------- I only copied these codes from "art-calc.pdf" so there must be some other critical concepts that I haven't realized. Please point them to me. Thanks