mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-19 21:53:19 +00:00
Monotone-Parent: 9b4c2eadc3d38aa14dc504c80d606df816c2f924
Monotone-Revision: 0df73c55c83973b5088ccb3350d103006525098c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-03T14:38:51 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
2006-10-03 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/UIxMailEditor.js: add support for
|
||||
additions of different types (to, cc, bcc) of recipients from the
|
||||
address book.
|
||||
|
||||
* UI/Common/UIxPageFrame.m ([UIxPageFrame -doctype]): added the
|
||||
"<?xml..." header.
|
||||
|
||||
|
||||
@@ -1,6 +1,73 @@
|
||||
function addContact(selectorId, contactId, contactName)
|
||||
function addContact(tag, fullContactName, contactId, contactName, contactEmail)
|
||||
{
|
||||
window.alert("contact: " + contactId
|
||||
+ "; contactName: " + contactName
|
||||
+ "; selectorId: " + selectorId);
|
||||
if (!mailIsRecipient(contactEmail)) {
|
||||
var neededOptionValue = 0;
|
||||
if (tag == "cc")
|
||||
neededOptionValue = 1;
|
||||
else if (tag == "bcc")
|
||||
neededOptionValue = 2;
|
||||
var rows = $("addressList").childNodes;
|
||||
// log ("tag: /" + tag + "/");
|
||||
// log ("neededOptionValue: " + neededOptionValue);
|
||||
|
||||
var stop = false;
|
||||
var counter = 0;
|
||||
var currentRow = $('row_' + counter);
|
||||
while (currentRow
|
||||
&& !stop) {
|
||||
var currentValue = currentRow.childNodes[0].childNodes[0].value;
|
||||
if (currentValue == neededOptionValue) {
|
||||
// log ("currentValue: " + currentValue);
|
||||
stop = true;
|
||||
insertContact($("addr_" + counter), contactName, contactEmail);
|
||||
}
|
||||
counter++;
|
||||
currentRow = $('row_' + counter);
|
||||
}
|
||||
|
||||
if (!stop) {
|
||||
fancyAddRow(false, "");
|
||||
$("row_" + counter).childNodes[0].childNodes[0].value
|
||||
= neededOptionValue;
|
||||
insertContact($("addr_" + counter), contactName, contactEmail);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function mailIsRecipient(mailto) {
|
||||
var isRecipient = false;
|
||||
|
||||
var counter = 0;
|
||||
var currentRow = $('row_' + counter);
|
||||
|
||||
var email = extractEmailAddress(mailto);
|
||||
|
||||
while (currentRow && !isRecipient) {
|
||||
var currentValue = $("addr_"+counter).value;
|
||||
if (currentValue.indexOf(email) > -1)
|
||||
isRecipient = true;
|
||||
else
|
||||
{
|
||||
counter++;
|
||||
currentRow = $('row_' + counter);
|
||||
}
|
||||
}
|
||||
|
||||
return isRecipient;
|
||||
}
|
||||
|
||||
function insertContact(inputNode, contactName, contactEmail) {
|
||||
var value = '' + inputNode.value;
|
||||
|
||||
var newContact = contactName;
|
||||
if (newContact.length > 0)
|
||||
newContact += ' <' + contactEmail + '>';
|
||||
else
|
||||
newContact = contactEmail;
|
||||
|
||||
if (value.length > 0)
|
||||
value += ", ";
|
||||
value += newContact;
|
||||
|
||||
inputNode.value = value;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ function removeLastEditedRowIfEmpty() {
|
||||
addresses.removeChild(addr);
|
||||
}
|
||||
addressList = $("addressList");
|
||||
senderRow = this.findRowWithIndex(idx);
|
||||
senderRow = $("row_" + idx);
|
||||
addressList.removeChild(senderRow);
|
||||
this.adjustInlineAttachmentListHeight(this);
|
||||
}
|
||||
@@ -170,11 +170,6 @@ function findAddressWithIndex(idx) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function findRowWithIndex(idx) {
|
||||
var id = 'row_' + idx;
|
||||
return $(id);
|
||||
}
|
||||
|
||||
function getIndexFromIdentifier(id) {
|
||||
return id.split('_')[1];
|
||||
}
|
||||
@@ -245,15 +240,5 @@ function adjustInlineAttachmentListHeight(sender) {
|
||||
}
|
||||
}
|
||||
|
||||
function hideInlineAttachmentList(sender) {
|
||||
var e;
|
||||
|
||||
// xVisibility('compose_rightside', false);
|
||||
e = $('compose_rightside');
|
||||
e.style.display = 'none';
|
||||
e = $('compose_leftside');
|
||||
e.style.width = "100%";
|
||||
}
|
||||
|
||||
/* addressbook helpers */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user