X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=examples%2Fjavascript%2Fjvcontroller.js;h=73f6670e4183b20b4e15d7de94d96d1ffa7e2b8a;hb=279c6495df1a0de231600a2d283098c7411c4730;hp=fa330230fa5251aa97fd0d03ec61404d399aa103;hpb=3eddf87cb1eb8046d191c65ec69d83264a3c41c0;p=jalview.git diff --git a/examples/javascript/jvcontroller.js b/examples/javascript/jvcontroller.js index fa33023..73f6670 100644 --- a/examples/javascript/jvcontroller.js +++ b/examples/javascript/jvcontroller.js @@ -17,15 +17,9 @@ * The Jalview Authors are detailed in the 'AUTHORS' file. */ - - var currentPage = (readCookie("current_page")) ? readCookie("current_page") : "applets"; - var signedJars = "jalviewApplet.jar,JmolApplet-12.2.4.jar,java-json.jar,json_simple-1.1.jar"; - var unsignedJars = "u_jalviewApplet.jar,u_JmolApplet-12.2.4.jar,u_java-json.jar,u_json_simple-1.1.jar"; - setOrUpdateCookie('jv_applet_mode', 'false', '1'); - var isSignedAppletMode = readCookie("jv_applet_mode"); - var appletJars = (isSignedAppletMode === 'true') ? signedJars : unsignedJars; - //alert(unsigned); - + + + var currentPage = "applets"; function createAppletTag(code, name, archive, width, height, params){ var app = document.createElement('applet'); @@ -69,48 +63,50 @@ document.cookie = name + "=" + value + expires + "; path=/"; } - $(function(){ - //var currentPage = (readCookie("current_page")) ? readCookie("current_page") : "applets.html"; - //alert("cur page : " + currentPage); - $('#header').load("includes/header_jv.html"); - $('#content').load(currentPage+".html"); - $('#nav').load("includes/nav_jv.html"); - $('#footer').load("includes/footer_jv.html"); - $('#'+ currentPage).addClass('active-trail active'); + $(function(){ + var url = window.location.href; + var end = url.length; + var start = url.lastIndexOf("#"); + var newPage = url.substring(start + 1, end); + var page = ((start === -1) ? currentPage : newPage); + //alert("page:" + page); + if(page === "embeddedWJmol"){ + // do nothing embeddedWJmol page already include + + $('#header').load("includes/header_jv.html"); + //$('#content').load(page + ".html"); + $('#nav').load("includes/nav_jv.html"); + $('#footer').load("includes/footer_jv.html"); + $('#'+ currentPage).addClass('active-trail active'); + }else{ + $('#header').load("includes/header_jv.html"); + $('#content').load(page + ".html"); + $('#nav').load("includes/nav_jv.html"); + $('#footer').load("includes/footer_jv.html"); + $('#'+ currentPage).addClass('active-trail active'); + + var e = document.getElementById("view_decorated"); + e.style.display = 'none'; + } }); - $(document).ready(function(){ - //var currentPage = (readCookie("current_page")) ? readCookie("current_page") : "applets.html"; - //updateLinks(currentPage); - var params = [["file","uniref50.fa"], - ["treeFile","ferredoxin.nw"], - ["userDefinedColour","C=yellow; R,K,H=FF5555; D,E=5555F"], - ["sortByTree","True"], - ["showSequenceLogo","true"], - ["showGroupConsensus","true"], - ["showFullId","false"], - ["linkLabel_1","Uniprot"], - ["linkUrl_1","http://www.uniprot.org/uniprot/$SEQUENCE_ID$"], - ["linkLabel_2","EMBL-EBI Search"], - ["linkUrl_2","http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$"], - ["APPLICATION_URL","http://www.jalview.org/services/launchApp"]]; - var app = createAppletTag('jalview.bin.JalviewLite','',appletJars,'140','35', params); - console.log('âââââââââ> app âââââââ> ' + app); - //var appDiv = document.getElementById("applet_div"); - //var appDiv = document.getElementById("applet_div"); - //appDiv.appendChild(app); - $("