mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 18:51:28 +00:00
First Checked In.
This commit is contained in:
parent
759f852c0d
commit
e1781071b1
135
mailnews/compose/resources/content/addressingWidgetOverlay.js
Normal file
135
mailnews/compose/resources/content/addressingWidgetOverlay.js
Normal file
@ -0,0 +1,135 @@
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
246
mailnews/compose/resources/content/addressingWidgetOverlay.xul
Normal file
246
mailnews/compose/resources/content/addressingWidgetOverlay.xul
Normal file
@ -0,0 +1,246 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
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 Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
-->
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://messengercompose/skin/" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://messengercompose/locale/addressingWidgetOverlay.dtd">
|
||||
|
||||
|
||||
<overlay xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<html:script language="JavaScript" src="chrome://messengercompose/content/addressingWidgetOverlay.js"/>
|
||||
|
||||
<!-- Addressing Widget -->
|
||||
<box id="addressingWidget"
|
||||
align="vertical"
|
||||
style="background-color:white; border:solid black 1px">
|
||||
|
||||
<tree id="addressingWidgetTree"> <!-- for fixed height: height:5em; -->
|
||||
<treecol style="width:15%"/>
|
||||
<treecol style="width:85%"/>
|
||||
|
||||
<treechildren id="addressWidgetBody">
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell>
|
||||
<html:select id="msgRecipientType#1">
|
||||
<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>
|
||||
</treecell>
|
||||
<treecell>
|
||||
<html:input type="text" id="msgRecipient#1" style="width:90%"
|
||||
onkeyup="if (event.which == 13)
|
||||
{ AutoCompleteAddress('msgRecipientType#1',
|
||||
'msgRecipient#1'); }"/>
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell>
|
||||
<html:select id="msgRecipientType#2"/>
|
||||
</treecell>
|
||||
<treecell>
|
||||
<html:input type="text" id="msgRecipient#2" style="width:90%"
|
||||
onkeyup="if (event.which == 13)
|
||||
{ AutoCompleteAddress('msgRecipientType#2',
|
||||
'msgRecipient#2'); }"/>
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell>
|
||||
<html:select id="msgRecipientType#3"/>
|
||||
</treecell>
|
||||
<treecell>
|
||||
<html:input type="text" id="msgRecipient#3" style="width:90%"
|
||||
onkeyup="if (event.which == 13)
|
||||
{ AutoCompleteAddress('msgRecipientType#3',
|
||||
'msgRecipient#3'); }"/>
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell>
|
||||
<html:select id="msgRecipientType#4"/>
|
||||
</treecell>
|
||||
<treecell>
|
||||
<html:input type="text" id="msgRecipient#4" style="width:90%"
|
||||
onkeyup="if (event.which == 13)
|
||||
{ AutoCompleteAddress('msgRecipientType#4',
|
||||
'msgRecipient#4'); }"/>
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell>
|
||||
<html:select id="msgRecipientType#5"/>
|
||||
</treecell>
|
||||
<treecell>
|
||||
<html:input type="text" id="msgRecipient#5" style="width:90%"
|
||||
onkeyup="if (event.which == 13)
|
||||
{ AutoCompleteAddress('msgRecipientType#5',
|
||||
'msgRecipient#5'); }"/>
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
<!--
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell>
|
||||
<html:select id="msgRecipientType#6"/>
|
||||
</treecell>
|
||||
<treecell>
|
||||
<html:input type="text" id="msgRecipient#6" style="width:90%"
|
||||
onkeyup="if (event.which == 13)
|
||||
{ AutoCompleteAddress('msgRecipientType#6',
|
||||
'msgRecipient#6'); }"/>
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell>
|
||||
<html:select id="msgRecipientType#7"/>
|
||||
</treecell>
|
||||
<treecell>
|
||||
<html:input type="text" id="msgRecipient#7" style="width:90%"
|
||||
onkeyup="if (event.which == 13)
|
||||
{ AutoCompleteAddress('msgRecipientType#7',
|
||||
'msgRecipient#7'); }"/>
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell>
|
||||
<html:select id="msgRecipientType#8"/>
|
||||
</treecell>
|
||||
<treecell>
|
||||
<html:input type="text" id="msgRecipient#8" style="width:90%"
|
||||
onkeyup="if (event.which == 13)
|
||||
{ AutoCompleteAddress('msgRecipientType#8',
|
||||
'msgRecipient#8'); }"/>
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell>
|
||||
<html:select id="msgRecipientType#9"/>
|
||||
</treecell>
|
||||
<treecell>
|
||||
<html:input type="text" id="msgRecipient#9" style="width:90%"
|
||||
onkeyup="if (event.which == 13)
|
||||
{ AutoCompleteAddress('msgRecipientType#9',
|
||||
'msgRecipient#9'); }"/>
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
-->
|
||||
|
||||
</treechildren>
|
||||
</tree>
|
||||
</box>
|
||||
|
||||
|
||||
<!--
|
||||
<box align="horizontal" flex="100%">
|
||||
|
||||
<box align="vertical">
|
||||
<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="100%">
|
||||
<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>
|
||||
-->
|
||||
|
||||
</overlay>
|
@ -0,0 +1,8 @@
|
||||
<!-- address labels -->
|
||||
<!ENTITY toAddr.label "To:">
|
||||
<!ENTITY ccAddr.label "Cc:">
|
||||
<!ENTITY bccAddr.label "Bcc:">
|
||||
<!ENTITY replyAddr.label "Reply:">
|
||||
<!ENTITY newsgroupsAddr.label "Newsgroup:">
|
||||
<!ENTITY followupAddr.label "Followup:">
|
||||
|
@ -0,0 +1,8 @@
|
||||
<!-- address labels -->
|
||||
<!ENTITY toAddr.label "To:">
|
||||
<!ENTITY ccAddr.label "Cc:">
|
||||
<!ENTITY bccAddr.label "Bcc:">
|
||||
<!ENTITY replyAddr.label "Reply:">
|
||||
<!ENTITY newsgroupsAddr.label "Newsgroup:">
|
||||
<!ENTITY followupAddr.label "Followup:">
|
||||
|
Loading…
Reference in New Issue
Block a user