]> jspc29.x-matter.uni-frankfurt.de Git - mvdsensorcontrol.git/commitdiff
now with checkboxes to hide unchecked included config files
authorMichael Wiebusch <stratomaster@gmx.net>
Thu, 4 Jul 2013 15:22:16 +0000 (17:22 +0200)
committerMichael Wiebusch <stratomaster@gmx.net>
Thu, 4 Jul 2013 15:22:16 +0000 (17:22 +0200)
xml_spielwiese/cgitest.pl

index 227fa0f0849513053da09b559bab42c11751c66a..4242f400a07c49695c1a093d80c31547aaccee40 100755 (executable)
@@ -212,11 +212,15 @@ sub print_ancestorInfo {
                my $tableNestingDepth = @ancestryList;
                for my $ancestor ( reverse(@ancestryList) ) {
                        print "<table class=fileLevel" . $fileLevelHash{$ancestor} . ">";
-                       print "<tr><td>";
+                       print "<tr><td colspan=2>";
                }
                for my $ancestor (@ancestryList) {
 
-                       print "$ancestor</td>";
+                       print "</td></tr><tr><td>$ancestor </td><td valign='bottom'>";
+                       print "<img src='./eye16.png' onclick=''></img>";
+                       print
+"<input type='checkbox' checked=true onchange='hideThisFileLevel(\"fileLevel"
+                         . $fileLevelHash{$ancestor} . "\",this.checked)'></td>";
                        if ( $fileLevelHash{$ancestor} eq "1" ) {
                                print <<EOF;
 <td class='button_move' title='unlink includes' onclick='changeAncestor("")'>&nbsp;X&nbsp;</td>
@@ -767,7 +771,11 @@ sub print_registers {
                die "xmlfile given to sub print_registers is unknown";
        }
        my @registers = sort by_name $xmltree->findnodes("/MAPS/register");
-       print "<table class=\"registers\">";
+       print "<table class=\"registers\"";
+       if ( $xmlfile eq $setfile ) {
+               print "id='configFileRegisters'";
+       }
+       print ">";
        for my $register (@registers) {
 
                my $registerName  = $register->findvalue("./\@name");
@@ -906,7 +914,9 @@ EOF
                if (   ( any2dec($fieldValue) < 0 )
                        or ( any2dec($fieldValue) > $maxFieldVal ) )
                {
-                       print "<tr class='fieldError'><td colspan = 4 align='center'>!!!Above value not in allowed range!!!</td></tr>";    # just debug
+                       print
+"<tr class='fieldError'><td colspan = 4 align='center'>!!!Above value not in allowed range!!!</td></tr>"
+                         ;    # just debug
                }
        }
        print "</table>";
@@ -1134,6 +1144,26 @@ function collapseElement(elementId) {
        }
 }
 
+function hideThisFileLevel(classname,checked){
+
+var array = document.getElementById("configFileRegisters").getElementsByClassName(classname);
+
+for(var i = 0; i < array.length; i++)
+{
+    if(checked){
+     array[i].style.visibility = 'visible';
+       
+    }else{
+       
+    array[i].style.visibility = 'collapse';
+    }
+    
+
+}
+
+
+}
+
 </script>
 
 <script language="javascript">