2009/dap/ReSpec.js/js respec.js,1.78,1.79

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

Modified Files:
	respec.js 
Log Message:
ReSpec now cleans whiter than white

Index: respec.js
===================================================================
RCS file: /sources/public/2009/dap/ReSpec.js/js/respec.js,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- respec.js	28 Jan 2010 15:29:20 -0000	1.78
+++ respec.js	28 Jan 2010 15:54:52 -0000	1.79
@@ -170,6 +170,7 @@
             this.informative();
             this.fixHeaders();
             this.makeTOC();
+            this.idHeaders();
 
             if (respecConfig.postProcess) {
                 for (var i = 0; i < respecConfig.postProcess.length; i++) respecConfig.postProcess[i].apply(this);
@@ -626,6 +627,17 @@
         return ul;
     },
 
+    idHeaders:    function () {
+        var heads = document.querySelectorAll("h2, h3, h4, h5, h6");
+        for (var i = 0; i < heads.length; i++) {
+            var h = heads[i];
+            if (h.hasAttribute("id")) continue;
+            var par = h.parentNode;
+            if (par.localName == "div" && par.hasAttribute("id") && !h.previousElementSibling) continue;
+            sn.makeID(h, null);
+        }
+    },
+    
     // --- INLINE PROCESSING ----------------------------------------------------------------------------------
     inlines:    function () {
         document.normalize();

Received on Thursday, 28 January 2010 15:54:58 UTC