BODY: anchor, graphics, tables, newtlets, client image maps

This document describes the following BODY tags:

A

indicates a hyperlink Anchor. Several attributes are possible; for now, we just document (and implement) NAME and HREF. You can combine NAME and HREF in the same A expression.

Attributes: REL, REV, TITLE (not implemented); NAME, HREF

NAME

names a destination ("head anchor") for a hyperlink. This has no visible effect. We typically add these to headings. For example, a later section's heading is defined as: <H3><A NAME="HR">HR</A></H3>

Notes: the first HR is the value (name) for this anchor (it can be different from the visible heading itself; case sensitive?). the second HR is the string which appears in this heading. You can apply A to text elements and to graphics (IMG). This now works with nested phrase markup.

Newt's Cape currently ignores empty strings, so to name a place in the document, you should include some non-spaces in the named range. Also, if you see strange results (especially with HREF), be sure to check that you aren't missing " or </A>. Note: Newt's Cape currently associates only a single name with an object, so if multiple names are specified, only the last will be used (and later found).

HREF

sets a destination for a hyperlink. When user taps the phrase (typically underlined), browser follows (or executes) the link. Usually, a destination consists of a document and possible named object within the document. For a relative file reference or absolute http: URL, Newt's Cape checks the "book cache" (i.e., saved book package in Extras) for a book that matches the filename (isbn) and full URL (book's BASE) -- if so, the book is opened. For NIE, Newt's Cape next checks the HTML source cache. Finally, Newt's Cape requests the URL via NIE or WebMail.

Notes: ' also recognized as URL delimiter. HREF="javascript:..." recognized but ignored.

For NOS 2.x (with NIE), Newt's Cape requests the URL from a server via TCP -- this file may be another HTML document, or a .gif or .pkg file (or another MIME type if the appropriate helper app is installed).

For 1.x (or no NIE or using a mailto: Proxy), Newt's Cape posts an email message to the Outbox addressed to a WebMail server. After you send this message using your email client, e.g., Aloha, you will receive an HTML source document in your Inbox that you can access directly from Newt's Cape. It is possible that large documents may be truncated or split. This is not real-time -- the delay depends on your email system and its internet gateway.

HR

adds a horizontal divider line.

Example: <HR>

Result:


ALIGN (not yet supported)

SIZE

specifies the height (in pixels) of the divider (default: 2)

WIDTH

specifies the width of the bar in pixels or as percentage (default: current container)

NOSHADE

a unary attribute. If present, divider is black; otherwise, it is dark gray (default).

IMG

adds an image or icon. Currently, Newt's Cape does not do any fancy layout, e.g., in-line graphics (use a table for horizontal layout). Should work within P, A, TD (table); other uses are less predictable. Large pictures automatically display a 2D scroll compass at lower left. If you would prefer to scale pictures to fit screen or table cells, use Scale to Fit option -- it does not scale 1.x PICT or any animated PICTs.

SRC

specifies the URI of the image resource. For NIE, this would the internet address of a .gif file. On the Newton, this could be a bitmap or PICT-format data object from ROM or a resource soup; if you use a single level of directory, this maps to the soupname, and the filename to a graphic object with that name or title slot in the soup, e.g., "bitmaps/nwscpicn.gif". See general description of graphic conversion/transfer and URL interpretation/shadowing. Graphics can be converted via NCGC and transferred via Sloup, or created locally with editors such as HexPaint. You can also include animated GIFs and other pictures (examples).

ALT

text to use in place of image if not available or skipped by user preference. Not required, but highly recommended.

ALIGN

Possible values: LEFT, RIGHT, CENTER (supported, except for image maps); TOP, MIDDLE, BOTTOM (unsupported).

ISMAP

indicates an image map. Normally used to indicate a server-side image map; Newt's Cape adds ?x,y to URL request (so that coordinates will work properly, ALIGN is ignored; and scaling may occur). For client-side image maps, use MAP and AREA.

Example: <IMG SRC="bitmaps/nwscpicn.gif" ALT="Newt's Cape Icon">

Result: Newt's Cape Icon

Example:<IMG SRC="Icons:BenG/someicon" ALT="Icon Editor icon">

Result: Icon Editor icon

You can use documented built-in, i.e., ROM icons. For further information, see advanced NewtonScript info.

Example:<IMG SRC="inboxIcon"ALT="Inbox">

Result: Inbox

You can include animated graphics (GIFs or built-in).

Example:<IMG SRC="arrows"ALT="rotating arrows">

Result: rotating arrows

USEMAP

reference to a MAP object

WIDTH

width of image in pixels (defaults to width of current container -- screen or table cell)

HEIGHT

height of image in pixels (defaults to height of image itself). If image does not fit on current book page, it appears at top of next page.

Other attributes: BORDER, HSPACE, VSPACE (unsupported).

MAP

MAP supports client-side image maps via a series of AREA tags: each associates a region with an HREF. Starting with version 1.4, you can define several IMG objects, before or after the corresponding MAP and AREA tags.

NAME

The name attribute provides a local reference for an earlier USEMAP in an IMG. For example,

<IMG...USEMAP="#foo1"><MAP NAME="foo1">

AREA

