5 /ontology/associate_ontology.mas - a component for printing a generic 'associate_ontology' javasript form and displaying the ontology annotation
20 the type of the object you are annotating
22 =item cvterm_autocomplete_uri
24 defaults to /ajax/cvterm/autocomplete
28 the uri for associating the cvterm with your object
30 =iterm relationships_uri
32 populate the relationships drop down menu. defaults to /ajax/cvterm/relationships
36 populate the evidence code menu. Defaults to /ajax/cvterm/evidence
38 =item evidence_description_uri
40 populate the evidence description menu. Defaults to /ajax/cvterm/evidence_description
44 whether the associate form should be printed. Usually only if the user is logged-in
48 the url for displaying the ontology annotation
54 Naama Menda <nm249@cornell.edu>
65 $cvterm_autocomplete_uri => '/ajax/cvterm/autocomplete'
67 $relationships_uri => '/ajax/cvterm/relationships'
68 $evidence_uri => '/ajax/cvterm/evidence'
69 $evidence_description_uri => '/ajax/cvterm/evidence_description'
70 $reference_uri => undef
71 $evidence_with_uri => undef
73 $div_id => 'ontology_terms'
75 $trait_db_name => 'SP'
83 border: 1px dotted gray;
86 #ontology_show_details {
90 #ontology_show_details label {
93 .active#ontology_show_details {
98 <script language="javascript">
99 jQuery(document).ready(function() {
100 var db_name = jQuery('#db_name option:selected').attr("value");
101 jQuery("#term_name").autocomplete({
102 source: '<% $cvterm_autocomplete_uri %>' + "?db_name=" + db_name,
106 select: function(event, ui) { Ontology.populateEvidence('relationship_select', '/ajax/cvterm/relationships'); }
109 jQuery("#db_name").change(function(){
110 db_name = jQuery('#db_name option:selected').attr("value");
111 jQuery("#term_name").autocomplete('option', 'source', '<% $cvterm_autocomplete_uri %>' + "?db_name=" + db_name);
122 <& /util/import_javascript.mas, classes=>[qw[ jqueryui popup CXGN.AJAX.Ontology] ]&>
126 <div id="associate_cvterm_form" style="display: none">
127 <form name="cvterm_form" >
128 <div id="cvterm_search" >
130 <tr><td width = "30%"><b>Select ontology</b><br />
131 <select id = "db_name" onchange = "jQuery('#term_name').val('');" >
132 <option value="GO">GO (gene ontology)</option>
133 <option value="PO">PO (plant ontology)</option>
134 <option value="<% $trait_db_name %>"><% $trait_db_name %> phenotype ontology</option>
137 <td><b>Type a term name</b><br /><input type="text" size ="60" id="term_name" name="term_name" />
138 <input type="hidden" id="object_id" name="object_id" value="<% $object_id %>" />
141 <b>Relationship type:</b>
142 <select id="relationship_select" style="width: 100%"
143 onchange="Ontology.populateEvidence('evidence_code_select', '<% $evidence_uri %>' )">
147 <b>Evidence code:</b>
148 <select id="evidence_code_select" style="width: 100%"
149 onchange="jQuery('#associate_ontology_button').removeAttr('disabled');Ontology.populateEvidence('evidence_description_select', '<% $evidence_description_uri %>' + '?evidence_code_id=' + jQuery('#evidence_code_select').val() );Ontology.populateEvidence('evidence_with_select', '<% $evidence_with_uri %>');Ontology.populateEvidence('reference_select', '<% $reference_uri %>')">
152 <tr><td colspan = "2">
153 <b>Evidence description:</b>
154 <select id="evidence_description_select" style="width: 100%">
157 <tr><td colspan = "2">
158 <b>Evidence with:</b>
159 <select id="evidence_with_select" style="width: 100%">
162 <tr><td colspan = "2">
164 <select id="reference_select" style="width: 100%">
167 <tr><td colspan = "2">
168 <div id="ontology_select_button">
170 id="associate_ontology_button"
171 value="associate term"
173 onclick="javascript:Ontology.submitCvtermForm('<% $cvterm_add_uri %>', '<% $ontology_url %>');this.disabled=true;" />
185 <div id="ontology_show_details" style="display: none">
186 <form> <input type="checkbox" id="show_details" disabled="true" />
187 <label for="show_details">Show complete details</label>
191 <div id="ontology" >[loading...] </div>
193 <script language="javascript">
195 jQuery(document).ready( function() {
196 Ontology.displayOntologies("ontology" , "<% $ontology_url %>");