======                                              DISview [748]
browse
======

_________________________________________________________________
browse <URL>
browse #<filename>
_________________________________________________________________

Fetches the page with http and displays it. However, the point of
browse, at least online, is to facilitate link following.

Browse is essentially a very simple HTML viewer (more accurately,
a crude viewer of simple HTML) so giving it a non-HTML URL is
pointless (and may be a disaster, although there is a check for 
a non-HTML suffix if a filename is provided). Once it's following
links itself it will sort out non-HTML URLs, but the initial one
must be an HTML document.
If you just want to fetch a non-HTML file, use Http.

A sixteen page circular history of pages is kept, navigated with
the Left/Right arrow keys. HTTP, FTP and Telnet off-site links
can be followed, as can on-site file links with URLs of the form:

file://local_filename.htm

Mailto: is supported (if support compiled in) with an external
mailer called mail. This can be anything which takes the URL 
address as a parm and builds the two mail files. Mail is the
default name, located in the cwd, but if the MAILER environmental
variable is defined it will be used instead:

SET MAILER=c:\demon\mailer\mail.exe

Use the conventional DOS backslash format. Any mailer can be used
which takes an address parm from the command line. See the Mail
command for details of YAN Mail (mail.exe).

Gopher:, wais: and news: links are specifically excluded, but
there may be others not suppported, selection of which could have
unpredictable, and probably unhappy, outcomes.

Telnet: A feature of a followed telnet link is that it will have
        its session logged into a file called telnet.log.
FTP: 1. FTP links are followed by means of a script and this has
        an important implication - if the session goes nowhere
        and you decide to reset it, the rest of the script runs.
     2. If the FTP link has a filename, FTP will start, run the
        script and end. If there is no filename, Xview will be
        run and you must exit this in the normal fashion.
        However, if the login doesn't happen (1), Xview is still
        run (on an empty dir) and must be ended for the script to
        finish. In both cases, when Xview ends you will be in the
        FTP session which will have to be ended manually.

The HTML terms it'll make a stab at handling are HTML, PRE, BR,
B, I, U, P, EM, CODE, STRONG, UL, OL, LI, TABLE, TR, DL, DD, HR,
<!--(comment)-->, H1 - H6, TITLE, A HREF, SCRIPT, FRAMESET,
FRAME SRC and NAME, FONT, BASE HREF, MAP, AREA HREF, ALT, IMG,
FORM and a subset of FORM terms. (SCRIPT is only indicated, not
processed.) META, apart from the single exception of redirection
URLs, is totally ignored.
However, what browse does with them may well not be what either
the HTML authors nor the webpage writer intended :)

Arbitrary colours are used for headers, text attributes and
several HTML features. The most important colour is GREEN, which
is used solely for links, which are also marked with a prefix:

          indicates HREF links
          indicates FRAME SRC links
	  indicates AREA HREF links
	  indicates META redirection links

s/S or up/down arrows will step forwards and backwards through
the visible links, highlighting as they go, and the actual URL
will be displayed in the bottom white bar, where an indication of
where you are in the web page is also present.

	 indicates an IMG link in DARK GREY

d/D work for images in the same way that s/S work for links.

Any web pages or files it causes to be fetched via http will be
saved in /CACHE which must be under the directory from which you
run NET.EXE.

>> Example:  browse www.demon.co.uk

Control:
	Key	Letter	Action
	down	s	highlight next visible link.
	up	S	highlight previous visible link.
		d	highlight next visible image.
		D	highlight previous visible image.
		f	highlight next visible form.
	PgUp	u	move up one screen.
	Home	h	go to the top of the file.
	Del	q, R	exit. 
	<-	J	step back one URL in history.
	->	L	step forwards one URL in history.
	PgDn,	P	move down one screen. At the end of the
	 Space		file it stops.
	Enter		follow highlighted link.
		k	keep webpage under it's real name or, if
			invalid, a new name. Overwrites if file
                        already exists.

Browse keeps a circular, and simplistic, history of only the last
4 screens viewed so PgUp/u is limited to that number.

VI version.

Some audible feedback when the link highlighting cycles from the
last to the first visible link and vice versa. The cursor is visible
and can be moved under control:
	Ctrl + up arrow		move cursor up one line
	Ctrl + down arrow	move cursor down one line

Within a form, input highlighting has the audible feedback and the
cursor works as before.
Paging down the file will stop at EOF and beep.
                                  
Forms.