AREA occurs inside MAP and defines a rectangle, circle or polygon region of a graphic image. Attributes:

SHAPE
rect, circle, poly/polygon
COORDS
coordinates are relative to upper left (y increases toward bottom). There should be commas between all element; however, version 1.4 will attempt to compensate if a single space is used instead.
rect
left,top,right,bottom
circle
centerx,centery,diameter
poly
x1,y1,x2,y2,...x1,y1 (note: closed)
HREF
URL
NOHREF
unary attribute to create a "hole" with no client (or server) action. currently ignored (just don't specify HREF)
ALT
text to appear if no graphic present

Several examples (using ROM graphics/sound):

http://members.bellatlantic.net/~sweyer/newton/newtscape/exs/mapplay9.htm
play some sounds for 0-9
http://members.bellatlantic.net/~sweyer/newton/newtscape/exs/mapworld.htm
display name of continent

TABLE

Contains table entries. Examples in intro and later. If a table has a large fixed width greater than screen size, Newt's Cape attempts to scale each column (rather than just clip rightmost columns as in earlier versions). For best results in your own documents, use percentages or smaller (or no) widths.

CAPTION

Typically used for a table title. (like Hx, should this be included in the book's TOC?)

Attributes: ALIGN(top,bottom) -- not implemented; BORDER (=0 to omit borders; =1 for a border (larger values default to 1), though for multiple items or certain objects there may be gaps; best to turn off if you have INPUT objects).

Current limitations: nested tables do not format properly (they are flattened into one table), rows with mixed height graphics (or radio buttons?) may not split properly, borders may not line up.

TR

delimits a Table Row. </TR> optional? Newt's Cape uses the first row to define the number of columns and column width. Other rows with less than that number of columns will be padded. Newt's Cape generally uses equal column widths (unless cells specify a WIDTH attribute) and does not split rows across page boundaries.

TH

A Table Heading, typically occurs in cells in first row and/or first column. </TH> optional? Attributes:

COLSPAN
(default=1). Currently, cells with COLSPAN=0 are skipped.
ALIGN
(default=CENTER)
ROWSPAN
(default=1) is not supported, except in a limited way for only the first column -- entire cell contents are still displayed in first row, but Newt's Cape should add a dummy column to appropriate number of later rows; this still assumes that first row contains maximum number of columns for table.
WIDTH
percentage or fixed number of pixels. total width should not exceed 100% or width of screen. pages with large fixed widths may be clipped or strange if there is right alignment. default cell widths default to first row (those default to equal parts of remaining width)
NOWRAP
unary. recognized but not implemented

TD

Table Data can contain text, phrase markup, IMG, and some FORM objects (INPUT, SELECT). Attributes: COLSPAN (default=1), ALIGN (default=LEFT), ROWSPAN (see TH note), WIDTH (see TH note). Newt's Cape should support empty cells, multiple items in a cell and headings (though gaps may occur if there are borders). </TD> optional?

<TABLE BORDER><CAPTION>Example: A test table</CAPTION><TR><TH>Head1
<TH COLSPAN=2>Head2 and Head3</TH><TH>Head4</TH><TH>Head5</TR><TR><TD>first
<TD>long text, next cols missing
<TR><TD><I>some italic</I><TD><B>some bold</B><TD><A HREF="#TABLE">a link</A><TD><I>some</I> <B>mixed</B><TD>E=mc<SUP>2</SUP><TR><TD COLSPAN=2>a straddle
<TD>a picture (next)
<TD><IMG SRC="inboxIcon" ALT="Inbox"><TD>the end</TABLE>

Result:
Result: A test table
Head1Head2 and Head3Head4Head5
firstlong text, next cols missing
some italicsome bolda linksome mixedE=mc2
a straddle. example with many features: table with animated graphics using "NewtonScript URLs" to play a sound or stop/start animationsa picture (next) Inbox

APPLET

While Java support may not be available on the Newton until 1998(?), you can embed NewtonScript packages now directly in your page. We call these "newtlets". You could, of course, already run an application by tapping on its URL, i.e., appSymbol. 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. It automatically opens (with initialization PARAMeters) and closes, as you open/close the book or scroll the page. (Of course, such pages will not work properly on the desktop). http://members.bellatlantic.net/~sweyer/newton/newtscape/exs/newtlets.htm example shows use of built-in apps (e.g., stylePalette and alarm), and a user app (e.g., Lee Moon's Doggie). 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() [this is an app, not autopart, currently]
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]

For example:

<H1>Doggie page</H1><P>here is a newtlet -- Lee Moon's Doggie.

<APPLET CODEBASE="http://members.aol.com/PALMEDIA/" 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:

PARAM

PARAM tag occurs inside APPLET to provide initialization parameters for a newtlet. Note: these are copied to the application object before opening, but they can also be provided via the :openNewtlet API.

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)

FRAME

Newt's Cape does not yet support FRAME. However, it substitutes the SRC attribute as a text link, so that you can browse to pages in the frame set.

For More Info

This document (in all its formats) is © 1995-98. Steve Weyer, Greg Simon. All Rights Reserved Worldwide

Version 1.5. Last updated: Jan 1998


Steve Weyer - weyer@kagi.com
Greg Simon - gsimon@ricochet.net