return [creds objectAtIndex:0]; /* the user */
}
-- (NSString *) urlHostString
+- (NSString *) _urlHostString
{
NSDictionary *mailAccount;
NSString *username, *escUsername, *hostString;
else
[urlString appendString: @"imap://"];
- host = [self urlHostString];
+ host = [self _urlHostString];
if (![host rangeOfString: @"@"].length)
[urlString appendFormat: @"%@@", [self imap4LoginFromHTTP]];
[urlString appendFormat: @"%@/", host];
$(this).selectElement();
}
-function onContactContextMenu(event, element) { log ("onContactContextMenu");
+function onContactContextMenu(event, element) {// log ("onContactContextMenu");
var menu = $("contactMenu");
Event.observe(menu, "mousedown", onContactContextMenuHide, false);
function onMenuWriteToContact(event) {
var contactId = document.menuTarget.getAttribute('id');
- var contactRow = $(contactId);
- var emailCell = contactRow.down('td', 1);
-
- if (!emailCell.firstChild) { // .nodeValue is the contact email address
- window.alert(labels["The selected contact has no email address."]);
- return false;
- }
openMailComposeWindow(ApplicationBaseURL + currentContactFolder
+ "/" + contactId + "/write");
window.close();
}
+function onMenuAIMContact(event) {
+ var contactRow = $(document.menuTarget.getAttribute('id'));
+ var aimCell = contactRow.down('td', 2);
+
+ window.location.href = "aim:goim?ScreenName=" + aimCell.firstChild.nodeValue;
+}
+
function onMenuDeleteContact(event) {
uixDeleteSelectedContacts(this);
}
function onContactFoldersMenuPrepareVisibility() {
var folders = $("contactFolders");
- var selected = folders.getSelectedNodes();
+ var selected = folders.getSelectedNodes();
if (selected.length > 0) {
var folderOwner = selected[0].getAttribute("owner");
}
}
+function onContactMenuPrepareVisibility() {
+ var contactId = document.menuTarget.getAttribute('id');
+ var contactRow = $(contactId);
+ var elements = $(this).down("ul").childElements();
+
+ var writeOption = elements[2];
+ var emailCell = contactRow.down('td', 1);
+ if (emailCell.firstChild)
+ writeOption.removeClassName("disabled");
+ else
+ writeOption.addClassName("disabled");
+
+ var aimOption = elements[3];
+ var aimCell = contactRow.down('td', 2);
+ if (aimCell.firstChild)
+ aimOption.removeClassName("disabled");
+ else
+ aimOption.addClassName("disabled");
+}
+
function getMenus() {
var menus = {};
menus["contactFoldersMenu"] = new Array(onMenuModify, "-", null,
null, "-", null, "-",
onMenuSharing);
menus["contactMenu"] = new Array(onMenuEditContact, "-",
- onMenuWriteToContact, null, "-",
- onMenuDeleteContact);
+ onMenuWriteToContact, onMenuAIMContact,
+ "-", onMenuDeleteContact);
menus["searchMenu"] = new Array(setSearchCriteria);
var contactFoldersMenu = $("contactFoldersMenu");
if (contactFoldersMenu)
contactFoldersMenu.prepareVisibility = onContactFoldersMenuPrepareVisibility;
+ var contactMenu = $("contactMenu");
+ if (contactMenu)
+ contactMenu.prepareVisibility = onContactMenuPrepareVisibility;
return menus;
}