Template:Team:Paris Saclay/simbox

From 2013.igem.org

(Difference between revisions)
Line 50: Line 50:
  //Load molecules
  //Load molecules
-
  var molecules= new Array();
+
  molecules[id]= new Array();
  var molecule_tags= xmldata.getElementsByTagName("molecule");
  var molecule_tags= xmldata.getElementsByTagName("molecule");
  for(var i= 0 ; i < molecule_tags.length ; ++i)
  for(var i= 0 ; i < molecule_tags.length ; ++i)
  {  
  {  
-
   molecules[i]= new molecule();
+
   molecules[id][i]= new molecule();
-
   molecules[i].name= molecule_tags[i].getAttribute('name');
+
   molecule[id]s[i].name= molecule_tags[i].getAttribute('name');
   if(molecule_tags[i].hasAttribute('quantity'))
   if(molecule_tags[i].hasAttribute('quantity'))
-
   molecules[i].quantity= molecule_tags[i].getAttribute('quantity');
+
   molecules[id][i].quantity= molecule_tags[i].getAttribute('quantity');
   if(molecule_tags[i].hasAttribute('curve_show'))
   if(molecule_tags[i].hasAttribute('curve_show'))
-
   molecules[i].curve_show= (molecule_tags[i].getAttribute('curve_show') == 'true');
+
   molecules[id][i].curve_show= (molecule_tags[i].getAttribute('curve_show') == 'true');
   if(molecule_tags[i].hasAttribute('curve_color'))
   if(molecule_tags[i].hasAttribute('curve_color'))
-
   molecules[i].curve_color= molecule_tags[i].getAttribute('curve_color');
+
   molecules[id][i].curve_color= molecule_tags[i].getAttribute('curve_color');
   if(molecule_tags[i].hasAttribute('const'))
   if(molecule_tags[i].hasAttribute('const'))
-
   molecules[i].const= (molecule_tags[i].getAttribute('const') == 'true');
+
   molecules[id][i].const= (molecule_tags[i].getAttribute('const') == 'true');
   if(molecule_tags[i].hasAttribute('adjustable'))
   if(molecule_tags[i].hasAttribute('adjustable'))
-
   molecules[i].adjustable= (molecule_tags[i].getAttribute('adjustable') == 'true');
+
   molecules[id][i].adjustable= (molecule_tags[i].getAttribute('adjustable') == 'true');
  }
  }
Line 81: Line 81:
  //legend
  //legend
  var reshtmlparamdiv= '';
  var reshtmlparamdiv= '';
-
  for(var i= 0 ; i < molecules.length ; ++i)
+
  for(var i= 0 ; i < molecules[id].length ; ++i)
  {
  {
-
   if(molecules[i].curve_show)
+
   if(molecules[id][i].curve_show)
-
   reshtmlparamdiv += '<span style="font-weight:bold;padding:0.1em 0.3em;color:#FFFFFF;background-color:'+molecules[i].curve_color+';">'+molecules[i].name+'</span>&nbsp;';
+
   reshtmlparamdiv += '<span style="font-weight:bold;padding:0.1em 0.3em;color:#FFFFFF;background-color:'+molecules[id][i].curve_color+';">'+molecules[id][i].name+'</span>&nbsp;';
  }
  }
  //quantity controls
  //quantity controls
-
  for(var i= 0 ; i < molecules.length ; ++i)
+
  for(var i= 0 ; i < molecules[id].length ; ++i)
  {
  {
-
   if(molecules[i].adjustable)
+
   if(molecules[id][i].adjustable)
   {
   {
   reshtmlparamdiv += '<br /><br />';
   reshtmlparamdiv += '<br /><br />';
-
   reshtmlparamdiv += molecules[i].name + ' = <input id="simbox_ctl'+i+'" type="number" min="0" value="'+molecules[i].quantity+'"/>';
+
   reshtmlparamdiv += molecules[id][i].name + ' = <input id="simbox_ctl'+i+'" type="number" min="0" value="'+molecules[id][i].quantity+'"/>';
   }
   }
  }
  }

Revision as of 21:13, 2 August 2013