~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/security/manager/pki/resources/content/serverCrlExpired.js

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 
2
 *
 
3
 * The contents of this file are subject to the Mozilla Public
 
4
 * License Version 1.1 (the "License"); you may not use this file
 
5
 * except in compliance with the License. You may obtain a copy of
 
6
 * the License at http://www.mozilla.org/MPL/
 
7
 *
 
8
 * Software distributed under the License is distributed on an "AS
 
9
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
10
 * implied. See the License for the specific language governing
 
11
 * rights and limitations under the License.
 
12
 *
 
13
 * The Original Code is mozilla.org code.
 
14
 *
 
15
 * The Initial Developer of the Original Code is Netscape
 
16
 * Communications Corporation.  Portions created by Netscape are
 
17
 * Copyright (C) 1998 Netscape Communications Corporation. All
 
18
 * Rights Reserved.
 
19
 *
 
20
 * Contributor(s):
 
21
 *  David Drinan <ddrinan@netscape.com>
 
22
 */
 
23
 
 
24
 
 
25
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
 
26
const nsIPKIParamBlock    = Components.interfaces.nsIPKIParamBlock;
 
27
const nsIX509Cert         = Components.interfaces.nsIX509Cert;
 
28
 
 
29
var dialogParams;
 
30
var pkiParams;
 
31
var bundle;
 
32
 
 
33
function onLoad()
 
34
{
 
35
  pkiParams    = window.arguments[0].QueryInterface(nsIPKIParamBlock);
 
36
  dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
 
37
  var isupport = pkiParams.getISupportAtIndex(1);
 
38
  var cert = isupport.QueryInterface(nsIX509Cert);
 
39
  bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
 
40
 
 
41
  //  Organization
 
42
  addAttributeFromCert('organization', cert.organization);
 
43
  //  Organizational Unit
 
44
  addAttributeFromCert('orgunit', cert.organizationalUnit);
 
45
 
 
46
  //Set the focus so key press events work.
 
47
  document.getElementById('ok-button').focus();
 
48
}
 
49
 
 
50
function doOK()
 
51
{
 
52
  dialogParams.SetInt(1,1);
 
53
  window.close();
 
54
}
 
55
 
 
56
function doCancel()
 
57
{
 
58
  dialogParams.SetInt(1,0);
 
59
  window.close();
 
60
}
 
61
 
 
62
function managerCrls()
 
63
{
 
64
  window.open('chrome://pippki/content/crlManager.xul',  "",
 
65
              'chrome,centerscreen,dialog,resizable');
 
66
}
 
67
 
 
68
function addAttributeFromCert(nodeName, value)
 
69
{
 
70
  var node = document.getElementById(nodeName);
 
71
  if (!value) {
 
72
    value = bundle.GetStringFromName('notPresent');  
 
73
  }
 
74
  node.setAttribute('value',value)
 
75
}