Monotone-Parent: eb80137abbc0c0a426a654921250804b1c3d92ab

Monotone-Revision: 9afbcfbc31ab96049b1a603edff5f9ed02a4a00d

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-02-07T23:09:16
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-02-07 23:09:16 +00:00
parent 4b7785fcf7
commit 4485c71cd0
2 changed files with 42 additions and 5 deletions
+35 -4
View File
@@ -169,7 +169,7 @@ function onContactFoldersContextMenu(event) {
$(this).selectElement();
}
function onContactContextMenu(event, element) { log ("onContactContextMenu");
function onContactContextMenu(event, element) {// log ("onContactContextMenu");
var menu = $("contactMenu");
Event.observe(menu, "mousedown", onContactContextMenuHide, false);
@@ -326,6 +326,14 @@ function onMenuWriteToContact(event) {
window.close();
}
function onMenuAIMContact(event) {
var contactId = document.menuTarget.getAttribute('id');
var contactRow = $(contactId);
var aimCell = contactRow.down('td', 2);
window.location.href = "aim:goim?ScreenName=" + aimCell.firstChild.nodeValue;
}
function onMenuDeleteContact(event) {
uixDeleteSelectedContacts(this);
}
@@ -808,7 +816,7 @@ function onMenuSharing(event) {
function onContactFoldersMenuPrepareVisibility() {
var folders = $("contactFolders");
var selected = folders.getSelectedNodes();
var selected = folders.getSelectedNodes();
if (selected.length > 0) {
var folderOwner = selected[0].getAttribute("owner");
@@ -827,19 +835,42 @@ function onContactFoldersMenuPrepareVisibility() {
}
}
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;
}
+7 -1
View File
@@ -652,6 +652,11 @@ function onBodyClickMenuHandler(event) {
preventDefault(event);
}
function onMenuClickHandler(event) {
if (!this.hasClassName("disabled"))
this.menuCallback.apply(this, [event]);
}
function hideMenu(menuNode) {
var onHide;
@@ -1198,7 +1203,8 @@ function initMenu(menuDIV, callbacks) {
}
else {
node.observe("mouseup", onBodyClickMenuHandler);
node.observe("click", callback);
node.menuCallback = callback;
node.observe("click", onMenuClickHandler);
}
}
else