6 #gene_group_export > * { vertical-align: middle }
8 <div id="gene_group_export">
9 <button onclick="export_gene_group(<% $feature->feature_id %>)">
10 Export sequences to alignment viewer
12 <img width="16" height="16" id="gene_group_export_spinner" src="/img/spinner.gif" style="display: none" />
13 <span class="message">(may take a long time for large gene groups)</span>
16 <script type="text/javascript">
17 <& /util/import_javascript.mas, classes => 'jquery' &>
19 jQuery(function($) { $('#gene_group_export button').attr('disabled',false) });
20 function export_gene_group(feature_id) {
21 var spinner = jQuery('#gene_group_export img');
22 var message = jQuery('#gene_group_export .message');
23 var button = jQuery('#gene_group_export button');
24 button.attr( 'disabled', true );
26 message.html( 'calculating and fetching sequences, please wait ... ');
27 jQuery.get( '/feature/'+feature_id+'/gene_group_protein_fasta', function(protein_fasta) {
28 myprotein = protein_fasta;
31 message.html('sending to alignment viewer...');
33 // make a hidden form to send sequences to the alignment viewer
34 var seqform = document.createElement('form');
35 seqform.method = 'POST';
36 seqform.action = '/tools/align_viewer/index.pl';
37 seqform.style.display = 'none';
39 // add our sequence data to it
40 var seq_input = document.createElement('input');
41 seq_input.type = 'hidden';
42 seq_input.value = protein_fasta;
43 seq_input.name = 'seq_data';
44 seqform.appendChild(seq_input);
46 // add a title for the alignment
47 var title = document.createElement('input');
48 title.type = 'hidden';
49 title.value = '<% $feature->type->name %> <% $feature->name %>';
51 seqform.appendChild( title );
53 // add the form to the document and submit it
54 document.body.appendChild(seqform);
56 button.attr( 'disabled', false );