A [FORM] display indicates the presence of a form and it can be
highlighted with 'f'. Selecting it, with Enter, will cause the
form to be redisplayed as an entry screen. Once you get this far,
the only keys which will get you out, without submitting the
form, are 'h'/home and 'q'/exit, which both have their normal
action. Needless to say, these keys only have this effect when
the form is displayed, not in the middle of text entry :)

Control:
	Key	Letter	Action
	down	i	highlight next visible form input.
	up	I	highlight previous visible form input.
	Home	h	exit form and go to the top of the file.
	Del	q, R	exit from Browse. 
	Enter		select form input. If a form input input
			is highlighted the type of input will
			control the action, including submission
			of the form.

All the inputs browse can handle are indicated with either a
prefix character or a tag word if none supplied or displayed.
Fields will initally be coloured blue on light gray, the
highlighted one being blue on cyan. An 'x' will indicate when a
checkbox or radio button is on.

Tags   Type          Action
----   ----          ------
Pswd - Password      plain text, not displayed
C    - Checkbox      any number can be on
R    - Radio button  only one can be on
Text - Text          plain text input
Send - Submit        sends off the form
Img  - Image         often used instead of Submit
???  - Not in the spec browse was written to :(

Select those you want to change.
One input (normally the last) should be "submit" which, when
selected, will cause the form data to be built into a data
packet and sent to the server. "Submit" can take any form the
webpage author dreams up, but will normally be fairly obvious
("Submit", "Go", "Enter", "Send" and "Do it" for example.) Send
will only be used if nothing was specified. However, it appears
that the submit button is often replaced by an image "button"
and, in the absence of a provided tag, this will show up as
'ImG'. Selecting it should have the same effect as submit.

Currently, only single line text entry, checkboxes and radio
"buttons" are implemented as such, with select/options being
emulated by radio buttons and checkboxes. Checkboxes and radio
buttons will be either 'C ' or 'R ' (unselected) or 'Cx' or 'Rx'
(selected), but text could be anything if an initial value has
been provided or 'Text' if not. Passwords are not displayed.
Selecting a radio button, checkbox or emulated option will stick
a 'x' against that entry and, in the case of radio buttons and
normal options, clear the rest. Selecting a text or password
entry will cause an invitation to enter text in the bottom bar,
just as with the search engine option, and the result displayed
(not passwords) up to the limit imposed by any size parameter or
the default limit, whichever is the smaller.

Limitations:

forms in browse are currently *very* limited:
      - single screen only. If it's too big to fit in 25 line mode,
        try running in 50 line mode.
        If it's still too big, (a) it too damned big
                           and (b) YAN can't handle do it :( 
      - 8 forms accessible from a single screen
      - 96 inputs per form
      - single screen for form data entry (big forms are out !)
      - 64 chr limit to single line text entry
      - max url/data packet size of 1024 chrs
      - the displayed field length is controlled by the size
           parm, but maxlength is also implemented and it acts
           post-entry. (If size = 10, maxlength = 20 and you
           enter a 30 chr line, only 10 chrs will be displayed
           and only 20 will go into the data packet.)
      - RESET isn't implemented at all - use 'h'/home and start
           again
      - no default selections for checkbox/radio button/options
           other than those provided by the web page author

Search Engines.

Browse has code to drive search engines with an html page
containing search engine URLs which will trigger a request for a
search term to be entered. That trigger is a URL with '%s' in it,
which will be replaced by whatever you enter (32 chrs max) prior
to the request being sent to the server.
(You can create your own search page and most (all which can take
a GET command) search engines can be driven from a command-line,
but CUSI's collection provides some suitable strings, although
obviously their search term string needs replacing with '%s'.)

Forms, to some extent, make this code redundant, but the built-in
facilty is a lot faster, albeit less versatile, for the engines
you use most.

Text encoding.

Both the search engine driver and FORMs will encode any special
characters in entered text lines before they are sent to the
server ($-_.!*+'(),;:@&=?/% plus space).
Apart from space, these are sent as Hex sequences, which implies
string expansion (space is replaced by +, but ' is sent as %27,
for example). While the FORMS code takes this in its stride, the
search engine driver code imposes its limitation on the *final*
string length so bear in mind that, excluding space, each special
character is taking up three "spaces".
 
_________________________________________________________________
browse <#filename>
_________________________________________________________________

Displays the html file filename.
This is intended for local menus and/or a "hotlist".

>> Example:  browse #cache/menu.htm
