updated javascript for example
authorLuc Moreau <l.moreau@ecs.soton.ac.uk>
Tue, 29 May 2012 15:19:05 +0100
changeset 3040 983cac305d43
parent 3039 5950d347db6c
child 3041 82c5ae1e58f1
updated javascript for example
model/extra-dm.css
model/prov-dm.html
--- a/model/extra-dm.css	Tue May 29 14:52:04 2012 +0100
+++ b/model/extra-dm.css	Tue May 29 15:19:05 2012 +0100
@@ -286,19 +286,26 @@
     padding:    3px 1em;
 }
 
-.anexample[count]::before {
-    content: "Example " attr(count) ;
+/* 
+generating this through java script now.
+
+.anexample[data-count]::before {
+    content: "Example " attr(data-count) ;
     font-family: sans-serif;
     font-size: 1.6ex;
     font-weight: bold;
 }
 
+
 .anexample:before {
     content: "Example:";
     font-family: sans-serif;
     font-size: 1.6ex;
     font-weight: bold;
 }
+
+*/
+
 .anexample {
     margin-top: 1ex;
     margin-bottom: 1ex;
@@ -313,6 +320,13 @@
     background-color: #f9f9f9;
 }
 
+.anexampleTitle {
+    font-family: sans-serif;
+    font-size: 1.6ex;
+    font-weight: bold;
+}
+
+
 .pnExpression {
     font-weight: normal;
     font-size:120%;
--- a/model/prov-dm.html	Tue May 29 14:52:04 2012 +0100
+++ b/model/prov-dm.html	Tue May 29 15:19:05 2012 +0100
@@ -77,7 +77,7 @@
           var myid=$(this).attr('id');
           var mycount=count++;
 
-          $(this).attr('count', mycount);
+          $(this).attr('data-count', mycount).prepend($('<div>').addClass('anexampleTitle').append("Example " + mycount));
 
           //console.log( "example for " + myid + " " + mycount);
 
@@ -92,7 +92,7 @@
 
           console.log( "example ref for " + myhref);
 
-          mycount=$(myhref).attr('count');
+          mycount=$(myhref).attr('data-count');
 
           console.log( "example ref for " + myhref + " " + mycount);