1 var contactSelectorAction = 'mailer-contacts';
3 function addContact(tag, fullContactName, contactId, contactName, contactEmail)
5 if (!mailIsRecipient(contactEmail)) {
6 var neededOptionValue = 0;
10 neededOptionValue = 2;
14 var currentRow = $('row_' + counter);
17 var currentValue = currentRow.childNodesWithTag("span")[1].childNodesWithTag("input")[0].value;
18 if (currentValue == neededOptionValue) {
20 insertContact($("addr_" + counter), contactName, contactEmail);
23 currentRow = $('row_' + counter);
27 fancyAddRow(false, "");
28 $("row_" + counter).childNodesWithTag("span")[0].childNodesWithTag("select")[0].value
30 insertContact($("addr_" + counter), contactName, contactEmail);
35 function mailIsRecipient(mailto) {
36 var isRecipient = false;
39 var currentRow = $('row_' + counter);
41 var email = extractEmailAddress(mailto).toUpperCase();
43 while (currentRow && !isRecipient) {
44 var currentValue = $("addr_"+counter).value.toUpperCase();
45 if (currentValue.indexOf(email) > -1)
50 currentRow = $('row_' + counter);
57 function insertContact(inputNode, contactName, contactEmail) {
58 var value = '' + inputNode.value;
60 var newContact = contactName;
61 if (newContact.length > 0)
62 newContact += ' <' + contactEmail + '>';
64 newContact = contactEmail;
70 inputNode.value = value;
73 function toggleAttachments() {
74 var div = $("attachmentsArea");
75 if (div.style.display)
76 div.style.display = "";
78 div.style.display = "block;";
83 function updateInlineAttachmentList(sender, attachments) {
86 var div = $("attachmentsArea");
88 count = attachments.length;
92 for (var i = 0; i < count; i++) {
93 text = text + attachments[i];
94 text = text + '<br />';
97 var e = $('compose_attachments_list');
99 if (!div.style.display)
100 div.style.display = "block;";
103 div.style.display = "";