Implement UI for "Reply To" and "Followup To". Implement also the menu file/close.

This commit is contained in:
ducarroz%netscape.com 1999-07-21 20:45:59 +00:00
Родитель 7676f5ae1e
Коммит 2184bcf83c
5 изменённых файлов: 65 добавлений и 10 удалений

Просмотреть файл

@ -423,11 +423,15 @@ function Recipients2CompFields(msgCompFields)
var addrTo = "";
var addrCc = "";
var addrBcc = "";
var addrReply = "";
var addrNg = "";
var addrFollow = "";
var to_Sep = "";
var cc_Sep = "";
var bcc_Sep = "";
var reply_Sep = "";
var ng_Sep = "";
var follow_Sep = "";
while ((inputField = document.getElementById("msgRecipient#" + i)))
{
@ -436,10 +440,12 @@ function Recipients2CompFields(msgCompFields)
{
switch (document.getElementById("msgRecipientType#" + i).value)
{
case "addr_to" : addrTo += to_Sep + fieldValue; to_Sep = ","; break;
case "addr_cc" : addrCc += cc_Sep + fieldValue; cc_Sep = ","; break;
case "addr_bcc" : addrBcc += bcc_Sep + fieldValue; bcc_Sep = ","; break;
case "addr_newsgroups" : addrNg += ng_Sep + fieldValue; ng_Sep = ","; break;
case "addr_to" : addrTo += to_Sep + fieldValue; to_Sep = ","; break;
case "addr_cc" : addrCc += cc_Sep + fieldValue; cc_Sep = ","; break;
case "addr_bcc" : addrBcc += bcc_Sep + fieldValue; bcc_Sep = ","; break;
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;
}
}
i ++;
@ -447,7 +453,9 @@ function Recipients2CompFields(msgCompFields)
msgCompFields.SetTo(addrTo);
msgCompFields.SetCc(addrCc);
msgCompFields.SetBcc(addrBcc);
msgCompFields.SetReplyTo(addrReply);
msgCompFields.SetNewsgroups(addrNg);
msgCompFields.SetFollowupTo(addrFollow);
}
else
dump("Message Compose Error: msgCompFields is null (ExtractRecipients)");
@ -482,6 +490,14 @@ function CompFields2Recipients(msgCompFields)
i ++;
}
fieldValue = msgCompFields.GetReplyTo();
if (fieldValue != "" && i <= MAX_RECIPIENTS)
{
document.getElementById("msgRecipient#" + i).value = fieldValue;
document.getElementById("msgRecipientType#" + i).value = "addr_reply";
i ++;
}
fieldValue = msgCompFields.GetNewsgroups();
if (fieldValue != "" && i <= MAX_RECIPIENTS)
{
@ -490,6 +506,14 @@ function CompFields2Recipients(msgCompFields)
i ++;
}
fieldValue = msgCompFields.GetFollowupTo();
if (fieldValue != "" && i <= MAX_RECIPIENTS)
{
document.getElementById("msgRecipient#" + i).value = fieldValue;
document.getElementById("msgRecipientType#" + i).value = "addr_followup";
i ++;
}
for (; i <= MAX_RECIPIENTS; i++)
{
document.getElementById("msgRecipient#" + i).value = "";
@ -520,3 +544,9 @@ function SetComposeWindowTitle(event)
/* i18N todo: this should not be hard coded, either */
window.title = "Compose: "+ newTitle;
}
function CloseWindow()
{
if (msgCompose)
msgCompose.CloseWindow();
}

Просмотреть файл

