--- 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>