See ChangeLog

Monotone-Parent: e0268121f41f4a9ac6226ffcf9e54efb36a9d2d3
Monotone-Revision: 5ca46341daec14901e918e991004a22b7ada9f49

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2008-09-28T14:02:40
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2008-09-28 14:02:40 +00:00
parent 7693e9df82
commit 26e2ab38de
15 changed files with 700 additions and 340 deletions

View File

@@ -553,6 +553,33 @@ function initMailEditor() {
var focusField = (mailIsReply ? textarea : $("addr_0"));
focusField.focus();
initializePriorityMenu();
}
function initializePriorityMenu() {
var priority = $("priority").value.toUpperCase();
var priorityMenu = $("priority-menu").childNodesWithTag("ul")[0];
var menuEntries = $(priorityMenu).childNodesWithTag("li");
var chosenNode;
if (priority == "HIGHEST")
chosenNode = menuEntries[0];
else if (priority == "HIGH")
chosenNode = menuEntries[1];
else if (priority == "LOW")
chosenNode = menuEntries[3];
else if (priority == "LOWEST")
chosenNode = menuEntries[4];
else
chosenNode = menuEntries[2];
priorityMenu.chosenNode = chosenNode;
$(chosenNode).addClassName("_chosen");
var menuItems = $("itemPriorityList").childNodesWithTag("li");
for (var i = 0; i < menuItems.length; i++)
menuItems[i].observe("mousedown",
onMenuSetPriority.bindAsEventListener(menuItems[i]),
false);
}
function getMenus() {
@@ -599,6 +626,19 @@ function attachmentDeleteCallback(http) {
}
}
function onMenuSetPriority(event) {
event.cancelBubble = true;
var priority = this.getAttribute("priority");
if (this.parentNode.chosenNode)
this.parentNode.chosenNode.removeClassName("_chosen");
this.addClassName("_chosen");
this.parentNode.chosenNode = this;
var priorityInput = $("priority");
priorityInput.value = priority;
}
function onSelectAllAttachments() {
var list = $("attachments");
var nodes = list.childNodesWithTag("li");
@@ -606,6 +646,17 @@ function onSelectAllAttachments() {
nodes[i].selectElement();
}
function onSelectPriority(event) {
if (event.button == 0 || (isSafari() && event.button == 1)) {
var node = getTarget(event);
if (node.tagName != 'BUTTON')
node = $(node).up("button");
popupToolbarMenu(node, "priority-menu");
Event.stop(event);
// preventDefault(event);
}
}
function onWindowResize(event) {
var textarea = document.pageform.text;
var rowheight = (Element.getHeight(textarea) / textarea.rows);