From 41c22f3101808e56063007b4eef09c1a9181a30e Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 28 Feb 2019 12:42:46 +0000 Subject: [PATCH] JAL-3032 any url parameter not "j2s..." taken as Jalview args --- src/jalview/bin/Jalview.java | 61 ++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index e528dec..5527450 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -93,12 +93,23 @@ public class Jalview /** * @j2sNative * - * // set space-delimited query parameters as arguments to Jalview main + * // find first query parameter (if any) that doesn't start with j2s + * // and set as space-delimited arguments to Jalview main * hr = decodeURI(document.location.href); * pos = hr.indexOf("?"); * if (pos > 0) * { - * thisApplet.__Info.args = hr.substring(pos+1).split(" "); + * q = hr.substring(pos+1); + * args = q.split("&"); + * for (i = 0 ; i < args.length; i++) + * { + * arg1 = args[i]; + * if (!arg1.startsWith("j2s")) + * { + * thisApplet.__Info.args = arg1.split(" "); + * break; + * } + * } * } */ @@ -111,40 +122,26 @@ public class Jalview public static AlignFrame currentAlignFrame; -//BH 2019.01.25 moved to Platform -///** -// * Answers true if Jalview is running as Javascript, else false. The value is -// * set at compile time. -// * -// * @return -// */ -//public static boolean isJS() -//{ -// return /** @j2sNative true || */ -// false; -//} - static { if (!Platform.isJS()) { // BH 2018 - // grab all the rights we can the JVM - Policy.setPolicy(new Policy() - { - @Override - public PermissionCollection getPermissions(CodeSource codesource) - { - Permissions perms = new Permissions(); - perms.add(new AllPermission()); - return (perms); - } - - @Override - public void refresh() - { - } - }); - + // grab all the rights we can for the JVM + Policy.setPolicy(new Policy() + { + @Override + public PermissionCollection getPermissions(CodeSource codesource) + { + Permissions perms = new Permissions(); + perms.add(new AllPermission()); + return (perms); + } + + @Override + public void refresh() + { + } + }); } } -- 1.7.10.2