From 3fb2c848ca1b6604856f113722c48f729e2dc174 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Tue, 27 Jul 1999 01:11:10 +0000 Subject: [PATCH] other header in compose feature, from dmose@netscape.com and endico@netscape.com. --- .../resources/content/MsgComposeCommands.js | 24 +++++++++++++++++++ .../resources/content/messengercompose.xul | 1 + mailnews/mailnews.js | 1 + modules/libpref/src/init/mailnews.js | 1 + 4 files changed, 27 insertions(+) diff --git a/mailnews/compose/resources/content/MsgComposeCommands.js b/mailnews/compose/resources/content/MsgComposeCommands.js index 6a1af673f623..70628a49b2e6 100644 --- a/mailnews/compose/resources/content/MsgComposeCommands.js +++ b/mailnews/compose/resources/content/MsgComposeCommands.js @@ -23,12 +23,14 @@ msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMs var msgCompose = null; var MAX_RECIPIENTS = 0; +var other_header = ""; var update_compose_title_as_you_type = true; var prefs = Components.classes["component://netscape/preferences"].getService(); if (prefs) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); if (prefs) { update_compose_title_as_you_type = prefs.GetBoolPref("mail.update_compose_title_as_you_type"); + other_header = prefs.CopyCharPref("mail.compose.other.header"); } } @@ -181,6 +183,17 @@ function ComposeStartup() } } +function ComposeLoad() +{ + dump("\nComposeLoad from XUL\n"); + var selectNode = document.getElementById('msgRecipientType#1'); + + if (other_header != "") { + var opt = new Option(other_header + ":", "addr_other"); + selectNode.add(opt, null); + } +} + function ComposeUnload(calledFromExit) { dump("\nComposeUnload from XUL\n"); @@ -441,6 +454,7 @@ function Recipients2CompFields(msgCompFields) var addrReply = ""; var addrNg = ""; var addrFollow = ""; + var addrOther = ""; var to_Sep = ""; var cc_Sep = ""; var bcc_Sep = ""; @@ -461,6 +475,7 @@ function Recipients2CompFields(msgCompFields) case "addr_reply" : addrReply += reply_Sep + fieldValue; reply_Sep = ","; break; case "addr_newsgroups" : addrNg += ng_Sep + fieldValue; ng_Sep = ","; break; case "addr_followup" : addrFollow += follow_Sep + fieldValue; follow_Sep = ","; break; + case "addr_other" : addrOther += other_header + ": " + fieldValue + "\n"; break; } } i ++; @@ -471,6 +486,7 @@ function Recipients2CompFields(msgCompFields) msgCompFields.SetReplyTo(addrReply); msgCompFields.SetNewsgroups(addrNg); msgCompFields.SetFollowupTo(addrFollow); + msgCompFields.SetOtherRandomHeaders(addrOther); } else dump("Message Compose Error: msgCompFields is null (ExtractRecipients)"); @@ -513,6 +529,14 @@ function CompFields2Recipients(msgCompFields) i ++; } + fieldValue = msgCompFields.GetOtherRandomHeaders(); + if (fieldValue != "") + { + document.getElementById("msgRecipient#" + i).value = fieldValue; + document.getElementById("msgRecipientType#" + i).value = "addr_other"; + i ++; + } + fieldValue = msgCompFields.GetNewsgroups(); if (fieldValue != "" && i <= MAX_RECIPIENTS) { diff --git a/mailnews/compose/resources/content/messengercompose.xul b/mailnews/compose/resources/content/messengercompose.xul index 14dc3dfbfb86..1d2af8a3df9e 100644 --- a/mailnews/compose/resources/content/messengercompose.xul +++ b/mailnews/compose/resources/content/messengercompose.xul @@ -29,6 +29,7 @@ Rights Reserved.