Packing tree file into html code

Why would you want to pack tree file into html code? It can slightly speed up applet loading time, because it spares establishing connection to load tree.txt. This is especially noticable at low quality connections.

I made moving tree structure into html as easy as possible. Actually you may use tree.txt at the stage of designing your web site, and then just copy&paste this file into html with few modifications. Here is an example how to do this.

For example you have <param name="tree" value="tree.txt"> in your html code. And your tree.txt look like this:

About|about.htm
.What's new|about.htm
.Features|features.htm
.Old version 1.0|old/index.htm|_top
Documentation|docs/index.htm
.Overall concept|docs/index.htm
.Browsing|docs/browsing.htm
.Applet parameters|docs/parameters.htm
.Tree file structure|docs/treefile.htm
.Custom items|docs/custom.htm

Download|download.htm

Then you replace tree parameter with items parameter in your html file as follows:

<param name="items" value=
"About|about.htm%%
.What's new|about.htm%%
.Features|features.htm%%
.Old version 1.0|old/index.htm|_top%%
Documentation|docs/index.htm%%
.Overall concept|docs/index.htm%%
.Browsing|docs/browsing.htm%%
.Applet parameters|docs/parameters.htm%%
.Tree file structure|docs/treefile.htm%%
.Custom items|docs/custom.htm%%
%%
Download|download.htm">

As you see this is mostly copy&paste work. Aftre pasting, just add "%%" at the end of each line, except the last. At end of the last line you insert the end of the param tag. Here full code of applet tag from really working example, whith packed tree.txt:

<applet width="200" height="300" code="SiteBrowser.class"
 archive="SiteBrowser.jar" align="left">
  <param name="font3" value="Helvetica 2 12">
  <param name="font2" value="TimesRoman 0 14">
  <param name="font1" value="TimesRoman 1 18">
  <param name="bgimage" value="bg.jpg">
  <param name="bgcolor" value="98ab75">
  <param name="text" value="ffff007f0000">
  <param name="shape2" value="p00ff00ff0000">
  <param name="shape1" value="vffafffff0000">
  <param name="icon1" value="oafaf00ffff00">
  <param name="menulayout" value="no">
  <param name="mouseover" value="no">
  <param name="autocollapse" value="yes">
  <param name="ralign" value="full">
  <param name="hspace" value="10">
  <param name="vspace1" value="2">
  <param name="vspace2" value="0">
  <param name="target" value="main_frame">
  <param name="highlight" value="6400480096ffff7f">
  <param name="smoothup" value="20">
  <param name="smoothdown" value="10">
  <param name="author" value="Mark S. Novozhilov (http://www.lordmark.de/SB)">
  <param name="items" value=
"+About|about.htm%%
.What's new|about.htm%%
.Features|features.htm%%
.Old version 1.0|old/index.htm|_top%%
Documentation|docs/index.htm%%
.Overall concept|docs/index.htm%%
.Browsing|docs/browsing.htm%%
.Applet parameters|docs/parameters.htm%%
.Tree file structure|docs/treefile.htm%%
.Custom items|docs/custom.htm%%
.Packing tree file into html|docs/treepacking%%
Examples|examples/index.htm%%
.Tree examples%%
..Simple tree|examples/tree/simple/index.htm%%
..Color blending|examples/tree/blending/index.htm%%
..Custom icons|examples/tree/icons/index.htm%%
..Scrolls|examples/tree/scrolls/index.htm%%
..Cool cats|examples/tree/cats/index.htm%%
.Menu examples%%
..Compact|examples/menu/compact/index.htm%%
..Scrolls|examples/menu/scrolls/index.htm%%
Download|download.htm%%
.Latest version%%
..Applet only|SiteBrowser.zip%%
..Applet + docs + examples |SB_all.zip%%
.Download documentation|docs.zip%%
Registering|whyreg.htm%%
.Why register?|whyreg.htm%%
.How to register|register.htm%%
.License terms|license.htm%%
Support|support.htm%%
.FAQ|faq.htm%%
.Contact me|contact.htm">
</applet>

Last modified 6 June 2000  (c) by Mark Novozhilov <lordmark@lordmark.de>