javaws.js

Plain Text icon — Plain Text, 2 kB (2189 bytes)

File contents

var javawsInstalled = 0; 
var javaws12Installed = 0; 
var javaws142Installed=0; 
isIE = "false"; 
if (navigator.mimeTypes && navigator.mimeTypes.length) { 
  x = navigator.mimeTypes['application/x-java-jnlp-file']; 
  if (x) { 
    javawsInstalled = 1; 
    javaws12Installed=1; 
    javaws142Installed=1; 
  } 
} 
else { 
  isIE = "true"; 
}

var webstartURL = "http://coast.bcgsc.bc.ca:8080/webstart/sockeyelauncher?";

function launchSockeye(database, chromosome, start, end, connection){
  var targetURL = webstartURL + "database=" + database + "&chromosome=" + chromosome + "&start=" + start + "&end=" + end + "&conn=" + connection;
  /* Note that the logic below always launches the JNLP application
   *if the browser is Gecko based. This is because it is not possible
   *to detect MIME type application/x-java-jnlp-file on Gecko-based browsers. 
   */
  if (navigator.userAgent.indexOf("Gecko") !=-1) {
    var message = "You are using Gecko browser.  Click ";
    message += ("<a href='");
    message += targetURL;
    message += ("'>here</a>");
    message += (" to launch Sockeye if you have JRE installed ");
    message += ("(Associate the MIME type application/x-java-jnlp-file to the executable <b>javaws</b> under the JRE_HOME/javaws folder if necessary)");
    message += ("<br>or<br>");
    message += ("Click ");
    message += ("<a href='http://java.sun.com/products/javawebstart/download.html' target='_new'>here</a> ");
    message += ("to download and install JRE 1.4.");
    
    var win = window.open("","LaunchSockeye","toolbar=no,scrollbars=yes,width=300,height=300");
    win.document.open();
    win.document.write(message);
    win.document.close();
  } else if (javawsInstalled) {
    location.href=targetURL;
  } else {
    var message = ("Click ");
    message += ("<a href='http://java.sun.com/products/javawebstart/download.html' target='_new'>here</a> ");
    message += ("to download and install JRE 1.4.");
    
    var win = window.open("","LaunchSockeye","toolbar=no,scrollbars=yes,width=300,height=300");
    win.document.open();
    win.document.write(message);
    win.document.close();
  }
}
Page last modified Feb 06, 2007