Monotone-Parent: d24f07174457ea6b1b468933be949003bde413ed

Monotone-Revision: 0fdbd40e83a190f1d39914851c8f51231d0ca200

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-07-04T15:40:22
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2007-07-04 15:40:22 +00:00
parent 512355c332
commit 69ecd0bce8
8 changed files with 120 additions and 8 deletions

View File

@ -1,5 +1,8 @@
2007-07-04 Wolfgang Sourdeau <wsourdeau@inverse.ca> 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 * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject
-contentAsString]): returns the message encoded in UTF8. -contentAsString]): returns the message encoded in UTF8.

View File

@ -147,6 +147,7 @@
"Mark" = "Marquer"; "Mark" = "Marquer";
"Save As..." = "Enregistrer comme..."; "Save As..." = "Enregistrer comme...";
"Print Preview" = "Aperçu avant impression"; "Print Preview" = "Aperçu avant impression";
"View Message Source" = "Voir le code source";
"Print..." = "Imprimer..."; "Print..." = "Imprimer...";
"Delete Message" = "Supprimer le message"; "Delete Message" = "Supprimer le message";

View File

@ -20,6 +20,7 @@ MailerUI_OBJC_FILES += \
\ \
UIxMailListView.m \ UIxMailListView.m \
UIxMailView.m \ UIxMailView.m \
UIxMailSourceView.m \
UIxMailPopupView.m \ UIxMailPopupView.m \
UIxMailMoveToPopUp.m \ UIxMailMoveToPopUp.m \
UIxMailFilterPanel.m \ UIxMailFilterPanel.m \

View File

@ -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 */

View File

@ -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

View File

@ -192,6 +192,11 @@ categories = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailView"; pageName = "UIxMailView";
}; };
viewsource = {
protectedBy = "View";
actionClass = "UIxMailSourceView";
actionName = "viewSource";
};
popupview = { popupview = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailPopupView"; pageName = "UIxMailPopupView";

View File

@ -95,6 +95,7 @@
<li><var:string label:value="Mark"/></li> <li><var:string label:value="Mark"/></li>
<li><!-- separator --></li> <li><!-- separator --></li>
<li><var:string label:value="Save As..."/></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 Preview"/></li>
<li><var:string label:value="Print..."/></li> <li><var:string label:value="Print..."/></li>
<li><var:string label:value="Delete Message"/></li> <li><var:string label:value="Delete Message"/></li>
@ -114,6 +115,7 @@
<li><var:string label:value="Mark"/></li> <li><var:string label:value="Mark"/></li>
<li><!-- separator --></li> <li><!-- separator --></li>
<li><var:string label:value="Save As..."/></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 Preview"/></li>
<li><var:string label:value="Print..."/></li> <li><var:string label:value="Print..."/></li>
<li><var:string label:value="Delete Message"/></li> <li><var:string label:value="Delete Message"/></li>

View File

@ -90,7 +90,7 @@ function clickedEditorAttach(sender) {
"width=320,height=320,resizable=1,scrollbars=1,toolbar=0," + "width=320,height=320,resizable=1,scrollbars=1,toolbar=0," +
"location=0,directories=0,status=0,menubar=0,copyhistory=0"); "location=0,directories=0,status=0,menubar=0,copyhistory=0");
return false; /* stop following the link */ return false; /* stop following the link */
} }
function clickedEditorSave(sender) { function clickedEditorSave(sender) {
document.pageform.action = "save"; document.pageform.action = "save";
@ -208,7 +208,7 @@ function openMessageWindowsForSelection(action) {
window.messageURL + "/" + action /* url */); window.messageURL + "/" + action /* url */);
else { else {
var messageList = $("messageList"); var messageList = $("messageList");
var rows = messageList.getSelectedRowsId(); var rows = messageList.getSelectedRowsId();
var idset = ""; var idset = "";
for (var i = 0; i < rows.length; i++) for (var i = 0; i < rows.length; i++)
win = openMessageWindow(rows[i].substr(4) /* msguid */, win = openMessageWindow(rows[i].substr(4) /* msguid */,
@ -676,15 +676,19 @@ function configureLinksInMessage() {
var messageDiv = $('messageContent'); var messageDiv = $('messageContent');
var mailContentDiv = document.getElementsByClassName('mailer_mailcontent', var mailContentDiv = document.getElementsByClassName('mailer_mailcontent',
messageDiv)[0]; messageDiv)[0];
Event.observe(mailContentDiv, "contextmenu", onMessageContentMenu.bindAsEventListener(mailContentDiv)); Event.observe(mailContentDiv, "contextmenu",
onMessageContentMenu.bindAsEventListener(mailContentDiv));
var anchors = messageDiv.getElementsByTagName('a'); var anchors = messageDiv.getElementsByTagName('a');
for (var i = 0; i < anchors.length; i++) for (var i = 0; i < anchors.length; i++)
if (anchors[i].href.substring(0,7) == "mailto:") { if (anchors[i].href.substring(0,7) == "mailto:") {
Event.observe(anchors[i], "click", onEmailAddressClick.bindAsEventListener(anchors[i])); Event.observe(anchors[i], "click",
Event.observe(anchors[i], "contextmenu", onEmailAddressClick.bindAsEventListener(anchors[i])); onEmailAddressClick.bindAsEventListener(anchors[i]));
Event.observe(anchors[i], "contextmenu",
onEmailAddressClick.bindAsEventListener(anchors[i]));
} }
else else
Event.observe(anchors[i], "click", onMessageAnchorClick); Event.observe(anchors[i], "click",
onMessageAnchorClick);
} }
function onMessageContentMenu(event) { function onMessageContentMenu(event) {
@ -794,6 +798,19 @@ function onMenuForwardMessage(event) {
return openMessageWindowsForSelection('forward'); 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 */ /* contacts */
function newContactFromEmail(event) { function newContactFromEmail(event) {
var mailto = document.menuTarget.innerHTML; var mailto = document.menuTarget.innerHTML;
@ -1326,7 +1343,8 @@ function getMenus() {
onMenuForwardMessage, null, onMenuForwardMessage, null,
"-", "moveMailboxMenu", "-", "moveMailboxMenu",
"copyMailboxMenu", "label-menu", "copyMailboxMenu", "label-menu",
"mark-menu", "-", null, null, "mark-menu", "-", null,
onMenuViewMessageSource, null,
null, onMenuDeleteMessage); null, onMenuDeleteMessage);
menus["messageContentMenu"] = new Array(onMenuReplyToSender, menus["messageContentMenu"] = new Array(onMenuReplyToSender,
onMenuReplyToAll, onMenuReplyToAll,
@ -1335,7 +1353,8 @@ function getMenus() {
"copyMailboxMenu", "copyMailboxMenu",
"-", "label-menu", "mark-menu", "-", "label-menu", "mark-menu",
"-", "-",
null, null, null, null, onMenuViewMessageSource,
null, null,
onMenuDeleteMessage); onMenuDeleteMessage);
menus["label-menu"] = new Array(null, "-", null , null, null, null , null, menus["label-menu"] = new Array(null, "-", null , null, null, null , null,
null); null);