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 419389a..259ff4f 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 bb7bde7..b944397 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 023e624..bcaee0d 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();
                        }
                }