Merge branch 'JAL-957_jbake' into Release_2_8_Branch
[jalview.git] / examples-jbake / templates / jvl_formComplete.ftl
diff --git a/examples-jbake/templates/jvl_formComplete.ftl b/examples-jbake/templates/jvl_formComplete.ftl
new file mode 100644 (file)
index 0000000..cab6cc3
--- /dev/null
@@ -0,0 +1,50 @@
+<h2><a href="jalviewLiteJs.html">JalviewLite API</a> Demo</h2>
+<p>Using the Javascript API to fill out forms using data from JalviewLite
+<br/>Click the Javascript buttons below to interact with the Applet
+instance on the page.</p>
+View the source in your browser to see how it has been done. <br/>
+<a name="api">View the full <a href="jalviewLiteJs.html">JalviewLite API documentation</a>.</a>
+<applet code="jalview.bin.JalviewLite" width="0" height="0"
+       archive="${content.jvl}" name="Jalview">
+  <#if content.permissions?exists><param name="permissions" value="${content.permissions}"/></#if>
+  <param name="file" value="plantfdx.fa"/>
+  <param name="features" value="plantfdx.features"/>
+  <param name="wrap" value="true"/>
+  <param name="showAnnotation" value="false"/>
+  <param name="windowHeight" value="500"/>
+  <param name="windowWidth" value="650"/>
+  <param name="showFullId" value="false"/>
+  <param name="linkLabel_1" value="Uniprot"/>
+  <param name="linkUrl_1"
+        value="http://www.uniprot.org/uniprot/$SEQUENCE_ID$"/>
+  <param name="linkLabel_2" value="Expasy">
+  <param name="linkUrl_2"
+        value="http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID$"/>
+  <param name="hidefeaturegroups" value="uniprot" />
+  <param name="showbutton" value="false" />
+</applet>
+<form name="exampleForm"><br/>
+  <br/>
+  <center><strong>Using the Jalview Applet for Input
+      to an HTML Form</strong></center>
+  <div align="center"><input type="button"
+                            onClick="document.forms.exampleForm.exampleTextarea.value=document.applets.Jalview.getAlignment('fasta', 'false')"
+                            value="Fill Form from Jalview" /> <br/>
+    <br/>
+    <textarea name="exampleTextarea" cols="55" rows="9"></textarea></div>
+</form>
+<center><strong>Make a new View and Get and Set
+    Group Display List</strong></center>
+<form name="groupForm">
+  <div align="center"><input type="button"
+                            onClick="document.forms.groupForm.groups.value=document.applets.Jalview.getFeatureGroups()"
+                            value="Get groups" /> <input type="button"
+                                                         onClick="document.applets.Jalview.newView()" value="new View" /> <br/>
+    <textarea name="groups" cols="55" rows="9"></textarea> <br/>
+    <input type="button"
+          onClick="document.applets.Jalview.setFeatureGroupState(document.forms.groupForm.groups.value, true)"
+          value="Display groups" /> <input type="button"
+                                           onClick="document.applets.Jalview.setFeatureGroupState(document.forms.groupForm.groups.value, false)"
+                                           value="Hide groups" /></div>
+</form>
+</div>