2009/dap/ReSpec.js/js respec.js,1.135,1.136

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

Modified Files:
	respec.js 
Log Message:
add numbering for best practices


Index: respec.js
===================================================================
RCS file: /sources/public/2009/dap/ReSpec.js/js/respec.js,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- respec.js	2 Aug 2010 20:56:58 -0000	1.135
+++ respec.js	17 Sep 2010 22:31:43 -0000	1.136
@@ -108,6 +108,7 @@
     },
     
     isLocal:    false,
+
     loadAndRun:    function () {
         var scripts = document.querySelectorAll("script[src]");
         var rs, base;
@@ -202,7 +203,8 @@
 
             // if (this.doMicroData) this.makeMicroData();
             if (this.doRDFa) this.makeRDFa();
-            this.unHTML5();
+            if( this.practiceNum) this.doBestPractices(); // do not slow down those who do not need it , fjh
+           this.unHTML5();
             this.removeRespec();
 
             // shortcuts
@@ -1275,6 +1277,20 @@
             }
         }
     },
+
+    doBestPractices: function () {
+        this.practiceNum = 1;
+        var spans = document.querySelectorAll("span");
+        for (var i = 0; i < spans.length; i++) {
+            var span = spans[i];
+            if (sn.hasClass(span, "practicelab")) {
+                var label = span.innerHTML;
+                span.innerHTML = "Best Practice " + this.practiceNum + ": " +  label;
+                this.practiceNum++;
+            }
+        }
+    },
+
     
     // --- WEB IDL --------------------------------------------------------------------------------------------
     webIDL:    function () {

Received on Friday, 17 September 2010 22:31:47 UTC