mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-20 04:19:35 +00:00
Monotone-Parent: c0e690042905295d3b7946d9d917fcf8e91982ef
Monotone-Revision: f8b29d68c36441f92d7ffe8056a95fd25a2fd409 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-10-17T22:29:51 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -11,6 +11,8 @@ var currentMailboxType = "";
|
||||
var usersRightsWindowHeight = 320;
|
||||
var usersRightsWindowWidth = 400;
|
||||
|
||||
var pageContent;
|
||||
|
||||
/* mail list */
|
||||
|
||||
function openMessageWindow(msguid, url) {
|
||||
@@ -330,12 +332,34 @@ function onMailboxTreeItemClick(event) {
|
||||
Event.stop(event);
|
||||
}
|
||||
|
||||
function onMailboxMenuMove() {
|
||||
window.alert("unimplemented");
|
||||
function _onMailboxMenuAction(menuEntry, error, actionName) {
|
||||
var targetMailbox = menuEntry.mailbox.fullName();
|
||||
|
||||
if (targetMailbox == currentMailbox)
|
||||
window.alert(labels[error]);
|
||||
else {
|
||||
var message;
|
||||
if (document.menuTarget instanceof HTMLDivElement)
|
||||
message = currentMessages[currentMailbox];
|
||||
else
|
||||
message = document.menuTarget.getAttribute("id").substr(4);
|
||||
|
||||
var urlstr = (URLForFolderID(currentMailbox) + "/" + message
|
||||
+ "/" + actionName + "?folder=" + targetMailbox);
|
||||
triggerAjaxRequest(urlstr, folderRefreshCallback, currentMailbox);
|
||||
}
|
||||
}
|
||||
|
||||
function onMailboxMenuCopy() {
|
||||
window.alert("unimplemented");
|
||||
function onMailboxMenuMove(event) {
|
||||
_onMailboxMenuAction(this,
|
||||
"Moving a message into its own folder is impossible!",
|
||||
"move");
|
||||
}
|
||||
|
||||
function onMailboxMenuCopy(event) {
|
||||
_onMailboxMenuAction(this,
|
||||
"Copying a message into its own folder is impossible!",
|
||||
"copy");
|
||||
}
|
||||
|
||||
function refreshMailbox() {
|
||||
@@ -1141,13 +1165,13 @@ function generateMenuForMailbox(mailbox, prefix, callback) {
|
||||
menuDIV.setAttribute("id", prefix + "Submenu");
|
||||
var menu = document.createElement("ul");
|
||||
menuDIV.appendChild(menu);
|
||||
document.body.appendChild(menuDIV);
|
||||
pageContent.appendChild(menuDIV);
|
||||
|
||||
var callbacks = new Array();
|
||||
if (mailbox.type != "account") {
|
||||
var newNode = document.createElement("li");
|
||||
newNode.mailbox = mailbox;
|
||||
newNode.appendChild(document.createTextNode("coucou"));
|
||||
newNode.appendChild(document.createTextNode(labels["This Folder"]));
|
||||
menu.appendChild(newNode);
|
||||
menu.appendChild(document.createElement("li"));
|
||||
callbacks.push(callback);
|
||||
@@ -1186,14 +1210,15 @@ function updateMailboxMenus() {
|
||||
menuDIV.parentNode.removeChild(menuDIV);
|
||||
|
||||
menuDIV = document.createElement("div");
|
||||
document.body.appendChild(menuDIV);
|
||||
pageContent = $("pageContent");
|
||||
pageContent.appendChild(menuDIV);
|
||||
|
||||
var menu = document.createElement("ul");
|
||||
menuDIV.appendChild(menu);
|
||||
|
||||
$(menuDIV).addClassName("menu");
|
||||
menuDIV.setAttribute("id", menuId);
|
||||
|
||||
|
||||
var submenuIds = new Array();
|
||||
for (var i = 0; i < mailAccounts.length; i++) {
|
||||
var menuEntry = mailboxMenuNode("account", mailAccounts[i]);
|
||||
@@ -1441,6 +1466,18 @@ Mailbox.prototype.dump = function(indent) {
|
||||
}
|
||||
}
|
||||
|
||||
Mailbox.prototype.fullName = function() {
|
||||
var fullName = "";
|
||||
|
||||
var currentFolder = this;
|
||||
while (currentFolder.parentFolder) {
|
||||
fullName = "/folder" + currentFolder.name + fullName;
|
||||
currentFolder = currentFolder.parentFolder;
|
||||
}
|
||||
|
||||
return "/" + currentFolder.name + fullName;
|
||||
}
|
||||
|
||||
Mailbox.prototype.findMailboxByName = function(name) {
|
||||
var mailbox = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user