Jim,
This example doesn't seem to be working for me in an embedded
applet. I've cleared my cache and restarted the browser.
What browser are you using ? firefox and chrome work fine for me.
But in any
case, can I ask what changes you made?
Here are the changes needed to for the 2.5.1 codebase:
jalview.appletgui.AlignFrame.showURL() (around line 2581):
! viewport.applet.getAppletContext().showDocument(
! new java.net.URL(url), target);
Changed to :
if (url.indexOf("javascript:")==0)
{
// no target for the javascript context
viewport.applet.getAppletContext().showDocument(new java.net.URL(url));
} else{
viewport.applet.getAppletContext().showDocument(
new java.net.URL(url), target);
}
Ok, not quite 3 lines, but near enough.
There is one other patch you need to make for consistency:
jalview.appletgui.AppletJmol.showUrl(String url) (around line 873) :
! try
! {
! ap.av.applet.getAppletContext().showDocument(new java.net.URL(url),
! "jmolOutput");
! } catch (java.net.MalformedURLException ex)
! {
! }
Changed to:
ap.alignFrame.showURL(url,
"jmolOutput");
This just makes sure that urls opened via Jmol are passed through the same javascript: protocol filter.
It looked like the relevant
code was in "jalview.util.BrowserLauncher", where links are being
opened by system calls. I don't see how any three line modification
of this could cause the javascript to be run within the applet
context. I don't think you could have it interact with any javascript
libraries unless this was the case.
jalview.util.BrowserLauncher is only used by the application. The applet uses the browser's standard java applet environment to interact with it.
I hope that clears things up for you. If you find that the patch is not sufficient, please create an account and contribute to the issue at
http://issues.jalview.org/browse/JAL-604
So I can propagate any changes to the 2.6 branch.
Thanks in advance,
Jim Procter.
···
On 21/07/2010 16:53, Patrick Winters wrote:
--
-------------------------------------------------------------------
J. B. Procter (JALVIEW/ENFIN) Barton Bioinformatics Research Group
Phone/Fax:+44(0)1382 388734/345764 http://www.compbio.dundee.ac.uk
The University of Dundee is a Scottish Registered Charity, No. SC015096.