Bug 260364 - Fixup radiogroups to use new .value functionality of radio.xml pki patch r=kaie
authorIan Neal <iann_cvs@blueyonder.co.uk>
Fri, 10 Jun 2011 16:56:17 +0100
changeset 71374 b7502e9fbd30a2992d97e6964a4dc69b5a99f959
parent 71373 49e57fa259dc21511d34be89a6f08a10f4ddd832
child 71375 46dbe6bfd8fea8fb715efca160c873010868bb93
child 71479 a9e0ace0ec38a17760f63d0b2c516b2b3ce0053f
push id159
push usereakhgari@mozilla.com
push dateTue, 16 Aug 2011 17:53:11 +0000
treeherdermozilla-beta@8786e3e49240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaie
bugs260364
milestone7.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 260364 - Fixup radiogroups to use new .value functionality of radio.xml pki patch r=kaie
security/manager/pki/resources/content/editcerts.js
security/manager/pki/resources/content/editemailcert.xul
security/manager/pki/resources/content/editsslcert.xul
--- a/security/manager/pki/resources/content/editcerts.js
+++ b/security/manager/pki/resources/content/editcerts.js
@@ -143,31 +143,25 @@ function doLoadForSSLCert()
   }
 /*
   if(cacert == null)
   {
      var editButton = document.getElementById('editca-button');
 	 editButton.setAttribute("disabled","true");
   }
 */  
-  var trustssl = document.getElementById("trustSSLCert");
-  var notrustssl = document.getElementById("dontTrustSSLCert");
-  if (certdb.isCertTrusted(cert, nsIX509Cert.SERVER_CERT, 
-                          nsIX509CertDB.TRUSTED_SSL)) {
-    trustssl.radioGroup.selectedItem = trustssl;
-  } else {
-    trustssl.radioGroup.selectedItem = notrustssl;
-  }
+  var sslTrust = document.getElementById("sslTrustGroup");
+  sslTrust.value = certdb.isCertTrusted(cert, nsIX509Cert.SERVER_CERT, 
+                                        nsIX509CertDB.TRUSTED_SSL);
 }
 
 function doSSLOK()
 {
-  var ssl = document.getElementById("trustSSLCert");
-  //var checked = ssl.getAttribute("value");
-  var trustssl = ssl.selected ? nsIX509CertDB.TRUSTED_SSL : 0;
+  var sslTrust = document.getElementById("sslTrustGroup");
+  var trustssl = sslTrust.value ? nsIX509CertDB.TRUSTED_SSL : 0;
   //
   //  Set the cert trust
   //
   certdb.setCertTrust(cert, nsIX509Cert.SERVER_CERT, trustssl);
   return true;
 }
 
 function doLoadForEmailCert()
@@ -204,31 +198,25 @@ function doLoadForEmailCert()
   }
 /*
   if(cacert == null)
   {
      var editButton = document.getElementById('editca-button');
 	 editButton.setAttribute("disabled","true");
   }
 */  
-  var trustemail = document.getElementById("trustEmailCert");
-  var notrustemail = document.getElementById("dontTrustEmailCert");
-  if (certdb.isCertTrusted(cert, nsIX509Cert.EMAIL_CERT, 
-                          nsIX509CertDB.TRUSTED_EMAIL)) {
-    trustemail.radioGroup.selectedItem = trustemail;
-  } else {
-    trustemail.radioGroup.selectedItem = notrustemail;
-  }
+  var sslTrust = document.getElementById("sslTrustGroup");
+  sslTrust.value = certdb.isCertTrusted(cert, nsIX509Cert.EMAIL_CERT, 
+                                        nsIX509CertDB.TRUSTED_EMAIL);
 }
 
 function doEmailOK()
 {
-  var email = document.getElementById("trustEmailCert");
-  //var checked = ssl.getAttribute("value");
-  var trustemail = email.selected ? nsIX509CertDB.TRUSTED_EMAIL : 0;
+  var sslTrust = document.getElementById("sslTrustGroup");
+  var trustemail = sslTrust.value ? nsIX509CertDB.TRUSTED_EMAIL : 0;
   //
   //  Set the cert trust
   //
   certdb.setCertTrust(cert, nsIX509Cert.EMAIL_CERT, trustemail);
   return true;
 }
 
 function editCaTrust()
@@ -254,17 +242,17 @@ function getCaCertForEntityCert(cert)
    var lastSubjectName="";
    while(true)
    {
      if(nextCertInChain == null)
      {
         return null;
      }
      if((nextCertInChain.type == nsIX509Cert.CA_CERT) || 
-                                 (nextCertInChain.subjectName = lastSubjectName))
+        (nextCertInChain.subjectName == lastSubjectName))
      {
         break;
      }
 
      lastSubjectName = nextCertInChain.subjectName;
      nextCertInChain = nextCertInChain.issuer;
    }
 
--- a/security/manager/pki/resources/content/editemailcert.xul
+++ b/security/manager/pki/resources/content/editemailcert.xul
@@ -55,19 +55,17 @@
 
   <description id="certmsg"/>
   <description id="issuer"/>
   <separator/>
   <description id="explanations"/>
   <separator />
   <description>&certmgr.editemailcert.edittrust;</description>
   <radiogroup id="sslTrustGroup">
-    <radio label="&certmgr.editemailcert.dotrust;"
-           id="trustEmailCert"/>
-    <radio label="&certmgr.editemailcert.donttrust;"
-           id="dontTrustEmailCert"/>
+    <radio label="&certmgr.editemailcert.dotrust;" value="true"/>
+    <radio label="&certmgr.editemailcert.donttrust;" value="false"/>
   </radiogroup>
   <hbox>
     <button id="editca-button" label="&certmgr.editca.label;"
             oncommand="editCaTrust();"/> 
   </hbox>
 
 </dialog>
--- a/security/manager/pki/resources/content/editsslcert.xul
+++ b/security/manager/pki/resources/content/editsslcert.xul
@@ -55,19 +55,17 @@
 
   <description id="certmsg"/>
   <description id="issuer"/>
   <separator/>
   <description id="explanations"/>
   <separator />
   <description>&certmgr.editsslcert.edittrust;</description>
   <radiogroup id="sslTrustGroup">
-    <radio label="&certmgr.editsslcert.dotrust;"
-           id="trustSSLCert"/>
-    <radio label="&certmgr.editsslcert.donttrust;"
-           id="dontTrustSSLCert"/>
+    <radio label="&certmgr.editsslcert.dotrust;" value="true"/>
+    <radio label="&certmgr.editsslcert.donttrust;" value="false"/>
   </radiogroup>
   <hbox>
     <button id="editca-button" label="&certmgr.editca.label;"
             oncommand="editCaTrust();"/> 
   </hbox>
 
 </dialog>