ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Acrobat JavaScript in ConTeXt
@ 2011-03-07 16:11 Vedran Miletić
  2011-03-07 23:29 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Vedran Miletić @ 2011-03-07 16:11 UTC (permalink / raw)
  To: NTG-ConTeXt mailing list


[-- Attachment #1.1: Type: text/plain, Size: 269 bytes --]

Hi,

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

\setupinteraction[state=start]

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

Can anyone help?

Regards,

Vedran Miletić

[-- Attachment #1.2: Type: text/html, Size: 304 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Acrobat JavaScript in ConTeXt
  2011-03-07 16:11 Acrobat JavaScript in ConTeXt Vedran Miletić
@ 2011-03-07 23:29 ` Hans Hagen
  2011-03-09 18:06   ` Vedran Miletić
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2011-03-07 23:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7-3-2011 5:11, Vedran Miletić wrote:
> Hi,
>
> how can one make a button that does app.alert() in ConTeXt? I tried
> something like this without much luck:
>
> \setupinteraction[state=start]
>
> \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.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Acrobat JavaScript in ConTeXt
  2011-03-07 23:29 ` Hans Hagen
@ 2011-03-09 18:06   ` Vedran Miletić
  2011-03-10 13:35     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Vedran Miletić @ 2011-03-09 18:06 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 874 bytes --]

Dana 8. ožujka 2011. 00:29 Hans Hagen <pragma@wxs.nl> je napisao/la:

> On 7-3-2011 5:11, Vedran Miletić wrote:
>
>> Hi,
>>
>> how can one make a button that does app.alert() in ConTeXt? I tried
>> something like this without much luck:
>>
>> \setupinteraction[state=start]
>>
>> \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 čćžšđ) in strings?

Regars,

Vedran Miletić

[-- Attachment #1.2: Type: text/html, Size: 1374 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Acrobat JavaScript in ConTeXt
  2011-03-09 18:06   ` Vedran Miletić
@ 2011-03-10 13:35     ` Hans Hagen
  2011-03-25  8:23       ` Vedran Miletić
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2011-03-10 13:35 UTC (permalink / raw)
  To: Vedran Miletić; +Cc: mailing list for ConTeXt users


> 1) how to deal with commas in strings? MyAlert{Hello, World} displays only
> Hello.

does {{Hello, World}} work?

> 2) is it possible to get international charcters (such as čćžšđ) in strings?

I don't know if javascript does utf


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Acrobat JavaScript in ConTeXt
  2011-03-10 13:35     ` Hans Hagen
@ 2011-03-25  8:23       ` Vedran Miletić
  0 siblings, 0 replies; 5+ messages in thread
From: Vedran Miletić @ 2011-03-25  8:23 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 272 bytes --]

Dana 10. ožujka 2011. 14:35 Hans Hagen <pragma@wxs.nl> je napisao/la:

>
>  1) how to deal with commas in strings? MyAlert{Hello, World} displays only
>> Hello.
>>
>
> does {{Hello, World}} work?


Unfortunately no. Hyperlink no longer gets created.

Vedran

[-- Attachment #1.2: Type: text/html, Size: 707 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-25  8:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-07 16:11 Acrobat JavaScript in ConTeXt Vedran Miletić
2011-03-07 23:29 ` Hans Hagen
2011-03-09 18:06   ` Vedran Miletić
2011-03-10 13:35     ` Hans Hagen
2011-03-25  8:23       ` Vedran Miletić

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).