Changeset 8476 for trunk/MagicSoft/Mars/datacenter/db
- Timestamp:
- 05/08/07 13:53:09 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/db
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/menu.js
r8466 r8476 4 4 statarr = new Array( 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); 5 5 6 //function to get the input for fShowHide from the page 7 //called each time, when an element is changed with showhide() 8 //and when the page is reloaded 6 9 function setdisplays () 7 10 { 8 var blub=""; 11 //reset variable for fShowHide 12 var sh=""; 9 13 for (var i = 0 ; i < ids.length ; i++) 10 14 { 15 //get element for each possible menu element 11 16 var d = document.getElementById(ids[i]); 17 //if element exists, check if it is currently displayed 18 //set the value in the status array accordingly 19 //0: element is not shown 20 //1: element is shown 12 21 if (d) 13 22 d.style.display == 'none' ? statarr[i]=0 : statarr[i]=1; 23 //set the value of 'all' to 0 24 //to make sure, that the whole menu is hidden in case of a query 14 25 if (i==0) 15 26 statarr[i]=0; 16 blub=blub+statarr[i]; 17 } 18 return blub; 19 } 20 27 //add value to the variable for fShowHide 28 sh=sh+statarr[i]; 29 } 30 //return variable for fShowHide 31 return sh; 32 } 33 34 //function to hide one element of the menu and adapt the button accordingly 21 35 function hide(el,img) 22 36 { … … 29 43 } 30 44 45 //function to show one element of the menu and adapt the button accordingly 31 46 function show(el,img) 32 47 { … … 39 54 } 40 55 56 //function to show or hide one element of the menu 41 57 function showhide (id) 42 58 { 59 //get menu element and button for the element that has to be changed 43 60 var el = document.getElementById(id); 44 61 var img = document.getElementById(id+"button"); 62 //query current status and change it accordingly 45 63 if (el.style.display == 'block') 46 64 hide(el,img); … … 48 66 { 49 67 show(el,img); 68 //expand the whole menu, when one element is shown 50 69 if (id!="showquery") 51 70 { … … 55 74 } 56 75 } 57 58 var soso = document.getElementById("sh"); 59 soso.value = setdisplays(); 60 } 61 76 //update the value of fShowHide (id sh) 77 var fShowHide = document.getElementById("sh"); 78 fShowHide.value = setdisplays(); 79 } 80 81 //function getting the info, how the menu is from fShowHide 82 //is called when the page is loaded (s. index-header.html) 62 83 function getdisplay() 63 84 { 85 //get value of fShowHide 64 86 var stat = document.getElementById("sh"); 65 87 statvalue=stat.value; 88 //set menu variables for each element accordingly 66 89 for (var i = 0 ; i < ids.length ; i++) 67 90 { 91 //get value of this element from fShowHide 68 92 var status = statvalue.slice(i,i+1); 93 //get elements of menu and button 69 94 var el = document.getElementById(ids[i]); 70 95 var img = document.getElementById(ids[i]+"button"); 96 //not all element exist on each page 71 97 if (!el) 72 98 continue; 99 //show or hide element according to the status value 73 100 status==0 ? hide(el,img) : show(el,img); 74 101 } 75 } 76 77 //functions and arrays needed for the function for plotdb.php 102 //set the value of fShowHide (id sh) 103 // needed here to make sure, that the whole menu is hidden 104 // even if nothing has been expanded (needed since 'ranges' 105 // is expanded by default) 106 var fShowHide = document.getElementById("sh"); 107 fShowHide.value = setdisplays(); 108 } 109 110 111 //functions and arrays needed for the menu of plotdb.php 78 112 primaries = new Array( "fSequenceFirst", "fRunNumber", "fDataSetNumber"); 79 113 114 //for each primary (run#, seq#, dataset#) two pulldowns exist 115 //the first is needed when plotting versus primary ('prim' is chosen) 116 //the second is only needed when plotting versus a second value ('val' is chosen) 117 118 //shows the first pulldown for a given primary 119 // and hides the ones of the other primaries 120 // and hides the second one for the primary if needed 121 //is called when a primary is chosen from the pulldown 80 122 function showpulldown (id2) 81 123 { 82 var el = document.getElementById(id2); 83 el.style.display="inline"; 124 //loop over primaries 84 125 for (var i = 0 ; i < primaries.length ; i++) 85 126 { 127 //if primary is given id 86 128 if (primaries[i]==id2) 87 129 { 130 //show first pulldown 88 131 var el2 = document.getElementById(primaries[i]); 89 132 el2.style.display="inline"; 133 //show pulldowns for limits 90 134 var el4 = document.getElementById(primaries[i]+"3"); 91 135 el4.style.display="inline"; … … 95 139 else 96 140 { 141 //hide first pulldown 97 142 var el2 = document.getElementById(primaries[i]); 98 143 el2.style.display="none"; 144 //get element for second pulldown 99 145 var el3 = document.getElementById(primaries[i]+"2"); 146 //if second pulldown is shown, 147 // hide second pulldown 148 // and show second pulldown for chosen primary (id2) 100 149 if (el3.style.display=='inline') 101 var add=id2; 102 el3.style.display="none"; 150 { 151 var el6 = document.getElementById(id2+"2"); 152 el6.style.display="inline"; 153 el3.style.display="none"; 154 } 155 //hide pulldowns for limits 103 156 var el4 = document.getElementById(primaries[i]+"3"); 104 157 el4.style.display="none"; … … 107 160 } 108 161 } 109 if (add) 110 { 111 var el5 = document.getElementById(id2+"2"); 112 el5.style.display="inline"; 113 } 114 } 115 162 } 163 164 //shows the second pulldown and inputs for the ranges 116 165 function showpulldown2 () 117 166 { … … 119 168 for (var i = 0 ; i < primaries.length ; i++) 120 169 { 170 //get element 121 171 var el = document.getElementById(primaries[i]); 172 //if the first pulldown is shown, show also the second one 122 173 if (el.style.display=='inline') 123 174 { … … 128 179 count++; 129 180 } 181 //if no first pulldown is shown, i.e. the primary has not yet been chosen, 182 //all second pulldowns are shown 130 183 if (count==3) 131 184 for (var i = 0 ; i < primaries.length ; i++) … … 135 188 } 136 189 190 //show the inputs for the ranges for the second pulldown 191 //there is only one element for this (not one for each primary) 137 192 var el3 = document.getElementById("Range2"); 138 193 el3.style.display="inline"; 139 194 } 140 195 196 //hides the second pulldown and inputs for the ranges 141 197 function hidepulldown2 () 142 198 { … … 150 206 } 151 207 208 //show the element for inserting the second set 152 209 function showset2() 153 210 { … … 156 213 } 157 214 215 //hide the element for inserting the second set 158 216 function hideset2() 159 217 { -
trunk/MagicSoft/Mars/datacenter/db/sequinfo-aio.php
r8467 r8476 283 283 printf("%s", $_GET["fShowHide"]); 284 284 else 285 printf("10000000 00");285 printf("1000000010"); 286 286 printf("'>\n"); 287 287 printf("<img id='allbutton' src='minus.png' alt='-' onclick='showhide(\"all\")'> <b>Menu</b> \n"); 288 printf(" <img id='infobutton' src='plus.png' alt='+' onClick='showhide(\"info\");showhide(\"info2\")'> SequInfo \n");289 printf(" <img id='statbutton' src='plus.png' alt='+' onClick='showhide(\"stat\");showhide(\"fail\")'> StatusInfo \n");290 printf(" <img id='calbutton' src='plus.png' alt='+' onClick='showhide(\"cal\")'> CalInfo \n");291 printf(" <img id='starbutton' src='plus.png' alt='+' onClick='showhide(\"star\")'> StarInfo \n");292 printf(" <img id='limitsbutton' src='plus.png' alt='+' onClick='showhide(\"limits\")'> Limits \n");293 printf(" <img id='rangesbutton' src=' plus.png' alt='+' onClick='showhide(\"ranges\")'> Ranges \n");288 printf(" <img id='infobutton' src='plus.png' alt='+' onClick='showhide(\"info\");showhide(\"info2\")'> SequInfo \n"); 289 printf(" <img id='statbutton' src='plus.png' alt='+' onClick='showhide(\"stat\");showhide(\"fail\")'> StatusInfo \n"); 290 printf(" <img id='calbutton' src='plus.png' alt='+' onClick='showhide(\"cal\")'> CalInfo \n"); 291 printf(" <img id='starbutton' src='plus.png' alt='+' onClick='showhide(\"star\")'> StarInfo \n"); 292 printf(" <img id='limitsbutton' src='plus.png' alt='+' onClick='showhide(\"limits\")'> Limits \n"); 293 printf(" <img id='rangesbutton' src='minus.png' alt='-' onClick='showhide(\"ranges\")'> Ranges \n"); 294 294 295 295 printf(" <div id='all' style='display:block'>"); … … 303 303 PrintLimitsMenu($limitsmean, $limitsmin, $limitsmax, $alias, ""); 304 304 305 printf(" <div id='ranges' style='display: none'>");305 printf(" <div id='ranges' style='display:block'>"); 306 306 PrintZdRangeMenu($host,$user,$pw,$db); 307 307 PrintSequRangeMenu($host,$user,$pw,$db);
Note:
See TracChangeset
for help on using the changeset viewer.