source: trunk/web-app/js/simpleQuery.js @ 647

Last change on this file since 647 was 647, checked in by vinlud, 8 years ago

Changes accordion simpleQuery

  • Property svn:keywords set to Date Author Rev
File size: 4.2 KB
Line 
1/**
2 * simpleQuery javascript functions
3 *
4 * @author  Vincent Ludden
5 * @since   20100526
6 * @package query
7 *
8 * Revision information:
9 * $Rev: 647 $
10 * $Author: vinlud $
11 * $Date: 2010-07-13 08:09:35 +0000 (di, 13 jul 2010) $
12 */
13
14  $(document).ready(function() {
15
16    var compoundCounter = 2;
17    var transcriptomeCounter = 2;
18
19    $("#accordion").accordion({collapsible: true,
20        autoHeight: false,
21        active: 0});
22
23    $('#addCompound').click(function() {
24        var compoundGroup = document.getElementById('compoundGroup');
25        var newCompoundDiv = document.createElement('div');
26        newCompoundDiv.setAttribute('id', 'compoundRow' + compoundCounter);
27
28        var newCompoundRowDiv1 = document.createElement('div');
29        newCompoundRowDiv1.setAttribute('class', 'descriptionSA');
30        newCompoundRowDiv1.innerHTML = "Compound";
31        newCompoundDiv.appendChild(newCompoundRowDiv1);
32
33        var newCompoundRowDiv2 = document.createElement('div');
34        newCompoundRowDiv2.setAttribute('class', 'input');
35        newCompoundRowDiv2.innerHTML = '<input type="text" name="sa_compound" value="">';
36        newCompoundDiv.appendChild(newCompoundRowDiv2);
37
38        var newCompoundRowDiv3 = document.createElement('div');
39        newCompoundRowDiv3.setAttribute('class', 'descriptionSA');
40        newCompoundRowDiv3.innerHTML = "Operator";
41        newCompoundDiv.appendChild(newCompoundRowDiv3);
42
43        var newCompoundRowDiv4 = document.createElement('div');
44        newCompoundRowDiv4.setAttribute('class', 'input');
45        var newSelectBox = document.getElementById('operatorInput');
46        newCompoundRowDiv4 = newSelectBox.cloneNode(true);
47        newCompoundDiv.appendChild(newCompoundRowDiv4);
48
49        var newCompoundRowDiv5 = document.createElement('div');
50        newCompoundRowDiv5.setAttribute('class', 'descriptionSA');
51        newCompoundRowDiv5.innerHTML = "Value";
52        newCompoundDiv.appendChild(newCompoundRowDiv5);
53
54        var newCompoundRowDiv6 = document.createElement('div');
55        newCompoundRowDiv6.setAttribute('class', 'input');
56        newCompoundRowDiv6.innerHTML = "<input type='text' name='sa_value' value=''>";
57        newCompoundDiv.appendChild(newCompoundRowDiv6); 
58        compoundGroup.appendChild(newCompoundDiv);
59
60        compoundCounter++;
61        // alert('Handler for adding compound called: ' + compoundCounter);
62        return true;
63    });
64
65      $('#addTranscriptome').click(function() {
66          var transcriptomeGroup = document.getElementById('transcriptomeGroup');
67          var newTranscriptomeDiv = document.createElement('div');
68          newTranscriptomeDiv.setAttribute('id', 'transcriptomeRow' + transcriptomeCounter);
69
70          var newTranscriptomeRowDiv1 = document.createElement('div');
71          newTranscriptomeRowDiv1.setAttribute('class', 'description');
72          newTranscriptomeRowDiv1.innerHTML = "Gene/pathway";
73          newTranscriptomeDiv.appendChild(newTranscriptomeRowDiv1);
74
75          var newTranscriptomeRowDiv2 = document.createElement('div');
76          newTranscriptomeRowDiv2.setAttribute('class', 'input');
77          newTranscriptomeRowDiv2.innerHTML = '<input type="text" name="genepath" value="">';
78          newTranscriptomeDiv.appendChild(newTranscriptomeRowDiv2);
79
80          var newTranscriptomeRowDiv3 = document.createElement('div');
81          newTranscriptomeRowDiv3.setAttribute('class', 'description');
82          newTranscriptomeRowDiv3.innerHTML = "Type of regulations";
83          newTranscriptomeDiv.appendChild(newTranscriptomeRowDiv3);
84
85          var newTranscriptomeRowDiv4 = document.createElement('div');
86          newTranscriptomeRowDiv4.setAttribute('class', 'input');
87          var newSelectBox = document.getElementById('regulationInput');
88          newTranscriptomeRowDiv4 = newSelectBox.cloneNode(true);
89          newTranscriptomeRowDiv4.setAttribute('id', 'regulation' + transcriptomeCounter);
90          newTranscriptomeDiv.appendChild(newTranscriptomeRowDiv4);
91
92          transcriptomeGroup.appendChild(newTranscriptomeDiv);
93
94          transcriptomeCounter++;
95          // alert('Handler for adding transcriptome called: ' + transcriptomeCounter);
96          return true;
97      });
98
99  });
100
Note: See TracBrowser for help on using the repository browser.