2009/dap/ReSpec.js/js respec.js,1.160,1.161

Update of /sources/public/2009/dap/ReSpec.js/js
In directory hutz:/tmp/cvs-serv29143

Modified Files:
	respec.js 
Log Message:
made it possible to place introductory material in ToC

Index: respec.js
===================================================================
RCS file: /sources/public/2009/dap/ReSpec.js/js/respec.js,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -d -r1.160 -r1.161
--- respec.js	7 Sep 2011 18:39:10 -0000	1.160
+++ respec.js	7 Sep 2011 19:01:24 -0000	1.161
@@ -538,6 +538,7 @@
         if (cfg.inlineCSS === undefined) cfg.inlineCSS = true;
         if (!cfg.noIDLSorting) cfg.noIDLSorting = false;
         if (cfg.noIDLIn === undefined) cfg.noIDLIn = true;
+        if (cfg.tocIntroductory === undefined) cfg.tocIntroductory = false;
         if (!cfg.maxTocLevel) cfg.maxTocLevel = 0;
         if (!cfg.diffTool) cfg.diffTool = 'http://www5.aptest.com/standards/htmldiff/htmldiff.pl';
         if (!cfg.noRecTrack) cfg.noRecTrack = false;
@@ -1108,7 +1109,9 @@
     lastNonAppendix:    0,
     alphabet:   "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
     makeTOCAtLevel:    function (parent, current, level) {
-        var secs = sn.findNodes("./x:section[not(@class='introductory')]|./section[not(@class='introductory')]", parent);
+        var xpath = this.tocIntroductory ? "./x:section|./section" :
+                                           "./x:section[not(@class='introductory')]|./section[not(@class='introductory')]"
+        var secs = sn.findNodes(xpath, parent);
         if (secs.length == 0) return null;
         var ul = sn.element("ul", { "class": "toc" });
         for (var i = 0; i < secs.length; i++) {

Received on Wednesday, 7 September 2011 19:01:28 UTC