<html>
-<head>
-<style>
-.biojs_msa_stage {
- cursor: default;
- line-height: normal; }
-
-.biojs_msa_labels {
- color: black;
- display: inline-block;
- white-space: nowrap;
- cursor: pointer;
- vertical-align: top; }
-
-.biojs_msa_seqblock {
- cursor: move; }
-
-.biojs_msa_layer {
- display: block;
- white-space: nowrap; }
-
-.biojs_msa_labelblock::-webkit-scrollbar, .biojs_msa_header::-webkit-scrollbar {
- -webkit-appearance: none;
- width: 7px;
- height: 7px; }
-
-.biojs_msa_labelblock::-webkit-scrollbar-thumb, .biojs_msa_header::-webkit-scrollbar-thumb {
- border-radius: 4px;
- background-color: rgba(0, 0, 0, 0.5);
- box-shadow: 0 0 1px rgba(255, 255, 255, 0.5); }
-
-.biojs_msa_marker {
- color: grey;
- white-space: nowrap;
- cursor: pointer; }
-
-.biojs_msa_marker span {
- text-align: center; }
-
-.biojs_msa_menubar .biojs_msa_menubar_alink {
- background: #3498db;
- background-image: -webkit-linear-gradient(top, #3498db, #2980b9);
- background-image: -moz-linear-gradient(top, #3498db, #2980b9);
- background-image: -ms-linear-gradient(top, #3498db, #2980b9);
- background-image: -o-linear-gradient(top, #3498db, #2980b9);
- background-image: linear-gradient(to bottom, #3498db, #2980b9);
- -webkit-border-radius: 28;
- -moz-border-radius: 28;
- border-radius: 28px;
- font-family: Arial;
- color: #ffffff;
- padding: 3px 10px 3px 10px;
- margin-left: 10px;
- text-decoration: none; }
-
-.biojs_msa_menubar .biojs_msa_menubar_alink:hover {
- cursor: pointer; }
-
-/* jquery dropdown CSS */
-.dropdown {
- position: absolute;
- z-index: 9999999;
- display: none; }
-
-.dropdown .dropdown-menu,
-.dropdown .dropdown-panel {
- min-width: 160px;
- max-width: 360px;
- list-style: none;
- background: #FFF;
- border: solid 1px #DDD;
- border: solid 1px rgba(0, 0, 0, 0.2);
- border-radius: 6px;
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- overflow: visible;
- padding: 4px 0;
- margin: 0; }
-
-.dropdown .dropdown-panel {
- padding: 10px; }
-
-.dropdown.dropdown-scroll .dropdown-menu,
-.dropdown.dropdown-scroll .dropdown-panel {
- max-height: 358px;
- overflow: auto; }
-
-.dropdown .dropdown-menu LI {
- list-style: none;
- padding: 0 0;
- margin: 0;
- line-height: 18px; }
-
-.dropdown .dropdown-menu LI,
-.dropdown .dropdown-menu LABEL {
- display: block;
- color: #555;
- text-decoration: none;
- line-height: 18px;
- padding: 3px 15px;
- white-space: nowrap; }
-
-.dropdown .dropdown-menu LI:hover,
-.dropdown .dropdown-menu LABEL:hover {
- background-color: #08C;
- color: #FFF;
- cursor: pointer; }
-
-.dropdown .dropdown-menu .dropdown-divider {
- font-size: 1px;
- border-top: solid 1px #E5E5E5;
- padding: 0;
- margin: 5px 0; }
-</style>
-</head>
<header><title>BioJS viewer</title></header>
<body>
<!-- include MSA js + css -->
<!-- <script src="https://s3-eu-west-1.amazonaws.com/biojs/msa/latest/msa.js"></script> -->
<!-- <link type=text/css rel=stylesheet href=https://s3-eu-west-1.amazonaws.com/biojs/msa/latest/msa.css /> -->
-
-
-<div id="menuDiv"></div>
-<div id="yourDiv">press "Run with JS"</div>
-<input type='hidden' id='seqData' name='seqData' value='#sequenceData#'/>
-</br>
-</br>
-<div> This html page was generated from Jalview, to import the data back to Jalview, please drag the generated html file and drop it unto the Jalview workbench.<div>
-</br>
-<div> Alternatively, you could copy the url from the address bar and use Jalview's url importer (main menu-> File-> Input Alignment-> from URL) to import back the alignment jalview.
+
+ <img src="#jalview_logo#" alt="Jalview Logo" title="This html page was generated from Jalview, to import the data back to Jalview, please drag the generated html file and drop it unto the Jalview workbench.
+
+ Alternatively, you could copy the url from the address bar and use Jalview's url importer (main menu-> File-> Input Alignment-> from URL) to import back the alignment jalview." >
+
</br>
</br>
-<button onclick="javascipt:openJalviewUsingCurrentUrl()">Launch in Jalview</button>
+<button onclick="javascipt:openJalviewUsingCurrentUrl();">Launch in Jalview</button>
+<input type="button" name="divToggleButton" id="divToggleButton" onclick="javascipt:toggleMenuVisibility();" value="Show Menu"></input>
+
+</br>
+</br>
+
+<div id="yourDiv">press "Run with JS"</div>
+<input type='hidden' id='seqData' name='seqData' value='#sequenceData#'/>
</body>
</html>
<script>
+
+function toggleMenuVisibility(){
+ //alert("toggleMenuVisibility called!");
+
+ var menu = document.getElementsByClassName("biojs_msa_menubar");
+ var divToggleButton = document.getElementById("divToggleButton");
+ if(menu[0].style.display == 'block'){
+ menu[0].style.display = 'none';
+ divToggleButton.value="Show Menu";
+ }else{
+ menu[0].style.display = 'block';
+ divToggleButton.value="Hide Menu";
+ }
+}
+
+
function openJalviewUsingCurrentUrl(){
- var url = "http://webservices.compbio.dundee.ac.uk:38080/jalviewServlet/services/launchAppDev"
+ var url = "http://webservices.compbio.dundee.ac.uk:38080/jalviewServlet/services/launchAppDev";
var myForm = document.createElement("form");
myForm.action = url;
var myInput1 = document.createElement("input") ;
myInput1.setAttribute("name", "open") ;
myInput1.setAttribute("value", document.URL);
- myForm.appendChild(myInput1) ;
-
+ myForm.appendChild(myInput1) ;
document.body.appendChild(myForm) ;
myForm.submit() ;
// this is a way how you use a bundled file parser
biojs.io.clustal.read("#", function(seqs){
-
var opts = {};
// set your custom properties
// @see: https://github.com/greenify/biojs-vis-msa/tree/master/src/g
-opts.seqs = JSON.parse(document.getElementById("seqData").value);
+var jalviewData = JSON.parse(document.getElementById("seqData").value);
+opts.seqs = jalviewData['seqs'];
opts.el = document.getElementById("yourDiv");
-opts.vis = {conserv: false, overviewbox: false, labelid: false};
+opts.vis = {conserv: false, overviewbox: false, labelId: false};
opts.zoomer = {alignmentHeight: 225, labelWidth: 130,labelFontsize: "13px",labelIdLength: 20, menuFontsize: "12px",menuMarginLeft: "3px", menuPadding: "3px 4px 3px 4px", menuItemFontsize: "14px", menuItemLineHeight: "14px"};
// init msa
var m = new msa.msa(opts);
-m.g.colorscheme.set("scheme", "#scheme#");
+m.g.colorscheme.set("scheme", jalviewData['globalColorScheme']);
+
+var x = 0;
+jalviewData.seqs.forEach( function (seq)
+{
+m.seqs.at(x++).set("features", new msa.model.featurecol(seq.features));
+});
// the menu is independent to the MSA container
var menuOpts = {};
// call render at the end to display the whole MSA
m.render();
-
+
+toggleMenuVisibility();
+toggleMenuVisibility();
});
</script>
\ No newline at end of file