marking of definitions with diamond
authorLuc Moreau <l.moreau@ecs.soton.ac.uk>
Wed, 13 Jun 2012 22:38:53 +0100
changeset 3326 a958d03b1cb6
parent 3316 90c12ad0f90f
child 3327 a47f61a1c45c
marking of definitions with diamond
model/prov-dm.html
--- a/model/prov-dm.html	Wed Jun 13 21:49:45 2012 +0100
+++ b/model/prov-dm.html	Wed Jun 13 22:38:53 2012 +0100
@@ -130,12 +130,21 @@
 
           console.log( "section ref for " + myhref);
 
-
-          mysectionNumber=$(myhref).find('span.secno').text().trim();
-
-          console.log( "section ref for " + myhref + " " + mysectionNumber);
-
-          $(this).children('span').replaceWith(function(){return $('<span>').append("Section " + mysectionNumber)});
+          if (myhref.startsWith("#")) {
+
+
+            //Problem, this returns all span.secno elements, and concatenates their text
+                    // I shoul just get the first one
+            mysectionNumber=$(myhref).find('span.secno').text().trim();
+
+                    
+
+
+             console.log( "section ref for " + myhref + " " + mysectionNumber);
+
+             $(this).children('span').replaceWith(function(){return $('<span>').append("Section " + mysectionNumber)});
+
+           }
 
         });
       }
@@ -150,6 +159,12 @@
         updateExamples();
         updateExamplesRefs();
 
+                      if (typeof String.prototype.startsWith != 'function') {
+                      String.prototype.startsWith = function (str){
+                      return this.indexOf(str) == 0;
+                      };
+                      }
+
       });
 
     </script>