Commit 79d6926d authored by Marc Duez's avatar Marc Duez
Browse files

interface : copy selected sequence to clipboard (fasta output)

parent 73a63f96
......@@ -41,6 +41,7 @@
<script type="text/javascript" src='js/lib/rgbcolor.js'></script>
<script type="text/javascript" src='js/lib/file.js'></script>
<script type="text/javascript" src="js/lib/less-1.5.0.min.js"></script>
<script type="text/javascript" src='js/lib/jquery.zclip.js'></script>
<script type="text/javascript" src='js/germline.js'></script>
......@@ -53,6 +54,7 @@
<script type="text/javascript" src='js/crossDomain.js'></script>
<script type="text/javascript" src='js/pdf.js'></script>
<!--
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
......@@ -495,6 +497,7 @@
<span class="button" onclick="segment.align()">align</span>
<span class="button" onclick="segment.sendTo('IMGT')">❯ to IMGT/V-QUEST</span>
<span class="button" onclick="segment.sendTo('igBlast')">❯ to IgBlast</span>
<span id="toClipBoard" class="button">❯ to clipBoard</span>
</div>
......@@ -510,6 +513,9 @@
</div>
</div>
<div id="clipBoard">
</div>
<div id="data-container">
<span class="closeButton" onclick="closeDataBox()">X</span>
<div id="data-msg">
......
......@@ -46,8 +46,15 @@ Segment.prototype = {
/*
*
* */
init : function(){
},
init : function(){
var self = this;
$('#toClipBoard').zclip({
path:'js/lib/ZeroClipboard.swf',
copy: function(){return self.toFasta()}
});
},
/*
*
......@@ -246,7 +253,37 @@ Segment.prototype = {
displayAjaxResult(result);
}
});
}
},
clipBoard : function () {
var div = document.getElementById('clipBoard');
div.innerHTML = "";
div.appendChild(document.createTextNode(""));
/*
if (document.createRange && window.getSelection) {
var range = document.createRange();
range.selectNode(div);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
}
*/
},
toFasta : function () {
var selected = this.m.getSelected();
var result = "";
for (var i=0; i < selected.length; i++){
result += "> "+this.m.getName(selected[i]) + " // " + this.m.getStrSize(selected[i]) + "\n";
result += this.m.windows[selected[i]].sequence + "\n";
}
return result
}
}//fin prototype
......
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