Changeset 8476


Ignore:
Timestamp:
05/08/07 13:53:09 (17 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/db
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/db/menu.js

    r8466 r8476  
    44statarr = new Array( 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    55
     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
    69function setdisplays ()
    710{
    8     var blub="";
     11    //reset variable for fShowHide
     12    var sh="";
    913    for (var i = 0 ; i < ids.length ; i++)
    1014    {
     15        //get element for each possible menu element
    1116        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
    1221        if (d)
    1322            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
    1425        if (i==0)
    1526            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
    2135function hide(el,img)
    2236{
     
    2943}
    3044
     45//function to show one element of the menu and adapt the button accordingly
    3146function show(el,img)
    3247{
     
    3954}
    4055
     56//function to show or hide one element of the menu
    4157function showhide (id)
    4258{
     59    //get menu element and button for the element that has to be changed
    4360    var el = document.getElementById(id);
    4461    var img = document.getElementById(id+"button");
     62    //query current status and change it accordingly
    4563    if (el.style.display == 'block')
    4664        hide(el,img);
     
    4866    {
    4967        show(el,img);
     68        //expand the whole menu, when one element is shown
    5069        if (id!="showquery")
    5170        {
     
    5574        }
    5675    }
    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)
    6283function getdisplay()
    6384{
     85    //get value of fShowHide
    6486    var stat = document.getElementById("sh");
    6587    statvalue=stat.value;
     88    //set menu variables for each element accordingly
    6689    for (var i = 0 ; i < ids.length ; i++)
    6790    {
     91        //get value of this element from fShowHide
    6892        var status = statvalue.slice(i,i+1);
     93        //get elements of menu and button
    6994        var el = document.getElementById(ids[i]);
    7095        var img = document.getElementById(ids[i]+"button");
     96        //not all element exist on each page
    7197        if (!el)
    7298            continue;
     99        //show or hide element according to the status value
    73100        status==0 ? hide(el,img) : show(el,img);
    74101    }
    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
    78112primaries = new Array( "fSequenceFirst", "fRunNumber", "fDataSetNumber");
    79113
     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
    80122function showpulldown (id2)
    81123{
    82     var el = document.getElementById(id2);
    83     el.style.display="inline";
     124    //loop over primaries
    84125    for (var i = 0 ; i < primaries.length ; i++)
    85126    {
     127        //if primary is given id
    86128        if (primaries[i]==id2)
    87129        {
     130            //show first pulldown
    88131            var el2 = document.getElementById(primaries[i]);
    89132            el2.style.display="inline";
     133            //show pulldowns for limits
    90134            var el4 = document.getElementById(primaries[i]+"3");
    91135            el4.style.display="inline";
     
    95139        else
    96140        {
     141            //hide first pulldown
    97142            var el2 = document.getElementById(primaries[i]);
    98143            el2.style.display="none";
     144            //get element for second pulldown
    99145            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)
    100149            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
    103156            var el4 = document.getElementById(primaries[i]+"3");
    104157            el4.style.display="none";
     
    107160        }
    108161    }
    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
    116165function showpulldown2 ()
    117166{
     
    119168    for (var i = 0 ; i < primaries.length ; i++)
    120169    {
     170        //get element
    121171        var el = document.getElementById(primaries[i]);
     172        //if the first pulldown is shown, show also the second one
    122173        if (el.style.display=='inline')
    123174        {
     
    128179            count++;
    129180    }
     181    //if no first pulldown is shown, i.e. the primary has not yet been chosen,
     182    //all second pulldowns are shown
    130183    if (count==3)
    131184        for (var i = 0 ; i < primaries.length ; i++)
     
    135188        }
    136189
     190    //show the inputs for the ranges for the second pulldown
     191    //there is only one element for this (not one for each primary)
    137192    var el3 = document.getElementById("Range2");
    138193    el3.style.display="inline";
    139194}
    140195
     196//hides the second pulldown and inputs for the ranges
    141197function hidepulldown2 ()
    142198{
     
    150206}
    151207
     208//show the element for inserting the second set
    152209function showset2()
    153210{
     
    156213}
    157214
     215//hide the element for inserting the second set
    158216function hideset2()
    159217{
  • trunk/MagicSoft/Mars/datacenter/db/sequinfo-aio.php

    r8467 r8476  
    283283            printf("%s", $_GET["fShowHide"]);
    284284        else
    285             printf("1000000000");
     285            printf("1000000010");
    286286        printf("'>\n");
    287287        printf("<img id='allbutton' src='minus.png' alt='-' onclick='showhide(\"all\")'> <b>Menu</b>&nbsp;&nbsp;&nbsp;&nbsp; \n");
    288         printf("&nbsp;&nbsp;<img id='infobutton'   src='plus.png' alt='+' onClick='showhide(\"info\");showhide(\"info2\")'> SequInfo   \n");
    289         printf("&nbsp;&nbsp;<img id='statbutton'   src='plus.png' alt='+' onClick='showhide(\"stat\");showhide(\"fail\")'>  StatusInfo \n");
    290         printf("&nbsp;&nbsp;<img id='calbutton'    src='plus.png' alt='+' onClick='showhide(\"cal\")'>                      CalInfo    \n");
    291         printf("&nbsp;&nbsp;<img id='starbutton'   src='plus.png' alt='+' onClick='showhide(\"star\")'>                     StarInfo   \n");
    292         printf("&nbsp;&nbsp;<img id='limitsbutton' src='plus.png' alt='+' onClick='showhide(\"limits\")'>                   Limits     \n");
    293         printf("&nbsp;&nbsp;<img id='rangesbutton' src='plus.png' alt='+' onClick='showhide(\"ranges\")'>                   Ranges     \n");
     288        printf("&nbsp;&nbsp;<img id='infobutton'   src='plus.png'  alt='+' onClick='showhide(\"info\");showhide(\"info2\")'> SequInfo   \n");
     289        printf("&nbsp;&nbsp;<img id='statbutton'   src='plus.png'  alt='+' onClick='showhide(\"stat\");showhide(\"fail\")'>  StatusInfo \n");
     290        printf("&nbsp;&nbsp;<img id='calbutton'    src='plus.png'  alt='+' onClick='showhide(\"cal\")'>                      CalInfo    \n");
     291        printf("&nbsp;&nbsp;<img id='starbutton'   src='plus.png'  alt='+' onClick='showhide(\"star\")'>                     StarInfo   \n");
     292        printf("&nbsp;&nbsp;<img id='limitsbutton' src='plus.png'  alt='+' onClick='showhide(\"limits\")'>                   Limits     \n");
     293        printf("&nbsp;&nbsp;<img id='rangesbutton' src='minus.png' alt='-' onClick='showhide(\"ranges\")'>                   Ranges     \n");
    294294
    295295        printf(" <div id='all' style='display:block'>");
     
    303303        PrintLimitsMenu($limitsmean, $limitsmin, $limitsmax, $alias, "");
    304304
    305         printf(" <div id='ranges' style='display:none'>");
     305        printf(" <div id='ranges' style='display:block'>");
    306306        PrintZdRangeMenu($host,$user,$pw,$db);
    307307        PrintSequRangeMenu($host,$user,$pw,$db);
Note: See TracChangeset for help on using the changeset viewer.