security/manager/pki/resources/content/deletecert.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/manager/pki/resources/content/deletecert.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,88 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +const nsIX509Cert = Components.interfaces.nsIX509Cert;
     1.9 +const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
    1.10 +const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
    1.11 +const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
    1.12 +const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
    1.13 +
    1.14 +var certdb;
    1.15 +var gParams;
    1.16 +
    1.17 +function setWindowName()
    1.18 +{
    1.19 +  gParams = window.arguments[0].QueryInterface(nsIDialogParamBlock);
    1.20 +  
    1.21 +  var typeFlag = gParams.GetString(0);
    1.22 +  var numberOfCerts = gParams.GetInt(0);
    1.23 +  
    1.24 +  var bundle = document.getElementById("pippki_bundle");
    1.25 +  var title;
    1.26 +  var confirm;
    1.27 +  var impact;
    1.28 +  
    1.29 +  if(typeFlag == "mine_tab")
    1.30 +  {
    1.31 +     title = bundle.getString("deleteUserCertTitle");
    1.32 +     confirm = bundle.getString("deleteUserCertConfirm");
    1.33 +     impact = bundle.getString("deleteUserCertImpact");
    1.34 +  }
    1.35 +  else if(typeFlag == "websites_tab")
    1.36 +  {
    1.37 +     title = bundle.getString("deleteSslCertTitle3");
    1.38 +     confirm = bundle.getString("deleteSslCertConfirm3");
    1.39 +     impact = bundle.getString("deleteSslCertImpact3");
    1.40 +  }
    1.41 +  else if(typeFlag == "ca_tab")
    1.42 +  {
    1.43 +     title = bundle.getString("deleteCaCertTitle2");
    1.44 +     confirm = bundle.getString("deleteCaCertConfirm2");
    1.45 +     impact = bundle.getString("deleteCaCertImpactX2");
    1.46 +  }
    1.47 +  else if(typeFlag == "others_tab")
    1.48 +  {
    1.49 +     title = bundle.getString("deleteEmailCertTitle");
    1.50 +     confirm = bundle.getString("deleteEmailCertConfirm");
    1.51 +     impact = bundle.getString("deleteEmailCertImpactDesc");
    1.52 +  }
    1.53 +  else if(typeFlag == "orphan_tab")
    1.54 +  {
    1.55 +     title = bundle.getString("deleteOrphanCertTitle");
    1.56 +     confirm = bundle.getString("deleteOrphanCertConfirm");
    1.57 +     impact = "";
    1.58 +  }
    1.59 +  else
    1.60 +  {
    1.61 +     return;
    1.62 +  }
    1.63 +  var confirReference = document.getElementById('confirm');
    1.64 +  var impactReference = document.getElementById('impact');
    1.65 +  document.title = title;
    1.66 +  
    1.67 +  setText("confirm",confirm);
    1.68 +
    1.69 +  var box=document.getElementById("certlist");
    1.70 +  var text;
    1.71 +  for(var x=0;x<numberOfCerts;x++)
    1.72 +  {
    1.73 +    text = document.createElement("text");
    1.74 +    text.setAttribute("value", gParams.GetString(x+1));
    1.75 +    box.appendChild(text);
    1.76 +  }
    1.77 +
    1.78 +  setText("impact",impact);
    1.79 +}
    1.80 +
    1.81 +function doOK()
    1.82 +{
    1.83 +  gParams.SetInt(1, 1); // means OK
    1.84 +  return true;
    1.85 +}
    1.86 +
    1.87 +function doCancel()
    1.88 +{
    1.89 +  gParams.SetInt(1, 0); // means CANCEL
    1.90 +  return true;
    1.91 +}

mercurial