Web hosting servers - 1349Chapter 52 .Application: Outline-Style Table of Contents One
1349Chapter 52 .Application: Outline-Style Table of Contents One of the fine points of the design of this outline is the way space to the left of each entry is assembled. Unlike the earlier outlines in this chapter, this one displays vertical dotted lines connecting nodes at the same level. There isn t a vertical line for every clickable node appearing above the item, because a clickable node may have no additional siblings, meaning that the space is blank. To see what I mean, open the OPML example, and expand the Peas and Canned nodes (or see Figure 52-2). The Canned node is the end of the second column, so the space beneath the icon is blank. That s what some of the code in makeHTML()named prefix is dealing with: Accumulating just the right combination of dotted line (chain.gif) and blank (empty.gif) images in sequence before the outline entry. Another frequent construction throughout this function is a three-level conditional expression. This construction is used to determine whether the image just to the left of the item s text should be a start, middle, or end version of the image. The differences among them are subtle (having to do with how the vertical dotted line extends above or below the widgets). All of these decisions are made from information revealed by the inherent structure of the OPML element nesting. The listing in the book looks longer than it truly is because so many long or deeply nested lines must be wrapped to the next line. Viewing the actual file in your text editor should calm your fears a bit. // counters for reflexive calls to makeHTML() var currID = 0 var blockID = 0 // generate HTML for outline function makeHTML(outlineID, ol, prefix) { var output = var nestCount, link, nestPrefix prefix = (prefix) ? prefix : for (var i = 0; i < ol.childNodes.length ; i++) { nestCount = ol.childNodes[i].childNodes.length output +=
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.