]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman/WebContent/js/search.js
Salome HOME
69c905bb7c934442828774545f15cd0d59ac1ad9
[tools/siman.git] / Workspace / Siman / WebContent / js / search.js
1     function initialize (result) {
2       var state = search.state.value;
3
4       if (state == "inWORK" || state == "inDRAFT" || state == "inCHECK") {
5         search.visibility[0].checked  = true;        
6         search.visibility[1].disabled = true;
7         search.visibility[2].disabled = true;
8       }
9       if (result == "obsolete") changeFilter();   // Hides the result section and enables the Search button
10     }
11
12     function setState () {
13       var state = search.state.value;
14
15       if (state == "inWORK" || state == "inDRAFT" || state == "inCHECK") {
16         search.visibility[0].checked  = true;        
17         search.visibility[1].disabled = true;
18         search.visibility[2].disabled = true;
19       } else if (search.visibility[1].value != "onlypublic") {
20         search.visibility[1].disabled = false;
21         search.visibility[2].disabled = false;
22       }
23       changeFilter();
24     }
25
26     function changeFilter () {
27       var result = document.getElementById("resulist");
28
29       search.elements[0].value = "0";      // Marks the result obsolete
30       result.style.display     = "none";   // Hides the result section
31       search.refresh.disabled  = false;    // Enables the Search button
32     }
33
34     function removeContext (index) {
35         search.elements[0].value = index;
36         search.submit();
37     }
38
39     function cancel () {
40       search.elements[0].value = "-1";
41       search.submit();
42     }