/******************************************************************************
**
** sheaf.js
**
**   A library that supports the representation and automated rendering of
**   lecture notes for mathematics and computer science courses.
**
**   Web:     sheaf.io
**   Version: 0.0.1.0
**
**   JavaScript functions used for rendering of sheaf course
**   material XML files as HTML webpages.
*/

/******************************************************************************
*/

$(document).ready(function() {
  // Render diagrams.
  protoql.Visualizations($('.pql')); 
  
  // Adjust source code styling (in addition to highlight.js styling).
  $('code').each(function(){
    $(this).css('background-color','#F7F7F7');
    $(this).html(($(this).html().trim()));
  });

  // Hide the solutions.
  $('.solution_toggle').click(function(e) {
    var sol = $(this).parent().next();
    $(this).text((sol.is(':visible')) ? 'show solution' : 'hide solution');
    sol.slideToggle();
  });

  // Update links to references with indices.
  var nameToBibIndex = {};
  $('.cite').each(function() {
    var name = $(this)[0].children[0].name, index = $(this)[0].innerText.slice(1,-1);
    nameToBibIndex[name] = index;
  });
  $('a').each(function() {
    var name = $(this)[0].attributes[0].nodeValue.slice(1);
    if (nameToBibIndex[name] != null && $(this)[0].childNodes[0].data == '#')
      $(this)[0].childNodes[0].data = nameToBibIndex[name];
  });
})

/*eof*/
@@ -1030,20 +1030,18 @@
 .%0A  var 
-name
+id
 ToBibInd
@@ -1080,36 +1080,34 @@
 ion() %7B%0A    var 
-name
+id
  = $(this)%5B0%5D.ch
@@ -1116,20 +1116,18 @@
 dren%5B0%5D.
-name
+id
 , index 
@@ -1166,20 +1166,18 @@
 1);%0A    
-name
+id
 ToBibInd
@@ -1179,20 +1179,18 @@
 ibIndex%5B
-name
+id
 %5D = inde
@@ -1233,20 +1233,18 @@
     var 
-name
+id
  = $(thi
@@ -1291,20 +1291,18 @@
     if (
-name
+id
 ToBibInd
@@ -1304,20 +1304,18 @@
 ibIndex%5B
-name
+id
 %5D != nul
@@ -1395,20 +1395,18 @@
 .data = 
-name
+id
 ToBibInd
@@ -1412,12 +1412,10 @@
 dex%5B
-name
+id
 %5D;%0A 

Fix bibliography code to be compatible with new no-"name" HTML convention.