mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-13 19:01:23 +00:00
merge of '1d1c945ea058db7070c9b83c4c2bb60689c52f92'
and '74d6ae3bf39677a7d5083301f1c29c74b97b84dd' Monotone-Parent: 1d1c945ea058db7070c9b83c4c2bb60689c52f92 Monotone-Parent: 74d6ae3bf39677a7d5083301f1c29c74b97b84dd Monotone-Revision: b5081fb240f719d3a1ce2583dff3738a9ceb9d93 Monotone-Author: crobert@inverse.ca Monotone-Date: 2008-09-28T19:49:39 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -561,6 +561,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() {
|
||||
@@ -607,6 +634,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");
|
||||
@@ -614,6 +654,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);
|
||||
|
||||
Reference in New Issue
Block a user