]> WPIA git - gigi.git/commitdiff
fix: advanced options on create certificate don't collapse
authorFelix Dörre <felix@dogcraft.de>
Thu, 16 Jun 2016 10:09:26 +0000 (12:09 +0200)
committerFelix Dörre <felix@dogcraft.de>
Thu, 16 Jun 2016 16:30:14 +0000 (18:30 +0200)
fixes #14

Change-Id: I0292692a7375ccb613bea3a6d12967dc54a453db

src/org/cacert/gigi/Gigi.templ
static/static/css/cacert.css
static/static/expert.js [new file with mode: 0644]
static/static/menu.js

index 419389a826658ed1ad59b367e09c4097a1b63709..259ff4f39de32913251ad93a743707ab77fa88b2 100644 (file)
@@ -15,8 +15,8 @@
         
         <script src="<?=$static?>/js/jquery.min.js"></script>
         <script src="<?=$static?>/js/bootstrap.min.js"></script>
+        <script src="<?=$static?>/expert.js"></script>
     </head>
-    <body>
 <body>
 <nav class="navbar navbar-default">
   <div class="container-fluid">
index bb7bde7114b951572c50e26d56979c3eba05adbe..b9443976c787ad4c0dd4021db8edb1435922f629 100644 (file)
@@ -14,3 +14,6 @@
 .tooltip-inner {
     white-space:pre-wrap;
 }
+.experthidden{
+       display: none;
+}
diff --git a/static/static/expert.js b/static/static/expert.js
new file mode 100644 (file)
index 0000000..a4d14ac
--- /dev/null
@@ -0,0 +1,32 @@
+(function() {
+       function showExpert(isExpert)
+       {
+         var elements = document.getElementsByClassName("expert");
+         for(var i = 0; elements.length > i; i++)
+         {
+           if(!isExpert) {
+               elements[i].setAttribute("class","expert experthidden");
+           } else {
+               elements[i].setAttribute("class","expert");
+           }
+         }
+       }
+       function init(){
+               showExpert(false);
+               var expert = document.getElementById("expertbox");
+               if(expert !== null) {
+                       expert.onchange = (function(expert){return function(){showExpert(expert.checked)}})(expert);
+               }
+       }
+       (function(oldLoad) {
+               if (oldLoad == undefined) {
+                       window.onload = init;
+               } else {
+                       window.onload = function() {
+                               init();
+                               oldLoad();
+                       }
+               }
+       })(window.onload);
+
+})();
index 023e62440757526865c0a33e05b8fdcf948d0526..bcaee0d8860666258df22ecd387995b6694fafb8 100644 (file)
                        }
                }
        }
-       function showExpert(a)
-       {
-         b=document.getElementsByClassName("expert");
-         for(i=0;b.length>i;i++)
-         {
-           if(!a) {b[i].setAttribute("class","expert experthidden"); }
-           else {b[i].setAttribute("class","expert");}
-         }
-         b=document.getElementsByClassName("expertoff");
-         for(i=0;b.length>i;i++)
-         {
-          b[i].setAttribute("class","");
-         }
 
-       }
-       function init(){
-               initMenu();
-               showExpert(false);
-               var expert = document.getElementById("expertbox");
-               if(expert !== null) {
-                       expert.onchange = (function(expert){return function(){showExpert(expert.checked)}})(expert);
-               }
-       }
        (function(oldLoad) {
                if (oldLoad == undefined) {
                        window.onload = init;
                } else {
                        window.onload = function() {
-                               init();
+                               initMenu();
                                oldLoad();
                        }
                }