From b0a1ab6042d6c854d09799eba4cb01c19b8ccf5a Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Thu, 1 Nov 2001 22:35:58 +0000 Subject: [PATCH] NOT PART OF THE BUILD Adding new smime extension files. NOT PART OF THE BUILD git-svn-id: svn://10.0.0.236/trunk@107001 18797224-902f-48f8-a5cc-f745e15eee43 --- .../smime/resources/content/am-smime.js | 133 +++ .../smime/resources/content/am-smime.xul | 97 ++ .../smime/resources/content/contents.rdf | 29 + .../smime/resources/content/makefile.win | 45 + .../resources/content/msgCompSMIMEOverlay.js | 115 +++ .../resources/content/msgCompSMIMEOverlay.xul | 45 + .../smime/resources/content/smime.js | 11 + .../smime/resources/locale/en-US/am-smime.dtd | 11 + .../locale/en-US/am-smime.properties | 3 + .../smime/resources/locale/en-US/contents.rdf | 23 + .../smime/resources/locale/en-US/makefile.win | 38 + .../locale/en-US/msgCompSMIMEOverlay.dtd | 7 + .../smime/resources/locale/makefile.win | 26 + .../mailnews/extensions/smime/src/MANIFEST | 1 + .../mailnews/extensions/smime/src/Makefile.in | 88 ++ .../extensions/smime/src/makefile.win | 87 ++ .../smime/src/nsMsgComposeSecure.cpp | 921 ++++++++++++++++++ .../extensions/smime/src/nsMsgComposeSecure.h | 92 ++ .../extensions/smime/src/smime-service.js | 111 +++ 19 files changed, 1883 insertions(+) create mode 100644 mozilla/mailnews/extensions/smime/resources/content/am-smime.js create mode 100644 mozilla/mailnews/extensions/smime/resources/content/am-smime.xul create mode 100644 mozilla/mailnews/extensions/smime/resources/content/contents.rdf create mode 100644 mozilla/mailnews/extensions/smime/resources/content/makefile.win create mode 100644 mozilla/mailnews/extensions/smime/resources/content/msgCompSMIMEOverlay.js create mode 100644 mozilla/mailnews/extensions/smime/resources/content/msgCompSMIMEOverlay.xul create mode 100644 mozilla/mailnews/extensions/smime/resources/content/smime.js create mode 100644 mozilla/mailnews/extensions/smime/resources/locale/en-US/am-smime.dtd create mode 100644 mozilla/mailnews/extensions/smime/resources/locale/en-US/am-smime.properties create mode 100644 mozilla/mailnews/extensions/smime/resources/locale/en-US/contents.rdf create mode 100644 mozilla/mailnews/extensions/smime/resources/locale/en-US/makefile.win create mode 100644 mozilla/mailnews/extensions/smime/resources/locale/en-US/msgCompSMIMEOverlay.dtd create mode 100644 mozilla/mailnews/extensions/smime/resources/locale/makefile.win create mode 100644 mozilla/mailnews/extensions/smime/src/MANIFEST create mode 100644 mozilla/mailnews/extensions/smime/src/Makefile.in create mode 100644 mozilla/mailnews/extensions/smime/src/makefile.win create mode 100644 mozilla/mailnews/extensions/smime/src/nsMsgComposeSecure.cpp create mode 100644 mozilla/mailnews/extensions/smime/src/nsMsgComposeSecure.h create mode 100644 mozilla/mailnews/extensions/smime/src/smime-service.js diff --git a/mozilla/mailnews/extensions/smime/resources/content/am-smime.js b/mozilla/mailnews/extensions/smime/resources/content/am-smime.js new file mode 100644 index 00000000000..745980a1adc --- /dev/null +++ b/mozilla/mailnews/extensions/smime/resources/content/am-smime.js @@ -0,0 +1,133 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998-2001 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributors: + * ddrinan@netscape.com + * Scott MacGregor + */ + +var gIdentity; +var gPref = null; +var gEncryptionCertName = null; +var gEncryptIfPossible = null; +var gEncryptAlways = null; +var gSignCertName = null; +var gSignMessages = null; + +function onInit() +{ + // initialize all of our elements based on the current identity values.... + gEncryptionCertName = document.getElementById("identity.encryption_cert_name"); + gEncryptIfPossible = document.getElementById("identity.encrypt_mail_if_possible"); + gEncryptAlways = document.getElementById("identity.encrypt_mail_always"); + gSignCertName = document.getElementById("identity.signing_cert_name"); + gSignMessages = document.getElementById("identity.sign_mail"); + + gEncryptionCertName.value = gIdentity.getUnicharAttribute("encryption_cert_name"); + gEncryptIfPossible.checked = gIdentity.getBoolAttribute("encrypt_mail_if_possible"); + gEncryptAlways.checked = gIdentity.getBoolAttribute("encrypt_mail_always"); + if (!gEncryptionCertName.value) + { + gEncryptAlways.setAttribute("disabled", true); + } + + // we currently don't support encrypt if possible so keep it disabled for now... + gEncryptIfPossible.setAttribute("disabled", true); + + gSignCertName.value = gIdentity.getUnicharAttribute("signing_cert_name"); + gSignMessages.checked = gIdentity.getBoolAttribute("sign_mail"); + if (!gSignCertName.value) + { + gSignMessages.setAttribute("disabled", true); + } +} + +function onPreInit(account, accountValues) +{ + gIdentity = account.defaultIdentity; +} + +function onSave() +{ +} + +function onLockPreference() +{ + dump("XXX on lock\n"); +} + + +// Does the work of disabling an element given the array which contains xul id/prefstring pairs. +// Also saves the id/locked state in an array so that other areas of the code can avoid +// stomping on the disabled state indiscriminately. +function disableIfLocked( prefstrArray ) +{ + if (!gLockedPref) + gLockedPref = new Array; + + for (i=0; i + + + + + + + + + + + +