From b9201e4741565f1a32e469aa4c19b64c4ba7e6c7 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 19 Aug 2010 19:20:48 +0000 Subject: [PATCH 1/3] Monotone-Parent: 069a26b1da4cd9cb430bcfa41dc9eb96e0cc8778 Monotone-Revision: fa8dc1c274f33f22112358063dcbafd1365e8c6f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-19T19:20:48 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/generic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index 53943df57..01cb4abf0 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -848,7 +848,7 @@ function popupSubmenu(event) { parentNode.submenu = submenuNode; if (submenuNode.prepareVisibility) - submenuNode.prepareVisibility(); + submenuNode.prepareVisibility.apply(submenuNode, []); var menuTop = (parentNode.offsetTop - 1 + this.offsetTop); From bbe850c044157a2c3fdc69b93f923c68cce7fa77 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 19 Aug 2010 19:20:56 +0000 Subject: [PATCH 2/3] Monotone-Parent: fa8dc1c274f33f22112358063dcbafd1365e8c6f Monotone-Revision: 5d6bd031d4a71e69a4759798355764f7f9894322 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-19T19:20:56 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 14 +++++++ UI/WebServerResources/MailerUI.js | 69 +++++++++++++------------------ 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index facd2f85d..3e0b0accc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2010-08-19 Wolfgang Sourdeau + * UI/WebServerResources/MailerUI.js: (initDnd): removed useless + method. + (onMessageListPrepareVisibility): fixed a bug where the current + mailbox name would be attemptedly taken from the menu target, + while it really should have been deduced from + "Mailer.currentMailbox". + (configureDraggables): we now take all label nodes under + "#mailboxTree" into account and accept them as droppable when they + are not an account node. Also, we associate an account tag with + all of them. + (startDragging): we set the drag classname of the drag handle to + the correct account tag, to avoid visual feedback when hovering + mailboxes from another account. + * UI/WebServerResources/UIxReminderEditor.js (initialiseFormValues): added code to configure the "actionList" if present (email alarms enabled). diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index b9a8d0727..57a720a16 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -1642,32 +1642,6 @@ function onWindowResize(event) { handle.adjust(); } -/* dnd */ -function initDnd() { - // log("MailerUI initDnd"); - - var tree = $("mailboxTree"); - if (tree) { - var images = tree.getElementsByTagName("img"); - for (var i = 0; i < images.length; i++) { - if (images[i].id[0] == 'j') { - images[i].dndAcceptType = mailboxSpanAcceptType; - images[i].dndEnter = plusSignEnter; - images[i].dndExit = plusSignExit; - document.DNDManager.registerDestination(images[i]); - } - } - var nodes = document.getElementsByClassName("nodeName", tree); - for (var i = 0; i < nodes.length; i++) { - nodes[i].dndAcceptType = mailboxSpanAcceptType; - nodes[i].dndEnter = mailboxSpanEnter; - nodes[i].dndExit = mailboxSpanExit; - nodes[i].dndDrop = mailboxSpanDrop; - document.DNDManager.registerDestination(nodes[i]); - } - } -} - /* stub */ function refreshContacts() { @@ -1695,8 +1669,6 @@ function initMailer(event) { } if (!$(document.body).hasClassName("popup")) { - //initDnd(); - Mailer.dataTable = $("mailboxList"); Mailer.dataTable.addInterface(SOGoDataTableInterface); Mailer.dataTable.setRowRenderCallback(messageListCallback); @@ -2287,7 +2259,7 @@ function onMessageListMenuPrepareVisibility() { "messagesListMenu": 2, "messageContentMenu": 4 }; if (document.menuTarget) { - var mbx = document.menuTarget.getAttribute("dataname"); + var mbx = Mailer.currentMailbox; if (mbx) { var lis = this.getElementsByTagName("li"); var idx = indexes[this.id]; @@ -2540,33 +2512,47 @@ function configureDraggables () { new Draggable ("dragDropVisual", { handle: "messageListBody", - onStart: startDragging, - onEnd: stopDragging, - onDrag: whileDragging, - scroll: "folderTreeContent" }); + onStart: startDragging, + onEnd: stopDragging, + onDrag: whileDragging, + scroll: "folderTreeContent" }); } -function configureDroppables () { - var drops = $$("div#dmailboxTree1 div.dTreeNode a.node span.nodeName"); +function configureDroppables() { + var drops = $$("div#mailboxTree div.dTreeNode a.node span.nodeName"); Droppables.empty (); drops.each(function (drop) { - drop.identify(); - Droppables.add(drop.id, - { hoverclass: "genericHoverClass", - onDrop: dropAction }); + var dataname = drop.parentNode.parentNode.getAttribute("dataname"); + var acceptClass = "account"; + if (dataname.length > 0) { + var parts = dataname.split("/"); + acceptClass += parts[1]; + } + var parent = drop.parentNode.parentNode; + if (parent.getAttribute("datatype") != "account") { + drop.identify(); + Droppables.add(drop.id, + { hoverclass: "genericHoverClass", + accept: [ acceptClass ], + onDrop: dropAction }); + } }); } function startDragging (itm, e) { var target = Event.element(e); if (target.up('TBODY') == undefined) - return false; + return; var handle = $("dragDropVisual"); var count = $("messageListBody").getSelectedRowsId().length; handle.update (count); + if (Mailer.currentMailbox) { + var parts = Mailer.currentMailbox.split("/"); + handle.addClassName("account" + parts[1]); + } if (e.shiftKey) { handle.addClassName("copy"); } @@ -2588,6 +2574,9 @@ function stopDragging () { handle.hide(); if (handle.hasClassName("copy")) handle.removeClassName("copy"); + for (var i = 0; i < accounts.length; i++) { + handle.removeClassName("account" + i); + } } function dropAction (dropped, zone, e) { From 67720a01a0a92f38531b3b26b8202d4517bb9761 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 19 Aug 2010 19:22:08 +0000 Subject: [PATCH 3/3] Monotone-Parent: 5d6bd031d4a71e69a4759798355764f7f9894322 Monotone-Revision: 4b75d0f2673a649962c631fea2213e8dbf33a7b1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-19T19:22:08 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/Mailer/SOGoMailFolder.m | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3e0b0accc..2fc56fa93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-08-19 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoMailFolder.m (-deleteUIDs:inContext:): make + the use of the "result" variable clearer by declaring it with a + proper class name and avoiding type confusion within the code. + * UI/WebServerResources/MailerUI.js: (initDnd): removed useless method. (onMessageListPrepareVisibility): fixed a bug where the current diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index e0b321eeb..e5e14f11d 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -271,7 +271,7 @@ static NSString *defaultUserID = @"anyone"; NGImap4Client *client; NSString *folderName; NSException *error; - id result; + NSString *result; BOOL b; trashFolder = [[self mailAccountFolder] trashFolderInContext: localContext]; @@ -296,19 +296,21 @@ static NSString *defaultUserID = @"anyone"; objectForKey: @"result"]; if (![result boolValue]) - result = [[self imap4Connection] createMailbox: folderName atURL: [[self mailAccountFolder] imap4URL]]; + [[self imap4Connection] createMailbox: folderName + atURL: [[self mailAccountFolder] imap4URL]]; + + result = [[client copyUids: uids toFolder: folderName] + objectForKey: @"result"]; - if (!result || [result boolValue]) - result = [client copyUids: uids toFolder: folderName]; - - b = [[result valueForKey: @"result"] boolValue]; + b = [result boolValue]; } if (b) { - result = [client storeFlags: [NSArray arrayWithObject: @"Deleted"] - forUIDs: uids addOrRemove: YES]; - if ([[result valueForKey: @"result"] boolValue]) + result = [[client storeFlags: [NSArray arrayWithObject: @"Deleted"] + forUIDs: uids addOrRemove: YES] + objectForKey: @"result"]; + if ([result boolValue]) { [self markForExpunge]; [trashFolder flushMailCaches];