2 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery.dataTables' ], &>
4 <p>View sequence metadata protocols associated with each sequence metadata data type. Click the name of the sequence
5 metadata protocol to query data from that protocol.</p>
7 <div id="sequence_metadata_protocol_types"></div>
10 <script type="text/javascript">
12 var data_types = []; // List of available sequence metadata data types fetched from the database
15 jQuery(document).ready(function() {
17 // Get the data types and then display the protocols
18 get_types(function() {
26 * Get the types associated with stored sequence metadata
27 * - build the sections for each data typ
29 function get_types(callback) {
33 url: '/ajax/sequence_metadata/types',
34 success: function(data) {
35 if ( data && data.types ) {
36 data_types = data.types;
40 for ( let i = 0; i < data.types.length; i++ ) {
41 html += "<div class='sequence_metadata_protocol_type sequence_metadata_protocol_type_" + i + "' data-type='" + data.types[i].type_name + "'>";
42 html += "<div class='sequence_metadata_protocol_type_header'>";
43 html += "<h4 class='sequence_metdata_protocol_type_name'>" + data.types[i].type_name.replaceAll(' ', ' ') + "</h4>";
44 html += "<p class='sequence_metadata_protocol_type_definition'>" + data.types[i].type_definition + "</p>";
46 html += "<div id='sequence_metadata_protocols_" + i + "'></div>";
49 jQuery('#sequence_metadata_protocol_types').html(html);
51 if ( callback ) return callback();
54 alert("ERROR: Could not load types!");
58 alert("ERROR: Could not load types");
64 * Get and display the Protocol Tables for each data type
66 function get_protocols() {
67 for ( let i = 0; i < data_types.length; i++ ) {
68 get_select_box('sequence_metadata_protocols', 'sequence_metadata_protocols_' + i, {
69 'sequence_metadata_data_type_id': data_types[i].type_id,
70 'include_query_link': 1
81 .sequence_metadata_protocol_type_header {
83 margin: 50px 0 15px 0;
84 border-bottom: 1px solid #ccc;
87 .sequence_metdata_protocol_type_name {
90 .sequence_metadata_protocol_type_definition {