added support for APPLET and PARAM tags. Although Java support may be in
the (distant) future, you can embed NewtonScript packages directly in your
page now. We call these "newtlets". You could, of course, already run an
application by tapping on its URL (i.e., appSymbol) in Newt's Cape. But a
newtlet appears in a reserved space on the page (you can also download the
newtlet directly from the net if you don't have it installed), automatically
opens (with initialization parameters) and close, as you open/close the book
or scroll the page. (This works currently for the built-in stylePalette and
alarm apps, and for Lee Moon's Doggie application. Not sure what happens in
a desktop browser if it sees a .pkg file in an APPLET). For example:
<H1>Doggie page</H1>
<P>
here is a newtlet -- Lee Moon's Doggie.
<APPLET CODEBASE="http://communicrossings.com/html/newton/newtscape/exs/" CODE="Doggie.pkg"
WIDTH=55 HEIGHT=53 HSPACE=1 VSPACE=1 NAME="Doggie:LeeMoon"
ALT="tap on this to run or download Doggie">
<PARAM NAME="delay" VALUE="100"> <!-- speedup animation -->
</APPLET>
Further info/assumptions about Newtlets:
- newtlet should be relatively "small" (<100K?) in size (so package downloading works well)
- newtlet should be relatively small on the screen (so other stuff can fit on page also)
- newtlet should not change its viewBounds upon opening
-- Newt's Cape changes the viewBounds (after taking into account borders and
top/center/bottom justification) to match the location on the book page
- newtlet checks some slots for initialization information (optional,
but nice if you'd like to allow parameterization from the HTML page via PARAM)
- when user taps on newtlet area, newtlet opens or starts to download
- Newtlet should check for clicks only in its area,
and not define viewOverview and Scroll scripts (so that TOC and page turning still works)
APPLET attributes:
- CODEBASE
- (required) base URL (directory path) for the newtlet. ends in /
- CODE
- (required) file URL (file name) for the newtlet. full path is CODEBASE plus this
- WIDTH
- (required) width of newtlet in pixels
- HEIGHT
- (required) height of newtlet in pixels
- NAME
- (required) name of the applet. for the Newton,
this is the "appSymbol" in GetRoot() [current assumption is that this is an app not autopart]
- ALT
- (recommended) string to tell user what's there, esp. on non-Newtons
- ALIGN
- (optional) [not implemented] TOP,MIDDLE,BOTTOM,LEFT,RIGHT
- HSPACE
- (optional) [default: 0] reserved space around the newtlet. this should be the border width (viewFormat.vfPen)
- VSPACE
- (optional) [default: 0] reserved space around the newtlet.
this should be the border height (viewFormat.vfPen) [I need to add this to book spacing]
PARAM attributes (kinda like META):
- NAME
- name of a slot to set in the newtlet
- VALUE
- value of slot. (this string is an expression, which is compiled and evaluated)
If you don't like the idea of another application messing around with your
viewBounds and other slots, your newtlet can provide a openNewtlet method.
If present, it takes two parameters
- viewBounds
- the viewBounds frame (in normal coordinates) from the book page
- params
- a frame with PARAM slots and values