From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30677 Path: news.gmane.org!not-for-mail From: "Zhichu Chen" Newsgroups: gmane.comp.tex.context Subject: Re: How to display JavaScript's values in ConTeXt Date: Thu, 7 Sep 2006 08:49:25 +0800 Message-ID: <769ba7780609061749s23017f99j16bc1b19c91430a0@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 1157590194 17060 80.91.229.2 (7 Sep 2006 00:49:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Sep 2006 00:49:54 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Sep 07 02:49:53 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 1GL85V-0002sp-1M for gctc-ntg-context-518@m.gmane.org; Thu, 07 Sep 2006 02:49:49 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 17C4D1FE2F; Thu, 7 Sep 2006 02:49:47 +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 14276-04-3; Thu, 7 Sep 2006 02:49:38 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C403B1FE39; Thu, 7 Sep 2006 02:49:37 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 591601FE39 for ; Thu, 7 Sep 2006 02:49:34 +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 14276-04-2 for ; Thu, 7 Sep 2006 02:49:28 +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 360051FE2F for ; Thu, 7 Sep 2006 02:49:27 +0200 (CEST) Original-Received: by py-out-1112.google.com with SMTP id m51so55414pye for ; Wed, 06 Sep 2006 17:49:26 -0700 (PDT) Original-Received: by 10.35.105.18 with SMTP id h18mr184613pym; Wed, 06 Sep 2006 17:49:26 -0700 (PDT) Original-Received: by 10.35.29.7 with HTTP; Wed, 6 Sep 2006 17:49: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:30677 Archived-At: It's so kind of you. Your example really helps me 'cause I can learn javascript and ConTeXt by books but there are few materials about how to associate them. Still, I'm sorry I have to open a new thread. I don't know how to reply under you, it's sad. ---------- Forwarded message ---------- From: Peter Rolf To: mailing list for ConTeXt users Date: Wed, 06 Sep 2006 12:06:02 +0200 Subject: Re: [NTG-context] How to display JavaScript's values in ConTeXt Zhichu Chen wrote: > . . . First thing to say: I'm also a javascript beginner (used it only once!), so don't expect too much from me :) In the following code the missing vars and function are added (javascript debugger), but still the initialisation ('undefined' text) and the reset for the result field are missing (and who knows what else). But it's a 'working' starting point. \startJSpreamble functions used now function do_digit(d) {console.println("do_digit("+d+") at page "+[this.pageNum]); Stack[Level] += String(d); do_refresh(Level) } var Stack = new Array(); var Level = 1 ; function do_refresh (i) { vv = this.getField("Stack.".concat(i)) ; if (vv) { vv.value = Stack[i] ; vv.readonly = (i!=Level) ; this.dirty = false } } \stopJSpreamble > . . . > I have not used text fields before (so no example code) and this is all I have about JavaScript: http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.3/reference/ from http://partners.adobe.com/public/developer/pdf/topic_js.html: http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/AcroJS.pdf http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/AcroJSGuide.pdf http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/AcroJSRefErrata.pdf BUT MOST IMPORTANT: http://partners.adobe.com/public/developer/en/pdf/debugger.js Description: "Use this file to enable the JavaScript Debugger in Adobe Reader, as described in the Acrobat JavaScript Scripting Guide." Hope that helps, Peter > . . . > >