Moved addressing widget from messengercompose to its own overlay

This commit is contained in:
hangas%netscape.com 1999-08-09 23:59:54 +00:00
parent 0dd4f2652b
commit bf63c48eed
4 changed files with 5 additions and 209 deletions

View File

@ -450,141 +450,6 @@ function getCurrentIdentity()
return identity;
}
function FillRecipientTypeCombobox()
{
originalCombo = document.getElementById("msgRecipientType#1");
if (originalCombo)
{
MAX_RECIPIENTS = 2;
while ((combo = document.getElementById("msgRecipientType#" + MAX_RECIPIENTS)))
{
for (var j = 0; j < originalCombo.length; j ++)
combo.add(new Option(originalCombo.options[j].text,
originalCombo.options[j].value), null);
MAX_RECIPIENTS++;
}
MAX_RECIPIENTS--;
}
}
function Recipients2CompFields(msgCompFields)
{
if (msgCompFields)
{
var i = 1;
var addrTo = "";
var addrCc = "";
var addrBcc = "";
var addrReply = "";
var addrNg = "";
var addrFollow = "";
var addrOther = "";
var to_Sep = "";
var cc_Sep = "";
var bcc_Sep = "";
var reply_Sep = "";
var ng_Sep = "";
var follow_Sep = "";
while ((inputField = document.getElementById("msgRecipient#" + i)))
{
fieldValue = inputField.value;
if (fieldValue != "")
{
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_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 ++;
}
msgCompFields.SetTo(addrTo);
msgCompFields.SetCc(addrCc);
msgCompFields.SetBcc(addrBcc);
msgCompFields.SetReplyTo(addrReply);
msgCompFields.SetNewsgroups(addrNg);
msgCompFields.SetFollowupTo(addrFollow);
msgCompFields.SetOtherRandomHeaders(addrOther);
}
else
dump("Message Compose Error: msgCompFields is null (ExtractRecipients)");
}
function CompFields2Recipients(msgCompFields)
{
if (msgCompFields)
{
var i = 1;
var fieldValue = msgCompFields.GetTo();
if (fieldValue != "" && i <= MAX_RECIPIENTS)
{
document.getElementById("msgRecipient#" + i).value = fieldValue;
document.getElementById("msgRecipientType#" + i).value = "addr_to";
i ++;
}
fieldValue = msgCompFields.GetCc();
if (fieldValue != "" && i <= MAX_RECIPIENTS)
{
document.getElementById("msgRecipient#" + i).value = fieldValue;
document.getElementById("msgRecipientType#" + i).value = "addr_cc";
i ++;
}
fieldValue = msgCompFields.GetBcc();
if (fieldValue != "" && i <= MAX_RECIPIENTS)
{
document.getElementById("msgRecipient#" + i).value = fieldValue;
document.getElementById("msgRecipientType#" + i).value = "addr_bcc";
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.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)
{
document.getElementById("msgRecipient#" + i).value = fieldValue;
document.getElementById("msgRecipientType#" + i).value = "addr_newsgroups";
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 = "";
document.getElementById("msgRecipientType#" + i).value = "addrTo";
}
}
}
function SetComposeWindowTitle(event)
{
/* dump("event = " + event + "\n"); */

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://global/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://messengercompose/content/addressingWidgetOverlay.xul"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://editor/skin/" type="text/css"?>
@ -249,64 +250,10 @@ Rights Reserved.
</html:select>
</box>
<spring style="height:0.5em"/>
<box align="horizontal" flex="100%">
<box align="vertical" flex="20%">
<box align="vertical" flex="100%">
<html:select id="msgRecipientType#1" flex="100%">
<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%">
<html:select id="msgRecipientType#2" flex="100%"/>
</box>
<box align="vertical" flex="100%">
<html:select id="msgRecipientType#3" flex="100%"/>
</box>
<box align="vertical" flex="100%">
<html:select id="msgRecipientType#4" flex="100%"/>
</box>
<box align="vertical" flex="100%">
<html:select id="msgRecipientType#5" flex="100%"/>
</box>
</box>
<box align="vertical" flex="80%">
<box align="vertical" flex="100%">
<html:input type="text" id="msgRecipient#1" flex="100%"
onkeyup="if (event.which == 13)
{ AutoCompleteAddress('msgRecipientType#1',
'msgRecipient#1'); }"/>
</box>
<box align="vertical" flex="100%">
<html:input type="text" id="msgRecipient#2" flex="100%"
onkeyup="if (event.which == 13)
{ AutoCompleteAddress('msgRecipientType#2',
'msgRecipient#2'); }"/>
</box>
<box align="vertical" flex="100%">
<html:input type="text" id="msgRecipient#3" flex="100%"
onkeyup="if (event.which == 13)
{ AutoCompleteAddress('msgRecipientType#3',
'msgRecipient#3'); }"/>
</box>
<box align="vertical" flex="100%">
<html:input type="text" id="msgRecipient#4" flex="100%"
onkeyup="if (event.which == 13)
{ AutoCompleteAddress('msgRecipientType#4',
'msgRecipient#4'); }"/>
</box>
<box align="vertical" flex="100%">
<html:input type="text" id="msgRecipient#5" flex="100%"
onkeyup="if (event.which == 13)
{ AutoCompleteAddress('msgRecipientType#5',
'msgRecipient#5'); }"/>
</box>
</box>
</box>
<!-- addressing widget -->
<box id="addressingWidget"/>
<box align="horizontal" flex="100%">
<html:div flex="20%">&subject.label;</html:div>
<html:input id="msgSubject" type="text" flex="80%" onkeyup="SetComposeWindowTitle(event.which);"/>

View File

@ -1,15 +1,7 @@
<!ENTITY msgComposeWindow.title "Message Compose">
<!-- address labels -->
<!ENTITY fromAddr.label "From:">
<!ENTITY toAddr.label "To:">
<!ENTITY ccAddr.label "Cc:">
<!ENTITY bccAddr.label "Bcc:">
<!ENTITY replyAddr.label "Reply:">
<!ENTITY newsgroupsAddr.label "Newsgroup:">
<!ENTITY followupAddr.label "Followup:">
<!ENTITY subject.label "Subject:">
<!ENTITY attachments.label "Attachments:">
<!-- menu items: the . means that the menu item isn't implemented yet -->

View File

@ -1,15 +1,7 @@
<!ENTITY msgComposeWindow.title "Message Compose">
<!-- address labels -->
<!ENTITY fromAddr.label "From:">
<!ENTITY toAddr.label "To:">
<!ENTITY ccAddr.label "Cc:">
<!ENTITY bccAddr.label "Bcc:">
<!ENTITY replyAddr.label "Reply:">
<!ENTITY newsgroupsAddr.label "Newsgroup:">
<!ENTITY followupAddr.label "Followup:">
<!ENTITY subject.label "Subject:">
<!ENTITY attachments.label "Attachments:">
<!-- menu items: the . means that the menu item isn't implemented yet -->