merge of '036947e22f5b3eb801463875f6254522044e8867'

and '2b304355998deb143c93ae7f034e0360072a7387'

Monotone-Parent: 036947e22f5b3eb801463875f6254522044e8867
Monotone-Parent: 2b304355998deb143c93ae7f034e0360072a7387
Monotone-Revision: 1ec2044e8b3d118db1cbc52ea520cb6c793d8406

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-09-10T18:47:35
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-09-10 18:47:35 +00:00
7 changed files with 466 additions and 542 deletions
+60 -21
View File
@@ -25,6 +25,8 @@
#import <NGObjWeb/WOContext.h>
#import <NGObjWeb/WORequest.h>
#import <NGObjWeb/WOResponse.h>
#import <NGObjWeb/NSException+HTTP.h>
#import <SoObjects/Mailer/SOGoDraftObject.h>
#import <SoObjects/Mailer/SOGoDraftsFolder.h>
#import <SoObjects/Mailer/SOGoMailAccount.h>
@@ -36,27 +38,6 @@
@implementation UIxMailActions
- (WOResponse *) editAction
{
SOGoMailAccount *account;
SOGoMailObject *co;
SOGoDraftsFolder *folder;
SOGoDraftObject *newMail;
NSString *newLocation;
co = [self clientObject];
account = [co mailAccountFolder];
folder = [account draftsFolderInContext: context];
newMail = [folder newDraft];
[newMail fetchMailForEditing: co];
[newMail storeInfo];
newLocation = [NSString stringWithFormat: @"%@/edit",
[newMail baseURLInContext: context]];
return [self redirectToLocation: newLocation];
}
- (WOResponse *) replyToAll: (BOOL) toAll
{
SOGoMailAccount *account;
@@ -107,7 +88,65 @@
return [self redirectToLocation: newLocation];
}
- (id) trashAction
{
id response;
response = [[self clientObject] trashInContext: context];
if (!response)
{
response = [context response];
[response setStatus: 204];
}
return response;
}
- (id) moveAction
{
NSString *destinationFolder;
id response;
destinationFolder = [[context request] formValueForKey: @"tofolder"];
if ([destinationFolder length] > 0)
{
response = [[self clientObject] moveToFolderNamed: destinationFolder
inContext: context];
if (!response)
{
response = [context response];
[response setStatus: 204];
}
}
else
response = [NSException exceptionWithHTTPStatus: 500 /* Server Error */
reason: @"No destination folder given"];
return response;
}
/* SOGoDraftObject */
- (WOResponse *) editAction
{
SOGoMailAccount *account;
SOGoMailObject *co;
SOGoDraftsFolder *folder;
SOGoDraftObject *newMail;
NSString *newLocation;
co = [self clientObject];
account = [co mailAccountFolder];
folder = [account draftsFolderInContext: context];
newMail = [folder newDraft];
[newMail fetchMailForEditing: co];
[newMail storeInfo];
newLocation = [NSString stringWithFormat: @"%@/edit",
[newMail baseURLInContext: context]];
return [self redirectToLocation: newLocation];
}
- (id) deleteAction
{
SOGoDraftObject *draft;
-113
View File
@@ -201,119 +201,6 @@ static NSString *mailETag = nil;
return [self redirectToLocation: url];
}
- (id) deleteAction
{
NSException *ex;
if (![self isDeletableClientObject]) {
return [NSException exceptionWithHTTPStatus:400 /* Bad Request */
reason:@"method cannot be invoked on "
@"the specified object"];
}
if ([self isInvokedBySafeMethod]) {
// TODO: fix UI to use POST for unsafe actions
[self logWithFormat:@"WARNING: method is invoked using safe HTTP method!"];
}
if ((ex = [[self clientObject] delete]) != nil) {
id url;
url = [[ex reason] stringByEscapingURL];
url = [@"view?error=" stringByAppendingString:url];
return [self redirectToLocation:url];
//return ex;
}
if (![self isInlineViewer]) {
// if everything is ok, close the window (send a JS closing the Window)
id page;
page = [self pageWithName:@"UIxMailWindowCloser"];
[page takeValue:@"YES" forKey:@"refreshOpener"];
return page;
}
return [self redirectToParentFolder];
}
- (id) trashAction
{
NSException *ex;
if ([self isInvokedBySafeMethod]) {
// TODO: fix UI to use POST for unsafe actions
[self logWithFormat:@"WARNING: method is invoked using safe HTTP method!"];
}
if ((ex = [[self clientObject] trashInContext:context]) != nil) {
id url;
if ([[[context request] formValueForKey:@"jsonly"] boolValue])
/* called using XMLHttpRequest */
return ex;
url = [[ex reason] stringByEscapingURL];
url = [@"view?error=" stringByAppendingString:url];
return [self redirectToLocation:url];
}
if ([[[context request] formValueForKey:@"jsonly"] boolValue]) {
/* called using XMLHttpRequest */
[[context response] setStatus:200 /* OK */];
return [context response];
}
if (![self isInlineViewer]) {
// if everything is ok, close the window (send a JS closing the Window)
id page;
page = [self pageWithName:@"UIxMailWindowCloser"];
[page takeValue:@"YES" forKey:@"refreshOpener"];
return page;
}
return [self redirectToParentFolder];
}
- (id <WOActionResults>) moveAction
{
id <WOActionResults> result;
NSString *destinationFolder;
id url;
if ([self isInvokedBySafeMethod]) {
// TODO: fix UI to use POST for unsafe actions
[self logWithFormat:@"WARNING: method is invoked using safe HTTP method!"];
}
destinationFolder = [self queryParameterForKey: @"tofolder"];
if ([destinationFolder length] > 0)
{
result = [[self clientObject] moveToFolderNamed: destinationFolder
inContext: context];
if (result)
{
if (![[[context request] formValueForKey:@"jsonly"] boolValue])
{
url = [NSString stringWithFormat: @"view?error=%@",
[[result reason] stringByEscapingURL]];
result = [self redirectToLocation: url];
}
}
else
{
result = [context response];
[result setStatus: 200];
}
}
else
result = [NSException exceptionWithHTTPStatus:500 /* Server Error */
reason: @"No destination folder given"];
return result;
}
/* generating response */
- (void) appendToResponse: (WOResponse *) _response
+380 -386
View File
@@ -1,435 +1,429 @@
{ /* -*-javascript-*- */
requires = ( MAIN, MainUI, CommonUI, Mailer, MailPartViewers ); /* , Sieve */
{ /* -*-java-*- */
requires = ( MAIN, MainUI, CommonUI, Mailer, MailPartViewers ); /* , Sieve */
publicResources = (
"uix.css",
"mailer.css",
"mailer.js",
"generic.js",
"searchfield.js",
"UIxAppointmentEditor.js",
"UIxContactEditor.js",
"UIxMailToSelection.js",
publicResources = ("uix.css",
"mailer.css",
"mailer.js",
"generic.js",
"searchfield.js",
"UIxAppointmentEditor.js",
"UIxContactEditor.js",
"UIxMailToSelection.js",
"lori_32x32.png",
"lori_32x32.png",
"tbtv_account_17x17.gif",
"tbtv_drafts_17x17.gif",
"tbtv_inbox_17x17.gif",
"tbtv_junction2_17x17.gif",
"tbtv_junction_17x17.gif",
"tbtv_leaf_corner_17x17.gif",
"tbtv_line_17x17.gif",
"tbtv_minus_17x17.gif",
"tbtv_plus_17x17.gif",
"tbtv_corner_17x17.gif",
"tbtv_corner_minus_17x17.gif",
"tbtv_corner_plus_17x17.gif",
"tbtv_sent_17x17.gif",
"tbtv_trash_17x17.gif",
"tbtv_account_17x17.gif",
"tbtv_drafts_17x17.gif",
"tbtv_inbox_17x17.gif",
"tbtv_junction2_17x17.gif",
"tbtv_junction_17x17.gif",
"tbtv_leaf_corner_17x17.gif",
"tbtv_line_17x17.gif",
"tbtv_minus_17x17.gif",
"tbtv_plus_17x17.gif",
"tbtv_corner_17x17.gif",
"tbtv_corner_minus_17x17.gif",
"tbtv_corner_plus_17x17.gif",
"tbtv_sent_17x17.gif",
"tbtv_trash_17x17.gif",
"tbtb_addressbook.png",
"tbtb_compose.png",
"tbtb_delete.png",
"tbtb_deletedoc.png",
"tbtb_filetofolder.png",
"tbtb_forward.png",
"tbtb_getmail.png",
"tbtb_next.png",
"tbtb_previous.png",
"tbtb_print.png",
"tbtb_reply.png",
"tbtb_replyall.png",
"tbtb_search.png",
"tbtb_trash.png",
"tbtb_addressbook.png",
"tbtb_compose.png",
"tbtb_delete.png",
"tbtb_deletedoc.png",
"tbtb_filetofolder.png",
"tbtb_forward.png",
"tbtb_getmail.png",
"tbtb_next.png",
"tbtb_previous.png",
"tbtb_print.png",
"tbtb_reply.png",
"tbtb_replyall.png",
"tbtb_search.png",
"tbtb_trash.png",
"tbtb_compose_addressbook_30x30.png",
"tbtb_compose_attach_30x30.png",
"tbtb_compose_clip_30x30.png",
"tbtb_compose_cut_30x30.png",
"tbtb_compose_dup_30x30.png",
"tbtb_compose_file_30x30.png",
"tbtb_compose_lock_30x30.png",
"tbtb_compose_quote_30x30.png",
"tbtb_compose_send_30x30.png",
"tbtb_compose_spell_30x30.png",
"tbtb_compose_addressbook_30x30.png",
"tbtb_compose_attach_30x30.png",
"tbtb_compose_clip_30x30.png",
"tbtb_compose_cut_30x30.png",
"tbtb_compose_dup_30x30.png",
"tbtb_compose_file_30x30.png",
"tbtb_compose_lock_30x30.png",
"tbtb_compose_quote_30x30.png",
"tbtb_compose_send_30x30.png",
"tbtb_compose_spell_30x30.png",
"message-mail.png",
"message-mail-read.png",
"message-mail.png",
"message-mail-read.png",
"icon_mark_flagged.gif",
"icon_mark_read.gif",
"icon_mark_unflagged.gif",
"icon_mark_unread.gif",
"icon_read.gif",
"icon_unread.gif",
"icon_mark_flagged.gif",
"icon_mark_read.gif",
"icon_mark_unflagged.gif",
"icon_mark_unread.gif",
"icon_read.gif",
"icon_unread.gif",
"title_attachment_14x14.png",
"title_config.png",
"title_junk.png",
"title_read_14x14.png",
"title_thread.png",
"title_sortdown_12x12.png",
"title_sortup_12x12.png",
);
"title_attachment_14x14.png",
"title_config.png",
"title_junk.png",
"title_read_14x14.png",
"title_thread.png",
"title_sortdown_12x12.png",
"title_sortup_12x12.png",
);
factories = {
};
factories = {
};
categories = {
SOGoMailFolder = {
categories = {
SOGoMailFolder = {
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
};
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
};
};
methods = {
subscribe = {
protectedBy = "<public>";
actionClass = "UIxMailFolderActions";
actionName = "subscribe";
};
unsubscribe = {
protectedBy = "<public>";
actionClass = "UIxMailFolderActions";
actionName = "unsubscribe";
};
quotas = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "quotas";
};
view = {
protectedBy = "View";
pageName = "UIxMailListView";
};
ajax = {
protectedBy = "View";
pageName = "UIxMailAjaxRequest";
};
index = {
protectedBy = "View";
pageName = "UIxMailListView";
};
GET = { /* hack to make it work as the default method */
protectedBy = "View";
pageName = "UIxMailListView";
};
markMessageUnread = {
protectedBy = "View";
pageName = "UIxMailListView";
actionName = "markMessageUnread";
};
markMessageRead = {
protectedBy = "View";
pageName = "UIxMailListView";
actionName = "markMessageRead";
};
getMail = {
protectedBy = "View";
pageName = "UIxMailListView";
actionName = "getMail";
};
expunge = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "emptyTrash";
};
createFolder = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "createFolder";
};
renameFolder = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "renameFolder";
};
deleteFolder = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "deleteFolder";
};
userRights = {
protectedBy = "ReadAcls";
pageName = "UIxMailUserRightsEditor";
};
saveUserRights = {
protectedBy = "SaveAcls";
pageName = "UIxMailUserRightsEditor";
actionName = "saveUserRights";
};
subscribe = {
protectedBy = "<public>";
actionClass = "UIxMailFolderActions";
actionName = "subscribe";
};
unsubscribe = {
protectedBy = "<public>";
actionClass = "UIxMailFolderActions";
actionName = "unsubscribe";
};
quotas = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "quotas";
};
view = {
protectedBy = "View";
pageName = "UIxMailListView";
};
ajax = {
protectedBy = "View";
pageName = "UIxMailAjaxRequest";
};
index = {
protectedBy = "View";
pageName = "UIxMailListView";
};
GET = { /* hack to make it work as the default method */
protectedBy = "View";
pageName = "UIxMailListView";
};
markMessageUnread = {
protectedBy = "View";
pageName = "UIxMailListView";
actionName = "markMessageUnread";
};
markMessageRead = {
protectedBy = "View";
pageName = "UIxMailListView";
actionName = "markMessageRead";
};
getMail = {
protectedBy = "View";
pageName = "UIxMailListView";
actionName = "getMail";
};
expunge = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "emptyTrash";
};
createFolder = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "createFolder";
};
renameFolder = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "renameFolder";
};
deleteFolder = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "deleteFolder";
};
userRights = {
protectedBy = "ReadAcls";
pageName = "UIxMailUserRightsEditor";
};
saveUserRights = {
protectedBy = "SaveAcls";
pageName = "UIxMailUserRightsEditor";
actionName = "saveUserRights";
};
};
};
};
SOGoTrashFolder = {
SOGoTrashFolder = {
/* just a new toolbar, other things come from SOGoMailFolder */
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
};
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
};
};
methods = {
emptyTrash = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "emptyTrash";
};
emptyTrash = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "emptyTrash";
};
};
};
};
SOGoMailObject = {
SOGoMailObject = {
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
};
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
};
};
methods = {
view = {
protectedBy = "View";
pageName = "UIxMailView";
};
viewsource = {
protectedBy = "View";
actionClass = "UIxMailSourceView";
actionName = "viewSource";
};
popupview = {
protectedBy = "View";
pageName = "UIxMailPopupView";
};
move = {
protectedBy = "View";
pageName = "UIxMailView";
actionName = "move";
};
delete = {
protectedBy = "View";
pageName = "UIxMailView";
actionName = "delete";
};
trash = {
protectedBy = "View";
pageName = "UIxMailView";
actionName = "trash";
};
junk = {
protectedBy = "View";
pageName = "UIxMailView";
actionName = "junk";
};
edit = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "edit";
};
reply = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "reply";
};
replyall = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "replyToAll";
};
forward = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "forward";
};
view = {
protectedBy = "View";
pageName = "UIxMailView";
};
viewsource = {
protectedBy = "View";
actionClass = "UIxMailSourceView";
actionName = "viewSource";
};
popupview = {
protectedBy = "View";
pageName = "UIxMailPopupView";
};
move = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "move";
};
trash = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "trash";
};
junk = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "junk";
};
edit = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "edit";
};
reply = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "reply";
};
replyall = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "replyToAll";
};
forward = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "forward";
};
};
};
};
SOGoMailAccounts = {
SOGoMailAccounts = {
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
};
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
};
};
methods = {
view = {
protectedBy = "View";
pageName = "UIxMailMainFrame";
};
compose = {
protectedBy = "View";
pageName = "UIxMailMainFrame";
actionName = "compose";
};
view = {
protectedBy = "View";
pageName = "UIxMailMainFrame";
};
compose = {
protectedBy = "View";
pageName = "UIxMailMainFrame";
actionName = "compose";
};
};
};
};
SOGoMailAccount = {
SOGoMailAccount = {
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
};
toolbar = {
protectedBy = "View";
value = "SOGoMailObject.toolbar";
};
};
methods = {
compose = {
protectedBy = "View";
actionClass = "UIxMailAccountActions";
actionName = "compose";
};
mailboxes = {
protectedBy = "View";
actionClass = "UIxMailAccountActions";
actionName = "listMailboxes";
};
createFolder = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "createFolder";
};
compose = {
protectedBy = "View";
actionClass = "UIxMailAccountActions";
actionName = "compose";
};
mailboxes = {
protectedBy = "View";
actionClass = "UIxMailAccountActions";
actionName = "listMailboxes";
};
createFolder = {
protectedBy = "View";
actionClass = "UIxMailFolderActions";
actionName = "createFolder";
};
};
};
};
SOGoDraftsFolder = {
SOGoDraftsFolder = {
slots = {
toolbar = {
protectedBy = "View";
value = ( /* the toolbar groups */
( /* first group */
{ link = "getMail";
image = "tb-mail-getmail-flat-24x24.png";
cssClass = "tbicon_getmail"; label = "Get Mail"; },
{
link = "#"; // "compose"; // target = "_blank";
isSafe = NO;
onclick = "return openMessageWindow(null, 'compose');";
image = "tb-mail-write-flat-24x24.png";
cssClass = "tbicon_compose"; label = "Write"; },
)
);
};
toolbar = {
protectedBy = "View";
value = ( /* the toolbar groups */
( /* first group */
{ link = "getMail";
image = "tb-mail-getmail-flat-24x24.png";
cssClass = "tbicon_getmail"; label = "Get Mail"; },
{
link = "#"; // "compose"; // target = "_blank";
isSafe = NO;
onclick = "return openMessageWindow(null, 'compose');";
image = "tb-mail-write-flat-24x24.png";
cssClass = "tbicon_compose"; label = "Write"; },
)
);
};
};
methods = {
view = {
protectedBy = "View";
pageName = "UIxMailListView";
};
getMail = {
protectedBy = "View";
pageName = "UIxMailListView";
};
view = {
protectedBy = "View";
pageName = "UIxMailListView";
};
getMail = {
protectedBy = "View";
pageName = "UIxMailListView";
};
};
};
};
SOGoDraftObject = {
SOGoDraftObject = {
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoDraftObject.toolbar";
};
toolbar = {
protectedBy = "View";
value = "SOGoDraftObject.toolbar";
};
};
methods = {
edit = {
protectedBy = "View";
pageName = "UIxMailEditor";
};
save = {
protectedBy = "View";
pageName = "UIxMailEditor";
actionName = "save";
};
send = {
protectedBy = "View";
pageName = "UIxMailEditor";
actionName = "send";
};
delete = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "delete";
};
deleteAttachment = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "deleteAttachment";
};
edit = {
protectedBy = "View";
pageName = "UIxMailEditor";
};
save = {
protectedBy = "View";
pageName = "UIxMailEditor";
actionName = "save";
};
send = {
protectedBy = "View";
pageName = "UIxMailEditor";
actionName = "send";
};
delete = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "delete";
};
deleteAttachment = {
protectedBy = "View";
actionClass = "UIxMailActions";
actionName = "deleteAttachment";
};
};
};
};
/* Sieve */
/* Sieve */
/* SOGoSieveScriptsFolder = {
slots = {
toolbar = {
protectedBy = "View";
value = (
(
{
link = "getMail";
image = "tb-mail-getmail-flat-24x24.png";
cssClass = "tbicon_getmail"; label = "Get Mail";
},
{
link = "#"; // "compose"; // target = "_blank";
onclick = "clickedNewFilter(this); return false";
image = "tb-mail-write-flat-24x24.png";
cssClass = "tbicon_compose"; label = "New Filter";
},
),
(
{ link = "#";
cssClass = "tbicon_delete"; label = "Delete"; },
),
);
};
};
methods = {
view = {
protectedBy = "View";
pageName = "UIxFilterList";
};
create = {
protectedBy = "View";
pageName = "UIxFilterList";
actionName = "create";
};
};
};
// SOGoSieveScriptsFolder = {
// slots = {
// toolbar = {
// protectedBy = "View";
// value = (
// (
// {
// link = "getMail";
// image = "tb-mail-getmail-flat-24x24.png";
// cssClass = "tbicon_getmail"; label = "Get Mail";
// },
// {
// link = "#"; // "compose"; // target = "_blank";
// onclick = "clickedNewFilter(this); return false";
// image = "tb-mail-write-flat-24x24.png";
// cssClass = "tbicon_compose"; label = "New Filter";
// },
// ),
// (
// { link = "#";
// cssClass = "tbicon_delete"; label = "Delete"; },
// ),
// );
// };
// };
// methods = {
// view = {
// protectedBy = "View";
// pageName = "UIxFilterList";
// };
// create = {
// protectedBy = "View";
// pageName = "UIxFilterList";
// actionName = "create";
// };
// };
// };
SOGoSieveScriptObject = {
slots = {
toolbar = {
protectedBy = "View";
value = (
( { link = "#";
onclick = "clickedEditorSave(this);return false;";
image = "tb-mail-file-flat-24x24.png";
cssClass = "tbicon_save"; label = "Save"; },
{ link = "#";
onclick = "clickedEditorDelete(this);return false;";
image = "tb-mail-delete-flat-24x24.png";
cssClass = "tbicon_delete"; label = "Delete"; },
)
);
};
};
methods = {
edit = {
protectedBy = "View";
pageName = "UIxSieveEditor";
actionName = "edit";
};
save = {
protectedBy = "View";
pageName = "UIxSieveEditor";
actionName = "save";
};
delete = {
protectedBy = "View";
pageName = "UIxSieveEditor";
actionName = "delete";
};
};
}; */
};
// SOGoSieveScriptObject = {
// slots = {
// toolbar = {
// protectedBy = "View";
// value = (
// ( { link = "#";
// onclick = "clickedEditorSave(this);return false;";
// image = "tb-mail-file-flat-24x24.png";
// cssClass = "tbicon_save"; label = "Save"; },
// { link = "#";
// onclick = "clickedEditorDelete(this);return false;";
// image = "tb-mail-delete-flat-24x24.png";
// cssClass = "tbicon_delete"; label = "Delete"; },
// )
// );
// };
// };
// methods = {
// edit = {
// protectedBy = "View";
// pageName = "UIxSieveEditor";
// actionName = "edit";
// };
// save = {
// protectedBy = "View";
// pageName = "UIxSieveEditor";
// actionName = "save";
// };
// delete = {
// protectedBy = "View";
// pageName = "UIxSieveEditor";
// actionName = "delete";
// };
// }
};
}
+13 -5
View File
@@ -153,7 +153,7 @@ function mailListMarkMessage(event) {
if (http) {
// TODO: add parameter to signal that we are only interested in OK
http.open("POST", url + "&jsonly=1", false /* not async */);
http.open("POST", url, false /* not async */);
http.send("");
if (http.status != 200) {
// TODO: refresh page?
@@ -229,11 +229,11 @@ function uixDeleteSelectedMessages(sender) {
/* send AJAX request (synchronously) */
var messageId = currentMailbox + "/" + rowId;
url = ApplicationBaseURL + messageId + "/trash?jsonly=1";
url = ApplicationBaseURL + messageId + "/trash";
http = createHTTPClient();
http.open("POST", url, false /* not async */);
http.send("");
if (http.status != 200) { /* request failed */
if (!isHttpStatus204(http.status)) { /* request failed */
failCount++;
http = null;
continue;
@@ -270,7 +270,7 @@ function moveMessages(rowIds, folder) {
var messageId = currentMailbox + "/" + rowIds[i];
url = (ApplicationBaseURL + messageId
+ "/move?jsonly=1&tofolder=" + folder);
+ "/move?tofolder=" + folder);
http = createHTTPClient();
http.open("GET", url, false /* not async */);
http.send("");
@@ -1301,8 +1301,16 @@ function onMenuExpungeFolder(event) {
function onMenuEmptyTrash(event) {
var folderID = document.menuTarget.getAttribute("dataname");
var urlstr = URLForFolderID(folderID) + "/emptyTrash";
triggerAjaxRequest(urlstr, folderRefreshCallback, folderID);
if (folderID == currentMailbox) {
var div = $('messageContent');
for (var i = div.childNodes.length - 1; i > -1; i--)
div.removeChild(div.childNodes[i]);
}
var msgID = currentMessages[folderID];
if (msgID)
deleteCachedMessage(folderID + "/" + msgID);
}
function folderOperationCallback(http) {