Template:Team:Paris Saclay/simbox

From 2013.igem.org

(Difference between revisions)
Line 112: Line 112:
  reshtmlparamdiv += '<br />';
  reshtmlparamdiv += '<br />';
  //controls
  //controls
-
  reshtmlparamdiv += '<button onclick="simbox_startclick(this,'+id+')" id="simbox_start_'+id+'">PLAY</button><button onclick="simbox_resetclick(this,'+id+')" id="simbox_reset_'+id+'">RESET</button>'
+
  reshtmlparamdiv += '<button onclick="simbox_startclick(this,'+id+')" id="simbox_start_'+id+'">PLAY</button><button onclick="simbox_resetclick(this,'+id+')" id="simbox_reset_'+id+'">RESET</button>';
  paramdiv.innerHTML= reshtmlparamdiv;
  paramdiv.innerHTML= reshtmlparamdiv;
Line 125: Line 125:
  if(simulations[simid].running)
  if(simulations[simid].running)
  {
  {
-
   //TODO PAUSE
+
   //TODO STOP
   simulations[simid].running= false;
   simulations[simid].running= false;
   btn.innerHTML= 'PLAY';
   btn.innerHTML= 'PLAY';
Line 139: Line 139:
function simbow_resetclicked(btn, simid)
function simbow_resetclicked(btn, simid)
{
{
-
  if(simulations[simid].running)
+
  //TODO STOP
-
{
+
simulations[simid].running= false;
-
  //TODO PAUSE
+
document.getElementById('simbox_start_'+simid).innerHTML= 'PLAY';
-
  simulations[simid].running= false;
+
-
  document.getElementById('simbox_start_'+simid).innerHTML= 'PLAY';
+
-
}
+
  for(var i= 0 ; i < simulations[simid].molecules.length ; ++i)
  for(var i= 0 ; i < simulations[simid].molecules.length ; ++i)
   simulations[simid].molecules[i].quantity= simulations[simid].molecules[i].init_qtty;
   simulations[simid].molecules[i].quantity= simulations[simid].molecules[i].init_qtty;

Revision as of 21:38, 2 August 2013