I tried TOC, which worked fine, but wasn't what my client wanted.
I branched my own implimentation which runs a modified version of the TOC.js to insert into a BLOCK instead of whacking it into the node body.

While I was there, I repaired the existing IE problem, by anchoring against IDs, not empty A tags.

This feedback is just an FYI. A a tiny module that supplies a block that only shows up if the document has some H2s in it.

The fix for IE , with reference to PPKs Quirksmode version:

        for (var i = 0; h2 = h2s[i]; ++i) {
          if (h2) {
            var headerId = h2.id || 'toc-' + i;
            h2.id = headerId;
            var li = document.createElement('li');
            var link = document.createElement('a');
            link.setAttribute('href', '#' + headerId);
            var span = document.createElement('span');
            span.appendChild(document.createTextNode(h2.firstChild.nodeValue));
            link.appendChild(span);
            li.appendChild(link);
            ol.appendChild(li);
          }
        }
CommentFileSizeAuthor
toc_block.tar.gz1.74 KBdman

Comments

nedjo’s picture

Status: Needs review » Closed (won't fix)

jstools is no longer maintained.