5 AJAX object for building an AGI list and getting a Fasta file back, in XML format within <fasta> tags
10 Chris Carpita <csc32@cornell.edu>
16 JSAN
.use("CXGN.Request");
18 //Hotlist is defined as a single object instead of a class. We can't have more than one!
19 var Fasta
= window
.Fasta
|| {};
20 Fasta
= { //buttonId: id of the clicked button, for changing the button
23 addAgi: function (agi
) {
26 removeAgi: function (agi
) {
29 _build_string: function () {
32 for (var agi
in Fasta
._agis
){
33 if(Fasta
._agis
[agi
] == 1){
34 if(i
>0) new_string
+= "::";
39 Fasta
._agi_list
= new_string
;
41 request: function (type
){
42 var req
= new Request();
44 Fasta
._build_string();
45 var param
= "agi_list=" + Fasta
._agi_list
+ "&type=" + type
;
46 req
.send("/scraps/fasta.pl", param
, "POST");
49 _response: function(doc
) {
51 var fasta
= doc
.getElementsByTagName("fasta")[0].firstChild
.nodeValue
;
52 var type
= doc
.getElementsByTagName("type")[0].firstChild
.nodeValue
;
53 document
.getElementById("hotlist_fasta_textarea").value
= fasta
;
54 document
.getElementById("hotlist_fasta_content").style
.display
= "block";