JAL-3446 reorganized JalviewJSApp (accidentally put that in jalview/api)
[jalview.git] / utils / jalviewjs / site-resources / _jalview_embedded_example2.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Embedded JalviewJS Example 2</title><meta charset="utf-8" />
5 <script src="swingjs/swingjs2.js"></script>
6 <script>
7
8 // NOTE: The applet on this page is "Jalview". 
9
10 // BH 2019.10.06 adds Tree and Pca functionality
11 // BH see issue JAL-3451
12
13 if (!self.SwingJS)alert('swingjs2.js was not found. It needs to be in swingjs folder in the same directory as ' + document.location.href)
14 Info = {
15   code: null,
16   main: "jalview.bin.JalviewJS2",
17   core: "NONE",
18 //      core:"_jalview",
19
20         oninit:function() {$("#links").show();},
21         noannotation: true,
22         
23   readyFunction: null,
24         serverURL: 'https://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php',
25         j2sPath: 'swingjs/j2s',
26         console:'sysoutdiv',
27         allowjavascript: true
28 }
29
30 jvGet = function(what) {
31         switch(what) {
32         case "select1":
33                 alert(Jalview1.getApp().getSelectedSequences());
34                 break;
35         case "select2":
36                 alert(Jalview2.getApp().getSelectedSequences());        
37                 break;
38         case "select1fasta":
39                 alert(Jalview1.getApp().getSelectedSequencesAsAlignment("fasta",true));
40                 break;
41         case "select2fasta":
42                 alert(Jalview2.getApp().getSelectedSequencesAsAlignment("fasta",true));
43                 break;
44         }
45         
46 }
47
48 $(document).ready(function() {
49
50           SwingJS.getApplet('Jalview1', Info);
51           SwingJS.getApplet('Jalview2', Info);
52
53 });
54
55 </script>
56 </head>
57 <body style="background-image: url(images/coolVeryLightBG.png);">
58 <table style="width:1000px;border:2px solid lightblue;border-spacing:0;font-size:16pt;" padding="10" valign="top">
59 <tr>
60 <td style="font-size:24;font-weight:bold;background-color:lightblue" colspan=2><center>Demonstration of embedded JalviewJS components</center>
61 </td>
62
63
64 </tr><tr>
65
66
67 <td colspan=2 valign=top style="padding:20px;background-color:lightgray">
68 this page tests two Jalview apps on the same page.
69 <div id="Jalview1-desktop-div" style="width:0px;height:0px;"></div>
70 <div id="Jalview2-desktop-div" style="width:0px;height:0px;"></div>
71 </td></tr>
72 <tr><td style="background-color:lightgray;padding:10px">
73 <div id="Jalview1-alignment-div" style="padding:10px;position:relative;width:550px;height:300px">
74 </td>
75 <td style="background-color:lightgray;padding:10px">
76 <div id="Jalview2-alignment-div" style="padding:10px;position:relative;width:550px;height:300px">
77 </td>
78 </tr>
79 <tr><td>
80 <div style="display:block;width:500px;height:300px;">
81 <div id="sysoutdiv" style="border:1px solid green;width:100%;height:95%;overflow:auto"></div>
82 This is System.out. <a href="javascript:J2S.thisApplet._clearConsole()">clear it</a> <br>Add ?j2snocore to URL to see full class list; ?j2sdebug to use uncompressed j2s/core files <br><a href="javascript:getClassList()">get _j2sClassList.txt</a>
83 </div>
84
85 </td><td valign=top>
86 <div id=links style="display:none">
87 <a href="javascript:jvGet('select1')">Show Jalview1 selections</a>
88
89 <a href="javascript:jvGet('select2')">Show Jalview2 selections</a>
90
91 <br>
92 <a href="javascript:jvGet('select1fasta')">Show Jalview1 selections (fasta)</a>
93
94 <a href="javascript:jvGet('select2fasta')">Show Jalview2 selections (fasta)</a>
95 </div>
96 </td></tr>
97 </table>
98
99
100 </body>
101 </html>