JAL-4059 Use namespaced query parameters in preference to Info.args. Report what...
authorBen Soares <b.soares@dundee.ac.uk>
Fri, 15 Dec 2023 12:58:03 +0000 (12:58 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Fri, 15 Dec 2023 12:58:03 +0000 (12:58 +0000)
src/jalview/util/JalviewJSUtil.java
utils/jalviewjs/site-resources/index.html
utils/jalviewjs/site-resources/jalviewjs.html

index f46014b..22f79a5 100644 (file)
@@ -268,7 +268,7 @@ public class JalviewJSUtil
          *            URLSearchParams(window.location.search);
          * 
          *            var qsargs = [];
-         * 
+         *
          *            for (var param of qsParams) {
          * 
          *            var key = param[0];
@@ -287,16 +287,36 @@ public class JalviewJSUtil
          * 
          *            }
          * 
-         *            qsargs && (System.out.println("URL parameters detected
-         *            were "+qsargs.join(" "))) &&
-         *            (J2S.thisApplet.__Info.urlargs = qsargs);
+         *            if (qsargs !== undefined && qsargs.length > 0) {
+         *
+         *            System.out.println("URL parameters detected are
+         *            '"+qsargs.join("', '")+"'");
+         *
+         *            J2S.thisApplet.__Info.j2s_urlargs = qsargs;
+         *
+         *            J2S.thisApplet.__Info.args = qsargs.join(" ");
+         *
+         *            System.out.println("URL parameters were passed to J2S
+         *            main.");
+         *
+         *            } else {
          * 
-         *            (!J2S.thisApplet.__Info.args || J2S.thisApplet.__Info.args
-         *            == "" || J2S.thisApplet.__Info.args == "??") &&
-         *            (J2S.thisApplet.__Info.args = qsargs.join(" ")) &&
-         *            (System.out.println("URL parameters were passed to J2S
-         *            main."));
+         *            // look for Info.args
          * 
+         *            var infoArgs = J2S.thisApplet.__Info.args;
+         *
+         *            if (infoArgs !== undefined) {
+         *
+         *            System.out.println("Info.args parameters detected are
+         *            "+J2S.thisApplet.__Info.args);
+         *
+         *            System.out.println("Info.args parameters were passed to
+         *            J2S main.");
+         *
+         *            }
+         *
+         *            }
+         *
          *            }
          */
       } catch (Throwable t)
index 9605bd8..acc4972 100644 (file)
@@ -6,10 +6,10 @@
 <h1>jalviewjs.html and jalviewjs-core.html examples with new CLI style query parameters</h1>
 <ul>
 <li>
-<a href="http://localhost:8000/jalviewjs.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true">http://localhost:8000/jalviewjs.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true</a>
+<a href="/jalviewjs.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true">/jalviewjs.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true</a>
 </li>
 <li>
-<a href="http://localhost:8000/jalviewjs-core.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true">http://localhost:8000/jalviewjs-core.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true</a>
+<a href="/jalviewjs-core.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true">/jalviewjs-core.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true</a>
 </li>
 </ul>
 </body>
index d735f00..e8d8cf8 100644 (file)
@@ -22,6 +22,7 @@ jv_Info = {
   // all j2s_... values can be accessed in JalviewJSUtil.getInstance().getJSInfoValue(key)
   j2s_namespace: "jv",
   j2s_overflow: true,
+  args: "--open=examples/plantfdx.fa --colour=gecos-ocean --structure=examples/AF-P00221-F1-model_v4.pdb --seqid=FER1_SPIOL --tempfac=plddt --paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json --noshowannotations --debug=true",
 }
 </script>
 <style>