From: gmungoc Date: Thu, 28 Feb 2019 12:42:46 +0000 (+0000) Subject: JAL-3032 any url parameter not "j2s..." taken as Jalview args X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~68^2~238 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=41c22f3101808e56063007b4eef09c1a9181a30e;p=jalview.git JAL-3032 any url parameter not "j2s..." taken as Jalview args --- 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() + { + } + }); } }