X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=examples%2Fjavascript%2Fjalview.js;fp=examples%2Fjavascript%2Fjalview.js;h=1c1f1c2cc49107d372441c859122bf24a9e3a83c;hb=9623cea766a766683243235557ad48e6f7659e6a;hp=dfe8c263d46b2ac3a3a20be533d0014d9f2a6376;hpb=6066400ed6b0fe288ebbea82389f59838a534706;p=jalview.git diff --git a/examples/javascript/jalview.js b/examples/javascript/jalview.js index dfe8c26..1c1f1c2 100644 --- a/examples/javascript/jalview.js +++ b/examples/javascript/jalview.js @@ -17,6 +17,14 @@ * The Jalview Authors are detailed in the 'AUTHORS' file. */ + + + + + + + + // default console to report messages var _console = document.getElementById("stdout"); var _jvapps = new Array(); @@ -145,7 +153,7 @@ function linkJvJmol(applet, jmolView, modeltofiles) { var sep = applet.getSeparator(); var oldjm=jmolView; // recover full id of Jmol applet - jmolView=_jmolGetApplet(jmolView).id; + jmolView=jmolFindTarget(jmolView)._id; // Jmol 14.2.14 var jmbinding=_jvjmols.get(jmolView); if (!jmbinding) { @@ -310,10 +318,8 @@ function _jmolhover(jmid, atomlabel, atomidx) { } // use atomlabel[5] to look up model filename so we can highlight associated positions in any jalviews for (ap in _jvapps) { - _jvapps[ap].mouseOverStructure(atomlabel[2], atomlabel[3], - getDocumentBase() - + "/" + - modeltofiles[atomlabel[5]]); + pdb = getDocumentBase() + modeltofiles[atomlabel[5]]; + _jvapps[ap].mouseOverStructure(atomlabel[2], atomlabel[3], pdb); msg = _jmolhovermsg; } } @@ -338,3 +344,37 @@ function _jmolMessagecallback(jmid, statmess) { } } + + + function lJvApp() { + setTimeout(function() { + //alert("in lJvApp"); + var jvapp = document.getElementById("jvapp"); + var jvfollower = document.getElementById("jvfollower"); + //console.log(">>>>>>>> lJvApp" + jvapp); + linkJvJmol(jvapp); + }, 200); + setConsole(document.getElementById("stdout")); + }; + + function lJvFollow() { + setTimeout(function() { + //alert("in lJvFollow"); + var jvapp = document.getElementById("jvapp"); + var jvfollower = document.getElementById("jvfollower"); + console.log(">>>>>>> lJvFollow" + jvfollower); + linkJvJmol(jvfollower); + }, 200); + }; + + function lJvA() { + setTimeout(function() { + //alert("lJvA"); + jvfollower = document.getElementById("jvA"); + setConsole(document.getElementById("stdout")); + //sep = jvfollower.getSeparator(); + //jvapp.setSeparator(""+jvapp.getSeparator()); + linkJvJmol(jvfollower, "jmolView", modeltofiles); + }, 100); + }; +