From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/66791 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Vedran_Mileti=C4=87?= Newsgroups: gmane.comp.tex.context Subject: Re: Acrobat JavaScript in ConTeXt Date: Wed, 9 Mar 2011 19:06:16 +0100 Message-ID: References: <4D756A49.3080904@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1255830753==" X-Trace: dough.gmane.org 1299694018 21838 80.91.229.12 (9 Mar 2011 18:06:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2011 18:06:58 +0000 (UTC) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Wed Mar 09 19:06:54 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PxNmf-0002a4-KA for gctc-ntg-context-518@m.gmane.org; Wed, 09 Mar 2011 19:06:53 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AD990CAAC4; Wed, 9 Mar 2011 19:06:52 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ktnHe5qqgyOy; Wed, 9 Mar 2011 19:06:50 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E8C4DCAABD; Wed, 9 Mar 2011 19:06:49 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A49CACAABD for ; Wed, 9 Mar 2011 19:06:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id G6n2hxg0Da9k for ; Wed, 9 Mar 2011 19:06:37 +0100 (CET) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id 7459ECAA77 for ; Wed, 9 Mar 2011 19:06:37 +0100 (CET) Original-Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p29I6aXv015725 for ; Wed, 9 Mar 2011 19:06:37 +0100 Original-Received: by wwb28 with SMTP id 28so792154wwb.2 for ; Wed, 09 Mar 2011 10:06:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=r5fjJosW1aPnKh89YpKfoOSfc/TTUo6B9dD7Cu9cb4E=; b=XuaWRVVq3g+UtjD8ArAq4xyuxTkQPPuH93sgacuqYPjj5T+/+4hlKtgAQjBT8JMSCU dOuXW8Pg/XwuTehhrTUhuZ2wp4u/Dh/l/5KO2vjiHl6NC4A6vcVCSuhYb590MJ0DbtUJ mMBq0SYZGqQFLNlKZfFZK1oFgcMbOfXmNEfb4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=s3qsp1lb5Psdt04zOqw12NeVxPtpw55hYiHgF9UYRWilSZYlltwwAaPTr7mItBZHAS dSmKH9WsgYcb8Sp8ufr4DWDtHsxOwDwX7IrH+yZ1IkNV2Px6gJN0maeDgKB6yqPkH94u xWt5xDdRJWYOXwMxvV6kECWeb0f3va1ItqQwU= Original-Received: by 10.216.245.11 with SMTP id n11mr4690337wer.108.1299693996135; Wed, 09 Mar 2011 10:06:36 -0800 (PST) Original-Received: by 10.216.155.71 with HTTP; Wed, 9 Mar 2011 10:06:16 -0800 (PST) In-Reply-To: <4D756A49.3080904@wxs.nl> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.82.45; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 05Eh66A0c - 7279ba156d36 - 20110309 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.216 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:66791 Archived-At: --===============1255830753== Content-Type: multipart/alternative; boundary=e0cb4e43ae6df4d698049e109629 --e0cb4e43ae6df4d698049e109629 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Dana 8. o=C5=BEujka 2011. 00:29 Hans Hagen je napisao/la: > On 7-3-2011 5:11, Vedran Mileti=C4=87 wrote: > >> Hi, >> >> how can one make a button that does app.alert() in ConTeXt? I tried >> something like this without much luck: >> >> \setupinteraction[state=3Dstart] >> >> \starttext >> \goto{Button}[JS(app.alert{Hello World})] >> \stoptext >> >> Can anyone help? >> > > \startJSpreamble MyStuff used later > > function MyAlert(str) { > app.alert(str) > } > > \stopJSpreamble > > \goto{Button}[JS(MyAlert{Hello World})] > > so, we have a separation between definitions and usage. > Thanks, it works! I have two further questions: 1) how to deal with commas in strings? MyAlert{Hello, World} displays only Hello. 2) is it possible to get international charcters (such as =C4=8D=C4=87=C5= =BE=C5=A1=C4=91) in strings? Regars, Vedran Mileti=C4=87 --e0cb4e43ae6df4d698049e109629 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dana 8. o=C5=BEujka 2011. 00:29 Hans Hagen <pragma@wxs.nl> je napisao/la:
On 7-3-2011 5:11, Vedran Mileti=C4=87 wro= te:
Hi,

how can one make a button that does app.alert() in ConTeXt? I tried
something like this without much luck:

\setupinteraction[state=3Dstart]

\starttext
\goto{Button}[JS(app.alert{Hello World})]
\stoptext

Can anyone help?

\startJSpreamble MyStuff used later

function MyAlert(str) {
=C2=A0app.alert(str)
}

\stopJSpreamble

\goto{Button}[JS(MyAlert{Hello World})]

so, we have a separation between definitions and usage.

Thanks, it works!

I have two further questions:
1) how to d= eal with commas in strings? MyAlert{Hello, World} displays only Hello.
2) is it possible to get international charcters (such as =C4=8D=C4=87=C5= =BE=C5=A1=C4=91) in strings?

Regars,

Vedran Mileti=C4=87
--e0cb4e43ae6df4d698049e109629-- --===============1255830753== 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1255830753==--