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

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

Multiple changes in structure/view/logic

  • Property svn:keywords set to Date Author Rev
File size: 4.4 KB
Line 
1/**
2 * simpleQuery javascript functions
3 *
4 * @author  Vincent Ludden
5 * @since   20100526
6 * @package query
7 *
8 * Revision information:
9 * $Rev: 650 $
10 * $Author: vinlud $
11 * $Date: 2010-07-13 16:26:50 +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
59        //var newCompoundRowDiv7 = document.createElement('div');
60        //newCompoundRowDiv7.setAttribute('class', 'delete');
61        //newCompoundRowDiv7.innerHTML = "delete";
62        //newCompoundDiv.appendChild(newCompoundRowDiv7);
63        compoundGroup.appendChild(newCompoundDiv);
64
65        compoundCounter++;
66        // alert('Handler for adding compound called: ' + compoundCounter);
67        return true;
68    });
69
70      $('#addTranscriptome').click(function() {
71          var transcriptomeGroup = document.getElementById('transcriptomeGroup');
72          var newTranscriptomeDiv = document.createElement('div');
73          newTranscriptomeDiv.setAttribute('id', 'transcriptomeRow' + transcriptomeCounter);
74
75          var newTranscriptomeRowDiv1 = document.createElement('div');
76          newTranscriptomeRowDiv1.setAttribute('class', 'description');
77          newTranscriptomeRowDiv1.innerHTML = "Gene/pathway";
78          newTranscriptomeDiv.appendChild(newTranscriptomeRowDiv1);
79
80          var newTranscriptomeRowDiv2 = document.createElement('div');
81          newTranscriptomeRowDiv2.setAttribute('class', 'input');
82          newTranscriptomeRowDiv2.innerHTML = '<input type="text" name="genepath" value="">';
83          newTranscriptomeDiv.appendChild(newTranscriptomeRowDiv2);
84
85          var newTranscriptomeRowDiv3 = document.createElement('div');
86          newTranscriptomeRowDiv3.setAttribute('class', 'description');
87          newTranscriptomeRowDiv3.innerHTML = "Type of regulations";
88          newTranscriptomeDiv.appendChild(newTranscriptomeRowDiv3);
89
90          var newTranscriptomeRowDiv4 = document.createElement('div');
91          newTranscriptomeRowDiv4.setAttribute('class', 'input');
92          var newSelectBox = document.getElementById('regulationInput');
93          newTranscriptomeRowDiv4 = newSelectBox.cloneNode(true);
94          newTranscriptomeRowDiv4.setAttribute('id', 'regulation' + transcriptomeCounter);
95          newTranscriptomeDiv.appendChild(newTranscriptomeRowDiv4);
96
97          transcriptomeGroup.appendChild(newTranscriptomeDiv);
98
99          transcriptomeCounter++;
100          // alert('Handler for adding transcriptome called: ' + transcriptomeCounter);
101          return true;
102      });
103
104  });
105
Note: See TracBrowser for help on using the repository browser.