Commit a44b0df9 authored by Marc Duez's avatar Marc Duez

model.js : export fasta (import/export menu >> export fasta)

parent 465b2759
......@@ -144,6 +144,7 @@
<a class="buttonSelector" onclick="javascript:pdf.make()">export pdf (graph + selected clones)</a>
<a class="buttonSelector" onclick="javascript:pdf.makeGraph()">export pdf (graph)</a>
<a class="buttonSelector" onclick="javascript:m.exportCSV()">export csv (visible clones)</a>
<a class="buttonSelector" onclick="javascript:m.exportFasta()">export fasta(selected clones)</a>
</div>
<div class="menu_box">
<div id="upload_list">
......
......@@ -1680,6 +1680,26 @@ Model.prototype = {
saveAs(textFileAsBlob, filename + ".csv");
},
exportFasta: function () {
var list = m.getSelected()
if (list.length>0){
var w = window.open("", "_blank", "selected=0, toolbar=yes, scrollbars=yes, resizable=yes");
var fasta = '<pre>'
for (var i=0; i<list.length; i++){
fasta += '>' + this.clone(list[i]).getCode() + '\n'
fasta += this.clone(list[i]).getSequence() + '\n'
}
var result = $('<div/>', {
html: fasta
}).appendTo(w.document.body);
}else{
myConsole("exportFasta: select clones to export before",1)
}
},
systemBox: function (system){
var span = document.createElement('span')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment