]> WPIA git - gigi.git/commitdiff
fix: hide non-activated domain pingconfigs
authorFelix Dörre <felix@dogcraft.de>
Sat, 13 Aug 2016 11:31:16 +0000 (13:31 +0200)
committerFelix Dörre <felix@dogcraft.de>
Sat, 13 Aug 2016 12:39:59 +0000 (14:39 +0200)
Change-Id: I8215ddc94dcb66788868f581604608b3c8c50343

src/org/cacert/gigi/pages/account/domain/PingConfigForm.templ
static/static/js/expert.js

index 62cb70fd3319989aec7c830653e6f8597efed8f9..16c50a3e53a8bb742d2f3d0d90bf7b692f5f50e5 100644 (file)
@@ -1,6 +1,6 @@
 <h3><?=_Verification mechanisms?></h3>
 
-<div class="panel panel-info">
+<div class="panel panel-info panel-activatable">
   <div class="panel-heading"><input type="checkbox" name="emailType" value="y"<?=$!mail?>> <?=_Verify by sending an email to authoritative email addresses?></div>
   <div class="panel-body">
     <?=_Select the destination mail address:?><br/>
     <? } ?>
   </div>
 </div>
-<div class="panel panel-info">
+<div class="panel panel-info panel-activatable">
   <div class="panel-heading"><input type="checkbox" name="DNSType" value="y"<?=$!dns?>> <?=_Verify by reading DNS-TXT entries?></div>
   <div class="panel-body">
     <?=_Please insert the following DNS TXT entry into the Zone-file of your domain:?><br/>
     <pre><?=$tokenName?>._cacert._auth IN TXT <?=$tokenValue?></pre>
   </div>
 </div>
-<div class="panel panel-info">
+<div class="panel panel-info panel-activatable">
   <div class="panel-heading"><input type="checkbox" name="HTTPType" value="y"<?=$!http?>> <?=_Verify by reading HTTP-content?></div>
   <div class="panel-body">
     <?=_Please make the following content available under ?><pre class='string'>http://<span class='exampleDomain'>example.org</span>/cacert-<?=$tokenName?>.txt</pre><br/>
     <pre><?=$tokenValue?></pre>
   </div>
 </div>
-<div class="panel panel-info">
+<div class="panel panel-info panel-activatable">
   <div class="panel-heading"><input type="checkbox" name="SSLType" value="y"<?=$!ssl?>> <?=_Verify by searching for installed certificate.?></div>
   <div class="panel-body">
     <?=_Please list up to four services using your certificate. You need to have one of them up and using a valid SomeCA certificate or a specific self-signed certificate in order to pass this test?>:
index a4d14acac95b41e0fbaabbfb335749e7399b6362..09987b170124e1ab14859d96400319a63d59379a 100644 (file)
                if(expert !== null) {
                        expert.onchange = (function(expert){return function(){showExpert(expert.checked)}})(expert);
                }
+               $(".panel-activatable").map(function() {
+                       var panel = $(this);
+                       var refresh = function(){
+                               if(this.checked){
+                                       panel.find(".panel-body").removeClass("hidden");
+                               }else{
+                                       panel.find(".panel-body").addClass("hidden");
+                               }
+                       };
+                       panel.find(".panel-heading [type=\"checkbox\"]").map(refresh);
+                       panel.find(".panel-heading [type=\"checkbox\"]").click(refresh);
+                       return this.id;
+               });
        }
        (function(oldLoad) {
                if (oldLoad == undefined) {