Team:Groningen/create desc
From 2010.igem.org
(Difference between revisions)
m |
|||
(39 intermediate revisions not shown) | |||
Line 3: | Line 3: | ||
<script language="JavaScript"> | <script language="JavaScript"> | ||
var cur=""; | var cur=""; | ||
+ | var fouten =""; | ||
+ | |||
+ | function getOpsomming(el) { | ||
+ | var str=""; | ||
+ | if (el.length == 1) { return el.value; } | ||
+ | else { | ||
+ | for (var loop = 0; loop<el.length; loop++) { | ||
+ | if (el[loop].checked == true) { | ||
+ | if (str != "") { str += ", "; } | ||
+ | str += el[loop].value; | ||
+ | } | ||
+ | } | ||
+ | return str; | ||
+ | } | ||
+ | } | ||
function characteristics() { | function characteristics() { | ||
var txt = ""; | var txt = ""; | ||
txt = "<b>Characteristics of BioBrick device/part</b><br>"; | txt = "<b>Characteristics of BioBrick device/part</b><br>"; | ||
- | txt+= "Type of BioBrick: "+document.inv.typ | + | |
- | if (document.inv.inputs.value != "") { | + | txt+= "Type of BioBrick: "+getOpsomming(document.inv.typ)+"<br>"; |
+ | if (document.inv.inputs.value != "N/A") { | ||
txt += "Inputs: "+document.inv.inputs.value+"<br>"; | txt += "Inputs: "+document.inv.inputs.value+"<br>"; | ||
} | } | ||
- | if (document.inv.outputs.value !="") { | + | if (document.inv.outputs.value !="N/A") { |
txt += "Outputs: "+document.inv.outputs.value+"<br>"; | txt += "Outputs: "+document.inv.outputs.value+"<br>"; | ||
} | } | ||
- | return txt; | + | txt += "Ribosome transit rate: "+document.inv.ribinv.value+"<br>Polymerase transit rate:"+document.inv.polyinv.value+"<br>"; |
+ | |||
+ | if (document.inv.components.value != "") { | ||
+ | txt += "Composed with "+document.inv.components.value+"<br>"; | ||
+ | } | ||
+ | return txt+"<br>"; | ||
} | } | ||
function physprop() { | function physprop() { | ||
var txt ="<b>Physical properties</b><br>"; | var txt ="<b>Physical properties</b><br>"; | ||
- | txt +="Sequence<br>"+document.inv.seq.value+"<br>Length: "+document.inv.blength.value+" bps<BR | + | var eh = getOpsomming(document.inv.host); |
+ | if (document.inv.host2.value != "") { | ||
+ | if (eh != "") { | ||
+ | eh += ", "+document.inv.host2.value; | ||
+ | } else { | ||
+ | eh = document.inv.host2.value; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | txt +="Sequence<br>"+document.inv.seq.value+"<br>Length: "+document.inv.blength.value+" bps<BR>Host: "+eh+"<br><br>"; | ||
return txt; | return txt; | ||
} | } | ||
+ | |||
function updateBPS() | function updateBPS() | ||
{ | { | ||
Line 26: | Line 57: | ||
} | } | ||
function post() { | function post() { | ||
- | |||
- | |||
var txt = ""; | var txt = ""; | ||
+ | fouten = ""; | ||
var ok = false; | var ok = false; | ||
- | if (document.inv.desc.value != "") { ok = true; } | + | if (document.inv.desc.value != "") { ok = true; } else { fouten += "Description is not provided"; } |
- | + | ||
- | txt = txt + "<textarea>"+txt+"</textarea>"; | + | txt = characteristics()+"<b>Description</b><br>\n"+document.inv.desc.value+"<br><br>"+physprop()+"<b>Recommended working conditions/usage</b><br>"+document.inv.oper.value+"<br><br><b>Status</b><br>"+document.inv.status.value+"<br><br><b>Safety notes</b><br>"+document.inv.safety.value+"<br><br><b>Contact information</b><br>"+document.inv.contact.value+"<br><br>"; |
- | txt+='<form onSubmit="restore(); | + | |
+ | txt = txt + "Resulting HTML: <textarea>"+txt+"</textarea><br>"; | ||
+ | txt+='<form onSubmit="restore(); return false;" ><input type="submit"></form>'; | ||
if (ok) { | if (ok) { | ||
+ | |||
+ | |||
+ | $("#formpje").hide(); | ||
+ | document.getElementById("fouten").innerHTML = fouten; | ||
document.getElementById("ans").innerHTML = txt; | document.getElementById("ans").innerHTML = txt; | ||
+ | } else { | ||
+ | document.getElementById("fouten").innerHTML = fouten; | ||
} | } | ||
- | $("#ans").show(); | + | $("#ans").show(); |
+ | $('#my-link').click(); | ||
return false; | return false; | ||
Line 44: | Line 82: | ||
function restore() { | function restore() { | ||
- | + | $("#ans").hide(); | |
- | $("#formpje"). | + | $("#formpje").show(); |
+ | $('#my-link').click(); | ||
+ | |||
return false; | return false; | ||
} | } | ||
</script> | </script> | ||
+ | <a id="my-link" href="#"></a> | ||
+ | <div id="fouten"></div> | ||
<div id="formpje"> | <div id="formpje"> | ||
- | <form name='inv' onSubmit="post(); | + | <form name='inv' onSubmit="post(); return false;" > |
<table> | <table> | ||
<tr><td colspan=2><b>Characteristics</b></td></tr> | <tr><td colspan=2><b>Characteristics</b></td></tr> | ||
Line 69: | Line 111: | ||
<tr><td valign="top"><b>Physical properties</b></td></tr> | <tr><td valign="top"><b>Physical properties</b></td></tr> | ||
<tr><td>Host</td><td><input type="checkBox" name="host" value="E. coli">Escherichia coli<br><input type="checkBox" name="host" value="Bacillus subtilis">Bacillus subtilis<br><input type="checkBox" name="host" value="Yeast">Yeast<br><input type="checkBox" name="host" value="Bacteriophage T7">Bacteriophage T7<br> | <tr><td>Host</td><td><input type="checkBox" name="host" value="E. coli">Escherichia coli<br><input type="checkBox" name="host" value="Bacillus subtilis">Bacillus subtilis<br><input type="checkBox" name="host" value="Yeast">Yeast<br><input type="checkBox" name="host" value="Bacteriophage T7">Bacteriophage T7<br> | ||
- | Other: <input type="text name="host2"></td></tr> | + | Other: <input type="text" name="host2"></td></tr> |
<tr><td><b>Recommended working conditions</b> specify here how there is worked with the BioBrick. Recommended working operations are mainly used for how the biobrick is used in the current project</td><td><textarea name="oper"></textarea></td></tr> | <tr><td><b>Recommended working conditions</b> specify here how there is worked with the BioBrick. Recommended working operations are mainly used for how the biobrick is used in the current project</td><td><textarea name="oper"></textarea></td></tr> | ||
<tr><td>Status of BioBrick part/device</td><td><textarea name="status" rows=7 cols=40></textarea></td></tr> | <tr><td>Status of BioBrick part/device</td><td><textarea name="status" rows=7 cols=40></textarea></td></tr> | ||
<tr><td>Safety notes</td><td><textarea name="safety">No additional safety meassures required</textarea></td></tr> | <tr><td>Safety notes</td><td><textarea name="safety">No additional safety meassures required</textarea></td></tr> | ||
- | + | <tr><td>Contact</td><td><textarea name="contact"></textarea></td></tr> | |
- | <tr><td> | + | |
<tr><td colspan=2><center><input type=submit></center></td></tr> | <tr><td colspan=2><center><input type=submit></center></td></tr> | ||
</table> | </table> | ||
Line 81: | Line 122: | ||
</form> | </form> | ||
+ | <br><br> | ||
</div> | </div> | ||
<div id="ans"> | <div id="ans"> |
Latest revision as of 00:06, 27 October 2010