prov-n changing example style
authorLuc Moreau <l.moreau@ecs.soton.ac.uk>
Wed, 13 Jun 2012 12:09:41 +0100
changeset 3296 0a211832ee56
parent 3295 3d05fdcd59dc
child 3297 195dd790378f
prov-n changing example style
model/extra.css
model/prov-n.html
--- a/model/extra.css	Wed Jun 13 11:43:52 2012 +0100
+++ b/model/extra.css	Wed Jun 13 12:09:41 2012 +0100
@@ -263,6 +263,7 @@
     padding:    3px 1em;
 }
 
+/*
 .anexample[count]::before {
     content: "Example " attr(count) ;
     font-family: sans-serif;
@@ -276,6 +277,9 @@
     font-size: 1.6ex;
     font-weight: bold;
 }
+
+*/
+
 .anexample {
     margin-top: 1ex;
     margin-bottom: 1ex;
--- a/model/prov-n.html	Wed Jun 13 11:43:52 2012 +0100
+++ b/model/prov-n.html	Wed Jun 13 12:09:41 2012 +0100
@@ -93,29 +93,40 @@
           var myid=$(this).attr('id');
           var mycount=count++;
 
-          $(this).attr('count', mycount);
+          if (myid==undefined) {
+            myid='example_' + mycount;
+            $(this).attr('id',myid);
+          }
+
+          
+          $(this).attr('data-count', mycount).prepend($('<div>').addClass('anexampleTitle')
+                                                          .append($('<a>').addClass('internalDFN').attr('href','#'+myid).append("Example " + mycount)));
 
           //console.log( "example for " + myid + " " + mycount);
 
         });
       }
 
+
       function updateExamplesRefs() {
         $('.anexample-ref').each(function(index) {
 
           myhref=$(this).attr('href');
 
-          console.log( "example ref for " + myhref);
-
-          mycount=$(myhref).attr('count');
-
-          console.log( "example ref for " + myhref + " " + mycount);
+              //console.log( "example ref for " + myhref);
+
+          mycount=$(myhref).attr('data-count');
+
+              //console.log( "example ref for " + myhref + " " + mycount);
 
           $(this).children('span').replaceWith(function(){return $('<span>').append("Example " + mycount)});
 
         });
       }
 
+
+
+
       $(document).ready(function(){
         // if grammar is in a string:
         $('#grammar_div').html(grammar_string);