This page is for the Webservant.
Every page on simplybible.com is kept in a database called FNI (File Name Index). This database is in the Startup script. The FNI is constructed as a two-dimentional array.
The first dimension of the array represents the series. The second dimension represents lessons. So if I refer to FNI[12][55] it yields which means this: The 55th lesson in the 12th series is .
And what does mean? It is the stem of the file name. This stem is the way the database identifies the file name for the lesson (or rather part 1 of the lesson).
The whole file name is made up of three parts: the file name initial, the stem, and the extension.
We already have the stem and we know the extension, so we already have.
All we need to complete the file name is the initial. That is provided in element zero of the second dimension:
FNI[12][0] which holds this string: .
You can see an -f- in that string which is the file name initial. We obtain it with FNI[12][0].slice(8,9).
which yields: . Each page "knows" its file initial and can access it from FilenameInitial.
So the complete file name is
The first dimension in the array is the series. The second is the lesson. The third is the part. Many lessons have only one part, but some will have two or more.
When this is so, we nest a third dimension in the second dimension of the FNI. For example if I refer to FNI[12][56] it yields which means this: The 55th lesson in the 12th series is a lesson of three parts which are .
What is meant by ? It is a data string containing three file name stems instead of just one. These identify three pages which are the 1st, 2nd, and 3rd parts of the lesson.
Note the pipe characters (vertical lines) in which separate or "delimit" the three stem codes. This enables this data string to be easily sliced into an array.
This makes for much simpler scripting of the third dimension since the array can be created "on the fly" (if required at all) when making the FNA (File Name Array) for the series. This is done later in the Startup script. We don't have to add a third dimension to the FNI to have a third dimension. That allows us to keep the FNI down to two dimensions.
There are
pages on simplybible.com —so a very definite, consistent, and integrated structure is needed to keep track of them all, and to provide clear navigation through them.The structure is three dimensional. Every page is attached to three structural elements: a series, a lesson, and a part. The diagram below shows this structure.
Note: What applies to a lesson also applies to a service. Service pages are organized together with (and in the same way as) lesson pages. When this tutorial refers to a "lesson" this should be understood to mean "lesson or service".
__>__>__>__>__>__>__>__>__>__> 1
__ __ __ __ __ 2
__ __ 3
__ 4
In the diaqgram, each dash represents a part of a lesson. A lesson may have one part only, or 2 parts, or 3, or (rarely) even more. Each lesson or service is connected in a series by its first part. The entire diagram represents the typical structure of one series. There are
series on the site. To summarize...So the structure of simplybible.com may be expressed as SITE[series][lesson][part] .
In this tutorial we use the words "page", "part", "lesson", and "series", in the above manner to avoid confusion.
When a page is open, it has a "fix" on numerous aspects of its place in the whole site structure. One piece of information the page "knows" is how many parts there are in the lesson it belongs to, and which of those parts it happens to be.
This is stored as an array in KEY[16]. Element zero holds the number of parts, and the elements from 1 onward hold the stems that identify the parts.
Conceptually, this array is the third dimension of the FNI but in practice it is a second dimension in the KEY array.
This is because, as explained above, we nest this data in the second dimension of FNI as a pipe delimited data string. Only when we make the FNA for the series do we turn the parts data into an array and store it as a global key —a far more practical method than using a truly three dimensional FNI.
The function MoreButtons() (parts handlers library) places a button and link at the end of the lesson, and in the sidebar, to alert the reader that there is more than one part, and directs the reader to the next part. The function is called with this syntax: <script>document.write(MoreIcon("","",""));</script> or in a script MoreIcon("","",""). The parameters "","",""are for stem,part, and alignment (in that order). They are left null unless you want to override the default. The default is for the next part, or if the page is the last part then the default is for the first part. The default alignment is center, but you can override that with any appropriate position style such as "floatright". You don't need to code the More button on to a page because it appears automatically in the page footer.
The function PartsButtons() (parts handlers library) will place a row of buttons or tabs under the page banner along the top of the page content. These are links to parts of the current lesson. These tabs appear automatically when the subtitle is set. They do not have to be coded on the html document.
The function GetParts("small") (parts handlers library) will display the part number, for example next to the lesson number under the sidelight heading. GetParts("mini") does the same in the page banner. In these cases the part number will appear only when there is more than one part.
The function PartsBoxes() (parts handlers library) places boxes in pick-a-box if there are two or more parts. The boxes appear next to the one labelled TOP.
The above documentation concerns the structure of the site. There is also a structure within each individual page to consider, namely the page layout. There are three main divisions on a page. These are the header or “banner”, the main content, and the sidebar or “margin”. Within the content division there are subdivisions in the form of divisions nested within the main content division. The principal nested division is the footer or “page end”. In addition, columns and boxes may float on the right hand side of the main content. These nested divisions are not considered part of the page structure, but merely as supplements to the main content.
The banner or header takes the full width of the window, then under it sits the main content.
The margin or sidebar floats left and extends to the bottom of the page. It is allotted 15% of the window width. It can be switched off and hidden. This division is produced by javascript from within the control scripts, mainly the Minor script.
The main content is allotted 80% of the width of the window when the sidebar is on. When the sidebar is off, main content takes the full window width. The main content division has two different style definitions one for when the sidebar is hidden, the other for when the sidebar is showing.
The page-end or footer (a division nested within the main content) is produced entirely from within the control scripts.
The setting up of these divisions is not done on the html document but in the Major control script. These divisions (and thus the page structure) change their style definitions for windows of different sizes and resolutions.