From 4f754994392326cd0c9fc43ff7d9e00e9c3296c3 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Fri, 29 May 2015 10:49:40 -0400 Subject: [PATCH] (fix) Materalized link and image templates --- UI/MailPartViewers/UIxMailPartImageViewer.m | 7 +- UI/MailPartViewers/UIxMailPartViewer.m | 17 ++++- .../UIxMailPartImageViewer.wox | 30 ++++++-- .../MailPartViewers/UIxMailPartLinkViewer.wox | 73 +++++++++++-------- .../js/Mailer/Message.service.js | 1 + 5 files changed, 85 insertions(+), 43 deletions(-) diff --git a/UI/MailPartViewers/UIxMailPartImageViewer.m b/UI/MailPartViewers/UIxMailPartImageViewer.m index bb05b1a2f..33bbfee45 100644 --- a/UI/MailPartViewers/UIxMailPartImageViewer.m +++ b/UI/MailPartViewers/UIxMailPartImageViewer.m @@ -1,14 +1,15 @@ /* + Copyright (C) 2007-2015 Inverse inc. Copyright (C) 2004-2005 SKYRIX Software AG - This file is part of OpenGroupware.org. + This file is part of SOGo - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo 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 Lesser General Public License for more details. diff --git a/UI/MailPartViewers/UIxMailPartViewer.m b/UI/MailPartViewers/UIxMailPartViewer.m index a34bcb2ab..eb481d6d5 100644 --- a/UI/MailPartViewers/UIxMailPartViewer.m +++ b/UI/MailPartViewers/UIxMailPartViewer.m @@ -303,7 +303,7 @@ return [filename stringByEscapingURL]; } -- (NSString *) pathToAttachment +- (NSString *) _pathForAttachmentOrDownload: (BOOL) forDownload { NSMutableString *url; NSString *s, *attachment; @@ -315,16 +315,29 @@ if (![url hasSuffix: @"/"]) [url appendString: @"/"]; -// s = [[self partPath] componentsJoinedByString: @"/"]; if ([bodyPart isKindOfClass: [SOGoMailBodyPart class]]) attachment = [self _filenameForAttachment: bodyPart]; else attachment = @"0"; + + if (forDownload) + [url appendString: @"asAttachment/"]; + [url appendString: attachment]; return url; } +- (NSString *) pathToAttachment +{ + return [self _pathForAttachmentOrDownload: NO]; +} + +- (NSString *) pathForDownload +{ + return [self _pathForAttachmentOrDownload: YES]; +} + - (NSString *) mimeImageURL { NSString *mimeImageFile, *mimeImageUrl; diff --git a/UI/Templates/MailPartViewers/UIxMailPartImageViewer.wox b/UI/Templates/MailPartViewers/UIxMailPartImageViewer.wox index 57da0493f..c9691ea59 100644 --- a/UI/Templates/MailPartViewers/UIxMailPartImageViewer.wox +++ b/UI/Templates/MailPartViewers/UIxMailPartImageViewer.wox @@ -1,9 +1,23 @@ - + +
+ + + +

+
+ +

+
+
+ +
+
+
+
+
diff --git a/UI/Templates/MailPartViewers/UIxMailPartLinkViewer.wox b/UI/Templates/MailPartViewers/UIxMailPartLinkViewer.wox index 525b16086..eacce40da 100644 --- a/UI/Templates/MailPartViewers/UIxMailPartLinkViewer.wox +++ b/UI/Templates/MailPartViewers/UIxMailPartLinkViewer.wox @@ -3,37 +3,50 @@
- + + -
+ + diff --git a/UI/WebServerResources/js/Mailer/Message.service.js b/UI/WebServerResources/js/Mailer/Message.service.js index f2e775ca6..80060a4f0 100644 --- a/UI/WebServerResources/js/Mailer/Message.service.js +++ b/UI/WebServerResources/js/Mailer/Message.service.js @@ -209,6 +209,7 @@ parts.push(part); } else if (part.type == 'UIxMailPartICalViewer' || + part.type == 'UIxMailPartImageViewer' || part.type == 'UIxMailPartLinkViewer') { // Trusted content that can be compiled (Angularly-speaking) part.compile = true;