ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Menus from Javascript
@ 1999-10-06  9:12 Matthew Baker
  1999-10-06 11:21 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew Baker @ 1999-10-06  9:12 UTC (permalink / raw)


Hi,

Is it possible to query and change menu settings from PDF Javascript
(specifically, turn off full screen mode).  If so, how?  Hans said
something about this to me before but I can't find anything about it in
the PDF documentation.  Is there an Adobe Javascript document?

- Matthew

--
Dr. Matthew Baker           matthew.baker@gmd.de
GMD - FIT.MMK               http://fit.gmd.de/hci/pages/matthew.baker.html


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

* Re: Menus from Javascript
  1999-10-06 11:21 ` Hans Hagen
@ 1999-10-06 10:58   ` Matthew Baker
  1999-10-06 12:46     ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew Baker @ 1999-10-06 10:58 UTC (permalink / raw)


On Wed, 6 Oct 1999, Hans Hagen wrote:

> Yes, AcroJs.pdf. This one is: 
> 
> app.fullscreen = true ; 

So, to use openaction or closeaction I would do something like

\setupinteraction[state=start,openaction={JS(app.fullscreen = true;)}]

?

This doesn't seem to work.

- Matt

--
Dr. Matthew Baker           matthew.baker@gmd.de
GMD - FIT.MMK               http://fit.gmd.de/hci/pages/matthew.baker.html


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

* Re: Menus from Javascript
  1999-10-06  9:12 Menus from Javascript Matthew Baker
@ 1999-10-06 11:21 ` Hans Hagen
  1999-10-06 10:58   ` Matthew Baker
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 1999-10-06 11:21 UTC (permalink / raw)
  Cc: Context List

Matthew Baker wrote:

> Is it possible to query and change menu settings from PDF Javascript
> (specifically, turn off full screen mode).  If so, how?  Hans said
> something about this to me before but I can't find anything about it in
> the PDF documentation.  Is there an Adobe Javascript document?

Yes, AcroJs.pdf. This one is: 

app.fullscreen = true ; 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Re: Menus from Javascript
  1999-10-06 12:46     ` Hans Hagen
@ 1999-10-06 12:20       ` Matthew Baker
  1999-10-06 16:11         ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew Baker @ 1999-10-06 12:20 UTC (permalink / raw)


On Wed, 6 Oct 1999, Hans Hagen wrote:

> \startJScode{fullscreen} 
>   app.fullscreen = true ; 
> \stopJScode
> 
> \setupinteraction[..,openaction=JS(fullscreen)]
> 
> (or, openaction=,{JS(fullscreen),lastpage,firstpage,CloseDocument}]

Hmm.  My JavaScript seems to work, but not as an openaction (it works, for
example, when I call it from a \button).  My code is

\setupoutput[pdftex]\pdfcompresslevel=0
\startJScode{fullscreen}
  app.fullscreen = true ;
\stopJScode
\setupinteraction[state=start,openaction=JS(fullscreen)]

\starttext
\section[sec1]{section 1}
Hello
\stoptext

I have the following in the PDF file

/Type /Catalog
/Pages 8 0 R
/Names 19 0 R
/OpenAction <</S /JavaScript /JS ( app.fullscreen= true ; )>>/PageMode /UseNone
>> endobj

Is the /PageMode /UseNone getting in the way?

closeaction is also not working for me (I am trying to do a
app.fullscreen=false so that subsequent documents don't open up full
screen).  Are the closeactions done before or after closing the
document?

- Matt

--
Dr. Matthew Baker           matthew.baker@gmd.de
GMD - FIT.MMK               http://fit.gmd.de/hci/pages/matthew.baker.html


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

* Re: Menus from Javascript
  1999-10-06 10:58   ` Matthew Baker
@ 1999-10-06 12:46     ` Hans Hagen
  1999-10-06 12:20       ` Matthew Baker
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 1999-10-06 12:46 UTC (permalink / raw)
  Cc: Context List

Matthew Baker wrote:

> > Yes, AcroJs.pdf. This one is:
> >
> > app.fullscreen = true ;
> 
> So, to use openaction or closeaction I would do something like
> 
> \setupinteraction[state=start,openaction={JS(app.fullscreen = true;)}]
> 
> ?
> 
> This doesn't seem to work.

No. 

\startJScode{fullscreen} 
  app.fullscreen = true ; 
\stopJScode

\setupinteraction[..,openaction=JS(fullscreen)]

(or, openaction=,{JS(fullscreen),lastpage,firstpage,CloseDocument}]

Alternatively: 

\startJSpreamble {whatever} used now 

function FullScreen 
  { app.fullscreen = true } 

\stopJSpreamble 

... openaction=JS(FullScreen)]

This saves bytes when one uses a function more than once. 

So, it comes down to separate the JS code from the reference; than way
one can more easy replace the implementaion by for instance by PERL code
in a dviviewer than has an interface to perl (Wasn't gilbert working on
that?) or a real Java plugin in the reader (Matthew's next challenge).

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Re: Menus from Javascript
  1999-10-06 12:20       ` Matthew Baker
@ 1999-10-06 16:11         ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 1999-10-06 16:11 UTC (permalink / raw)
  Cc: Context List

Matthew Baker wrote:

> Hmm.  My JavaScript seems to work, but not as an openaction (it works, for
> example, when I call it from a \button).  My code is

Looks like an acrobat bug to me. 

You can try this: 

\setupoutput[pdftex]

\setupinteraction[state=start,openaction=SwapViewer]

\starttext
  \section[sec1]{section 1} Hello
\stoptext

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

end of thread, other threads:[~1999-10-06 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-06  9:12 Menus from Javascript Matthew Baker
1999-10-06 11:21 ` Hans Hagen
1999-10-06 10:58   ` Matthew Baker
1999-10-06 12:46     ` Hans Hagen
1999-10-06 12:20       ` Matthew Baker
1999-10-06 16:11         ` Hans Hagen

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