@ -68,7 +68,7 @@ Rights Reserved.
<menuitem name="&printPreviewCmd.label;" cmd="nsCmd:BrowserPrintPreview"/>
<menuitem name="&printCmd.label;" cmd="nsCmd:BrowserPrint"/>
<separator/>
<menuitem name="&closeCmd.label;" cmd="nsCmd:BrowserClose"/>
<menuitem name="&closeCmd.label;" onclick="CloseWindow();"/>
</menu>
<menu name="&editMenu.label;">
<menuitem name="&undoCmd.label;" cmd="nsCmd:ComposeNYI"/>
@ -194,7 +194,9 @@ Rights Reserved.
<html:option value="addr_to">&toAddr.label;</html:option>
<html:option value="addr_cc">&ccAddr.label;</html:option>
<html:option value="addr_bcc">&bccAddr.label;</html:option>
<html:option value="addr_reply">&replyAddr.label;</html:option>
<html:option value="addr_newsgroups">&newsgroupsAddr.label;</html:option>
<html:option value="addr_followup">&followupAddr.label;</html:option>
</html:select>
</box>
<box align="vertical" flex="100%">
@ -250,6 +252,22 @@ Rights Reserved.
</box>
<box align="vertical" flex="40%">
<html:div flex="100%">[attachment box]</html:div>
<!--
<tree id="attachment" flex="100%">
<treehead>
<treerow>
<treecell>Attachment</treecell>
</treerow>
</treehead>
<treechildren id="attachmentTree" open="true">
<treeitem> <treerow> <treecell>aaaa</treecell> </treerow> </treeitem>
<treeitem> <treerow> <treecell>bbb</treecell> </treerow> </treeitem>
<treeitem> <treerow> <treecell>ccc</treecell> </treerow> </treeitem>
<treeitem> <treerow> <treecell>dddd</treecell> </treerow> </treeitem>
<treeitem> <treerow> <treecell>eeeee</treecell> </treerow> </treeitem>
</treechildren>
</tree>
-->
</box>
</box>
</toolbar>

Просмотреть файл

@ -5,7 +5,9 @@
<!ENTITY toAddr.label "To:">
<!ENTITY ccAddr.label "Cc:">
<!ENTITY bccAddr.label "Bcc:">
<!ENTITY newsgroupsAddr.label "Newsgroups:">
<!ENTITY replyAddr.label "Reply:">
<!ENTITY newsgroupsAddr.label "Newsgroup:">
<!ENTITY followupAddr.label "Followup:">
<!ENTITY subject.label "Subject:">
@ -25,7 +27,7 @@
<!ENTITY printSetupCmd.label ".Print Setup">
<!ENTITY printPreviewCmd.label ".Print Preview">
<!ENTITY printCmd.label ".Print">
<!ENTITY closeCmd.label ".Close">
<!ENTITY closeCmd.label "Close">
<!-- Edit menu items -->
<!ENTITY editMenu.label ".Edit">

Просмотреть файл

@ -286,7 +286,10 @@ nsresult nsMsgCompose::_SendMsg(MSG_DeliverMode deliverMode,
identity->GetOrganization(getter_Copies(organization));
m_compFields->SetFrom(NS_CONST_CAST(char*, (const char *)email));
m_compFields->SetReplyTo(NS_CONST_CAST(char*, (const char *)replyTo));
//Set the reply-to only if the user have not specified one in the message
const char * reply = m_compFields->GetReplyTo();
if (reply == nsnull || *reply == 0)
m_compFields->SetReplyTo(NS_CONST_CAST(char*, (const char *)replyTo));
m_compFields->SetOrganization(NS_CONST_CAST(char*, (const char *)organization));
#ifdef DEBUG_ducarroz

Просмотреть файл

@ -5,7 +5,9 @@
<!ENTITY toAddr.label "To:">
<!ENTITY ccAddr.label "Cc:">
<!ENTITY bccAddr.label "Bcc:">
<!ENTITY newsgroupsAddr.label "Newsgroups:">
<!ENTITY replyAddr.label "Reply:">
<!ENTITY newsgroupsAddr.label "Newsgroup:">
<!ENTITY followupAddr.label "Followup:">
<!ENTITY subject.label "Subject:">
@ -25,7 +27,7 @@
<!ENTITY printSetupCmd.label ".Print Setup">
<!ENTITY printPreviewCmd.label ".Print Preview">
<!ENTITY printCmd.label ".Print">
<!ENTITY closeCmd.label ".Close">
<!ENTITY closeCmd.label "Close">
<!-- Edit menu items -->
<!ENTITY editMenu.label ".Edit">