Team:Warsaw/JSTest2

From 2008.igem.org

(Difference between revisions)
 
(16 intermediate revisions not shown)
Line 1: Line 1:
{{WarHead}}
{{WarHead}}
<html>
<html>
 +
<style>
 +
.hidden { display:none; }
 +
.visible {display:block; }
 +
 +
</style>
<h3>Browse by topics</h3>
<h3>Browse by topics</h3>
Line 46: Line 51:
</form>
</form>
-
<a id="anch">Jump</a>
+
<a id="anch" style="display:none;">Jump</a>
<div id="progress"></div>
<div id="progress"></div>
-
<div id="result"></div>
+
<div id="result">&nbsp;</div>
 +
<br>
 +
<div align="right"><a href="javascript:toggle_dump()">Toggle source</a></div>
 +
<textarea id="dump" readonly="true" class="hidden" style="width:100%;height:400px">core dump</textarea>
 +
 
<script type="text/javascript">
<script type="text/javascript">
Line 142: Line 151:
                 document.getElementById("progress").innerHTML="Done";
                 document.getElementById("progress").innerHTML="Done";
                 create_links(topics);
                 create_links(topics);
 +
                document.getElementById("dump").value=document.getElementById("result").innerHTML;
                 return true;
                 return true;
                 }
                 }
Line 194: Line 204:
function get_topics(ans)
function get_topics(ans)
{
{
 +
ans=ans.replace(/<h3><\/h3>/gi,"");
var ans_topics=new Array();
var ans_topics=new Array();
h3=new RegExp(/<h3.*>(.*)<\/h3>/ig);
h3=new RegExp(/<h3.*>(.*)<\/h3>/ig);
Line 202: Line 213:
  {
  {
  var notags=titles[i].split(/(<h3>)|(<\/h3>)/i);
  var notags=titles[i].split(/(<h3>)|(<\/h3>)/i);
-
 
+
if (notags[3]==undefined) var currtitle=removeHTMLTags(notags[0]);
-
  var currtitle=removeHTMLTags(notags[3]);
+
  else var currtitle=removeHTMLTags(notags[3]);
-
  currtitle=trimStr(currtitle.replace('+',' '));
+
  currtitle=trimStr(currtitle.replace(/\+/g,' '));
  if(currtitle!="") ans_topics.push(currtitle);
  if(currtitle!="") ans_topics.push(currtitle);
  }
  }
Line 215: Line 226:
for (i in topics)
for (i in topics)
{
{
-
var days=topics[i].split(';');
+
 
-
var ans="";
+
var d=topics[i]; // another dirty IE hack
-
var num=0;
+
//alert (typeof(d));
-
for (var j=0;j<days.length;j++)  
+
if (typeof(d)=="string")
-
{
+
  {
-
if(days[j]!="") ans+="arg"+j+"="+days[j]+String.fromCharCode(38);
+
  //if (d.match(/from\ 2008.igem.org/i)==null) continue;
-
else num=j;
+
  var days=d.split(';');  
-
}
+
  var ans="";
-
ans=codebase+"num="+num+String.fromCharCode(38)+ans+"name="+escape(removeHTMLTags(i));
+
  var num=0;
-
document.getElementById("result").innerHTML+='<a href="'+ans+'">'+i+"</a><br>";
+
  for (var j=0;j<days.length;j++)  
-
}
+
  {
 +
  if(days[j]!="") ans+="arg"+j+"="+days[j]+String.fromCharCode(38);
 +
  else num=j;
 +
  }
 +
  ans=codebase+"num="+num+String.fromCharCode(38)+ans+"name="+escape(removeHTMLTags(i));
 +
  document.getElementById("result").innerHTML+='<a href="'+ans+'">'+i+"</a><br>\n";
 +
  }
 +
}
}
}
Line 234: Line 252:
}
}
-
 
+
var dump_visible=false;
-
 
+
function toggle_dump()
-
var title='Preparation of <a href="https://2008.igem.org/Wiki/Team:Warsaw/vectors/pMPM-T5-AID">pMPMT5+AID</a> construct';
+
{
-
 
+
if (dump_visible)  
-
var days=['6_May_2008','7_May_2008'];
+
{
-
 
+
document.getElementById("dump").className="hidden";
-
var params="num="+days.length+String.fromCharCode(38);
+
dump_visible=false;
-
 
+
}
-
for (var i=0;i<days.length;i++) params+="arg"+i+"="+days[i]+String.fromCharCode(38);
+
else
-
 
+
{
-
params+="name="+escape(removeHTMLTags(title));
+
document.getElementById("dump").className="visible";
-
 
+
dump_visible=true;
-
document.getElementById("anch").href=codebase+params;
+
}
-
 
+
}

Latest revision as of 15:57, 27 October 2008

Gallery Bricks Notebook Team Project Home

Browse by topics

Start dateEnd date