Monotone-Parent: d24f07174457ea6b1b468933be949003bde413ed
Monotone-Revision: 0fdbd40e83a190f1d39914851c8f51231d0ca200 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-07-04T15:40:22 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
512355c332
commit
69ecd0bce8
|
@ -1,5 +1,8 @@
|
|||
2007-07-04 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/MailerUI/UIxMailSourceView.[hm]: new class module designed to
|
||||
return the message source code in plain text.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject
|
||||
-contentAsString]): returns the message encoded in UTF8.
|
||||
|
||||
|
|
|
@ -147,6 +147,7 @@
|
|||
"Mark" = "Marquer";
|
||||
"Save As..." = "Enregistrer comme...";
|
||||
"Print Preview" = "Aperçu avant impression";
|
||||
"View Message Source" = "Voir le code source";
|
||||
"Print..." = "Imprimer...";
|
||||
"Delete Message" = "Supprimer le message";
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ MailerUI_OBJC_FILES += \
|
|||
\
|
||||
UIxMailListView.m \
|
||||
UIxMailView.m \
|
||||
UIxMailSourceView.m \
|
||||
UIxMailPopupView.m \
|
||||
UIxMailMoveToPopUp.m \
|
||||
UIxMailFilterPanel.m \
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
/* UIxMailSourceView.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef UIXMAILSOURCEVIEW_H
|
||||
#define UIXMAILSOURCEVIEW_H
|
||||
|
||||
#import <NGObjWeb/WODirectAction.h>
|
||||
|
||||
@interface UIxMailSourceView : WODirectAction
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#endif /* UIXMAILSOURCEVIEW_H */
|
|
@ -0,0 +1,48 @@
|
|||
/* UIxMailSourceView.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <SoObjects/Mailer/SOGoMailObject.h>
|
||||
|
||||
#import "UIxMailSourceView.h"
|
||||
|
||||
@implementation UIxMailSourceView
|
||||
|
||||
- (WOResponse *) viewSourceAction
|
||||
{
|
||||
NSString *source;
|
||||
WOResponse *response;
|
||||
|
||||
source = [[self clientObject] contentAsString];
|
||||
|
||||
response = [context response];
|
||||
[response setStatus: 200];
|
||||
[response setHeader: @"text/plain; charset=utf-8"
|
||||
forKey: @"content-type"];
|
||||
[response appendContentString: source];
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@end
|
|
@ -192,6 +192,11 @@ categories = {
|
|||
protectedBy = "View";
|
||||
pageName = "UIxMailView";
|
||||
};
|
||||
viewsource = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailSourceView";
|
||||
actionName = "viewSource";
|
||||
};
|
||||
popupview = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailPopupView";
|
||||
|
|
|
@ -95,6 +95,7 @@
|
|||
<li><var:string label:value="Mark"/></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Save As..."/></li>
|
||||
<li><var:string label:value="View Message Source"/></li>
|
||||
<li><var:string label:value="Print Preview"/></li>
|
||||
<li><var:string label:value="Print..."/></li>
|
||||
<li><var:string label:value="Delete Message"/></li>
|
||||
|
@ -114,6 +115,7 @@
|
|||
<li><var:string label:value="Mark"/></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Save As..."/></li>
|
||||
<li><var:string label:value="View Message Source"/></li>
|
||||
<li><var:string label:value="Print Preview"/></li>
|
||||
<li><var:string label:value="Print..."/></li>
|
||||
<li><var:string label:value="Delete Message"/></li>
|
||||
|
|
|
@ -676,15 +676,19 @@ function configureLinksInMessage() {
|
|||
var messageDiv = $('messageContent');
|
||||
var mailContentDiv = document.getElementsByClassName('mailer_mailcontent',
|
||||
messageDiv)[0];
|
||||
Event.observe(mailContentDiv, "contextmenu", onMessageContentMenu.bindAsEventListener(mailContentDiv));
|
||||
Event.observe(mailContentDiv, "contextmenu",
|
||||
onMessageContentMenu.bindAsEventListener(mailContentDiv));
|
||||
var anchors = messageDiv.getElementsByTagName('a');
|
||||
for (var i = 0; i < anchors.length; i++)
|
||||
if (anchors[i].href.substring(0,7) == "mailto:") {
|
||||
Event.observe(anchors[i], "click", onEmailAddressClick.bindAsEventListener(anchors[i]));
|
||||
Event.observe(anchors[i], "contextmenu", onEmailAddressClick.bindAsEventListener(anchors[i]));
|
||||
Event.observe(anchors[i], "click",
|
||||
onEmailAddressClick.bindAsEventListener(anchors[i]));
|
||||
Event.observe(anchors[i], "contextmenu",
|
||||
onEmailAddressClick.bindAsEventListener(anchors[i]));
|
||||
}
|
||||
else
|
||||
Event.observe(anchors[i], "click", onMessageAnchorClick);
|
||||
Event.observe(anchors[i], "click",
|
||||
onMessageAnchorClick);
|
||||
}
|
||||
|
||||
function onMessageContentMenu(event) {
|
||||
|
@ -794,6 +798,19 @@ function onMenuForwardMessage(event) {
|
|||
return openMessageWindowsForSelection('forward');
|
||||
}
|
||||
|
||||
function onMenuViewMessageSource(event) {
|
||||
var messageList = $("messageList");
|
||||
var rows = messageList.getSelectedRowsId();
|
||||
|
||||
if (rows.length > 0) {
|
||||
var url = (ApplicationBaseURL + currentMailbox + "/"
|
||||
+ rows[0].substr(4) + "/viewsource");
|
||||
window.open(url);
|
||||
}
|
||||
|
||||
preventDefault(event);
|
||||
}
|
||||
|
||||
/* contacts */
|
||||
function newContactFromEmail(event) {
|
||||
var mailto = document.menuTarget.innerHTML;
|
||||
|
@ -1326,7 +1343,8 @@ function getMenus() {
|
|||
onMenuForwardMessage, null,
|
||||
"-", "moveMailboxMenu",
|
||||
"copyMailboxMenu", "label-menu",
|
||||
"mark-menu", "-", null, null,
|
||||
"mark-menu", "-", null,
|
||||
onMenuViewMessageSource, null,
|
||||
null, onMenuDeleteMessage);
|
||||
menus["messageContentMenu"] = new Array(onMenuReplyToSender,
|
||||
onMenuReplyToAll,
|
||||
|
@ -1335,7 +1353,8 @@ function getMenus() {
|
|||
"copyMailboxMenu",
|
||||
"-", "label-menu", "mark-menu",
|
||||
"-",
|
||||
null, null, null,
|
||||
null, onMenuViewMessageSource,
|
||||
null, null,
|
||||
onMenuDeleteMessage);
|
||||
menus["label-menu"] = new Array(null, "-", null , null, null, null , null,
|
||||
null);
|
||||
|
|
Loading…
Reference in New Issue