House keeping
[jalview.git] / resources / templates / BioJSTemplate.txt
index d86fa65..74990ad 100644 (file)
@@ -7,15 +7,15 @@
 <!-- <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 /> -->
  
- <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.
+ <img src="http://www.jalview.org/help/html/Jalview_Logo.png" 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>
 <input type="button" name="divToggleButton" id="divToggleButton" onclick="javascipt:toggleMenuVisibility();" value="Show Menu"></input>
+<button onclick="javascipt:openJalviewUsingCurrentUrl();">Launch in Jalview</button>
 
 </br>
 </br> 
@@ -31,8 +31,6 @@
 <script>
 
 function toggleMenuVisibility(){
-       //alert("toggleMenuVisibility called!");
-       
        var menu = document.getElementsByClassName("biojs_msa_menubar");
        var divToggleButton = document.getElementById("divToggleButton");
        if(menu[0].style.display == 'block'){
@@ -43,54 +41,30 @@ function toggleMenuVisibility(){
           divToggleButton.value="Hide Menu";
           }
 }
-function openJalviewUsingCurrentUrl2(){
-var jnpl = "<!--"+
-"Hi!"+
-"If you have downloaded this file after pressing \"Launch Full Application\" from Jalview on a web page and you don't know what to do with this file, you must install Java from http://www.java.sun.com then try opening this file again."+
-" \n"+
-"      JNLP generated by /jalviewServlet/services/launchAppDev"+
-"      JNLP generated from http://www.jalview.org/builds/develop/webstart/jalview.jnlp"+
-"Available servlet parameters (please URLEncode):"+
-"      open=<alignment file URL>"+
-"      jvm-max-heap=heap size in M or G"+
-"      features maps to        '-features'"+
-"      treeFile maps to        '-tree'"+
-"      tree maps to    '-tree'"+
-"      annotations maps to     '-annotations'"+
-"      colour maps to  '-colour'"+
-" "+
-"-->"+
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?><jnlp spec=\"1.0+\" codebase=\"http://www.jalview.org/builds/develop/webstart\">    <information>           <title>Jalview</title>          <vendor>The Barton Group</vendor>               <homepage href=\"http://www.jalview.org\"/>             <description>Jalview Multiple Alignment Editor</description>            <description kind=\"short\">Jalview</description>               <icon href=\"JalviewLogo_big.png\"/>            <offline-allowed/>      </information>  <security>              <all-permissions/>      </security>     <resources>             <j2se version=\"1.7+\" initial-heap-size=\"10M\" max-heap-size=\"2G\"/>         <jar href=\"jalview.jar\"/>             <jar href=\"JGoogleAnalytics_0.3.jar\"/>                <jar href=\"Jmol-12.2.4.jar\"/>         <jar href=\"VARNAv3-91.jar\"/>          <jar href=\"activation.jar\"/>          <jar href=\"apache-mime4j-0.6.jar\"/>           <jar href=\"axis.jar\"/>                <jar href=\"castor-1.1-cycle-xml.jar\"/>                <jar href=\"commons-codec-1.3.jar\"/>           <jar href=\"commons-discovery.jar\"/>           <jar href=\"commons-logging-1.1.1.jar\"/>               <jar href=\"groovy-all-1.8.2.jar\"/>            <jar href=\"httpclient-4.0.3.jar\"/>            <jar href=\"httpcore-4.0.1.jar\"/>              <jar href=\"httpmime-4.0.3.jar\"/>              <jar href=\"jalview_jnlp_vm.jar\"/>             <jar href=\"jaxrpc.jar\"/>              <jar href=\"jdas-1.0.4.jar\"/>          <jar href=\"jhall.jar\"/>               <jar href=\"json_simple-1.1.jar\"/>             <jar href=\"jsoup-1.8.1.jar\"/>         <jar href=\"jswingreader-0.3.jar\"/>            <jar href=\"log4j-to-slf4j-2.0-rc2.jar\"/>              <jar href=\"mail.jar\"/>                <jar href=\"miglayout-4.0-swing.jar\"/>         <jar href=\"min-jabaws-client-2.1.0.jar\"/>             <jar href=\"regex.jar\"/>               <jar href=\"saaj.jar\"/>                <jar href=\"slf4j-api-1.7.7.jar\"/>             <jar href=\"slf4j-log4j12-1.7.7.jar\"/>         <jar href=\"spring-core-3.0.5.RELEASE.jar\"/>           <jar href=\"spring-web-3.0.5.RELEASE.jar\"/>            <jar href=\"vamsas-client.jar\"/>               <jar href=\"wsdl4j.jar\"/>              <jar href=\"xercesImpl.jar\"/>          <jar href=\"xml-apis.jar\"/>            <property name=\"jalview.version\" value=\"Development Branch Build\"/> </resources>"+
-"<application-desc main-class=\"jalview.bin.Jalview\">"+
-"<argument>-open</argument>"+
-"<argument>file:///Users/tcnofoegbu/Documents/workspace/java/dev/jalview/examples/example_biojs.html</argument>"+
-"</application-desc>"+
-"      <security>"+
-"              <all-permissions/>"+
-"      </security>"+
-"</jnlp>"
-
-var encodedUri = encodeURI(jnpl);
-window.open(encodedUri)
-//alert(jnpl)
-}
+
 
 function openJalviewUsingCurrentUrl(){
-       var url = "http://webservices.compbio.dundee.ac.uk:38080/jalviewServlet/services/launchAppDev";
+       var jalviewData = JSON.parse(document.getElementById("seqData").value)
+    var jalviewVersion = jalviewData['jalviewVersion'];
+    var url = jalviewData['webStartUrl'];
        var myForm = document.createElement("form");
        myForm.action = url;
        
-    var myInput = document.createElement("input") ;
-    myInput.setAttribute("name", "jvm-max-heap") ;
-    myInput.setAttribute("value", "2G");
-    myForm.appendChild(myInput) ;
+    var heap = document.createElement("input") ;
+    heap.setAttribute("name", "jvm-max-heap") ;
+    heap.setAttribute("value", "2G");
+    myForm.appendChild(heap) ;
     
-    var myInput1 = document.createElement("input") ;
-    myInput1.setAttribute("name", "open") ;
-    myInput1.setAttribute("value", document.URL);
-    myForm.appendChild(myInput1) ;
+    var target = document.createElement("input") ;
+    target.setAttribute("name", "open") ;
+    target.setAttribute("value", document.URL);
+    myForm.appendChild(target) ;
+    
+    var jvVersion = document.createElement("input") ;
+    jvVersion.setAttribute("name", "version") ;
+    jvVersion.setAttribute("value", jalviewVersion);
+    myForm.appendChild(jvVersion) ;
     
-
        document.body.appendChild(myForm) ;
        myForm.submit() ;
        document.body.removeChild(myForm) ;
@@ -9051,7 +9025,6 @@ m.addView("menu", defMenu);
 
 // call render at the end to display the whole MSA
 m.render();
 toggleMenuVisibility(); 
 toggleMenuVisibility(); 
 });