Monotone-Parent: 8566d6fbfa896a774b9907c3125e7b3de87296cd

Monotone-Revision: 2ad8b0c019808014c990f51cc69c4457fdb537c6

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-07-28T22:59:11
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2006-07-28 22:59:11 +00:00
parent bef8dad238
commit 39228fb130
73 changed files with 4023 additions and 1628 deletions

View File

@ -113,9 +113,11 @@ static NSString *AgenorShareLoginMarker = @".-.";
return [[ctx activeUser] fetchAllMailIdentitiesWithOnlyEmitterAccess:_flag];
}
- (NSArray *)fetchAllIdentities {
return [self fetchIdentitiesWithOnlyEmitterAccess:NO];
}
- (NSArray *)fetchIdentitiesWithEmitterPermissions {
return [self fetchIdentitiesWithOnlyEmitterAccess:YES];
}
@ -143,6 +145,7 @@ static NSString *AgenorShareLoginMarker = @".-.";
ct = [[ctClass alloc] initWithName:_key inContainer:self];
return [ct autorelease];
}
- (id)sharedMailAccountWithName:(NSString *)_key inContext:(id)_ctx {
static Class ctClass = Nil;
id ct;

View File

@ -31,9 +31,23 @@
@interface UIxPageFrame : UIxComponent
{
NSString *title;
id item;
id item;
BOOL isPopup;
}
- (NSString *) pageJavaScriptURL;
- (NSString *) productJavaScriptURL;
- (BOOL) hasPageSpecificJavaScript;
- (BOOL) hasProductSpecificJavaScript;
- (NSString *) pageCSSURL;
- (NSString *) productCSSURL;
- (BOOL) hasPageSpecificCSS;
- (BOOL) hasProductSpecificCSS;
- (void) setPopup: (BOOL) popup;
- (BOOL) isPopup;
@end
#endif /* UIXPAGEFRAME_H */

View File

@ -39,6 +39,7 @@
- (void)setTitle:(NSString *)_value {
ASSIGNCOPY(self->title, _value);
}
- (NSString *)title {
if ([self isUIxDebugEnabled])
return self->title;
@ -49,6 +50,7 @@
- (void)setItem:(id)_item {
ASSIGN(self->item, _item);
}
- (id)item {
return self->item;
}
@ -59,14 +61,16 @@
/* Help URL/target */
- (NSString *)helpURL {
- (NSString *)helpURL
{
return [NSString stringWithFormat: @"help/%@.html", self->title];
}
- (NSString *)helpWindowTarget {
- (NSString *)helpWindowTarget
{
return [NSString stringWithFormat: @"Help_%@", self->title];
}
/* notifications */
- (void)sleep {
@ -77,108 +81,66 @@
/* URL generation */
// TODO: I think all this should be done by the clientObject?!
- (NSString *)relativeHomePath {
- (NSString *) relativeHomePath
{
return [self relativePathToUserFolderSubPath: @""];
}
- (NSString *)relativeCalendarPath {
- (NSString *)relativeCalendarPath
{
return [self relativePathToUserFolderSubPath: @"Calendar/"];
}
- (NSString *)relativeContactsPath {
- (NSString *)relativeContactsPath
{
return [self relativePathToUserFolderSubPath: @"Contacts/"];
}
- (NSString *)relativeMailPath {
- (NSString *)relativeMailPath
{
return [self relativePathToUserFolderSubPath: @"Mail/"];
}
- (NSString *)logoffPath {
- (NSString *)logoffPath
{
return [self relativePathToUserFolderSubPath: @"logoff"];
}
/* page based JavaScript */
- (WOResourceManager *)pageResourceManager {
WOResourceManager *rm;
if ((rm = [[[self context] page] resourceManager]) == nil)
rm = [[WOApplication application] resourceManager];
return rm;
/* popup handling */
- (void) setPopup: (BOOL) popup
{
isPopup = popup;
}
- (BOOL) isPopup
{
WOComponent *page;
page = [[self context] page];
return ([page respondsToSelector: @selector(isPopup)]
&& [page isPopup]);
return isPopup;
}
/* page based JavaScript */
- (NSString *) pageJavaScriptURL
{
static NSMutableDictionary *pageToURL = nil;
WOResourceManager *rm;
WOComponent *page;
NSString *jsname, *pageName;
NSString *url;
NSString *pageJSFilename;
page = [[self context] page];
pageName = NSStringFromClass([page class]);
// TODO: does not seem to work! (gets reset): pageName = [page name];
if ((url = [pageToURL objectForKey:pageName]) != nil)
return [url isNotNull] ? url : nil;
pageJSFilename = [NSString stringWithFormat: @"%@.js",
NSStringFromClass([page class])];
if (pageToURL == nil)
pageToURL = [[NSMutableDictionary alloc] initWithCapacity:32];
rm = [self pageResourceManager];
jsname = [pageName stringByAppendingString: @".js"];
url = [rm urlForResourceNamed: jsname
inFramework: [[NSBundle bundleForClass: [page class]] bundlePath]
languages:nil
request:[[self context] request]];
/* cache */
[pageToURL setObject:(url ? url : (id)[NSNull null]) forKey:pageName];
return url;
return [self urlForResourceFilename: pageJSFilename];
}
- (NSString *) productJavaScriptURL
{
static NSMutableDictionary *pageToURL = nil;
WOResourceManager *rm;
WOComponent *page;
NSString *jsname, *pageName;
NSString *url;
NSString *fwJSFilename;
page = [[self context] page];
fwJSFilename = [NSString stringWithFormat: @"%@.js",
[page frameworkName]];
page = [[self context] page];
pageName = NSStringFromClass([page class]);
// TODO: does not seem to work! (gets reset): pageName = [page name];
if ((url = [pageToURL objectForKey:pageName]) != nil)
return [url isNotNull] ? url : nil;
if (pageToURL == nil)
pageToURL = [[NSMutableDictionary alloc] initWithCapacity:32];
rm = [self pageResourceManager];
jsname = [[page frameworkName] stringByAppendingString: @".js"];
url = [rm urlForResourceNamed: jsname
inFramework: [[NSBundle bundleForClass: [page class]] bundlePath]
languages:nil
request:[[self context] request]];
/* cache */
[pageToURL setObject:(url ? url : (id)[NSNull null]) forKey:pageName];
return url;
return [self urlForResourceFilename: fwJSFilename];
}
- (BOOL) hasPageSpecificJavaScript
@ -191,4 +153,38 @@
return ([[self productJavaScriptURL] length] > 0);
}
- (NSString *) pageCSSURL
{
WOComponent *page;
NSString *pageJSFilename;
page = [[self context] page];
pageJSFilename = [NSString stringWithFormat: @"%@.css",
NSStringFromClass([page class])];
return [self urlForResourceFilename: pageJSFilename];
}
- (NSString *) productCSSURL
{
WOComponent *page;
NSString *fwJSFilename;
page = [[self context] page];
fwJSFilename = [NSString stringWithFormat: @"%@.css",
[page frameworkName]];
return [self urlForResourceFilename: fwJSFilename];
}
- (BOOL) hasPageSpecificCSS
{
return ([[self pageCSSURL] length] > 0);
}
- (BOOL) hasProductSpecificCSS
{
return ([[self productCSSURL] length] > 0);
}
@end /* UIxPageFrame */

View File

@ -19,18 +19,13 @@
02111-1307, USA.
*/
#if LIB_FOUNDATION_LIBRARY
# include <Foundation/exceptions/GeneralExceptions.h>
#elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
# include <NGExtensions/NGObjectMacros.h>
# include <NGExtensions/NSString+Ext.h>
#endif
#import <NGExtensions/NGExtensions.h>
#import <NGObjWeb/NGObjWeb.h>
#import <NGObjWeb/SoObjects.h>
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
#import <SOGoUI/UIxComponent.h>
#include <SOGoUI/UIxComponent.h>
#import <NGObjWeb/SoComponent.h>
@class NSArray, NSDictionary;
@ -42,8 +37,6 @@
}
@end
#include <NGObjWeb/SoComponent.h>
@implementation UIxToolbar
- (void)dealloc {
@ -192,14 +185,13 @@
return label;
}
- (id) buttonImage {
WOResourceManager *rm;
- (id) buttonImage
{
NSString *image;
rm = [self pageResourceManager];
image = [buttonInfo objectForKey: @"image"];
if (image && [image length] > 0)
image = [rm urlForResourceNamed: image];
image = [self urlForResourceFilename: image];
return image;
}
@ -213,7 +205,7 @@
if ((onOffKey = [[self buttonInfo] valueForKey:@"enabled"]) == nil)
return YES;
return [[[[self context] page] valueForKeyPath:onOffKey] boolValue];
}

View File

@ -30,15 +30,6 @@
};
categories = {
SOGoUserLogin = {
methods = {
logoff = {
protectedBy = "View";
pageName = "UIxUserLogoff";
actionName = "logoffUser";
}
};
};
SOGoObject = {
methods = {
};

View File

@ -279,9 +279,4 @@
return [self redirectToLocation:uri];
}
- (BOOL) isPopup
{
return YES;
}
@end /* UIxContactEditorBase */

View File

@ -10,7 +10,7 @@
"Get Mail" = "Relever";
"Junk" = "Indésirable";
"Reply" = "Répondre";
"Reply All" = "Répo. à tous";
"Reply All" = "Rép. à tous";
"Print" = "Imprimer";
"Stop" = "Stop";
"Write" = "Écrire";
@ -19,7 +19,7 @@
"Home" = "Accueil";
"Calendar" = "Agenda";
"Addressbook" = "Carnet d'adresses";
"Addressbook" = "Adresses";
"Mail" = "Mail";
"Right Administration" = "Administration";
"Help" = "Aide";
@ -54,7 +54,7 @@
"all" = "Tous";
"read" = "Lus";
"unread" = "Non Lus";
"deleted" = "Éffacés";
"deleted" = "Effacés";
"flagged" = "Drapeau";
/* MailListView */
@ -80,7 +80,7 @@
"SentFolderName" = "Éléments envoyés";
"TrashFolderName" = "Corbeille";
"InboxFolderName" = "Boite de Réception";
"InboxFolderName" = "Boite de réception";
"DraftsFolderName" = "Brouillons";
"SieveFolderName" = "Filtres";
"Folders" = "Dossiers";
@ -93,3 +93,50 @@
"Add to Address Book..." = "Ajouter au carnet d'adresses";
"Compose Mail To" = "Écrire à";
"Create Filter From Message..." = "Créer un filtre à partir du message...";
/* Mailbox popup menus */
"Open in New Mail Window" = "Ouvrir dans une nouvelle fenétre";
"Copy Folder Location" = "Copier l'adresse du dossier";
"Subscribe..." = "S'abonner...";
"Mark Folder Read..." = "Marquer le dossier comme lu";
"New Folder..." = "Nouveau dossier...";
"Compact This Folder" = "Compacter ce dossier";
"Search Messages..." = "Rechercher dans les messages...";
"Properties..." = "Propriétés";
"New Subfolder..." = "Nouveau sous-dossier...";
"Rename Folder..." = "Renommer le dossier...";
"Delete Folder" = "Supprimer le dossier...";
"Get Messages for Account" = "Relever les messages de ce compte";
/* Message list popup menu */
"Open Message In New Window" = "Ouvrir dans une nouvelle fenétre";
"Reply to Sender Only" = "Répondre à l'expéditeur";
"Reply to All" = "Répondre à tout le monde";
"Forward" = "Transférer";
"Edit As New..." = "Modifier comme un nouveau message";
"Move To" = "Déplacer vers";
"Copy To" = "Copier vers";
"Label" = "Étiquette";
"Mark" = "Marquer";
"Save As..." = "Enregistrer comme...";
"Print Preview" = "Aperçu avant impression";
"Print..." = "Imprimer...";
"Delete Message" = "Supprimer le message";
/* Label popup menu */
"None" = "Aucune";
"Important" = "Important";
"Work" = "Travail";
"Personal" = "Personnel";
"To Do" = "À faire";
"Later" = "Peut attendre";
/* Mark popup menu */
"As Read" = "Comme lu";
"Thread As Read" = "La discussion comme lue";
"As Read By Date..." = "Comme lus par date...";
"All Read" = "Tous les messages comme lus";
"Flag" = "Avec un drapeau";
"As Junk" = "Comme indésirable";
"As Not Junk" = "Comme acceptable";
"Run Junk Mail Controls" = "Lancer le contrôle des indésirables";

View File

@ -19,11 +19,16 @@ MailerUI_OBJC_FILES += \
UIxMailMainFrame.m \
UIxMailTree.m \
UIxMailTreeBlock.m \
UIxMailTreeBlockJS.m \
UIxMailFolderMenu.m \
\
UIxMailAccountsView.m \
UIxMailAccountView.m \
UIxMailAccountViewContainer.m \
UIxMailListView.m \
UIxMailListViewContainer.m \
UIxMailView.m \
UIxMailViewContainer.m \
UIxMailSortableTableHeader.m \
UIxMailMoveToPopUp.m \
UIxMailFilterPanel.m \
@ -40,12 +45,11 @@ MailerUI_OBJC_FILES += \
UIxFilterList.m \
UIxSieveEditor.m \
\
UIxMailFolderACLEditor.m \
UIxMailFolderACLEditor.m
MailerUI_RESOURCE_FILES += \
Version \
product.plist \
UIxMailView.js \
Toolbars/*.toolbar \
Images/*.png

View File

@ -6,12 +6,12 @@
cssClass = "tbicon_send"; label = "Send"; },
{ link = "#"; target = "addressbook";
onclick = "openAddressbook(this);return false;";
image = "tb-mail-addressbook-flat-24x24.png";
cssClass = "tbicon_addressbook"; label = "Addressbook"; },
{ link = "#"; target = "anais";
image = "tb-compose-contacts-flat-24x24.png";
cssClass = "tbicon_addressbook"; label = "Contacts"; },
/* { link = "#"; target = "anais";
onclick = "openAnais(this);return false;";
image = "tbtb_anais.png";
cssClass = "tbicon_anais"; label = "Anais"; },
cssClass = "tbicon_anais"; label = "Anais"; }, */
{ link = "#"; isSafe = NO;
onclick = "clickedEditorAttach(this)";
image = "tb-compose-attach-flat-24x24.png";
@ -20,8 +20,5 @@
onclick = "clickedEditorSave(this);return false;";
image = "tb-mail-file-flat-24x24.png";
cssClass = "tbicon_save"; label = "Save"; },
{ link = "delete"; isSafe = NO;
image = "tb-mail-delete-flat-24x24.png";
cssClass = "tbicon_delete"; label = "Delete"; },
)
)

View File

@ -10,6 +10,10 @@
image = "tb-mail-write-flat-24x24.png";
onclick = "clickedCompose(this);return false;";
cssClass = "tbicon_compose"; label = "Write"; },
{ link = "#"; target = "addressbook";
onclick = "openAddressbook(this);return false;";
image = "tb-mail-addressbook-flat-24x24.png";
cssClass = "tbicon_addressbook"; label = "Addressbook"; },
),
( // second group
@ -30,28 +34,25 @@
),
( // third group
{ link = "delete"; isSafe = NO;
{ link = "delete";
isSafe = NO;
enabled = showMarkDeletedButton;
image = "tb-mail-delete-flat-24x24.png";
cssClass = "tbicon_delete"; label = "Delete"; },
{ link = "trash"; isSafe = NO;
enabled = showTrashButton;
image = "tb-mail-delete-flat-24x24.png";
cssClass = "tbicon_delete"; label = "Delete"; },
/* TODO: enable when we know how to mark junk (#971)
=> we could move the mail to the Junk folder?!
{ link = "#";
isSafe = NO;
cssClass = "tbicon_junk"; label = "Junk"; },
*/
{ link = "#";
isSafe = NO;
image = "tb-mail-junk-flat-24x24.png";
cssClass = "tbicon_junk"; label = "Junk";
},
),
/*
( // fourth group
// TODO: enable when we can print (#1207)
// { link = "#"; cssClass = "tbicon_print"; label = "Print"; },
{ link = "#"; cssClass = "tbicon_stop"; label = "Stop"; },
(
{ link = "#";
cssClass = "tbicon_print";
image = "tb-mail-print-flat-24x24.png";
label = "Print"; },
{ link = "#";
image = "tb-mail-stop-flat-24x24.png";
cssClass = "tbicon_stop";
label = "Stop"; },
),
*/
)

View File

@ -113,6 +113,12 @@ static BOOL useAltNamespace = NO;
return [self->inbox isCreateAllowedInACL];
}
- (NSString *) mailFolderName
{
return [NSString stringWithFormat: @"/%@",
[[self clientObject] nameInContainer]];
}
/* error redirects */
- (id)redirectToViewWithError:(id)_error {

View File

@ -0,0 +1,32 @@
/* UIxMailAccountViewContainer.h - this file is part of SOGo
*
* Copyright (C) 2006 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 UIXMAILACCOUNTVIEWCONTAINER_H
#define UIXMAILACCOUNTVIEWCONTAINER_H
#import <SOGoUI/UIxComponent.h>
@interface UIxMailAccountViewContainer : UIxComponent
@end
#endif /* UIXMAILLISTVIEWCONTAINER_H */

View File

@ -0,0 +1,27 @@
/* UIxMailAccountViewContainer.m - this file is part of SOGo
*
* Copyright (C) 2006 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 "UIxMailAccountViewContainer.h"
@implementation UIxMailAccountViewContainer
@end

View File

@ -35,4 +35,23 @@
return [self labelForKey:@"SOGo Mail Accounts"];
}
- (id) defaultAction
{
NSArray *c;
NSString *inbox;
id actionResult;
c = [[self clientObject] toManyRelationshipKeys];
if ([c count] == 1)
{
inbox = [NSString stringWithFormat: @"%@/INBOX",
[c objectAtIndex: 0]];
actionResult = [self redirectToLocation: inbox];
}
else
actionResult = self;
return actionResult;
}
@end /* UIxMailAccountsView */

View File

@ -280,17 +280,17 @@ static NSArray *infoKeys = nil;
SOGoMailAccounts *accounts;
SOGoMailAccount *account;
SOGoMailIdentity *identity;
if (useLocationBasedSentFolder) /* from will be based on location */
return;
if ([self->from isNotEmpty]) /* a from is already set */
return;
accountID = [[[self context] request] formValueForKey:@"account"];
if (![accountID isNotEmpty])
return;
accounts = [[self clientObject] mailAccountsFolder];
if ([accounts isExceptionOrNull])
return; /* we don't treat this as an error but are tolerant */
@ -306,7 +306,7 @@ static NSArray *infoKeys = nil;
return;
}
[self setFrom:[identity email]];
[self setFrom: [identity email]];
}
- (SOGoMailIdentity *)selectedMailIdentity {

View File

@ -27,7 +27,7 @@
#include <SoObjects/Mailer/SOGoMailObject.h>
#include "common.h"
#import "../Common/NSString+URL.h"
#import "../SOGoUI/NSString+URL.h"
@implementation UIxMailEditorAction

View File

@ -25,10 +25,6 @@
{
NSString *searchText;
NSString *searchCriteria;
struct {
int hideFrame:1;
int reserved:31;
} mfFlags;
}
@end
@ -79,8 +75,6 @@ static NSDictionary *filterToQualifier = nil;
{
searchText = nil;
searchCriteria = nil;
mfFlags.hideFrame = 0;
mfFlags.reserved = 0;
}
return self;
@ -94,16 +88,6 @@ static NSDictionary *filterToQualifier = nil;
/* accessors */
- (void)setHideFrame:(BOOL)_flag
{
self->mfFlags.hideFrame = _flag ? 1 : 0;
}
- (BOOL)hideFrame
{
return self->mfFlags.hideFrame ? YES : NO;
}
- (void)setSearchText: (NSString *)_txt
{
ASSIGNCOPY(self->searchText, _txt);

View File

@ -0,0 +1,46 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo 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
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#ifndef UIXMAILLISTVIEW_H
#define UIXMAILLISTVIEW_H
#include <SOGoUI/UIxComponent.h>
@class EOQualifier;
@interface UIxMailListView : UIxComponent
{
NSArray *sortedUIDs; /* we always need to retrieve all anyway! */
NSArray *messages;
unsigned firstMessageNumber;
id message;
EOQualifier *qualifier;
}
- (NSString *)defaultSortKey;
- (NSString *)imap4SortKey;
- (NSString *)imap4SortOrdering;
- (BOOL)isSortedDescending;
@end
#endif /* UIXMAILLISTVIEW_H */

View File

@ -19,8 +19,6 @@
02111-1307, USA.
*/
#include <SOGoUI/UIxComponent.h>
/*
UIxMailListView
@ -28,35 +26,20 @@
object.
*/
@class EOQualifier;
@interface UIxMailListView : UIxComponent
{
NSArray *sortedUIDs; /* we always need to retrieve all anyway! */
NSArray *messages;
unsigned firstMessageNumber;
id message;
EOQualifier *qualifier;
}
- (NSString *)defaultSortKey;
- (NSString *)imap4SortKey;
- (NSString *)imap4SortOrdering;
- (BOOL)isSortedDescending;
@end
#include "common.h"
#include <SoObjects/Mailer/SOGoMailFolder.h>
#include <SoObjects/Mailer/SOGoMailObject.h>
#include <NGObjWeb/SoObject+SoDAV.h>
@implementation UIxMailListView
#import "UIxMailListView.h"
static int attachmentFlagSize = 8096;
- (void)dealloc {
@implementation UIxMailListView
- (void) dealloc
{
[self->qualifier release];
[self->sortedUIDs release];
[self->messages release];
@ -64,15 +47,10 @@ static int attachmentFlagSize = 8096;
[super dealloc];
}
/* frame */
- (BOOL)hideFrame {
return [[[[self context] request] formValueForKey:@"noframe"] boolValue];
}
/* notifications */
- (void)sleep {
- (void) sleep
{
[self->qualifier release]; self->qualifier = nil;
[self->sortedUIDs release]; self->sortedUIDs = nil;
[self->messages release]; self->messages = nil;
@ -82,21 +60,28 @@ static int attachmentFlagSize = 8096;
/* accessors */
- (void)setMessage:(id)_msg {
- (void)setMessage:(id)_msg
{
ASSIGN(self->message, _msg);
}
- (id)message {
- (id) message
{
return self->message;
}
- (void)setQualifier:(EOQualifier *)_msg {
- (void) setQualifier: (EOQualifier *) _msg
{
ASSIGN(self->qualifier, _msg);
}
- (EOQualifier *)qualifier {
- (EOQualifier *) qualifier
{
return self->qualifier;
}
- (BOOL)showToAddress {
- (BOOL) showToAddress
{
NSString *ftype;
ftype = [[self clientObject] valueForKey:@"outlookFolderClass"];
@ -105,10 +90,13 @@ static int attachmentFlagSize = 8096;
/* title */
- (NSString *)objectTitle {
- (NSString *) objectTitle
{
return [[self clientObject] nameInContainer];
}
- (NSString *)panelTitle {
- (NSString *) panelTitle
{
NSString *s;
s = [self labelForKey:@"View Mail Folder"];
@ -119,24 +107,35 @@ static int attachmentFlagSize = 8096;
/* derived accessors */
- (BOOL)isMessageDeleted {
- (BOOL) isMessageDeleted
{
NSArray *flags;
flags = [[self message] valueForKey:@"flags"];
return [flags containsObject:@"deleted"];
}
- (BOOL)isMessageRead {
- (BOOL) isMessageRead
{
NSArray *flags;
flags = [[self message] valueForKey:@"flags"];
return [flags containsObject:@"seen"];
}
- (NSString *)messageUidString {
- (NSString *) messageUidString
{
return [[[self message] valueForKey:@"uid"] stringValue];
}
- (NSString *)messageSubjectCellStyleClass {
- (NSString *) messageCellStyleClass
{
return [self isMessageDeleted]
? @"mailer_listcell_deleted"
: @"mailer_listcell_regular";
}
- (NSString *) messageSubjectCellStyleClass
{
return [NSString stringWithFormat: @"%@ %@",
[self messageCellStyleClass],
([self isMessageRead]
@ -144,13 +143,8 @@ static int attachmentFlagSize = 8096;
: @"mailer_unreadmailsubject")];
}
- (NSString *)messageCellStyleClass {
return [self isMessageDeleted]
? @"mailer_listcell_deleted"
: @"mailer_listcell_regular";
}
- (BOOL)hasMessageAttachment {
- (BOOL) hasMessageAttachment
{
/* we detect attachments by size ... */
unsigned size;
@ -160,7 +154,8 @@ static int attachmentFlagSize = 8096;
/* fetching messages */
- (NSArray *)fetchKeys {
- (NSArray *) fetchKeys
{
/* Note: see SOGoMailManager.m for allowed IMAP4 keys */
static NSArray *keys = nil;
if (keys == nil) {
@ -170,10 +165,12 @@ static int attachmentFlagSize = 8096;
return keys;
}
- (NSString *)defaultSortKey {
- (NSString *) defaultSortKey
{
return @"DATE";
}
- (NSString *)imap4SortKey {
- (NSString *) imap4SortKey
{
NSString *sort;
sort = [[[self context] request] formValueForKey:@"sort"];
@ -183,7 +180,8 @@ static int attachmentFlagSize = 8096;
return [sort uppercaseString];
}
- (BOOL)isSortedDescending {
- (BOOL) isSortedDescending
{
NSString *desc;
desc = [[[self context] request] formValueForKey:@"desc"];
@ -192,7 +190,8 @@ static int attachmentFlagSize = 8096;
return [desc boolValue] ? YES : NO;
}
- (NSString *)imap4SortOrdering {
- (NSString *) imap4SortOrdering
{
NSString *sort;
sort = [self imap4SortKey];
@ -201,13 +200,15 @@ static int attachmentFlagSize = 8096;
return [@"REVERSE " stringByAppendingString:sort];
}
- (NSRange)fetchRange {
- (NSRange) fetchRange
{
if (self->firstMessageNumber == 0)
return NSMakeRange(0, 50);
return NSMakeRange(self->firstMessageNumber - 1, 50);
}
- (NSArray *)sortedUIDs {
- (NSArray *) sortedUIDs
{
if (self->sortedUIDs != nil)
return self->sortedUIDs;
@ -216,14 +217,19 @@ static int attachmentFlagSize = 8096;
sortOrdering:[self imap4SortOrdering]] retain];
return self->sortedUIDs;
}
- (unsigned int)totalMessageCount {
- (unsigned int) totalMessageCount
{
return [self->sortedUIDs count];
}
- (BOOL)showsAllMessages {
- (BOOL) showsAllMessages
{
return ([[self sortedUIDs] count] <= [self fetchRange].length) ? YES : NO;
}
- (NSRange)fetchBlock {
- (NSRange) fetchBlock
{
NSRange r;
unsigned len;
NSArray *uids;
@ -249,27 +255,33 @@ static int attachmentFlagSize = 8096;
r.length = len - r.location;
return r;
}
- (unsigned int)firstMessageNumber {
- (unsigned int) firstMessageNumber
{
return [self fetchBlock].location + 1;
}
- (unsigned int)lastMessageNumber {
- (unsigned int) lastMessageNumber
{
NSRange r;
r = [self fetchBlock];
return r.location + r.length;
}
- (BOOL)hasPrevious {
- (BOOL) hasPrevious
{
return [self fetchBlock].location == 0 ? NO : YES;
}
- (BOOL)hasNext {
- (BOOL) hasNext
{
NSRange r = [self fetchBlock];
return r.location + r.length >= [[self sortedUIDs] count] ? NO : YES;
}
- (unsigned int)nextFirstMessageNumber {
- (unsigned int) nextFirstMessageNumber
{
return [self firstMessageNumber] + [self fetchRange].length;
}
- (unsigned int)prevFirstMessageNumber {
- (unsigned int) prevFirstMessageNumber
{
NSRange r;
unsigned idx;
@ -280,7 +292,8 @@ static int attachmentFlagSize = 8096;
return 1;
}
- (NSArray *)messages {
- (NSArray *) messages
{
NSArray *uids;
NSArray *msgs;
NSRange r;
@ -302,10 +315,14 @@ static int attachmentFlagSize = 8096;
/* URL processing */
- (NSString *)messageViewTarget {
return [@"SOGo_msg_" stringByAppendingString:[self messageUidString]];
- (NSString *) messageViewTarget
{
return [NSString stringWithFormat: @"SOGo_msg_%@",
[self messageUidString]];
}
- (NSString *)messageViewURL {
- (NSString *) messageViewURL
{
// TODO: noframe only when view-target is empty
// TODO: markread only if the message is unread
NSString *s;
@ -314,11 +331,13 @@ static int attachmentFlagSize = 8096;
if (![self isMessageRead]) s = [s stringByAppendingString:@"&markread=1"];
return s;
}
- (NSString *)markReadURL {
- (NSString *) markReadURL
{
return [@"markMessageRead?uid=" stringByAppendingString:
[self messageUidString]];
}
- (NSString *)markUnreadURL {
- (NSString *) markUnreadURL
{
return [@"markMessageUnread?uid=" stringByAppendingString:
[self messageUidString]];
}
@ -345,35 +364,41 @@ static int attachmentFlagSize = 8096;
return [@"unreaddiv_" stringByAppendingString:[self messageUidString]];
}
- (NSString *)clickedMsgJS {
- (NSString *) clickedMsgJS
{
/* return 'false' aborts processing */
return [NSString stringWithFormat:@"clickedUid(this, '%@'); return false",
[self messageUidString]];
}
// the following are unused?
- (NSString *)dblClickedMsgJS {
- (NSString *) dblClickedMsgJS
{
return [NSString stringWithFormat:@"doubleClickedUid(this, '%@')",
[self messageUidString]];
}
// the following are unused?
- (NSString *)highlightRowJS {
- (NSString *) highlightRowJS
{
return [NSString stringWithFormat:@"highlightUid(this, '%@')",
[self messageUidString]];
}
- (NSString *)lowlightRowJS {
- (NSString *) lowlightRowJS
{
return [NSString stringWithFormat:@"lowlightUid(this, '%@')",
[self messageUidString]];
}
- (NSString *)markUnreadJS {
- (NSString *) markUnreadJS
{
return [NSString stringWithFormat:
@"mailListMarkMessage(this, 'markMessageUnread', "
@"'%@', false)",
[self messageUidString]];
}
- (NSString *)markReadJS {
- (NSString *) markReadJS
{
return [NSString stringWithFormat:
@"mailListMarkMessage(this, 'markMessageRead', "
@"'%@', true)",
@ -382,7 +407,8 @@ static int attachmentFlagSize = 8096;
/* error redirects */
- (id)redirectToViewWithError:(id)_error {
- (id) redirectToViewWithError: (id) _error
{
// TODO: DUP in UIxMailAccountView
// TODO: improve, localize
// TODO: there is a bug in the treeview which preserves the current URL for
@ -404,7 +430,8 @@ static int attachmentFlagSize = 8096;
/* active message */
- (SOGoMailObject *)lookupActiveMessage {
- (SOGoMailObject *) lookupActiveMessage
{
NSString *uid;
if ((uid = [[[self context] request] formValueForKey:@"uid"]) == nil)
@ -416,16 +443,13 @@ static int attachmentFlagSize = 8096;
/* actions */
- (id)defaultAction {
self->firstMessageNumber =
[[[[self context] request] formValueForKey:@"idx"] intValue];
return self;
}
- (BOOL)isJavaScriptRequest {
- (BOOL) isJavaScriptRequest
{
return [[[[self context] request] formValueForKey:@"jsonly"] boolValue];
}
- (id)javaScriptOK {
- (id) javaScriptOK
{
WOResponse *r;
r = [[self context] response];
@ -433,7 +457,21 @@ static int attachmentFlagSize = 8096;
return r;
}
- (id)markMessageUnreadAction {
- (id) defaultAction
{
self->firstMessageNumber =
[[[[self context] request] formValueForKey:@"idx"] intValue];
return self;
}
- (id) viewAction
{
return [self defaultAction];
}
- (id) markMessageUnreadAction
{
NSException *error;
if ((error = [[self lookupActiveMessage] removeFlags:@"seen"]) != nil)
@ -445,7 +483,9 @@ static int attachmentFlagSize = 8096;
return [self redirectToLocation:@"view"];
}
- (id)markMessageReadAction {
- (id) markMessageReadAction
{
NSException *error;
if ((error = [[self lookupActiveMessage] addFlags:@"seen"]) != nil)
@ -458,7 +498,8 @@ static int attachmentFlagSize = 8096;
return [self redirectToLocation:@"view"];
}
- (id)getMailAction {
- (id) getMailAction
{
// TODO: we might want to flush the caches?
id client;
@ -466,18 +507,21 @@ static int attachmentFlagSize = 8096;
return [NSException exceptionWithHTTPStatus:404 /* Not Found */
reason:@"did not find mail folder"];
}
if (![client respondsToSelector:@selector(flushMailCaches)]) {
return [NSException exceptionWithHTTPStatus:500 /* Server Error */
reason:
@"invalid client object (does not support flush)"];
}
if (![client respondsToSelector:@selector(flushMailCaches) ])
{
return [NSException exceptionWithHTTPStatus:500 /* Server Error */
reason:
@"invalid client object (does not support flush)"];
}
[client flushMailCaches];
return [self redirectToLocation:@"view"];
}
- (id)expungeAction {
- (id) expungeAction
{
// TODO: we might want to flush the caches?
NSException *error;
id client;
@ -495,7 +539,8 @@ static int attachmentFlagSize = 8096;
return [self redirectToLocation:@"view"];
}
- (id)emptyTrashAction {
- (id) emptyTrashAction
{
// TODO: we might want to flush the caches?
NSException *error;
id client;
@ -536,7 +581,8 @@ static int attachmentFlagSize = 8096;
/* folder operations */
- (id)createFolderAction {
- (id) createFolderAction
{
NSException *error;
NSString *folderName;
id client;
@ -562,7 +608,8 @@ static int attachmentFlagSize = 8096;
return [self redirectToLocation:[folderName stringByAppendingString:@"/"]];
}
- (id)deleteFolderAction {
- (id) deleteFolderAction
{
NSException *error;
NSString *url;
id client;
@ -583,4 +630,6 @@ static int attachmentFlagSize = 8096;
return [self redirectToLocation:url];
}
@end /* UIxMailListView */
@end
/* UIxMailListView */

View File

@ -0,0 +1,34 @@
/* UIxMailListViewContainer.h - this file is part of SOGo
*
* Copyright (C) 2006 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 UIXMAILLISTVIEWCONTAINER_H
#define UIXMAILLISTVIEWCONTAINER_H
#import <SOGoUI/UIxComponent.h>
@interface UIxMailListViewContainer : UIxComponent
- (NSString *) mailFolderName;
@end
#endif /* UIXMAILLISTVIEWCONTAINER_H */

View File

@ -0,0 +1,51 @@
/* UIxMailListViewContainer.m - this file is part of SOGo
*
* Copyright (C) 2006 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 <Foundation/NSArray.h>
#import <NGObjWeb/SoObjects.h>
#import <SoObjects/Mailer/SOGoMailObject.h>
#import <SoObjects/Mailer/SOGoMailAccounts.h>
#import "UIxMailListViewContainer.h"
@implementation UIxMailListViewContainer
- (NSString *) mailFolderName
{
NSMutableArray *mailboxes;
SOGoMailObject *currentObject;
mailboxes = [NSMutableArray new];
[mailboxes autorelease];
currentObject = [self clientObject];
while (![currentObject isKindOfClass: [SOGoMailAccounts class]])
{
[mailboxes insertObject: [currentObject nameInContainer] atIndex: 0];
currentObject = [currentObject container];
}
return [NSString stringWithFormat: @"/%@",
[mailboxes componentsJoinedByString: @"/"]];
}
@end

View File

@ -0,0 +1,44 @@
/* UIxMailMainFrame.h - this file is part of $PROJECT_NAME_HERE$
*
* Copyright (C) 2006 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 UIXMAILMAINFRAME_H
#define UIXMAILMAINFRAME_H
#import "../Common/UIxPageFrame.h"
@interface UIxMailMainFrame : UIxPageFrame
{
NSString *rootURL;
NSString *userRootURL;
struct {
int hideFolderTree:1;
int reserved:31;
} mmfFlags;
}
- (NSString *)rootURL;
- (NSString *)userRootURL;
- (NSString *)calendarRootURL;
@end
#endif /* UIXMAILMAINFRAME_H */

View File

@ -19,31 +19,11 @@
02111-1307, USA.
*/
#include <SOGoUI/UIxComponent.h>
#include "../Common/UIxPageFrame.h"
#import <SOGoUI/UIxComponent.h>
#import "UIxMailMainFrame.h"
@interface UIxMailMainFrame : UIxPageFrame
{
NSString *rootURL;
NSString *userRootURL;
struct {
int hideFolderTree:1;
int hideFrame:1; /* completely disables all the frame around the comp. */
int reserved:30;
} mmfFlags;
}
- (NSString *)rootURL;
- (NSString *)userRootURL;
- (NSString *)calendarRootURL;
@end
@interface UIxMailPanelFrame : UIxMailMainFrame
@end
#include "common.h"
#include <NGObjWeb/SoComponent.h>
#import "common.h"
#import <NGObjWeb/SoComponent.h>
@implementation UIxMailMainFrame
@ -78,14 +58,7 @@ static NSString *treeRootClassName = nil;
return self->mmfFlags.hideFolderTree ? YES : NO;
}
- (void)setHideFrame:(BOOL)_flag {
self->mmfFlags.hideFrame = _flag ? 1 : 0;
}
- (BOOL)hideFrame {
return self->mmfFlags.hideFrame ? YES : NO;
}
- (NSString *)pageFormURL {
- (NSString *) pageFormURL {
NSString *u;
NSRange r;
@ -179,6 +152,7 @@ static NSString *treeRootClassName = nil;
- (NSString *)calendarRootURL {
return [[self userRootURL] stringByAppendingString:@"Calendar/"];
}
- (NSString *)contactsRootURL {
return [[self userRootURL] stringByAppendingString:@"Contacts/"];
}
@ -210,14 +184,3 @@ static NSString *treeRootClassName = nil;
}
@end /* UIxMailMainFrame */
@implementation UIxMailPanelFrame
- (BOOL)hideFolderTree {
return YES;
}
- (BOOL)showLinkBanner {
return NO;
}
@end /* UIxMailPanelFrame */

View File

@ -65,6 +65,7 @@
- (void)setSortKey:(NSString *)_sortKey {
ASSIGNCOPY(self->sortKey, _sortKey);
}
- (NSString *)sortKey {
return self->sortKey;
}

View File

@ -0,0 +1,43 @@
/* UIxMailTree.h - this file is part of $PROJECT_NAME_HERE$
*
* Copyright (C) 2006 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 UIXMAILTREE_H
#define UIXMAILTREE_H
#import <SOGoUI/UIxComponent.h>
@class NSString;
@interface UIxMailTree : UIxComponent
{
NSString *rootClassName;
NSString *treeFolderAction;
NSMutableDictionary *flattenedNodes;
id rootNodes;
id item;
}
- (NSArray *) flattenedNodes;
@end
#endif /* UIXMAILTREE_H */

View File

@ -19,23 +19,16 @@
02111-1307, USA.
*/
#include <SOGoUI/UIxComponent.h>
#import "common.h"
@interface UIxMailTree : UIxComponent
{
NSString *rootClassName;
NSString *treeFolderAction;
id rootNodes;
id item;
}
@end
#import <SoObjects/Mailer/SOGoMailBaseObject.h>
#import <SoObjects/Mailer/SOGoMailAccount.h>
#import <SoObjects/Mailer/SOGoMailFolder.h>
#import <NGObjWeb/SoComponent.h>
#import <NGObjWeb/SoObject+SoDAV.h>
#include "UIxMailTreeBlock.h"
#include <SoObjects/Mailer/SOGoMailBaseObject.h>
#include <SoObjects/Mailer/SOGoMailAccount.h>
#include "common.h"
#include <NGObjWeb/SoComponent.h>
#include <NGObjWeb/SoObject+SoDAV.h>
#import "UIxMailTree.h"
#import "UIxMailTreeBlock.h"
/*
Support special icons:
@ -58,21 +51,34 @@
static BOOL debugBlocks = NO;
+ (void)initialize {
+ (void)initialize
{
[UIxMailTreeBlock class]; // ensure that globals are initialized
}
- (void)dealloc {
- (id) init
{
if ((self = [super init]))
{
flattenedNodes = [NSMutableDictionary new];
}
return self;
}
- (void) dealloc
{
[self->treeFolderAction release];
[self->rootClassName release];
[self->rootNodes release];
[self->item release];
[flattenedNodes release];
[super dealloc];
}
/* icons */
- (NSString *)defaultIconName {
- (NSString *) defaultIconName
{
return @"tbtv_leaf_corner_17x17.gif";
}
@ -133,7 +139,7 @@ static BOOL debugBlocks = NO;
[self logWithFormat:@"to-many: %@ %@", _object,
[names componentsJoinedByString:@","]];
}
count = [names count];
ma = [NSMutableArray arrayWithCapacity:(count + 1)];
for (i = 0; i < count; i++) {
@ -180,40 +186,48 @@ static BOOL debugBlocks = NO;
return [_object isKindOfClass:NSClassFromString([self rootClassName])];
}
- (NSString *)treeNavigationLinkForObject:(id)_object atDepth:(int)_depth {
NSString *link;
unsigned i;
link = [[_object nameInContainer] stringByAppendingString:@"/"];
link = [link stringByAppendingString:[self treeFolderAction]];
switch (_depth) {
case 0: return link;
case 1: return [@"../" stringByAppendingString:link];
case 2: return [@"../../" stringByAppendingString:link];
case 3: return [@"../../../" stringByAppendingString:link];
}
- (NSString *)treeNavigationLinkForObject:(id)_object
atDepth:(int)_depth
{
NSMutableString *link;
int i;
link = [NSMutableString new];
[link autorelease];
for (i = 0; i < _depth; i++)
link = [@"../" stringByAppendingString:link];
[link appendString: @"../"];
[link appendFormat: @"%@/%@",
[_object nameInContainer],
[self treeFolderAction]];
return link;
}
- (void)getTitle:(NSString **)_t andIcon:(NSString **)_icon
forObject:(id)_object
- (void) getTitle: (NSString **)_t
folderType: (NSString **)_ft
andIcon: (NSString **)_icon
forObject: (id)_object
{
// TODO: need to refactor for reuse!
NSString *ftype;
unsigned len;
// if ([_object respondsToSelector: @selector (outlookFolderClass)])
// ftype = [_object outlookFolderClass];
// else
ftype = [_object valueForKey:@"outlookFolderClass"];
len = [ftype length];
ftype = [_object valueForKey:@"outlookFolderClass"];
len = [ftype length];
*_ft = nil;
switch (len) {
case 8:
if ([ftype isEqualToString:@"IPF.Sent"]) {
*_t = [self labelForKey:@"SentFolderName"];
*_icon = @"tbtv_sent_17x17.gif";
*_ft = @"sent";
return;
}
break;
@ -221,11 +235,13 @@ static BOOL debugBlocks = NO;
if ([ftype isEqualToString:@"IPF.Inbox"]) {
*_t = [self labelForKey:@"InboxFolderName"];
*_icon = @"tbtv_inbox_17x17.gif";
*_ft = @"inbox";
return;
}
if ([ftype isEqualToString:@"IPF.Trash"]) {
*_t = [self labelForKey:@"TrashFolderName"];
*_icon = @"tbtv_trash_17x17.gif";
*_ft = @"trash";
return;
}
break;
@ -233,11 +249,13 @@ static BOOL debugBlocks = NO;
if ([ftype isEqualToString:@"IPF.Drafts"]) {
*_t = [self labelForKey:@"DraftsFolderName"];
*_icon = @"tbtv_drafts_17x17.gif";
*_ft = @"drafts";
return;
}
if ([ftype isEqualToString:@"IPF.Filter"]) {
*_t = [self labelForKey:@"SieveFolderName"];
*_icon = nil;
*_ft = @"sieve";
return;
}
break;
@ -249,32 +267,30 @@ static BOOL debugBlocks = NO;
if ([_object isKindOfClass:NSClassFromString(@"SOGoMailFolder")])
*_icon = nil;
else if ([_object isKindOfClass:NSClassFromString(@"SOGoMailAccount")]) {
*_icon = @"tbtv_inbox_17x17.gif";
*_icon = @"tbtv_account_17x17.gif";
*_ft = @"account";
/* title processing is somehow Agenor specific and should be done in UI */
*_t = [[_object nameInContainer] titleForSOGoIMAP4String];
}
else if ([_object isKindOfClass:NSClassFromString(@"SOGoMailAccounts")])
*_icon = @"tbtv_inbox_17x17.gif";
*_icon = @"tbtv_account_17x17.gif";
else if ([_object isKindOfClass:NSClassFromString(@"SOGoUserFolder")])
*_icon = @"tbtv_inbox_17x17.gif";
else {
// TODO: use drafts icon for other SOGo folders
*_icon = @"tbtv_drafts_17x17.gif";
}
NSLog (@"title: '%@', ftype: '%@', class: '%@', icon: '%@'",
*_t,
ftype, NSStringFromClass([_object class]), *_icon);
return;
}
- (UIxMailTreeBlock *)treeNavigationBlockForLeafNode:(id)_o atDepth:(int)_d {
- (UIxMailTreeBlock *) treeNavigationBlockForLeafNode: (id) _o
atDepth: (int) _d
{
UIxMailTreeBlock *md;
NSString *n, *i;
NSString *n, *i, *ft;
id blocks;
/*
Trigger plus in treeview if it has subfolders. It is an optimization that
we do not generate blocks for folders which are not displayed anyway.
@ -282,14 +298,16 @@ static BOOL debugBlocks = NO;
blocks = [[_o toManyRelationshipKeys] count] > 0
? UIxMailTreeHasChildrenMarker
: nil;
[self getTitle:&n andIcon:&i forObject:_o];
md = [UIxMailTreeBlock blockWithName:nil
title:n iconName:i
link:[self treeNavigationLinkForObject:_o atDepth:_d]
isPathNode:NO isActiveNode:NO
childBlocks:blocks];
[self getTitle: &n folderType: &ft andIcon: &i forObject:_o];
md = [UIxMailTreeBlock blockWithName: nil
title: n
iconName: i
link: [self treeNavigationLinkForObject:_o atDepth:_d]
isPathNode:NO
isActiveNode:NO
childBlocks: blocks];
return md;
}
@ -301,7 +319,7 @@ static BOOL debugBlocks = NO;
UIxMailTreeBlock *md;
NSMutableArray *blocks;
NSArray *folders;
NSString *title, *icon;
NSString *title, *icon, *ft;
unsigned i, count;
if (debugBlocks) {
@ -317,7 +335,7 @@ static BOOL debugBlocks = NO;
for (i = 0; i < count; i++) {
id block;
block = [self treeNavigationBlockForLeafNode:[folders objectAtIndex:i]
block = [self treeNavigationBlockForLeafNode: [folders objectAtIndex:i]
atDepth:0];
if ([block isNotNull]) [blocks addObject:block];
}
@ -326,18 +344,63 @@ static BOOL debugBlocks = NO;
/* build block */
[self getTitle:&title andIcon:&icon forObject:_object];
[self getTitle:&title folderType: &ft andIcon:&icon forObject:_object];
md = [UIxMailTreeBlock blockWithName:[_object nameInContainer]
title:title iconName:icon
link:[@"../" stringByAppendingString:
[_object nameInContainer]]
isPathNode:YES isActiveNode:YES
childBlocks:blocks];
md = [UIxMailTreeBlock blockWithName: [_object nameInContainer]
title: title
iconName: icon
link: [@"../" stringByAppendingString:
[_object nameInContainer]]
isPathNode: YES
isActiveNode: YES
childBlocks: blocks];
return md;
}
- (UIxMailTreeBlock *)treeNavigationBlockForActiveNode:(id)_object {
- (UIxMailTreeBlock *) fullTreeNavigationBlockForNode: (id)_object
{
UIxMailTreeBlock *md;
NSMutableArray *blocks;
NSArray *folders;
NSString *title, *icon, *ft;
unsigned i, count;
if (debugBlocks)
[self logWithFormat:@"block for root node 0x%08X<%@>",
_object, NSStringFromClass([_object class])];
folders = [self fetchSubfoldersOfObject: _object];
count = [folders count];
blocks = [NSMutableArray arrayWithCapacity: count];
for (i = 0; i < count; i++)
{
id block;
block = [self fullTreeNavigationBlockForNode: [folders objectAtIndex:i]];
if ([block isNotNull]) [blocks addObject:block];
}
if (![blocks count])
blocks = nil;
[self getTitle: &title folderType: &ft andIcon: &icon forObject: _object];
// NSLog (@"*********** title = '%@'/icon = '%@'", title, icon);
md = [UIxMailTreeBlock blockWithName: [_object nameInContainer]
title: title
iconName: icon
link: [@"../" stringByAppendingString:
[_object nameInContainer]]
isPathNode: YES
isActiveNode: YES
childBlocks: blocks];
[md setFolderType: ft];
return md;
}
- (UIxMailTreeBlock *) treeNavigationBlockForActiveNode: (id) _object
{
/*
This generates the block for the clientObject (the object which has the
focus)
@ -345,7 +408,7 @@ static BOOL debugBlocks = NO;
UIxMailTreeBlock *md;
NSMutableArray *blocks;
NSArray *folders;
NSString *title, *icon;
NSString *title, *icon, *ft;
unsigned i, count;
// TODO: maybe we can join the two implementations, this might not be
@ -367,26 +430,29 @@ static BOOL debugBlocks = NO;
for (i = 0; i < count; i++) {
UIxMailTreeBlock *block;
block = [self treeNavigationBlockForLeafNode:[folders objectAtIndex:i]
atDepth:0];
block = [self treeNavigationBlockForLeafNode: [folders objectAtIndex:i]
atDepth: 0];
if ([block isNotNull]) [blocks addObject:block];
}
if ([blocks count] == 0) blocks = nil;
/* build block */
[self getTitle:&title andIcon:&icon forObject:_object];
md = [UIxMailTreeBlock blockWithName:[_object nameInContainer]
title:title iconName:icon
link:@"."
isPathNode:YES isActiveNode:YES
childBlocks:blocks];
[self getTitle:&title folderType: &ft andIcon:&icon forObject:_object];
md = [UIxMailTreeBlock blockWithName: [_object nameInContainer]
title: title
iconName: icon
link: @"."
isPathNode: YES
isActiveNode: YES
childBlocks: blocks];
return md;
}
- (UIxMailTreeBlock *)treeNavigationBlockForObject:(id)_object
withActiveChildBlock:(UIxMailTreeBlock *)_activeChildBlock
depth:(int)_depth
- (UIxMailTreeBlock *)
treeNavigationBlockForObject: (id) _object
withActiveChildBlock: (UIxMailTreeBlock *) _activeChildBlock
depth: (int) _depth
{
/*
Note: 'activeChildBlock' here doesn't mean that the block is the selected
@ -397,7 +463,7 @@ static BOOL debugBlocks = NO;
NSMutableArray *blocks;
NSString *activeName;
NSArray *folders;
NSString *title, *icon;
NSString *title, *icon, *ft;
unsigned i, count;
activeName = [_activeChildBlock valueForKey:@"name"];
@ -411,11 +477,11 @@ static BOOL debugBlocks = NO;
UIxMailTreeBlock *block;
id folder;
NSLog(@"activeName: %@", activeName);
folder = [folders objectAtIndex:i];
block = [activeName isEqualToString:[folder nameInContainer]]
? _activeChildBlock
: [self treeNavigationBlockForLeafNode:folder atDepth:_depth];
: [self treeNavigationBlockForLeafNode: folder
atDepth:_depth];
if ([block isNotNull]) [blocks addObject:block];
}
@ -425,17 +491,19 @@ static BOOL debugBlocks = NO;
else
blocks = nil;
}
/* build block */
[self getTitle:&title andIcon:&icon forObject:_object];
resultBlock = [UIxMailTreeBlock blockWithName:[_object nameInContainer]
title:title iconName:icon
link:
[self treeNavigationLinkForObject:_object
atDepth:(_depth + 1)]
isPathNode:YES isActiveNode:NO
childBlocks:blocks];
[self getTitle:&title folderType: &ft andIcon:&icon forObject:_object];
resultBlock
= [UIxMailTreeBlock blockWithName: [_object nameInContainer]
title: title
iconName: icon
link:
[self treeNavigationLinkForObject: _object
atDepth: (_depth + 1)]
isPathNode:YES isActiveNode:NO
childBlocks:blocks];
/* recurse up unless we are at the root */
@ -478,7 +546,7 @@ static BOOL debugBlocks = NO;
if (debugBlocks) [self logWithFormat:@"ACTIVE parent block ..."];
block = [self treeNavigationBlockForObject:[_object container]
withActiveChildBlock:block
depth:1];
depth: 1];
if (debugBlocks) [self logWithFormat:@"done: %@", block];
return block;
}
@ -501,6 +569,78 @@ static BOOL debugBlocks = NO;
return self->rootNodes;
}
- (int) addNodes: (NSArray *) nodes
atSerial: (int) startSerial
forParent: (int) parent
withRootName: (NSString *) rootName
toArray: (NSMutableArray *) array
{
unsigned int count, max, currentSerial;
UIxMailTreeBlock *curNode;
NSArray *children;
NSString *fullName;
max = [nodes count];
currentSerial = startSerial;
for (count = 0; count < max; count++)
{
curNode = [nodes objectAtIndex: count];
fullName = [rootName stringByAppendingFormat: @"/%@", [curNode name]];
[curNode setName: fullName];
[curNode setSerial: currentSerial];
[curNode setParent: parent];
[array addObject: curNode];
if ([curNode hasChildren])
currentSerial = [self addNodes: [curNode children]
atSerial: currentSerial + 1
forParent: currentSerial
withRootName: fullName
toArray: array];
else
currentSerial++;
}
return currentSerial;
}
- (NSArray *) flattenedNodes
{
NSMutableArray *flattenedBlocks = nil;
NSString *userKey;
UIxMailTreeBlock *rootNode; // , *curNode;
id mailAccounts;
// unsigned int count, max;
userKey = [[self user] login];
flattenedBlocks = [flattenedNodes objectForKey: userKey];
if (!flattenedBlocks)
{
flattenedBlocks = [NSMutableArray new];
if (![[self clientObject] isKindOfClass: NSClassFromString(@"SOGoMailAccounts")])
mailAccounts = [[self clientObject] mailAccountsFolder];
else
mailAccounts = [self clientObject];
rootNode = [self fullTreeNavigationBlockForNode: mailAccounts];
[self addNodes: [rootNode children]
atSerial: 1
forParent: 0
withRootName: @""
toArray: flattenedBlocks];
[flattenedNodes setObject: flattenedBlocks forKey: userKey];
// max = [flattenedBlocks count];
// for (count = 0; count < max; count++)
// {
// curNode = [flattenedBlocks objectAtIndex: count];
// NSLog (@"%d: %@/%@", count, [curNode title], [curNode iconName]);
// }
}
return flattenedBlocks;
}
/* notifications */
- (void)sleep {

View File

@ -41,6 +41,9 @@ extern id UIxMailTreeHasChildrenMarker;
NSString *link;
NSArray *blocks;
NSString *iconName;
NSString *folderType;
int serial;
int parent;
struct {
int isPath:1;
int isActive:1;
@ -48,19 +51,48 @@ extern id UIxMailTreeHasChildrenMarker;
} flags;
}
+ (id)blockWithName:(NSString *)_n title:(NSString *)_t iconName:(NSString *)_i
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive
childBlocks:(NSArray *)_blocks;
+ (id) blockWithName: (NSString *)_n
title: (NSString *)_t
iconName: (NSString *)_i
link: (NSString *)_link
isPathNode: (BOOL)_isPath
isActiveNode: (BOOL)_isActive
childBlocks: (NSArray *)_blocks;
- (id)initWithName:(NSString *)_n title:(NSString *)_t iconName:(NSString *)_i
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive
childBlocks:(NSArray *)_blocks;
- (id)initWithName: (NSString *)_n
title: (NSString *)_t
iconName: (NSString *)_i
link: (NSString *)_link
isPathNode: (BOOL)_isPath
isActiveNode: (BOOL)_isActive
childBlocks: (NSArray *)_blocks;
/* accessors */
- (BOOL)hasChildren;
- (BOOL)areChildrenLoaded;
- (NSArray *)children;
- (BOOL) hasChildren;
- (BOOL) areChildrenLoaded;
- (NSArray *) children;
- (void) setName: (NSString *) newName;
- (NSString *) name;
- (void) setSerial: (int) newSerial;
- (int) serial;
- (void) setParent: (int) newParent;
- (int) parent;
- (void) setFolderType: (NSString *) newFolderType;
- (NSString *) folderType;
- (NSString *) serialAsString;
- (NSString *) parentAsString;
- (NSString *) title;
- (NSString *) link;
- (NSString *) iconName;
- (NSString *) folderMenuId;
@end

View File

@ -19,53 +19,65 @@
02111-1307, USA.
*/
#include "UIxMailTreeBlock.h"
#include "common.h"
#import "UIxMailTreeBlock.h"
#import "common.h"
@implementation UIxMailTreeBlock
id UIxMailTreeHasChildrenMarker = nil;
+ (void)initialize {
+ (void) initialize
{
// TODO: needs to be an array because the WETreeView requires a
// children array
UIxMailTreeHasChildrenMarker =
[[NSArray alloc] initWithObjects:@"FAKE", nil];
}
+ (id)blockWithName:(NSString *)_name title:(NSString *)_title
iconName:(NSString *)_icon
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive
childBlocks:(NSArray *)_blocks
+ (id) blockWithName: (NSString *) _name
title: (NSString *) _title
iconName: (NSString *) _icon
link: (NSString *) _link
isPathNode: (BOOL) _isPath
isActiveNode: (BOOL) _isActive
childBlocks: (NSArray *) _blocks
{
UIxMailTreeBlock *block;
block = [[self alloc] initWithName:_name title:_title iconName:_icon
block = [[self alloc] initWithName:_name
title:_title
iconName:_icon
link:_link
isPathNode:_isPath isActiveNode:_isActive
isPathNode:_isPath
isActiveNode:_isActive
childBlocks:_blocks];
return [block autorelease];
}
- (id)initWithName:(NSString *)_name title:(NSString *)_title
iconName:(NSString *)_icon
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive
childBlocks:(NSArray *)_blocks
- (id) initWithName: (NSString *) _name
title: (NSString *) _title
iconName: (NSString *) _icon
link: (NSString *) _link
isPathNode: (BOOL) _isPath
isActiveNode: (BOOL) _isActive
childBlocks: (NSArray *) _blocks
{
if ((self = [self init])) {
self->name = [_name copy];
self->title = [_title copy];
self->iconName = [_icon copy];
self->link = [_link copy];
self->blocks = [_blocks retain];
if ((self = [self init]))
{
self->name = [_name copy];
self->title = [_title copy];
self->iconName = [_icon copy];
self->link = [_link copy];
self->blocks = [_blocks retain];
self->flags.isPath = _isPath ? 1 : 0;
self->flags.isActive = _isActive ? 1 : 0;
}
self->flags.isPath = _isPath ? 1 : 0;
self->flags.isActive = _isActive ? 1 : 0;
}
return self;
}
- (void)dealloc {
- (void) dealloc
{
[self->iconName release];
[self->blocks release];
[self->name release];
@ -76,30 +88,49 @@ id UIxMailTreeHasChildrenMarker = nil;
/* accessors */
- (NSString *)name {
- (NSString *) name
{
return self->name;
}
- (NSString *)title {
- (void) setName: (NSString *) newName
{
if (name)
[name release];
name = [newName copy];
if (name)
[name retain];
}
- (NSString *) title
{
return self->title;
}
- (NSString *)link {
- (NSString *) link
{
return self->link;
}
- (NSString *)iconName {
- (NSString *) iconName
{
return self->iconName;
}
- (BOOL)hasChildren {
- (BOOL) hasChildren
{
if (self->blocks == UIxMailTreeHasChildrenMarker)
return YES;
return [self->blocks count] > 0 ? YES : NO;
}
- (BOOL)areChildrenLoaded {
- (BOOL) areChildrenLoaded
{
return self->blocks != UIxMailTreeHasChildrenMarker ? YES : NO;
}
- (NSArray *)children {
- (NSArray *) children
{
if (self->blocks == UIxMailTreeHasChildrenMarker)
// TODO: print a warning
return self->blocks;
@ -107,16 +138,20 @@ id UIxMailTreeHasChildrenMarker = nil;
return self->blocks;
}
- (BOOL)isPathNode {
- (BOOL) isPathNode
{
return self->flags.isPath ? YES : NO;
}
- (BOOL)isActiveNode {
- (BOOL) isActiveNode
{
return self->flags.isActive ? YES : NO;
}
/* description */
- (void)appendAttributesToDescription:(NSMutableString *)_ms {
- (void) appendAttributesToDescription: (NSMutableString *) _ms
{
if (self->name != nil) [_ms appendFormat:@" name='%@'", self->name];
if (self->title != nil) [_ms appendFormat:@" title='%@'", self->title];
@ -129,7 +164,8 @@ id UIxMailTreeHasChildrenMarker = nil;
[_ms appendFormat:@" children=%@", self->blocks];
}
- (NSString *)description {
- (NSString *) description
{
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
@ -139,4 +175,49 @@ id UIxMailTreeHasChildrenMarker = nil;
return ms;
}
- (void) setSerial: (int) newSerial
{
serial = newSerial;
}
- (int) serial
{
return serial;
}
- (NSString *) serialAsString
{
return [NSString stringWithFormat: @"%d", serial];
}
- (void) setParent: (int) newParent
{
parent = newParent;
}
- (int) parent
{
return parent;
}
- (void) setFolderType: (NSString *) newFolderType
{
folderType = newFolderType;
}
- (NSString *) folderType
{
return folderType;
}
- (NSString *) parentAsString
{
return [NSString stringWithFormat: @"%d", parent];
}
- (NSString *) folderMenuId
{
return [NSString stringWithFormat: @"__wox_submenu_%d-%d", parent, serial];
}
@end /* UIxMailTreeBlock */

View File

@ -0,0 +1,53 @@
/* UIxMailTreeBlockJS.h - this file is part of $PROJECT_NAME_HERE$
*
* Copyright (C) 2006 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 UIXMAILTREEBLOCKJS_H
#define UIXMAILTREEBLOCKJS_H
#import <SOGoUI/UIxComponent.h>
#import "common.h"
@class NSString;
@class UIxMailTreeBlock;
@interface UIxMailTreeBlockJS : UIxComponent
{
UIxMailTreeBlock *item;
NSString *treeObjectName;
}
- (void) setItem: (UIxMailTreeBlock *) newItem;
- (UIxMailTreeBlock *) item;
- (NSString *) iconName;
- (void) setTreeObjectName: (NSString *) newName;
- (NSString *) treeObjectName;
- (BOOL) isAccount;
- (BOOL) isInbox;
- (BOOL) isTrash;
@end
#endif /* UIXMAILTREEBLOCKJS_H */

View File

@ -0,0 +1,113 @@
/* UIxMailTreeBlockJS.m - this file is part of $PROJECT_NAME_HERE$
*
* Copyright (C) 2006 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 "UIxMailTreeBlockJS.h"
#import "Common/UIxPageFrame.h"
@implementation UIxMailTreeBlockJS
- (id) init
{
if ((self = [super init]))
{
item = nil;
}
return self;
}
- (void) setItem: (UIxMailTreeBlock *) newItem
{
item = newItem;
}
- (UIxMailTreeBlock *) item
{
return item;
}
- (WOResourceManager *) resourceManager
{
WOResourceManager *resourceManager;
id c;
resourceManager = nil;
c = self;
while (!resourceManager
&& c)
if ([c respondsToSelector: @selector(pageResourceManager)])
resourceManager = [c pageResourceManager];
else
c = [c parent];
return resourceManager;
}
- (NSString *) iconName
{
WOResourceManager *resourceManager;
NSString *iconName, *rsrcIconName;
iconName = [item iconName];
if ([iconName length] > 0)
{
resourceManager = [self resourceManager];
rsrcIconName = [resourceManager urlForResourceNamed: iconName
inFramework: nil
languages: nil
request: [[self context] request]];
}
else
rsrcIconName = nil;
return rsrcIconName;
}
- (void) setTreeObjectName: (NSString *) newName
{
treeObjectName = newName;
}
- (NSString *) treeObjectName
{
return treeObjectName;
}
- (BOOL) isAccount
{
return ([item parent] == 0);
}
- (BOOL) isInbox
{
return ([[item name] isEqualToString: @"INBOX"]);
}
- (BOOL) isTrash
{
return NO;
}
@end

View File

@ -1,35 +0,0 @@
/* contacts */
function newContactFromEmail(sender) {
var emailre
= /([a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])/g;
emailre.exec(menuClickNode.innerHTML);
email = RegExp.$1;
if (email.length > 0)
{
emailre.exec("");
w = window.open("../../../../Contacts/new?contactEmail=" + email,
"SOGo_new_contact",
"width=680,height=520,resizable=1,scrollbars=1,toolbar=0," +
"location=0,directories=0,status=0,menubar=0,copyhistory=0");
w.focus();
}
return false; /* stop following the link */
}
function newEmailTo(sender) {
var mailto = sanitizeMailTo(menuClickNode.innerHTML);
if (mailto.length > 0)
{
w = window.open("compose?mailto=" + mailto,
"SOGo_compose",
"width=680,height=520,resizable=1,scrollbars=1,toolbar=0," +
"location=0,directories=0,status=0,menubar=0,copyhistory=0");
w.focus();
}
return false; /* stop following the link */
}

View File

@ -0,0 +1,31 @@
/* UIxMailViewContainer.h - this file is part of SOGo
*
* Copyright (C) 2006 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 UIXMAILVIEWCONTAINER_H
#define UIXMAILVIEWCONTAINER_H
#import <SOGoUI/UIxComponent.h>
@interface UIxMailViewContainer : UIxComponent
@end
#endif /* UIXMAILVIEWCONTAINER_H */

View File

@ -0,0 +1,27 @@
/* UIxMailViewContainer.m - this file is part of SOGo
*
* Copyright (C) 2006 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 "UIxMailViewContainer.h"
@implementation UIxMailViewContainer
@end

View File

@ -12,7 +12,7 @@
"UIxMailToSelection.js",
"lori_32x32.png",
"tbtv_account_17x17.gif",
"tbtv_drafts_17x17.gif",
"tbtv_inbox_17x17.gif",
@ -27,7 +27,7 @@
"tbtv_corner_plus_17x17.gif",
"tbtv_sent_17x17.gif",
"tbtv_trash_17x17.gif",
"tbtb_addressbook.png",
"tbtb_compose.png",
"tbtb_delete.png",
@ -81,52 +81,55 @@
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoMailFolder.toolbar";
value = "SOGoMailObject.toolbar";
};
};
methods = {
view = {
protectedBy = "View";
pageName = "UIxMailListView";
pageName = "UIxMailListView";
};
ajax = {
protectedBy = "View";
pageName = "UIxMailAjaxRequest";
};
index = {
protectedBy = "View";
pageName = "UIxMailListView";
pageName = "UIxMailListView";
};
GET = { /* hack to make it work as the default method */
protectedBy = "View";
pageName = "UIxMailListView";
pageName = "UIxMailListView";
};
markMessageUnread = {
protectedBy = "View";
pageName = "UIxMailListView";
pageName = "UIxMailListView";
actionName = "markMessageUnread";
};
markMessageRead = {
protectedBy = "View";
pageName = "UIxMailListView";
pageName = "UIxMailListView";
actionName = "markMessageRead";
};
getMail = {
protectedBy = "View";
pageName = "UIxMailListView";
pageName = "UIxMailListView";
actionName = "getMail";
};
expunge = {
protectedBy = "View";
pageName = "UIxMailListView";
pageName = "UIxMailListView";
actionName = "expunge";
};
createFolder = {
protectedBy = "View";
pageName = "UIxMailListView";
pageName = "UIxMailListView";
actionName = "createFolder";
};
deleteFolder = {
protectedBy = "View";
pageName = "UIxMailListView";
pageName = "UIxMailListView";
actionName = "deleteFolder";
};
@ -134,10 +137,10 @@
protectedBy = "View";
pageName = "UIxMailFolderACLEditor";
};
compose = {
protectedBy = "View";
actionClass = "UIxMailEditorAction";
actionClass = "UIxMailEditorAction";
actionName = "compose";
};
};
@ -148,13 +151,13 @@
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoTrashFolder.toolbar";
value = "SOGoMailObject.toolbar";
};
};
methods = {
emptyTrash = {
protectedBy = "View";
pageName = "UIxMailListView";
pageName = "UIxMailListView";
actionName = "emptyTrash";
};
};
@ -168,103 +171,97 @@
};
};
methods = {
view = {
view = {
protectedBy = "View";
pageName = "UIxMailView";
pageName = "UIxMailViewContainer";
};
getMail = {
protectedBy = "View";
pageName = "UIxMailView";
pageName = "UIxMailViewContainer";
actionName = "getMail";
};
delete = {
delete = {
protectedBy = "View";
pageName = "UIxMailView";
pageName = "UIxMailViewContainer";
actionName = "delete";
};
trash = {
trash = {
protectedBy = "View";
pageName = "UIxMailView";
pageName = "UIxMailViewContainer";
actionName = "trash";
};
junk = {
junk = {
protectedBy = "View";
pageName = "UIxMailView";
pageName = "UIxMailViewContainer";
actionName = "junk";
};
edit = {
edit = {
protectedBy = "View";
pageName = "UIxMailEditor";
pageName = "UIxMailEditor";
};
compose = {
protectedBy = "View";
actionClass = "UIxMailEditorAction";
actionClass = "UIxMailEditorAction";
actionName = "compose";
};
reply = {
protectedBy = "View";
actionClass = "UIxMailReplyAction";
actionClass = "UIxMailReplyAction";
actionName = "reply";
};
replyall = {
protectedBy = "View";
actionClass = "UIxMailReplyAction";
actionClass = "UIxMailReplyAction";
actionName = "replyall";
};
forward = {
protectedBy = "View";
actionClass = "UIxMailForwardAction";
actionClass = "UIxMailForwardAction";
actionName = "forward";
};
};
};
SOGoMailAccounts = {
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"; },
)
);
value = "SOGoMailObject.toolbar";
};
};
methods = {
view = {
protectedBy = "View";
pageName = "UIxMailAccountsView";
pageName = "UIxMailAccountsView";
};
getMail = {
protectedBy = "View";
pageName = "UIxMailAccountsView";
pageName = "UIxMailAccountsView";
};
};
};
SOGoMailAccount = {
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoMailAccount.toolbar";
value = "SOGoMailObject.toolbar";
};
};
methods = {
view = {
protectedBy = "View";
pageName = "UIxMailAccountView";
pageName = "UIxMailAccountView";
};
getMail = {
protectedBy = "View";
pageName = "UIxMailAccountView";
pageName = "UIxMailAccountView";
};
addressbook = {
protectedBy = "View";
pageName = "UIxMailAddressbook";
pageName = "UIxMailAddressbook";
};
anais = {
protectedBy = "View";
@ -273,12 +270,12 @@
};
compose = {
protectedBy = "View";
actionClass = "UIxMailEditorAction";
actionClass = "UIxMailEditorAction";
actionName = "compose";
};
createFolder = {
protectedBy = "View";
pageName = "UIxMailAccountView";
pageName = "UIxMailAccountView";
actionName = "createFolder";
};
};
@ -330,43 +327,43 @@
methods = {
view = { /* somewhat hackish */
protectedBy = "View";
pageName = "UIxMailEditor";
pageName = "UIxMailEditor";
};
edit = {
protectedBy = "View";
pageName = "UIxMailEditor";
pageName = "UIxMailEditor";
actionName = "edit";
};
save = {
protectedBy = "View";
pageName = "UIxMailEditor";
pageName = "UIxMailEditor";
actionName = "save";
};
delete = {
protectedBy = "View";
pageName = "UIxMailEditor";
pageName = "UIxMailEditor";
actionName = "delete";
};
viewAttachments = {
protectedBy = "View";
pageName = "UIxMailEditorAttach";
pageName = "UIxMailEditorAttach";
actionName = "viewAttachments";
};
attach = {
protectedBy = "View";
pageName = "UIxMailEditorAttach";
pageName = "UIxMailEditorAttach";
actionName = "attach";
};
deleteAttachment = {
protectedBy = "View";
pageName = "UIxMailEditorAttach";
pageName = "UIxMailEditorAttach";
actionName = "deleteAttachment";
};
send = {
protectedBy = "View";
pageName = "UIxMailEditor";
pageName = "UIxMailEditor";
actionName = "send";
};
addressbook = {
@ -382,7 +379,7 @@
};
/* Sieve */
SOGoSieveScriptsFolder = {
slots = {
toolbar = {
@ -402,7 +399,7 @@
},
),
( /* second group
{ link = "#";
{ link = "#";
cssClass = "tbicon_delete"; label = "Delete"; },*/
),
);
@ -411,11 +408,11 @@
methods = {
view = {
protectedBy = "View";
pageName = "UIxFilterList";
pageName = "UIxFilterList";
};
create = {
protectedBy = "View";
pageName = "UIxFilterList";
pageName = "UIxFilterList";
actionName = "create";
};
};
@ -442,17 +439,17 @@
methods = {
edit = {
protectedBy = "View";
pageName = "UIxSieveEditor";
pageName = "UIxSieveEditor";
actionName = "edit";
};
save = {
protectedBy = "View";
pageName = "UIxSieveEditor";
pageName = "UIxSieveEditor";
actionName = "save";
};
delete = {
protectedBy = "View";
pageName = "UIxSieveEditor";
pageName = "UIxSieveEditor";
actionName = "delete";
};
};

View File

@ -66,6 +66,8 @@
- (NSString *)dateStringForDate:(NSCalendarDate *)_date;
- (NSCalendarDate *)dateForDateString:(NSString *)_dateString;
- (BOOL) hideFrame;
/* SoUser */
- (SoUser *)user;
- (NSString *)shortUserNameForDisplay;
@ -84,6 +86,10 @@
/* locale */
- (NSDictionary *)locale;
/* cached resource filenames */
- (WOResourceManager *) pageResourceManager;
- (NSString *) urlForResourceFilename: (NSString *) filename;
/* Debugging */
- (BOOL)isUIxDebugEnabled;

View File

@ -19,10 +19,12 @@
02111-1307, USA.
*/
#include "UIxComponent.h"
#include "SOGoJSStringFormatter.h"
#include "common.h"
#include <NGObjWeb/SoHTTPAuthenticator.h>
#import "UIxComponent.h"
#import "SOGoJSStringFormatter.h"
#import "NSString+URL.h"
#import "common.h"
#import <NGObjWeb/SoHTTPAuthenticator.h>
#import <NGObjWeb/WOResourceManager.h>
@interface UIxComponent (PrivateAPI)
- (void)_parseQueryString:(NSString *)_s;
@ -244,7 +246,8 @@ static BOOL uixDebugEnabled = NO;
return [uri substringFromIndex:(r.location + 1)];
}
- (NSString *)userFolderPath {
- (NSString *) _urlForTraversalObject: (int) traversal
{
WOContext *ctx;
NSArray *traversalObjects;
NSString *url;
@ -252,13 +255,34 @@ static BOOL uixDebugEnabled = NO;
ctx = [self context];
traversalObjects = [ctx objectTraversalStack];
url = [[traversalObjects objectAtIndex:0]
url = [[traversalObjects objectAtIndex: traversal]
baseURLInContext:ctx];
path = [[NSURL URLWithString:url] path];
path = [path stringByAppendingPathComponent:[[ctx activeUser] login]];
// path = [path stringByAppendingPathComponent:[[ctx activeUser] login]];
return path;
}
- (NSString *) userFolderPath
{
return [self _urlForTraversalObject: 1];
}
- (NSString *) applicationPath
{
return [self _urlForTraversalObject: 2];
}
- (NSString *) resourcesPath
{
WOResourceManager *rm;
if ((rm = [self resourceManager]) == nil)
rm = [[WOApplication application] resourceManager];
return [rm webServerResourcesPath];
}
- (NSString *)ownPath {
NSString *uri;
NSRange r;
@ -325,6 +349,10 @@ static BOOL uixDebugEnabled = NO;
calendarFormat:@"%Y%m%d"];
}
- (BOOL) hideFrame
{
return ([[self queryParameterForKey: @"noframe"] boolValue]);
}
/* SoUser */
@ -410,9 +438,6 @@ static BOOL uixDebugEnabled = NO;
label = [rm stringForKey:lKey inTableNamed:lTable withDefaultValue:lVal
languages:languages];
NSLog (@"string '%s' = '%s' (default: '%s')",
[lKey cString], [label cString], [lVal cString]);
return label;
}
@ -455,6 +480,50 @@ static BOOL uixDebugEnabled = NO;
return [[self context] valueForKey:@"locale"];
}
- (WOResourceManager *) pageResourceManager
{
WOResourceManager *rm;
if ((rm = [[[self context] page] resourceManager]) == nil)
rm = [[WOApplication application] resourceManager];
return rm;
}
- (NSString *) urlForResourceFilename: (NSString *) filename
{
static NSMutableDictionary *pageToURL = nil;
NSString *url;
WOComponent *page;
WOResourceManager *rm;
NSBundle *pageBundle;
if (!pageToURL)
pageToURL = [[NSMutableDictionary alloc] initWithCapacity: 32];
url = [pageToURL objectForKey: filename];
if (!url)
{
rm = [self pageResourceManager];
page = [[self context] page];
pageBundle = [NSBundle bundleForClass: [page class]];
url = [rm urlForResourceNamed: filename
inFramework: [pageBundle bundlePath]
languages: nil
request: [[self context] request]];
if (!url)
url = @"";
else
if ([url hasPrefix: @"http"])
url = [url hostlessURL];
[pageToURL setObject: url forKey: filename];
}
// NSLog (@"url for '%@': '%@'", filename, url);
return url;
}
/* debugging */
- (BOOL)isUIxDebugEnabled {

View File

@ -1080,8 +1080,4 @@
return [self redirectToLocation:[self _completeURIForMethod:@"../view"]];
}
- (BOOL) isPopup {
return YES;
}
@end /* UIxAppointmentEditor */

View File

@ -6,29 +6,27 @@
xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxMailMainFrame"
title="panelTitle"
className="UIxMailAccountViewContainer"
title="title"
>
<div class="mailAccount">
<div style="padding: 1em;" oncontextmenu="return false;">
<h2>
SOGo Mail -
SOGo Mail - <var:string value="objectTitle" />
<var:if condition="clientObject.isSharedAccount">
<var:string label:value="Shared Account: " />
</var:if>
<!-- <div class="titlediv">
<var:if condition="clientObject.isSharedAccount">
<var:string label:value="Share: " />
</var:if>
<var:if condition="clientObject.isSharedAccount" const:negate="1">
<var:string label:value="Account: " />
</var:if>
<var:string value="objectTitle"/>
</div>
-->
<!-- <div class="titlediv">
<var:if condition="clientObject.isSharedAccount">
<var:string label:value="Share: " />
</var:if>
<var:if condition="clientObject.isSharedAccount" const:negate="1">
<var:string label:value="Account: " />
</var:if>
<var:string value="objectTitle"/>
</div>
-->
</h2>
<var:if condition="clientObject.isSharedAccount">
<div>
@ -36,25 +34,25 @@
<var:string value="clientObject.sharedAccountName" />
</div>
</var:if>
<h3>Email</h3>
<p>
<a href="INBOX/"><img rsrc:src="read-messages.png" /><var:string label:value="Read messages" /></a><br />
<a href="#" onclick="clickedCompose(this);"><img rsrc:src="write-message.png" /><var:string label:value="Write a new message" /></a><br />
<a href="INBOX/" onclick="initMailboxSelection(currentMailbox + '/INBOX'); openMailbox(currentMailbox + '/INBOX'); return false;"><img rsrc:src="read-messages.png" /><var:string label:value="Read messages" /></a><br />
<a href="#" onclick="clickedCompose(this);"><img rsrc:src="write-message.png" /><var:string label:value="Write a new message" /></a><br />
</p>
<h3>Accounts</h3>
<p>
<a href=""><img rsrc:src="account-settings.png" />View settings for this account</a><br />
<a href=""><img rsrc:src="create-account.png" />Create a new account</a> [TBD: not in Agenor]<br />
<a href=""><img rsrc:src="account-settings.png" />View settings for this account</a><br />
<a href=""><img rsrc:src="create-account.png" />Create a new account</a> [TBD: not in Agenor]<br />
</p>
<h3>Advanced Features</h3>
<p>
<a href=""><img rsrc:src="search-messages.png" />Search messages</a><br />
<a href=""><img rsrc:src="manage-filters.png" />Manage message filters</a><br />
<a href=""><img rsrc:src="manage-imap.png" />Manage folder subscriptions</a><br />
<a href=""><img rsrc:src="offline-settings.png" />Offline settings</a> [TBD: not in Agenor]<br />
<a href=""><img rsrc:src="search-messages.png" />Search messages</a><br />
<a href=""><img rsrc:src="manage-filters.png" />Manage message filters</a><br />
<a href=""><img rsrc:src="manage-imap.png" />Manage folder subscriptions</a><br />
<a href=""><img rsrc:src="offline-settings.png" />Offline settings</a> [TBD: not in Agenor]<br />
</p>
</div>
</var:component>

View File

@ -0,0 +1,39 @@
<?xml version='1.0' standalone='yes'?>
<var:component
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxMailMainFrame"
title="name"
>
<var:if condition="hideFrame" const:negate="YES">
<div id="mailboxContent" style="visibility: hidden;">
</div>
<div id="mailboxDragHandle"
style="visibility: hidden;"
onmousedown="startHandleDragging(event);"
onmousemove=""
ondblclick="dragHandleDoubleClick(event);"
upperblock="mailboxContent"
lowerblock="messageContent">
</div>
<div id="messageContent"
style="top: 0px;">
<var:component-content />
</div>
<script type="text/javascript">
initMailboxSelection('<var:string value="mailFolderName" />');
</script>
</var:if>
<var:if condition="hideFrame">
<var:component-content />
</var:if>
</var:component>

View File

@ -7,22 +7,24 @@
xmlns:label="OGo:label"
xmlns:rsrc="OGo:url"
className="UIxMailMainFrame"
title="panelTitle"
title="name"
>
<div class="titlediv">
<var:string value="clientObject.davDisplayName" />
</div>
<div class="embedwhite_out">
<div class="embedwhite_in" style="height: 300px">
<div style="padding: 8px;">
<var:string label:value="Welcome to the SOGo Mailer. Use the folder tree on the left to browse your mail accounts!" />
</div>
<!--
<h3>SOGo Mail - Available Accounts</h3>
<a rsrc:href="tbird_073_accountview.png">screenshot</a>
-->
<div id="mailboxContent" style="visibility: hidden;">
</div>
</div>
</var:component>
<div id="mailboxDragHandle"
style="visibility: hidden;"
onmousedown="startHandleDragging(event);"
onmousemove=""
ondblclick="dragHandleDoubleClick(event);"
upperblock="mailboxContent"
lowerblock="messageContent">
</div>
<div id="messageContent"
style="top: 0px;">
<div style="padding: 1em;">
<var:string label:value="Welcome to the SOGo Mailer. Use the folder tree on the left to browse your mail accounts!" />
</div>
</div>
</var:component>

View File

@ -1,88 +1,89 @@
<?xml version='1.0' standalone='yes'?>
<var:component xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxMailPanelFrame"
title="panelTitle"
>
<script rsrc:src="layout2or3_xlib.js" > <!-- space required --></script>
<div id="compose_panel">
<var:if condition="showInternetMarker">
<div id="compose_internetmarker">
<var:string
<var:component
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxMailMainFrame"
title="panelTitle"
const:popup="YES"
>
<div id="compose_panel">
<var:if condition="showInternetMarker">
<div id="compose_internetmarker">
<var:string
label:value="This mail is being sent from an unsecure network!" />
</div>
</var:if>
<table border="0" width="100%" id="compose_table">
<tr>
<td id="compose_leftside" var:style="initialLeftsideStyle">
<div id="compose_fromline">
<table border="0" width="100%">
<tr>
<td class="compose_label" width="20%">
<var:string label:value="From" />:
</td>
<td width="80%">
<var:popup const:name="from" list="fromEMails" item="item"
selection="from"
const:style="width: 100%;"
/>
</td>
</tr>
</div>
</var:if>
<table id="compose_table">
<tr>
<td id="compose_leftside" var:style="initialLeftsideStyle">
<div id="compose_fromline">
<table>
<tr>
<td class="compose_label" width="20%">
<var:string label:value="From" />:
</td>
<td width="80%">
<var:popup const:name="from" list="fromEMails" item="item"
selection="from"
const:style="width: 100%;"
/>
</td>
</tr>
</table>
</div>
<div id="compose_toselection">
</div>
<div id="compose_toselection">
<var:component className="UIxMailToSelection"
to="to"
cc="cc"
bcc="bcc"
/>
</div>
<!-- moved below to selection to make it look better -->
<div id="compose_subject">
<table border="0" width="100%">
<tr>
<td class="compose_label" width="20%">
<var:string label:value="Subject" />:
</td>
<td width="80%"><input name="subject"
id="compose_subject_input"
type="text"
var:value="subject"
/></td>
</tr>
</table>
</div>
</td>
<td id="compose_rightside" var:style="initialRightsideStyle">
<div id="compose_attachments">
<div id="compose_attachments_header">
<span class="compose_label"
><var:string label:value="Attachments" />:</span>
<!--<a href="#"
onclick="hideInlineAttachmentList(this);"
><var:string label:value="close" /></a>-->
to="to"
cc="cc"
bcc="bcc"
/>
</div>
<div id="compose_attachments_list"
onclick="clickedEditorAttach(this);"
>
<var:foreach list="attachmentNames" item="attachmentName">
<var:string value="attachmentName" /><br />
</var:foreach>
<!-- moved below to selection to make it look better -->
<div id="compose_subject">
<table>
<tr>
<td class="compose_label" width="20%">
<var:string label:value="Subject" />:
</td>
<td width="80%"><input name="subject"
id="compose_subject_input"
type="text"
var:value="subject"
/></td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
<!-- separator line -->
<div id="compose_text">
<textarea name="content" var:value="text" />
</div>
</td>
<td id="compose_rightside" var:style="initialRightsideStyle">
<div id="compose_attachments">
<div id="compose_attachments_header">
<span class="compose_label"
><var:string label:value="Attachments" />:</span>
<!--<a href="#"
onclick="hideInlineAttachmentList(this);"
><var:string label:value="close" /></a>-->
</div>
<div id="compose_attachments_list"
onclick="clickedEditorAttach(this);"
>
<var:foreach list="attachmentNames" item="attachmentName">
<var:string value="attachmentName" /><br />
</var:foreach>
</div>
</div>
</td>
</tr>
</table>
<!-- separator line -->
<div id="compose_text">
<textarea name="content" var:value="text" />
</div>
<!-- img rsrc:src="tbird_073_compose.png" alt="screenshot" / -->
</div>
</var:component>
<!-- img rsrc:src="tbird_073_compose.png" alt="screenshot" / -->
</div>
</var:component>

View File

@ -4,56 +4,47 @@
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
>
<div class="menu" id="searchMenu">
<ul id="searchOptions">
<li id="subject"
onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="Subject"/></li>
<li id="sender"
onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="Sender"/></li>
<li id="subject_or_sender"
onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="Subject or Sender"/></li>
<li id="to_or_cc"
onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="To or Cc"/></li>
<li id="entire_message"
onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="Entire Message"/></li>
<li id="find_in_message"
onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="Find In Message"/></li>
<li id="subject"
onmousedown="return false;"
onmouseup="setSearchCriteria(event);"><var:string label:value="Subject"/></li>
<li id="sender"
onmousedown="return false;"
onmouseup="setSearchCriteria(event);"><var:string label:value="Sender"/></li>
<li id="subject_or_sender"
onmousedown="return false;"
onmouseup="setSearchCriteria(event);"><var:string label:value="Subject or Sender"/></li>
<li id="to_or_cc"
onmousedown="return false;"
onmouseup="setSearchCriteria(event);"><var:string label:value="To or Cc"/></li>
<li id="entire_message"
onmousedown="return false;"
onmouseup="setSearchCriteria(event);"><var:string label:value="Entire Message"/></li>
<li id="find_in_message"
onmousedown="return false;"
onmouseup="setSearchCriteria(event);"><var:string label:value="Find In Message"/></li>
</ul>
</div>
<var:if condition="hideFrame" const:negate="YES">
<span class="searchBox" style="float: right">
<input id="searchCriteria" name="criteria" type="hidden" var:value="searchCriteria" />
<input id="searchValue" onmousedown="onSearchMouseDown(event);" onclick="popupSearchMenu(event, 'searchMenu');" autocomplete="off" name="search" type="text" var:value="searchText" onchange="onSearchChange();" onblur="onSearchBlur();" onfocus="onSearchFocus(event);" />
</span>
<div id="filterPanel">
<var:if condition="hideFrame" const:negate="YES"
><span class="searchBox" style="float: right">
<input id="searchCriteria" name="criteria" type="hidden" var:value="searchCriteria" />
<input id="searchValue" onmousedown="onSearchMouseDown(event);" onclick="popupSearchMenu(event, 'searchMenu');" autocomplete="off" name="search" type="text" var:value="searchText" onchange="onSearchChange();" onblur="onSearchBlur();" onfocus="onSearchFocus(event);" />
</span>
<script type="text/javascript">
initCriteria();
document.pageform.search.focus();
</script>
<script type="text/javascript">
initCriteria();
document.pageform.search.focus();
</script>
</var:if>
<var:string label:value="View" />:
<var:popup list="filters"
item="filter" string="filterLabel" value="filter"
selection="selectedFilter"
const:name="filterpopup"
const:onchange="document.pageform.submit()" />
<!--
autocomplete="off"
onkeypress="ml_searchFieldKeyPressed(this)"
onfocus="ml_activateSearchField(this, 500)"
onblur="ml_deactivateSearchField(this)" />
-->
</span>
</var:if>
<var:string label:value="View" />:
<var:popup list="filters"
item="filter" string="filterLabel" value="filter"
selection="selectedFilter"
const:name="filterpopup"
const:onchange="document.pageform.submit()" />
</var:if>
</div>
</container>

View File

@ -0,0 +1,39 @@
<?xml version='1.0' standalone='yes'?>
<container xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxMailFolderMenu"
title="panelTitle"
>
<div class="menu" var:id="menuId">
<ul id="">
<var:foreach list="levelledNodes" item="item"
><var:if condition="item.hasChildren" const:negate="YES"
><li onmouseup="processMailboxMenuAction(this);" var:mailboxname="item.name"><img var:src="iconForMenuItem" /><var:string value="item.title" /></li>
</var:if
><var:if condition="item.hasChildren"
><li
class="submenu"
var:submenu="item.folderMenuId"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"><img var:src="iconForMenuItem" /><var:string value="item.title" /></li>
</var:if
></var:foreach
></ul>
<var:foreach list="levelledNodes" item="item"
><var:if condition="item.hasChildren"
><var:component
className="UIxMailFolderMenu"
var:menuId="item.folderMenuId"
var:parentMenu="item.serialAsString"
rootClassName="treeRootClassName"
const:treeFolderAction="view"
/></var:if
></var:foreach>
</div>
</container>

View File

@ -6,282 +6,174 @@
xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxMailMainFrame"
title="panelTitle"
hideFrame="hideFrame"
className="UIxMailListViewContainer"
title="name"
>
<var:component className="UIxMailFilterPanel" qualifier="qualifier" />
<var:string value="patate" />
<div class="menu" id="messageListMenu">
<ul id="sourceList">
<li
onmousedown="return false;"
var:onclick="clickedMsgJS"><var:string label:value="Open Message In New Window"/></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onclick=""><var:string label:value="Reply to Sender Only"/></li>
<li
onmousedown="return false;"
onclick=""><var:string label:value="Reply to All"/></li>
<li
onmousedown="return false;"
onclick=""><var:string label:value="Forward"/></li>
<li
onmousedown="return false;"
onclick=""><var:string label:value="Edit As New..."/></li>
<li class="separator"></li>
<li
class="submenu"
submenu="mailboxes-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"
onclick=""><var:string label:value="Move To"/></li>
<li
class="submenu"
submenu="mailboxes-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"
onclick=""><var:string label:value="Copy To"/></li>
<li
class="submenu"
submenu="label-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"
onclick=""><var:string label:value="Label"/></li>
<li
class="submenu"
submenu="mark-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"
onclick=""><var:string label:value="Mark"/></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onclick=""><var:string label:value="Save As..."/></li>
<li
onmousedown="return false;"
onclick=""><var:string label:value="Print Preview"/></li>
<li
onmousedown="return false;"
onclick=""><var:string label:value="Print..."/></li>
<li
onmousedown="return false;"
onclick=""><var:string label:value="Delete Message"/></li>
</ul>
<table multiselect="yes" id="messageList"
onselectionchange="onMessageSelectionChange();">
<thead>
<tr class="tableview"
><td class="tbtv_headercell"
><var:entity const:name="nbsp"
/></td
><td class="tbtv_headercell">
<img rsrc:src="title_attachment_14x14.png" width="14"
height="14"
/></td
><td class="tbtv_headercell tbtv_subject_headercell"
><var:component className="UIxMailSortableTableHeader"
label:label="Subject"
const:sortKey="subject"
const:href="view"
var:queryDictionary="context.request.formValues"
/></td
><td class="tbtv_headercell"
><var:if condition="showToAddress" const:negate="YES"
><var:component className="UIxMailSortableTableHeader"
label:label="From"
const:sortKey="from"
const:href="view"
var:queryDictionary="context.request.formValues"
/></var:if
><var:if condition="showToAddress"
><var:component className="UIxMailSortableTableHeader"
label:label="To"
const:sortKey="to"
const:href="view"
var:queryDictionary="context.request.formValues"
/></var:if
></td
><td class="tbtv_headercell"
><img rsrc:src="title_read_14x14.png" width="14" height="14"
/></td
><td class="tbtv_headercell"
><var:component className="UIxMailSortableTableHeader"
label:label="Date"
const:sortKey="date"
const:href="view"
var:queryDictionary="context.request.formValues"
const:isDefault="YES"
/></td
></tr>
<var:if condition="showsAllMessages" const:negate="YES"
><tr class="tableview"
><td colspan="6" class="tbtv_navcell" align="right"
><var:if condition="hasPrevious">
<a href="#"
onclick="openMailboxAtIndex(this);"
idx="1"><var:string label:value="first"/></a> |
<a href="#"
onclick="openMailboxAtIndex(this);"
var:idx="prevFirstMessageNumber"
><var:string label:value="previous"/></a> |
</var:if>
<var:string value="firstMessageNumber"/>
<var:string label:value="msgnumber_to" />
<var:string value="lastMessageNumber"/>
<var:string label:value="msgnumber_of" />
<var:string value="sortedUIDs.count" />
<var:if condition="hasNext">
| <a href="#"
onclick="openMailboxAtIndex(this);"
var:idx="nextFirstMessageNumber"
><var:string label:value="next" /></a>
</var:if>
</td
></tr
></var:if>
</thead>
<div class="menu" id="mailboxes-menu">
<ul id="">
<li onmousedown="return false;">really</li>
<li onmousedown="return false;">is</li>
<li onmousedown="return false;">a</li>
<li onmousedown="return false;">dumb dummy!</li>
</ul>
</div>
<div class="menu" id="label-menu">
<ul id="">
<li onmousedown="return false;"><var:string label:value="None" /></li>
<li class="separator"></li>
<li onmousedown="return false;"><var:string label:value="Important" /></li>
<li onmousedown="return false;"><var:string label:value="Work" /></li>
<li onmousedown="return false;"><var:string label:value="Personal" /></li>
<li onmousedown="return false;"><var:string label:value="To Do" /></li>
<li onmousedown="return false;"><var:string label:value="Later" /></li>
</ul>
</div>
<div class="menu" id="mark-menu">
<ul id="">
<li onmousedown="return false;"><var:string label:value="As Read" /></li>
<li onmousedown="return false;"><var:string label:value="Thread As Read" /></li>
<li onmousedown="return false;"><var:string label:value="As Read By Date..." /></li>
<li onmousedown="return false;"><var:string label:value="All Read" /></li>
<li class="separator"></li>
<li onmousedown="return false;"><var:string label:value="Flag" /></li>
<li class="separator"></li>
<li onmousedown="return false;"><var:string label:value="As Junk" /></li>
<li onmousedown="return false;"><var:string label:value="As Not Junk" /></li>
<li onmousedown="return false;"><var:string label:value="Run Junk Mail Controls" /></li>
</ul>
</div>
</div>
<tbody>
<var:foreach list="messages" item="message"
><tr class="tableview" var:id="msgRowID"
onclick="return onRowClick(event);"
oncontextmenu="onMenuClick(event, 'messageListMenu'); onRowClick(event); return false;"
><td onmousedown="return false;"
></td
><td onmousedown="return false;"
><var:if condition="hasMessageAttachment"
><img rsrc:src="title_attachment_14x14.png"
/></var:if
></td
><td
onmousedown="return false;"
var:class="messageSubjectCellStyleClass"
var:ondblclick="clickedMsgJS"
var:id="msgDivID"
><var:string value="message.envelope.subject"
formatter="context.mailSubjectFormatter"
/></td
<div id="mailboxContent" oncontextmenu="return false;">
<var:component className="UIxMailFilterPanel" qualifier="qualifier"
hideFrame="hideFrame" />
<table multiselect="yes" id="messageList" oncontextmenu="return false;">
<thead>
<tr class="tableview">
<td class="tbtv_headercell" width="17">
<var:entity const:name="nbsp" />
</td>
<td class="tbtv_headercell" width="17">
<img rsrc:src="title_attachment_14x14.png" width="14" height="14" />
</td>
<td class="tbtv_headercell" width="50%">
<var:component className="UIxMailSortableTableHeader"
label:label="Subject"
const:sortKey="subject"
const:href="view"
var:queryDictionary="context.request.formValues"
/>
</td>
<td class="tbtv_headercell">
<var:if condition="showToAddress" const:negate="YES">
<var:component className="UIxMailSortableTableHeader"
label:label="From"
const:sortKey="from"
const:href="view"
var:queryDictionary="context.request.formValues"
/>
</var:if>
<var:if condition="showToAddress">
<var:component className="UIxMailSortableTableHeader"
label:label="To"
const:sortKey="to"
const:href="view"
var:queryDictionary="context.request.formValues"
/>
</var:if>
</td>
<td class="tbtv_headercell" width="17">
<img rsrc:src="title_read_14x14.png" width="14" height="14" />
</td>
<td class="tbtv_headercell">
<var:component className="UIxMailSortableTableHeader"
label:label="Date"
const:sortKey="date"
const:href="view"
var:queryDictionary="context.request.formValues"
const:isDefault="YES"
/>
</td>
</tr>
<tr class="tableview">
<td colspan="6" class="tbtv_navcell" align="right">
<var:if condition="showsAllMessages">
<var:string value="sortedUIDs.count" />
<var:string label:value="messages" />
</var:if>
<var:if condition="showsAllMessages" const:negate="YES">
<var:if condition="hasPrevious">
<a href="view"
_idx="1"
var:queryDictionary="queryParameters"
><var:string label:value="first"/></a> |
<a href="view"
var:_idx="prevFirstMessageNumber"
var:queryDictionary="queryParameters"
><var:string label:value="previous"/></a> |
</var:if>
<var:string value="firstMessageNumber"/>
<var:string label:value="msgnumber_to" />
<var:string value="lastMessageNumber"/>
<var:string label:value="msgnumber_of" />
<var:string value="sortedUIDs.count" />
<var:if condition="hasNext">
| <a href="view"
var:_idx="nextFirstMessageNumber"
var:queryDictionary="queryParameters"
><var:string label:value="next" /></a>
</var:if>
</var:if>
</td>
</tr>
</thead>
<tbody oncontextmenu="return false;">
<var:foreach list="messages" item="message">
<tr class="tableview" var:id="msgRowID"
onmousedown="return false;"
onclick="onRowClick(event);"
oncontextmenu="onMenuClick(event, 'messageListMenu'); onRowClick(event); return false;">
<td>
<!-- this seems to break on Safari, it treats name==id? -->
</td>
<!-- the td:onlick doesn't work on Safari -->
<td>
<var:if condition="hasMessageAttachment">
<img rsrc:src="title_attachment_14x14.png" />
</var:if>
</td>
<td
var:class="messageSubjectCellStyleClass"
var:ondblclick="clickedMsgJS"
var:id="msgDivID">
<!-- div var:class="messageSubjectStyleClass" var:id="msgDivID" -->
<!-- removed anker (resulted in two clicks on Moz -->
<!-- a href="#" var:ondblclick="clickedMsgJS" -->
<!-- Note: var:href="messageViewURL" (done by JS),
var:target="messageViewTarget" -->
<var:string value="message.envelope.subject"
formatter="context.mailSubjectFormatter"/>
<!-- /a -->
</td>
<td var:class="messageCellStyleClass" var:ondblclick="clickedMsgJS">
<!-- TODO: show compose links -->
<!-- TODO: different color for internal vs external addrs -->
<var:if condition="showToAddress" const:negate="YES">
<var:string value="message.envelope.from"
formatter="context.mailEnvelopeAddressFormatter" />
</var:if>
<var:if condition="showToAddress">
<var:string value="message.envelope.to"
formatter="context.mailEnvelopeAddressFormatter" />
</var:if>
</td>
<td var:class="messageCellStyleClass">
<var:if condition="isMessageRead">
<img rsrc:src="icon_read.gif"
class="mailerReadIcon"
var:onclick="markUnreadJS"
label:title="Mark Unread"
var:id="msgIconReadImgID" />
</var:if>
<var:if condition="isMessageRead" const:negate="YES">
<img rsrc:src="icon_unread.gif"
class="mailerUnreadIcon"
var:onclick="markReadJS"
label:title="Mark Read"
var:id="msgIconUnreadImgID" />
</var:if>
</td>
<td var:class="messageCellStyleClass" var:ondblclick="clickedMsgJS">
<span class="mailer_datefield">
<var:string value="message.envelope.date"
formatter="context.mailDateFormatter"/>
</span>
<entity name="nbsp" />
</td>
</tr>
</var:foreach>
<tr class="tableview">
<td colspan="6" class="tbtv_actcell">
<!-- TODO: fix used tree, treeNavigationNodes is the _wrong_ choice
<var:component className="UIxMailMoveToPopUp"
const:identifier="moveto"
const:callback="moveTo"
rootNodes="clientObject.treeNavigationNodes"
/>
-->
<!-- enable once we have buttons and functionality to actually move sth #1211
<var:popup const:name="moveto" const:id="moveto"
list="clientObject.mailAccountFolder.allFolderPathes"
item="item" value="item" displayString="item" />
-->
</td>
</tr>
</tbody>
</table>
<span id="selected_uids" style="visibility: hidden;">
</span>
</div>
><td
onmousedown="return false;"
var:class="messageCellStyleClass"
var:ondblclick="clickedMsgJS"
><var:if condition="showToAddress" const:negate="YES"
><var:string value="message.envelope.from"
formatter="context.mailEnvelopeAddressFormatter"
/></var:if
><var:if condition="showToAddress"
><var:string value="message.envelope.to"
formatter="context.mailEnvelopeAddressFormatter"
/></var:if
></td
><td onmousedown="return false;"
var:class="messageCellStyleClass"
><var:if condition="isMessageRead"
><img rsrc:src="icon_read.gif"
class="mailerReadIcon"
var:onclick="markUnreadJS"
label:title="Mark Unread"
var:id="msgIconReadImgID"
/></var:if
><var:if condition="isMessageRead" const:negate="YES"
><img rsrc:src="icon_unread.gif"
class="mailerUnreadIcon"
var:onclick="markReadJS"
label:title="Mark Read"
var:id="msgIconUnreadImgID"
/></var:if
></td
><td onmousedown="return false;"
var:class="messageCellStyleClass"
var:ondblclick="clickedMsgJS"
><span class="mailer_datefield"
><var:string value="message.envelope.date"
formatter="context.mailDateFormatter"
/></span
><entity name="nbsp"
/></td
></tr>
</var:foreach>
</tbody>
</table>
<script type="text/javascript">
registerDraggableMessageNodes();
</script>
<!--
<tr class="tableview">
<td colspan="6" class="tbtv_actcell">
<! TODO: fix used tree, treeNavigationNodes is the _wrong_ choice
<var:component className="UIxMailMoveToPopUp"
const:identifier="moveto"
const:callback="moveTo"
rootNodes="clientObject.treeNavigationNodes"
/>
>
<! enable once we have buttons and functionality to actually move sth #1211
<var:popup const:name="moveto" const:id="moveto"
list="clientObject.mailAccountFolder.allFolderPathes"
item="item" value="item" displayString="item" />
->
</td>
</tr>
-->
</var:component>

View File

@ -0,0 +1,38 @@
<?xml version='1.0' standalone='yes'?>
<var:component
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxMailMainFrame"
title="name"
>
<var:if condition="hideFrame" const:negate="YES">
<div id="mailboxContent">
<var:component-content/>
</div>
<div id="mailboxDragHandle"
onmousedown="startHandleDragging(event);"
onmousemove=""
ondblclick="dragHandleDoubleClick(event);"
upperblock="mailboxContent"
lowerblock="messageContent">
</div>
<div id="messageContent">
</div>
<script type="text/javascript">
initMailboxSelection('<var:string value="mailFolderName" />');
initMailboxAppearance();
</script>
</var:if>
<var:if condition="hideFrame">
<var:component-content/>
</var:if>
</var:component>

View File

@ -1,103 +1,344 @@
<?xml version="1.0" standalone="yes"?>
<container xmlns="http://www.w3.org/1999/xhtml"
<var:component xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
xmlns:uix="OGo:uix"
xmlns:label="OGo:label"
className="UIxPageFrame"
title="title"
popup="isPopup"
>
<var:if condition="hideFrame" const:negate="YES">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
>
<head>
<title>
<var:string value="title"/>
</title>
<meta name="templatename" content="UIXMailMainFrame.wox"/>
<meta name="description" content="SOGo Web Interface"/>
<meta name="author" content="SKYRIX Software AG"/>
<meta name="robots" content="stop"/>
<script rsrc:src="generic.js"> <!-- space required --></script>
<script rsrc:src="mailer.js" > <!-- space required --></script>
<div class="menu" id="accountIconMenu">
<ul id="sourceList">
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Subscribe..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Get Messages for Account" /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="New Folder..." /></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Search Messages..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Properties..." /></li>
</ul>
</div>
<var:if condition="hasProductSpecificJavaScript">
<script var:src="productJavaScriptURL"> <!-- space required --></script>
</var:if>
<var:if condition="hasPageSpecificJavaScript">
<script var:src="pageJavaScriptURL"> <!-- space required --></script>
</var:if>
<div class="menu" id="inboxIconMenu">
<ul id="sourceList">
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Open in New Mail Window" /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Copy Folder Location" /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Subscribe..." /></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Mark Folder Read..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="New Folder..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Compact This Folder" /></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Search Messages..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Properties..." /></li>
</ul>
</div>
<div class="menu" id="trashIconMenu">
<ul id="sourceList">
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Open in New Mail Window" /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Copy Folder Location" /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Subscribe..." /></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Mark Folder Read..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="New Subfolder..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Compact This Folder" /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Empty Trash" /></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Search Messages..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Properties..." /></li>
</ul>
</div>
<link type="text/css" rel="stylesheet" rsrc:href="uix.css"/>
<link type="text/css" rel="stylesheet" rsrc:href="mailer.css"/>
<link type="text/css" rel="stylesheet" rsrc:href="mailer-toolbar.css"/>
<div class="menu" id="mailboxIconMenu">
<ul id="sourceList">
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Open in New Mail Window" /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Copy Folder Location" /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Subscribe..." /></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Mark Folder Read..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="New Subfolder..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Rename Folder..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Compact This Folder" /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Delete Folder" /></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Search Messages..." /></li>
<li
onmousedown="return false;"
onmouseup="return false;"><var:string label:value="Properties..." /></li>
</ul>
</div>
<link href="mailto:info@skyrix.com" rev="made"/>
</head>
<div class="menu" id="addressMenu">
<ul id="sourceList">
<li id="add_to_addressbook"
onmousedown="return false;"
onmouseup="newContactFromEmail(this);"><var:string label:value="Add to Address Book..."/></li>
<li id="compose_mailto"
onmousedown="return false;"
onmouseup="newEmailTo(this);"><var:string label:value="Compose Mail To"/></li>
<li id="create_filter"
onmousedown="return false;"
onmouseup="onMenuEntryClick(this, event);"><var:string label:value="Create Filter From Message..."/></li>
</ul>
</div>
<body oncontextmenu="return false;">
<!--
Note: the 'href' is required, otherwise an element-id will get created
-->
<var:if condition="showLinkBanner">
<div class="linkbanner">
<!-- span style="float: left" -->
<a var:href="relativeHomePath"
><var:string label:value="Home" /></a> |
<a var:href="relativeCalendarPath"
><var:string label:value="Calendar" /></a> |
<a var:href="relativeContactsPath"
><var:string label:value="Addressbook" /></a> |
<a var:href="relativeMailPath"
><var:string label:value="Mail" /></a> |
<a var:href="logoffPath"
><var:string label:value="Logoff" /></a> |
<a href="http://to.be.done/"
><var:string label:value="Right Administration" /></a>
</div>
</var:if>
<div class="menu" id="messageListMenu">
<ul id="sourceList">
<li
onmousedown="return false;"
onmouseup="onMenuOpenMessage(event);"><var:string label:value="Open Message In New Window"/></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onmouseup="onMenuReplyToSender(event);"><var:string label:value="Reply to Sender Only"/></li>
<li
onmousedown="return false;"
onmouseup="onMenuReplyToAll(event);"><var:string label:value="Reply to All"/></li>
<li
onmousedown="return false;"
onmouseup="onMenuForwardMessage(event);"><var:string label:value="Forward"/></li>
<li
onmousedown="return false;"
onmouseup="onMenuEditMessageAsNew(event);"><var:string label:value="Edit As New..."/></li>
<li class="separator"></li>
<li
class="submenu"
mailboxaction="move"
submenu="mailboxes-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"><var:string label:value="Move To"/></li>
<li
class="submenu"
mailboxaction="copy"
submenu="mailboxes-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"><var:string label:value="Copy To"/></li>
<li
class="submenu"
submenu="label-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"><var:string label:value="Label"/></li>
<li
class="submenu"
submenu="mark-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"><var:string label:value="Mark"/></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onmouseup="onMenuSaveMessageAs(event);"><var:string label:value="Save As..."/></li>
<li
onmousedown="return false;"
onmouseup="onMenuPreviewPrintMessage(event);"><var:string label:value="Print Preview"/></li>
<li
onmousedown="return false;"
onmouseup="onMenuPrintMessage(event);"><var:string label:value="Print..."/></li>
<li
onmousedown="return false;"
onmouseup="onMenuDeleteMessage(event);"><var:string label:value="Delete Message"/></li>
</ul>
<var:component className="UIxToolbar" />
<div class="menu" id="messageContentMenu">
<ul>
<li
onmousedown="return false;"
onmouseup="onMenuReplyToSender(event);"><var:string label:value="Reply to Sender Only"/></li>
<li
onmousedown="return false;"
onmouseup="onMenuReplyToAll(event);"><var:string label:value="Reply to All"/></li>
<li
onmousedown="return false;"
onmouseup="onMenuForwardMessage(event);"><var:string label:value="Forward"/></li>
<li
onmousedown="return false;"
onmouseup="onMenuEditMessageAsNew(event);"><var:string label:value="Edit As New..."/></li>
<li
class="submenu"
mailboxaction="move"
submenu="mailboxes-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"><var:string label:value="Move To"/></li>
<li
class="submenu"
mailboxaction="copy"
submenu="mailboxes-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"><var:string label:value="Copy To"/></li>
<li class="separator"></li>
<li
class="submenu"
submenu="label-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"><var:string label:value="Label"/></li>
<li
class="submenu"
submenu="mark-menu"
onmouseover="dropDownSubmenu(event);"
onmousedown="return false;"><var:string label:value="Mark"/></li>
<li class="separator"></li>
<li
onmousedown="return false;"
onmouseup="onMenuSaveMessageAs(event);"><var:string label:value="Save As..."/></li>
<li
onmousedown="return false;"
onmouseup="onMenuPreviewPrintMessage(event);"><var:string label:value="Print Preview"/></li>
<li
onmousedown="return false;"
onmouseup="onMenuPrintMessage(event);"><var:string label:value="Print..."/></li>
<li
onmousedown="return false;"
onmouseup="onMenuDeleteMessage(event);"><var:string label:value="Delete Message"/></li>
</ul>
</div>
<form name="pageform" var:href="pageFormURL" _wosid="0">
<div class="menu" id="label-menu">
<ul id="">
<li onmousedown="return false;"
onmouseup="onMenuLabelMessage(event, 'none');"><var:string label:value="None" /></li>
<li class="separator"></li>
<li onmousedown="return false;"
onmouseup="onMenuLabelMessage(event, 'important);"><var:string label:value="Important" /></li>
<li onmousedown="return false;"
onmouseup="onMenuLabelMessage(event, 'work');"><var:string label:value="Work" /></li>
<li onmousedown="return false;"
onmouseup="onMenuLabelMessage(event, 'personal');"><var:string label:value="Personal" /></li>
<li onmousedown="return false;"
onmouseup="onMenuLabelMessage(event, 'todo');"><var:string label:value="To Do" /></li>
<li onmousedown="return false;"
onmouseup="onMenuLab-elMessage(event, 'later');"><var:string label:value="Later" /></li>
</ul>
</div>
<div class="folderTree" id="mailerFolderTree">
<var:if condition="hideFolderTree">
<var:component-content/>
</var:if>
<var:component
className="UIxMailFolderMenu"
const:menuId="mailboxes-menu"
const:parentMenu="0"
rootClassName="treeRootClassName"
const:treeFolderAction="view"
/>
<var:if condition="hideFolderTree" const:negate="YES">
<div class="titlediv"><var:string label:value="Folders" /></div>
<var:component className="UIxMailTree"
rootClassName="treeRootClassName"
const:treeFolderAction="view"
/>
</var:if>
</div>
<div class="menu" id="mark-menu">
<ul id="">
<li onmousedown="return false;"
onmouseup="onMenuMarkMessage(event, 'read');"><var:string label:value="As Read" /></li>
<li onmousedown="return false;"
onmouseup="onMenuMarkMessage(event, 'threadread');"><var:string label:value="Thread As Read" /></li>
<li onmousedown="return false;"
onmouseup="onMenuMarkMessage(event, 'readbydate);"><var:string label:value="As Read By Date..." /></li>
<li onmousedown="return false;"
onmouseup="onMenuMarkMessage(event, 'allread);"><var:string label:value="All Read" /></li>
<li class="separator"></li>
<li onmousedown="return false;"
onmouseup="onMenuMarkMessage(event, 'flag);"><var:string label:value="Flag" /></li>
<li class="separator"></li>
<li onmousedown="return false;"
onmouseup="onMenuMarkMessage(event, 'junk);"><var:string label:value="As Junk" /></li>
<li onmousedown="return false;"
onmouseup="onMenuMarkMessage(event, 'notjunk);"><var:string label:value="As Not Junk" /></li>
<li onmousedown="return false;"
onmouseup="onMenuMarkMessage(event, 'runjunkmailcontrols);"><var:string label:value="Run Junk Mail Controls" /></li>
</ul>
</div>
</div>
<div id="dragHandle"
onmousedown="startHandleDragging(event);"
onmousemove=""
ondblclick="dragHandleDoubleClick(event);"
leftblock="mailerFolderTree"
rightblock="mailerPageContent">
</div>
<form name="pageform" var:href="pageFormURL" _wosid="0" onsubmit="checkSearchValue(event);">
<var:if condition="isPopup" const:negate="YES">
<var:if condition="hideFolderTree" const:negate="YES">
<div class="folderTree" id="mailerFolderTree">
<div class="titlediv"><var:string label:value="Folders" /></div>
<var:component className="UIxMailTree"
rootClassName="treeRootClassName"
const:treeFolderAction="view"
/>
</div>
<div id="dragHandle"
onmousedown="startHandleDragging(event);"
onmousemove=""
ondblclick="dragHandleDoubleClick(event);"
leftblock="mailerFolderTree"
rightblock="mailerPageContent">
</div>
</var:if>
<div class="mailPageContent" id="mailerPageContent">
<var:component-content/>
</div>
</form>
<div id="mailerPageContent">
<var:component-content/>
</div>
</var:if>
<var:string value="errorAlertJavaScript" const:escapeHTML="NO" />
</body>
</html>
<var:if condition="isPopup">
<var:component-content/>
</var:if>
</form>
<var:string value="errorAlertJavaScript" const:escapeHTML="NO" />
</var:if>
<var:if condition="hideFrame">
<var:component-content/>
</var:if>
</container>
</var:component>

View File

@ -23,4 +23,4 @@
</var:foreach>
<option value="all" disabled="1" >All</option>
</select>
</select>

View File

@ -12,11 +12,11 @@
</script>
<script language="JavaScript" rsrc:src="UIxMailToSelection.js"> <!-- Space! --></script>
<table id="addr_table" style="width: 100%;">
<table id="addr_table">
<var:foreach list="addressLists" item="addressList">
<var:foreach list="addressList" item="address">
<tr var:id="currentRowId">
<td width="20%">
<td>
<var:popup name="currentPopUpId"
list="headers"
item="item"
@ -25,7 +25,7 @@
const:style="width: 100%;"
/>
</td>
<td width="80%">
<td>
<input var:id="currentAddressId"
var:name="currentAddressId"
type="text"
@ -40,13 +40,13 @@
</var:foreach>
</var:foreach>
<tr id="row_last">
<td width="20%">
<td>
<!-- todo: use stylesheet? -->
<select style="width: 100%;" disabled="1">
<option value="to" ><var:string label:value="to" />:</option>
</select>
</td>
<td width="80%">
<td>
<!-- todo: use stylesheet? -->
<input onfocus="fancyAddRow(true,'');" type="text"
style="width: 100%;" />
@ -58,4 +58,4 @@
</var:if>-->
<span id="addr_addresses" style="visibility: hidden;"><var:foreach list="addressLists" item="addressList"><var:foreach list="addressList" item="address"><span var:id="address" /></var:foreach></var:foreach>
</span>
</span>
</span>

View File

@ -1,39 +1,72 @@
<?xml version="1.0" standalone="yes"?>
<div class="folderTreeContent"
<div id="folderTreeContent"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label">
<!-- TODO: extend treeview to use CSS -->
<var:treeview
list="rootNodes" item="item" sublist="item.children"
zoom="item.isPathNode"
const:iconWidth = "17"
const:plusIcon = "tbtv_plus_17x17.gif"
const:minusIcon = "tbtv_minus_17x17.gif"
const:lineIcon = "tbtv_line_17x17.gif"
const:cornerIcon = "tbtv_corner_17x17.gif"
const:junctionIcon = "tbtv_junction_17x17.gif"
const:leafIcon = "tbtv_leaf_corner_17x17.gif"
const:leafCornerIcon = "tbtv_leaf_corner_17x17.gif"
const:cornerPlusIcon = "tbtv_corner_plus_17x17.gif"
const:cornerMinusIcon = "tbtv_corner_minus_17x17.gif"
const:spaceIcon = "tbtv_space_17x17.gif"
>
<var:tree-data const:isTreeElement="YES" const:treeLink=""
var:icon="item.iconName"
var:cornerIcon="item.iconName">
<a var:href="item.link">
<span class="treecell">
<var:if condition="item.isActiveNode">
<b><var:string value="item.title" /></b>
</var:if>
<var:if condition="item.isActiveNode" const:negate="YES">
<var:string value="item.title" />
</var:if>
</span>
</a>
</var:tree-data>
</var:treeview>
<script type="text/javascript" rsrc:src="dtree.js"> <!-- space --></script>
<script type="text/javascript">
d = new dTree('d');
d.config.folderLlinks = true;
d.config.hideRoot = true;
d.icon.root = '<var:string rsrc:value="tbtv_account_17x17.gif" />';
d.icon.folder = '<var:string rsrc:value="tbtv_leaf_corner_17x17.gif" />';
d.icon.folderOpen = '<var:string rsrc:value="tbtv_leaf_corner_17x17.gif" />';
d.icon.node = '<var:string rsrc:value="tbtv_leaf_corner_17x17.gif" />';
d.icon.line = '<var:string rsrc:value="tbtv_line_17x17.gif" />';
d.icon.join = '<var:string rsrc:value="tbtv_junction_17x17.gif" />';
d.icon.joinBottom = '<var:string rsrc:value="tbtv_corner_17x17.gif" />';
d.icon.plus = '<var:string rsrc:value="tbtv_plus_17x17.gif" />';
d.icon.plusBottom = '<var:string rsrc:value="tbtv_corner_plus_17x17.gif" />';
d.icon.minus = '<var:string rsrc:value="tbtv_minus_17x17.gif" />';
d.icon.minusBottom = '<var:string rsrc:value="tbtv_corner_minus_17x17.gif" />';
d.icon.nlPlus = '<var:string rsrc:value="tbtv_corner_plus_17x17.gif" />';
d.icon.nlMinus = '<var:string rsrc:value="tbtv_corner_minus_17x17.gif" />';
d.icon.empty = '<var:string rsrc:value="empty.gif" />';
d.add(0, -1, '');
<var:foreach list="flattenedNodes" item="item"
><var:component className="UIxMailTreeBlockJS"
const:treeObjectName="d"
var:item="item"
/></var:foreach>
document.write(d);
</script>
<noscript>
<var:treeview
list="rootNodes" item="item" sublist="item.children"
zoom="item.isPathNode"
const:iconWidth = "17"
const:plusIcon = "tbtv_plus_17x17.gif"
const:minusIcon = "tbtv_minus_17x17.gif"
const:lineIcon = "tbtv_line_17x17.gif"
const:cornerIcon = "tbtv_corner_17x17.gif"
const:junctionIcon = "tbtv_junction_17x17.gif"
const:leafIcon = "tbtv_leaf_corner_17x17.gif"
const:leafCornerIcon = "tbtv_leaf_corner_17x17.gif"
const:cornerPlusIcon = "tbtv_corner_plus_17x17.gif"
const:cornerMinusIcon = "tbtv_corner_minus_17x17.gif"
const:spaceIcon = "tbtv_space_17x17.gif"
>
<var:tree-data const:isTreeElement="YES"
var:icon="item.iconName"
var:cornerIcon="item.iconName"
var:treeLink="item.link"
><a var:href="item.link"
><span class="treecell"
><var:if condition="item.isActiveNode"
><b><var:string value="item.title" /></b
></var:if
><var:if condition="item.isActiveNode" const:negate="YES"
><var:string value="item.title"
/></var:if
></span
></a
></var:tree-data>
</var:treeview>
</noscript>
</div>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" standalone="yes"?>
<container
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
><var:string value="treeObjectName" />.add(<var:string value="item.serial" />, <var:string value="item.parent" />, '<var:string value="item.title" />', '#', 'onMailboxTreeItemClick(this);', '<var:string value="item.name" />', '<var:string value="item.folderType" />', '', '', '<var:string value="iconName" />', '<var:string value="iconName" />');
</container>

View File

@ -1,188 +1,156 @@
<?xml version='1.0' standalone='yes'?>
<var:component
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxMailPanelFrame"
title="panelTitle"
>
<div class="menu" id="addressMenu">
<ul id="sourceList">
<li id="add_to_addressbook"
onmousedown="return false;"
onclick="newContactFromEmail(this);"><var:string label:value="Add to Address Book..."/></li>
<li id="compose_mailto"
onmousedown="return false;"
onclick="newEmailTo(this);"><var:string label:value="Compose Mail To"/></li>
<li id="create_filter"
onmousedown="return false;"
onclick="onMenuEntryClick(this, event);"><var:string label:value="Create Filter From Message..."/></li>
</ul>
</div>
<!-- TODO: refactor address rendering into an own component(/element) -->
<!-- TODO: can we create own clientObject's for Kolab entities? Probably
not (since we would always need to fetch the header during
lookup). It would work for 'annotated' folders though.
TODO: for Kolab we need a completely different viewer with a different
toolbar etc. And for Kolab we would need a different list viewer
as well ...
-->
<var:if condition="clientObject.isKolabObject" const:negate="1">
<!--
Note: We cannot make this section static (like the toolbar) because the CC
list has a dynamic height (would require some tricky JavaScript).
-->
<table class="mailer_fieldtable">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="Subject"/>:</td>
<td class="mailer_subjectfieldvalue">
<var:string value="clientObject.subject"
formatter="context.mailSubjectFormatter"/>
</td>
</tr>
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="From"/>:</td>
<td class="mailer_fieldvalue">
<var:foreach list="clientObject.fromEnvelopeAddresses"
item="currentAddress">
<a var:href="currentAddressLink" onclick="onMenuClick(event, 'addressMenu');" oncontextmenu="onMenuClick(event, 'addressMenu');" onmousedown="return false;">
<var:string value="currentAddress"
formatter="context.mailEnvelopeFullAddressFormatter" /></a>
</var:foreach>
</td>
</tr>
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="Date"/>:</td>
<td class="mailer_fieldvalue">
<var:string value="clientObject.date"
formatter="context.mailDateFormatter"/>
<!-- TODO:
(<a rsrc:href="tbird_073_viewer.png">screenshot</a>)
-->
</td>
</tr>
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="To"/>:</td>
<td class="mailer_fieldvalue">
<var:foreach list="clientObject.toEnvelopeAddresses"
item="currentAddress">
<a var:href="currentAddressLink" onclick="onMenuClick(event, 'addressMenu');" oncontextmenu="onMenuClick(event, 'addressMenu');" onmousedown="return false;">
<var:string value="currentAddress"
formatter="context.mailEnvelopeFullAddressFormatter" /></a>
</var:foreach>
</td>
</tr>
<var:if condition="hasCC">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="CC"/>:</td>
<td class="mailer_fieldvalue">
<var:foreach list="clientObject.ccEnvelopeAddresses"
item="currentAddress">
<a var:href="currentAddressLink" onclick="onMenuClick(event, 'addressMenu');" oncontextmenu="onMenuClick(event, 'addressMenu');" onmousedown="return false;">
<var:string value="currentAddress"
formatter="context.mailEnvelopeFullAddressFormatter" /></a>
<br /> <!-- TODO: better to use li+CSS -->
</var:foreach>
</td>
</tr>
</var:if>
<!-- header fields if available -->
<var:if condition="clientObject.hasMailHeaderInCoreInfos">
<var:if condition="clientObject.mailHeaders.organization.isNotEmpty">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname"
><var:string label:value="Organization"/>:</td>
<td class="mailer_fieldvalue">
<var:if-qualifier
const:condition="organization hasPrefix: 'http://'"
object="clientObject.mailHeaders">
<a var:href="clientObject.mailHeaders.organization"
var:string="clientObject.mailHeaders.organization" />
</var:if-qualifier>
<var:if-qualifier
const:condition="organization hasPrefix: 'http://'"
object="clientObject.mailHeaders"
const:negate="1">
<var:string value="clientObject.mailHeaders.organization" />
</var:if-qualifier>
</td>
</tr>
</var:if>
<var:if condition="clientObject.mailHeaders.list-id.isNotEmpty">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname"
><var:string label:value="Mailinglist"/>:</td>
<td class="mailer_fieldvalue">
<a var:href="clientObject.mailingListArchiveURL"
target="_blank"
var:string="clientObject.mailHeaders.list-id" />
|
<a var:href="clientObject.mailingListSubscribeURL"
target="_blank"><var:string label:value="subscribe"/></a>
|
<a var:href="clientObject.mailingListUnsubscribeURL"
target="_blank"><var:string label:value="unsubscribe"/></a>
</td>
</tr>
</var:if>
<var:if condition="clientObject.mailHeaders.x-virus-status.isNotEmpty">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname"
><var:string label:value="Virusstatus"/>:</td>
<td class="mailer_fieldvalue">
<var:string value="clientObject.mailHeaders.x-virus-status" />
</td>
</tr>
</var:if>
<var:if condition="clientObject.mailHeaders.x-spam-level.isNotEmpty">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname"
><var:string label:value="Spamlevel"/>:</td>
<td class="mailer_fieldvalue">
<var:string value="clientObject.mailHeaders.x-spam-level" />
<var:if condition="clientObject.mailHeaders.x-spam-flag"
const:value="YES">
/ <var:string label:value="marked as spam by mailserver" />
</var:if>
</td>
</tr>
</var:if>
<!-- all headers
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="Header"/>:</td>
<td class="mailer_fieldvalue">
<pre><var:string value="clientObject.mailHeaders" /></pre>
</td>
</tr>
<container
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
>
<var:if condition="clientObject.isKolabObject" const:negate="YES">
<!--
Note: We cannot make this section static (like the toolbar) because the CC
list has a dynamic height (would require some tricky JavaScript).
-->
</var:if>
</table>
</var:if><!-- !Kolab -->
<table class="mailer_fieldtable">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="Subject"/>:</td>
<td class="mailer_subjectfieldvalue">
<var:string value="clientObject.subject"
formatter="context.mailSubjectFormatter"/>
</td>
</tr>
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="From"/>:</td>
<td class="mailer_fieldvalue">
<var:foreach list="clientObject.fromEnvelopeAddresses"
item="currentAddress">
<a var:href="currentAddressLink" onclick="onMenuClick(event, 'addressMenu');" oncontextmenu="onMenuClick(event, 'addressMenu');" onmousedown="return false;">
<var:string value="currentAddress"
formatter="context.mailEnvelopeFullAddressFormatter" /></a>
</var:foreach>
</td>
</tr>
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="Date"/>:</td>
<td class="mailer_fieldvalue">
<var:string value="clientObject.date"
formatter="context.mailDateFormatter"/>
<div class="mailer_mailcontent">
<var:component value="contentViewerComponent"
bodyInfo="clientObject.bodyStructure" />
</div>
<!-- TODO:
(<a rsrc:href="tbird_073_viewer.png">screenshot</a>)
-->
</td>
</tr>
<script language="JavaScript">
if (window.opener) {
markMailReadInWindow(window.opener,
'<var:string value="clientObject.nameInContainer"/>');
}
</script>
</var:component>
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="To"/>:</td>
<td class="mailer_fieldvalue">
<var:foreach list="clientObject.toEnvelopeAddresses"
item="currentAddress">
<a var:href="currentAddressLink" onclick="onMenuClick(event, 'addressMenu');" oncontextmenu="onMenuClick(event, 'addressMenu');" onmousedown="return false;">
<var:string value="currentAddress"
formatter="context.mailEnvelopeFullAddressFormatter" /></a>
</var:foreach>
</td>
</tr>
<var:if condition="hasCC">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="CC"/>:</td>
<td class="mailer_fieldvalue">
<var:foreach list="clientObject.ccEnvelopeAddresses"
item="currentAddress">
<a var:href="currentAddressLink" onclick="onMenuClick(event, 'addressMenu');" oncontextmenu="onMenuClick(event, 'addressMenu');" onmousedown="return false;">
<var:string value="currentAddress"
formatter="context.mailEnvelopeFullAddressFormatter" /></a>
<br /> <!-- TODO: better to use li+CSS -->
</var:foreach>
</td>
</tr>
</var:if>
<!-- header fields if available -->
<var:if condition="clientObject.hasMailHeaderInCoreInfos">
<var:if condition="clientObject.mailHeaders.organization.isNotEmpty">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname"
><var:string label:value="Organization"/>:</td>
<td class="mailer_fieldvalue">
<var:if-qualifier
const:condition="organization hasPrefix: 'http://'"
object="clientObject.mailHeaders">
<a var:href="clientObject.mailHeaders.organization"
var:string="clientObject.mailHeaders.organization" />
</var:if-qualifier>
<var:if-qualifier
const:condition="organization hasPrefix: 'http://'"
object="clientObject.mailHeaders"
const:negate="YES">
<var:string value="clientObject.mailHeaders.organization" />
</var:if-qualifier>
</td>
</tr>
</var:if>
<var:if condition="clientObject.mailHeaders.list-id.isNotEmpty">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname"
><var:string label:value="Mailinglist"/>:</td>
<td class="mailer_fieldvalue">
<a var:href="clientObject.mailingListArchiveURL"
target="_blank"
var:string="clientObject.mailHeaders.list-id" />
|
<a var:href="clientObject.mailingListSubscribeURL"
target="_blank"><var:string label:value="subscribe"/></a>
|
<a var:href="clientObject.mailingListUnsubscribeURL"
target="_blank"><var:string label:value="unsubscribe"/></a>
</td>
</tr>
</var:if>
<var:if condition="clientObject.mailHeaders.x-virus-status.isNotEmpty">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname"
><var:string label:value="Virusstatus"/>:</td>
<td class="mailer_fieldvalue">
<var:string value="clientObject.mailHeaders.x-virus-status" />
</td>
</tr>
</var:if>
<var:if condition="clientObject.mailHeaders.x-spam-level.isNotEmpty">
<tr class="mailer_fieldrow">
<td class="mailer_fieldname"
><var:string label:value="Spamlevel"/>:</td>
<td class="mailer_fieldvalue">
<var:string value="clientObject.mailHeaders.x-spam-level" />
<var:if condition="clientObject.mailHeaders.x-spam-flag"
const:value="YES">
/ <var:string label:value="marked as spam by mailserver" />
</var:if>
</td>
</tr>
</var:if>
<!-- all headers
<tr class="mailer_fieldrow">
<td class="mailer_fieldname" ><var:string label:value="Header"/>:</td>
<td class="mailer_fieldvalue">
<pre><var:string value="clientObject.mailHeaders" /></pre>
</td>
</tr>
-->
</var:if>
</table>
</var:if><!-- !Kolab -->
<div class="mailer_mailcontent"
oncontextmenu="onMenuClick(event, 'messageContentMenu');">
<var:component value="contentViewerComponent"
bodyInfo="clientObject.bodyStructure" />
</div>
</container>

View File

@ -0,0 +1,37 @@
<?xml version='1.0' standalone='yes'?>
<var:component
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxMailMainFrame"
title="panelTitle"
const:popup="YES"
>
<var:if condition="hideFrame" const:negate="YES">
<!-- TODO: refactor address rendering into an own component(/element) -->
<!-- TODO: can we create own clientObject's for Kolab entities? Probably
not (since we would always need to fetch the header during
lookup). It would work for 'annotated' folders though.
TODO: for Kolab we need a completely different viewer with a different
toolbar etc. And for Kolab we would need a different list viewer
as well ...
-->
<div class="messageContent">
<var:component className="UIxMailView" />
</div>
<script language="JavaScript">
if (window.opener) {
markMailReadInWindow(window.opener,
'<var:string value="clientObject.nameInContainer"/>');
}
</script>
</var:if>
<var:if condition="hideFrame">
<var:component className="UIxMailView" />
</var:if>
</var:component>

View File

@ -1,162 +1,165 @@
<?xml version="1.0" standalone="yes"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
>
<head>
<title>
<var:string value="title"/>
</title>
<meta name="description" content="SOGo Web Interface"/>
<meta name="author" content="SKYRIX Software AG"/>
<meta name="robots" content="stop"/>
<meta name="test" var:content="patate"/>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"/>
<link type="text/css" rel="stylesheet" rsrc:href="uix.css"/>
<link type="text/css" rel="stylesheet" rsrc:href="calendar.css"/>
<link href="mailto:hh@skyrix.com" rev="made"/>
<container
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label">
<var:if condition="hideFrame" const:negate="YES">
<html>
<head>
<title>
<var:string value="title"/>
</title>
<meta name="hideFrame" var:content="hideFrame" />
<meta name="description" content="SOGo Web Interface"/>
<meta name="author" content="SKYRIX Software AG"/>
<meta name="robots" content="stop"/>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"/>
<link href="mailto:hh@skyrix.com" rev="made"/>
<script rsrc:src="generic.js"> <!-- space required --></script>
<var:if condition="hasProductSpecificJavaScript">
<script var:src="productJavaScriptURL"> <!-- space required --></script>
</var:if>
<var:if condition="hasPageSpecificJavaScript">
<script var:src="pageJavaScriptURL"> <!-- space required --></script>
</var:if>
</head>
<link type="text/css" rel="stylesheet" rsrc:href="generic.css" />
<link type="text/css" rel="stylesheet" rsrc:href="dtree.css" />
<var:if condition="hasProductSpecificCSS"
><link type="text/css" rel="stylesheet" var:href="productCSSURL"
/></var:if>
<var:if condition="hasPageSpecificCSS"
><link type="text/css" rel="stylesheet" var:href="pageCSSURL"
/></var:if>
</head>
<body>
<var:if condition="isPopup" const:negate="YES">
<div class="linkbanner">
<a var:href="relativeHomePath"
><var:string label:value="Home" /></a> |
<a var:href="relativeCalendarPath"
><var:string label:value="Calendar" /></a> |
<a var:href="relativeContactsPath"
><var:string label:value="Addressbook" /></a> |
<a var:href="relativeMailPath"
><var:string label:value="Mail" /></a> |
<a var:href="logoffPath"
><var:string label:value="Logoff" /></a> |
<a href="http://to.be.done/"
><var:string label:value="Right Administration" /></a>
</div>
<body oncontextmenu="return false;">
<script type="text/javascript">
var UserFolderURL = '<var:string value="userFolderPath" />';
var ApplicationBaseURL = '<var:string value="applicationPath" />';
var ResourcesURL = '/SOGo.woa/WebServerResources'
</script>
<script type="text/javascript" rsrc:src="prototype.js"> <!-- space required --></script>
<script type="text/javascript" rsrc:src="yul/yahoo/yahoo-min.js"> <!-- space required --></script>
<script type="text/javascript" rsrc:src="yul/dom/dom-min.js"> <!-- space required --></script>
<script type="text/javascript" rsrc:src="yul/event/event-min.js"> <!-- space required --></script>
<script type="text/javascript" rsrc:src="yul/dragdrop/dragdrop-min.js"> <!-- space required --></script>
<script type="text/javascript" rsrc:src="generic.js"> <!-- space required --></script>
<var:if condition="hasProductSpecificJavaScript"
><script type="text/javascript" var:src="productJavaScriptURL"> <!-- space required --></script>
</var:if>
<var:if condition="hasPageSpecificJavaScript"
><script type="text/javascript" var:src="pageJavaScriptURL"> <!-- space required --></script>
</var:if>
<div id="logConsole">
</div>
<script type="text/javascript">
initLogConsole();
</script>
<var:if condition="isPopup" const:negate="YES"
><div class="linkbanner">
<a var:href="relativeHomePath"
><var:string label:value="Home" /></a> |
<a var:href="relativeCalendarPath"
><var:string label:value="Calendar" /></a> |
<a var:href="relativeContactsPath"
><var:string label:value="Addressbook" /></a> |
<a var:href="relativeMailPath"
><var:string label:value="Mail" /></a> |
<a var:href="logoffPath"
><var:string label:value="Logoff" /></a> |
<a href="http://to.be.done/"
><var:string label:value="Right Administration" /></a> |
<a href="#" onclick="toggleLogConsole();"
><var:string label:value="Log Console" /></a>
</div>
</var:if
><var:component className="UIxToolbar"
/>
<div class="pageContent">
<var:component-content
/></div>
<var:if condition="isUIxDebugEnabled">
<table border="0" style="font-size: 9pt; visibility: hidden;">
<tr>
<td valign="top">clientObject:</td>
<td valign="top"><var:string value="clientObject" /></td>
</tr>
<tr>
<td valign="top">ownerInContext:</td>
<td valign="top"><var:string value="ownerInContext" /></td>
</tr>
<tr>
<td valign="top">traversal stack:</td>
<td valign="top">
<var:foreach list="context.objectTraversalStack" item="item">
<var:string value="item" /><br />
</var:foreach>
</td>
</tr>
<tr>
<td valign="top">traversal path:</td>
<td valign="top">
<var:foreach list="context.soRequestTraversalPath"
item="item" const:separator=" => ">
<var:string value="item" />
</var:foreach>
</td>
</tr>
<tr>
<td valign="top">request type:</td>
<td valign="top"><var:string value="context.soRequestType"/>
</td>
</tr>
<tr>
<td valign="top">path info:</td>
<td valign="top"><var:string value="context.pathInfo"/></td>
</tr>
<tr>
<td valign="top">rootURL:</td>
<td valign="top"><var:string value="context.rootURL"/></td>
</tr>
<tr>
<td valign="top">active user:</td>
<td valign="top"><var:string value="context.activeUser"/></td>
</tr>
<tr>
<td valign="top">CN / email:</td>
<td valign="top">
<var:string value="cnForUser"/>
<var:entity const:name="lt"
/><var:string value="emailForUser"
/><var:entity const:name="gt"
/></td>
</tr>
<tr>
<td valign="top">Access Restricted:</td>
<td valign="top">
<var:if condition="isAccessRestricted">YES</var:if>
<var:if condition="isAccessRestricted"
const:negate="YES"
>NO</var:if>
</td>
</tr>
<tr>
<td valign="top">Headers:</td>
<td valign="top">
<span style="white-space: pre;">
<var:string value="context.request.headers"
const:escapeHTML="YES"
/>
</span>
</td>
</tr>
</table>
</var:if>
</body>
</html>
</var:if>
<var:component className="UIxToolbar" />
<div class="pageContent">
<!-- <tr> -->
<!-- <td colspan="2"> -->
<!-- TODO: replace the line with a CSS straight line -->
<!-- <table cellpadding="0" cellspacing="0" border="0" width="100%"> -->
<!-- <tr> -->
<!-- <td class="linecolor"><img rsrc:src="line_left.gif"/></td> -->
<!-- <td class="linecolor" width="98%"> -->
<!-- <img rsrc:src="line_stretch.gif"/> -->
<!-- </td> -->
<!-- <td class="linecolor"><img rsrc:src="line_right.gif"/></td> -->
<!-- </tr> -->
<!-- <tr> -->
<!-- <td valign="top" colspan="2"> -->
<!-- <var:component className="UIxAppNavView" /> -->
<!-- </td> -->
<!-- <td valign="top" align="right" class="button_submit_env"> -->
<!-- <a var:href="helpURL" -->
<!-- class="button_submit" -->
<!-- label:string="Help" -->
<!-- var:target="helpWindowTarget" -->
<!-- /> -->
<!-- </td> -->
<!-- </tr> -->
<!-- </table> -->
<!-- </td> -->
<!-- </tr> -->
<var:component-content/>
</div>
<var:if condition="isUIxDebugEnabled">
<table border="0" style="font-size: 9pt;">
<tr>
<td valign="top">clientObject:</td>
<td valign="top"><var:string value="clientObject" /></td>
</tr>
<tr>
<td valign="top">ownerInContext:</td>
<td valign="top"><var:string value="ownerInContext" /></td>
</tr>
<tr>
<td valign="top">traversal stack:</td>
<td valign="top">
<var:foreach list="context.objectTraversalStack" item="item">
<var:string value="item" /><br />
</var:foreach>
</td>
</tr>
<tr>
<td valign="top">traversal path:</td>
<td valign="top">
<var:foreach list="context.soRequestTraversalPath"
item="item" const:separator=" => ">
<var:string value="item" />
</var:foreach>
</td>
</tr>
<tr>
<td valign="top">request type:</td>
<td valign="top"><var:string value="context.soRequestType"/>
</td>
</tr>
<tr>
<td valign="top">path info:</td>
<td valign="top"><var:string value="context.pathInfo"/></td>
</tr>
<tr>
<td valign="top">rootURL:</td>
<td valign="top"><var:string value="context.rootURL"/></td>
</tr>
<tr>
<td valign="top">active user:</td>
<td valign="top"><var:string value="context.activeUser"/></td>
</tr>
<tr>
<td valign="top">CN / email:</td>
<td valign="top">
<var:string value="cnForUser"/>
<var:entity const:name="lt"
/><var:string value="emailForUser"
/><var:entity const:name="gt"
/></td>
</tr>
<tr>
<td valign="top">Access Restricted:</td>
<td valign="top">
<var:if condition="isAccessRestricted">YES</var:if>
<var:if condition="isAccessRestricted"
const:negate="YES"
>NO</var:if>
</td>
</tr>
<tr>
<td valign="top">Headers:</td>
<td valign="top">
<span style="white-space: pre;">
<var:string value="context.request.headers"
const:escapeHTML="YES"
/>
</span>
</td>
</tr>
</table>
<var:if condition="hideFrame">
<var:component-content />
</var:if>
</body>
</html>
<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-omittag:nil
sgml-shorttag:nil
End:
-->
</container>

View File

@ -1,39 +1,51 @@
<?xml version="1.0" standalone="yes"?>
<var:if condition="hasButtons"
<var:if condition="hasButtons"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
xmlns:so="http://www.skyrix.com/od/so-lookup">
<div class="toolbar">
<var:foreach list="toolbarConfig" item="toolbarGroup">
<var:foreach list="toolbarGroup" item="buttonInfo">
<var:if condition="isButtonEnabled">
<a class="toolbarButton"
var:href="buttonInfo.link"
var:target="buttonInfo.target"
var:onclick="buttonInfo.onclick"
var:alt="buttonInfo.tooltip"
var:title="buttonInfo.tooltip">
<span class="toolbarButton">
<img class="buttonImage"
var:src="buttonImage"
var:alt="buttonInfo.image" /><br />
<span class="buttonLabel"><var:string
value="buttonLabel" /></span>
</span>
</a>
</var:if>
<div id="toolbar" class="toolbar">
<var:foreach list="toolbarConfig" item="toolbarGroup"
><var:foreach list="toolbarGroup" item="buttonInfo"
><var:if condition="isButtonEnabled"
><a class="toolbarButton"
var:href="buttonInfo.link"
var:target="buttonInfo.target"
var:onclick="buttonInfo.onclick"
var:title="buttonInfo.tooltip"
><span class="toolbarButton"
><img class="buttonImage"
var:src="buttonImage"
var:alt="buttonInfo.image"
/><br
/><span class="buttonLabel"
><var:string
value="buttonLabel"
/></span
></span
></a>
</var:if>
<var:if condition="isButtonEnabled"
const:negate="YES"
><span class="disabledToolbarButton"
><img class="buttonImage"
var:src="buttonImage"
var:alt="buttonInfo.image"
/><br
/><span class="buttonLabel"
><var:string
value="buttonLabel"
/></span
></span>
</var:if>
</var:foreach>
<var:if condition="isLastGroup" const:negate="YES"
><span class="toolbarSeparator"
><var:entity const:name="nbsp"
/></span
></var:if>
</var:foreach>
<var:if condition="isLastGroup" const:negate="YES">
<span class="toolbarSeparator">
<var:entity const:name="nbsp" />
</span>
</var:if>
</var:foreach>
</div>
</var:if>
</div>
</var:if>

View File

@ -0,0 +1,997 @@
/*
Copyright (C) 2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo 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
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
/* JavaScript for SOGo Mailer */
/*
DOM ids available in mail list view:
row_$msgid
div_$msgid
readdiv_$msgid
unreaddiv_$msgid
Window Properties:
width, height
bool: resizable, scrollbars, toolbar, location, directories, status,
menubar, copyhistory
*/
var currentMessages = new Array();
var maxCachedMessages = 10;
var cachedMessages = new Array();
var currentMailbox = '';
/* mail list */
function openMessageWindow(sender, msguid, url) {
var msgWin = window.open(url, "SOGo_msg_" + msguid,
"width=640,height=480,resizable=1,scrollbars=1,toolbar=0," +
"location=0,directories=0,status=0,menubar=0,copyhistory=0");
msgWin.focus();
}
function clickedUid(sender, msguid) {
resetSelection(window);
openMessageWindow(sender, msguid,
ApplicationBaseURL + currentMailbox + "/" + msguid + "/view");
return true;
}
function doubleClickedUid(sender, msguid) {
alert("DOUBLE Clicked " + msguid);
return false;
}
function toggleMailSelect(sender) {
var row;
row = document.getElementById(sender.name);
row.className = sender.checked ? "tableview_selected" : "tableview";
}
function collectSelectedRows() {
var rows = new Array();
var messageList = document.getElementById('messageList');
var tbody = (messageList.getElementsByTagName('tbody'))[0];
var selectedRows = getSelectedNodes(tbody);
for (var i = 0; i < selectedRows.length; i++) {
var row = selectedRows[i];
var rowId = row.getAttribute('id').substring(4);
rows[rows.length] = rowId;
}
return rows;
}
function clearSearch(sender) {
var searchField = window.document.getElementById("search");
if (searchField) searchField.value="";
return true;
}
/* compose support */
function clickedCompose(sender) {
var urlstr;
urlstr = "compose";
window.open(urlstr, "SOGo_compose",
"width=680,height=520,resizable=1,scrollbars=1,toolbar=0," +
"location=0,directories=0,status=0,menubar=0,copyhistory=0");
return false; /* stop following the link */
}
/* mail editor */
function validateEditorInput(sender) {
var errortext = "";
var field;
field = document.pageform.subject;
if (field.value == "")
errortext = errortext + labels.error_missingsubject + "\n";
if (!UIxRecipientSelectorHasRecipients())
errortext = errortext + labels.error_missingrecipients + "\n";
if (errortext.length > 0) {
alert(labels.error_validationfailed + ":\n" + errortext);
return false;
}
return true;
}
function clickedEditorSend(sender) {
if (!validateEditorInput(sender))
return false;
document.pageform.action="send";
document.pageform.submit();
// if everything is ok, close the window
return true;
}
function clickedEditorAttach(sender) {
var urlstr;
urlstr = "viewAttachments";
window.open(urlstr, "SOGo_attach",
"width=320,height=320,resizable=1,scrollbars=1,toolbar=0," +
"location=0,directories=0,status=0,menubar=0,copyhistory=0");
return false; /* stop following the link */
}
function clickedEditorSave(sender) {
document.pageform.action="save";
document.pageform.submit();
refreshOpener();
return true;
}
function clickedEditorDelete(sender) {
document.pageform.action="delete";
document.pageform.submit();
refreshOpener();
window.close();
return true;
}
function showInlineAttachmentList(sender) {
var r, l;
r = document.getElementById('compose_rightside');
r.style.display = 'block';
l = document.getElementById('compose_leftside');
l.style.width = "67%";
this.adjustInlineAttachmentListHeight(sender);
}
function updateInlineAttachmentList(sender, attachments) {
if (!attachments || (attachments.length == 0)) {
this.hideInlineAttachmentList(sender);
return;
}
var e, i, count, text;
count = attachments.length;
text = "";
for (i = 0; i < count; i++) {
text = text + attachments[i];
text = text + '<br />';
}
e = document.getElementById('compose_attachments_list');
e.innerHTML = text;
this.showInlineAttachmentList(sender);
}
function adjustInlineAttachmentListHeight(sender) {
var e;
e = document.getElementById('compose_rightside');
if (e.style.display == 'none') return;
/* need to lower left size first, because left auto-adjusts to right! */
xHeight('compose_attachments_list', 10);
var leftHeight, rightHeaderHeight;
leftHeight = xHeight('compose_leftside');
rightHeaderHeight = xHeight('compose_attachments_header');
xHeight('compose_attachments_list', (leftHeight - rightHeaderHeight) - 16);
}
function hideInlineAttachmentList(sender) {
var e;
// xVisibility('compose_rightside', false);
e = document.getElementById('compose_rightside');
e.style.display = 'none';
e = document.getElementById('compose_leftside');
e.style.width = "100%";
}
/* addressbook helpers */
function openAnais(sender) {
var urlstr;
urlstr = "anais";
var w = window.open(urlstr, "Anais",
"width=350,height=600,left=10,top=10,toolbar=no," +
"dependent=yes,menubar=no,location=no,resizable=yes," +
"scrollbars=yes,directories=no,status=no");
w.focus();
}
function openAddressbook(sender) {
var urlstr;
urlstr = "addressbook";
var w = window.open(urlstr, "Addressbook",
"width=600,height=400,left=10,top=10,toolbar=no," +
"dependent=yes,menubar=no,location=no,resizable=yes," +
"scrollbars=yes,directories=no,status=no");
w.focus();
}
/* filters */
function clickedFilter(sender, scriptname) {
var urlstr;
urlstr = scriptname + "/edit";
window.open(urlstr, "SOGo_filter_" + scriptname,
"width=640,height=480,resizable=1,scrollbars=1,toolbar=0," +
"location=0,directories=0,status=0,menubar=0,copyhistory=0")
return true;
}
function clickedNewFilter(sender) {
var urlstr;
urlstr = "create";
window.open(urlstr, "SOGo_filter",
"width=680,height=480,resizable=1,scrollbars=1,toolbar=0," +
"location=0,directories=0,status=0,menubar=0,copyhistory=0");
return false; /* stop following the link */
}
/* mail list DOM changes */
function markMailInWindow(win, msguid, markread) {
var msgDiv;
msgDiv = win.document.getElementById("div_" + msguid);
if (msgDiv) {
if (markread) {
msgDiv.className = "mailer_readmailsubject";
msgDiv = win.document.getElementById("unreaddiv_" + msguid);
if (msgDiv) msgDiv.style.display = "none";
msgDiv = win.document.getElementById("readdiv_" + msguid);
if (msgDiv) msgDiv.style.display = "block";
}
else {
msgDiv.className = "mailer_unreadmailsubject";
msgDiv = win.document.getElementById("readdiv_" + msguid);
if (msgDiv) msgDiv.style.display = "none";
msgDiv = win.document.getElementById("unreaddiv_" + msguid);
if (msgDiv) msgDiv.style.display = "block";
}
return true;
}
else
return false;
}
function markMailReadInWindow(win, msguid) {
/* this is called by UIxMailView with window.opener */
return markMailInWindow(win, msguid, true);
}
/* main window */
function reopenToRemoveLocationBar() {
// we cannot really use this, see below at the close comment
if (window.locationbar && window.locationbar.visible) {
newwin = window.open(window.location.href, "SOGo",
"width=800,height=600,resizable=1,scrollbars=1," +
"toolbar=0,location=0,directories=0,status=0," +
"menubar=0,copyhistory=0");
if (newwin) {
window.close(); // this does only work for windows opened by scripts!
newwin.focus();
return true;
}
return false;
}
return true;
}
/* mail list reply */
function openMessageWindowsForSelection(sender, action) {
var rows = collectSelectedRows();
var idset = "";
for (var i = 0; i < rows.length; i++) {
win = openMessageWindow(sender,
rows[i] /* msguid */,
rows[i] + "/" + action /* url */);
}
}
function mailListMarkMessage(sender, action, msguid, markread) {
var url;
var http = createHTTPClient();
url = action + "?uid=" + msguid;
if (http) {
// TODO: add parameter to signal that we are only interested in OK
http.open("POST", url + "&jsonly=1", false /* not async */);
http.send("");
if (http.status != 200) {
// TODO: refresh page?
alert("Message Mark Failed: " + http.statusText);
window.location.reload();
}
else {
markMailInWindow(window, msguid, markread);
}
}
else {
window.location.href = url;
}
}
/* maillist row highlight */
var oldMaillistHighlight = null; // to remember deleted/selected style
function ml_highlight(sender) {
oldMaillistHighlight = sender.className;
if (oldMaillistHighlight == "tableview_highlight")
oldMaillistHighlight = null;
sender.className = "tableview_highlight";
}
function ml_lowlight(sender) {
if (oldMaillistHighlight) {
sender.className = oldMaillistHighlight;
oldMaillistHighlight = null;
}
else
sender.className = "tableview";
}
/* folder operations */
function ctxFolderAdd(sender) {
var folderName;
folderName = prompt("Foldername: ");
if (folderName == undefined)
return false;
if (folderName == "")
return false;
// TODO: should use a form-POST or AJAX
window.location.href = "createFolder?name=" + escape(folderName);
return false;
}
function ctxFolderDelete(sender) {
if (!confirm("Delete current folder?"))
return false;
// TODO: should use a form-POST or AJAX
window.location.href = "deleteFolder";
return false;
}
/* bulk delete of messages */
function uixDeleteSelectedMessages(sender) {
var rows;
var failCount = 0;
rows = collectSelectedRows();
for (var i = 0; i < rows.length; i++) {
var url, http, rowElem;
/* send AJAX request (synchronously) */
url = "" + rows[i] + "/trash?jsonly=1";
http = createHTTPClient();
http.open("POST", url, false /* not async */);
http.send("");
if (http.status != 200) { /* request failed */
failCount++;
http = null;
continue;
}
http = null;
/* remove from page */
/* line-through would be nicer, but hiding is OK too */
rowElem = document.getElementById("row_" + rows[i]);
rowElem.parentNode.removeChild(rowElem);
}
if (failCount > 0)
alert("Could not delete " + failCount + " messages!");
return false;
}
/* ajax mailbox handling */
var activeAjaxRequests = 0;
function triggerAjaxRequest(url, callback, userdata) {
var http = createHTTPClient();
activeAjaxRequests += 1;
document.animTimer = setTimeout("checkAjaxRequestsState();", 200);
if (http) {
http.onreadystatechange
= function() {
try {
if (http.readyState == 4
&& activeAjaxRequests > 0) {
http.callbackData = userdata;
callback(http);
activeAjaxRequests -= 1;
checkAjaxRequestsState();
}
}
catch( e ) {
activeAjaxRequests -= 1;
checkAjaxRequestsState();
alert('AJAX Request, Caught Exception: ' + e.description);
}
};
http.url = url;
http.open("GET", url, true);
http.send("");
}
// window.alert('should open ' + mailbox);
return false;
}
function checkAjaxRequestsState()
{
if (activeAjaxRequests > 0
&& !document.busyAnim) {
var anim = document.createElement("img");
document.busyAnim = anim;
anim.setAttribute("src", ResourcesURL + '/busy.gif');
anim.style.position = "absolute;";
anim.style.top = "2.5em;";
anim.style.right = "1em;";
anim.style.visibility = "hidden;";
anim.style.zindex = "1;";
var folderTree = document.getElementById("toolbar");
folderTree.appendChild(anim);
anim.style.visibility = "visible;";
} else if (activeAjaxRequests == 0
&& document.busyAnim) {
document.busyAnim.parentNode.removeChild(document.busyAnim);
document.busyAnim = null;
}
}
function onMailboxTreeItemClick(element)
{
var topNode = document.getElementById('d');
var mailbox = element.parentNode.getAttribute("dataname");
if (topNode.selectedEntry)
deselectNode(topNode.selectedEntry);
selectNode(element);
topNode.selectedEntry = element;
openMailbox(mailbox);
}
function openMailbox(mailbox)
{
if (mailbox != currentMailbox) {
currentMailbox = mailbox;
var url = ApplicationBaseURL + mailbox + "/view?noframe=1";
var mailboxContent = document.getElementById("mailboxContent");
var mailboxDragHandle = document.getElementById("mailboxDragHandle");
var messageContent = document.getElementById("messageContent");
if (mailbox.lastIndexOf("/") == 0) {
mailboxContent.style.visibility = "hidden;";
mailboxDragHandle.style.visibility = "hidden;";
messageContent.style.top = "0px;";
var url = (ApplicationBaseURL + currentMailbox + "/"
+ "/view?noframe=1");
triggerAjaxRequest(url, messageCallback);
} else {
if (mailboxContent.style.visibility == "hidden") {
mailboxContent.style.visibility = "visible;";
mailboxDragHandle.style.visibility = "visible;";
messageContent.style.top = (mailboxDragHandle.offsetTop
+ mailboxDragHandle.offsetHeight
+ 'px;');
}
triggerAjaxRequest(url, messageListCallback);
if (currentMessages[mailbox]) {
loadMessage(currentMessages[mailbox]);
} else {
messageContent.innerHTML = '';
}
}
}
// triggerAjaxRequest(mailbox, 'toolbar', toolbarCallback);
}
function openMailboxAtIndex(element) {
var idx = element.getAttribute("idx");
var url = ApplicationBaseURL + currentMailbox + "/view?noframe=1&idx=" + idx;
log ("url: " + url);
triggerAjaxRequest(url, messageListCallback);
}
function messageListCallback(http)
{
log ('messageListCallback');
var div = document.getElementById('mailboxContent');
if (http.readyState == 4
&& http.status == 200)
{
log ('displaying result');
div.innerHTML = http.responseText;
}
else
log ("ajax fuckage");
}
var onHideMenuEventHandler = {
handleEvent: function(event) {
onFolderMenuHide(event);
}
}
function onFolderMenuClick(event, element, menutype)
{
var onhide, menuName;
if (menutype == "inbox") {
menuName = "inboxIconMenu";
} else if (menutype == "account") {
menuName = "accountIconMenu";
} else if (menutype == "trash") {
menuName = "trashIconMenu";
} else {
menuName = "mailboxIconMenu";
}
var menu = document.getElementById(menuName);
menu.addEventListener("hideMenu", onHideMenuEventHandler, false);
onMenuClick(event, menuName);
var topNode = document.getElementById('d');
if (topNode.selectedEntry)
deselectNode(topNode.selectedEntry);
if (topNode.menuSelectedEntry)
deselectNode(topNode.menuSelectedEntry);
topNode.menuSelectedEntry = element;
selectNode(element);
}
function onFolderMenuHide(event)
{
var topNode = document.getElementById('d');
if (topNode.menuSelectedEntry)
deselectNode(topNode.menuSelectedEntry);
topNode.menuSelectedEntry = null;
if (topNode.selectedEntry)
selectNode(topNode.selectedEntry);
}
function getCachedMessage(idx)
{
var message = null;
var counter = 0;
while (counter < cachedMessages.length
&& message == null)
if (cachedMessages[counter]
&& cachedMessages[counter]['idx'] == currentMailbox + '/' + idx)
message = cachedMessages[counter];
else
counter++;
return message;
}
function storeCachedMessage(cachedMessage)
{
var oldest = -1;
var timeOldest = -1;
var counter = 0;
if (cachedMessages.length < maxCachedMessages)
oldest = cachedMessages.length;
else {
while (cachedMessages[counter]) {
if (oldest == -1
|| cachedMessages[counter]['time'] < timeOldest) {
oldest = counter;
timeOldest = cachedMessages[counter]['time'];
}
counter++;
}
if (oldest == -1)
oldest = 0;
}
cachedMessages[oldest] = cachedMessage;
}
function onMessageSelectionChange()
{
var selection = collectSelectedRows();
if (selection.length == 1)
{
var idx = selection[0];
if (currentMessages[currentMailbox] != idx) {
currentMessages[currentMailbox] = idx;
loadMessage(idx);
}
}
}
function loadMessage(idx)
{
var cachedMessage = getCachedMessage(idx);
if (cachedMessage == null) {
var url = (ApplicationBaseURL + currentMailbox + "/"
+ idx + "/view?noframe=1");
triggerAjaxRequest(url, messageCallback, idx);
markMailInWindow(window, idx, true);
} else {
var div = document.getElementById('messageContent');
div.innerHTML = cachedMessage['text'];
cachedMessage['time'] = (new Date()).getTime();
}
}
function messageCallback(http)
{
var div = document.getElementById('messageContent');
if (http.readyState == 4
&& http.status == 200)
{
div.innerHTML = http.responseText;
if (http.callbackData)
{
var cachedMessage = new Array();
cachedMessage['idx'] = currentMailbox + '/' + http.callbackData;
cachedMessage['time'] = (new Date()).getTime();
cachedMessage['text'] = http.responseText;
storeCachedMessage(cachedMessage);
}
}
else
log ("ajax fuckage");
}
function processMailboxMenuAction(mailbox)
{
var currentNode, upperNode;
var mailboxName;
var action;
mailboxName = mailbox.getAttribute('mailboxname');
currentNode = mailbox;
upperNode = null;
while (currentNode
&& !currentNode.hasAttribute('mailboxaction'))
currentNode = currentNode.parentNode.parentNode.parentMenuItem;
if (currentNode)
{
action = currentNode.getAttribute('mailboxaction');
var rows = collectSelectedRows();
var rString = rows.join(', ');
alert("performing '" + action + "' on " + rString
+ " to " + mailboxName);
}
}
var rowSelectionCount = 0;
validateControls();
function showElement(e, shouldShow) {
e.style.display = shouldShow ? "" : "none";
}
function enableElement(e, shouldEnable) {
if(!e)
return;
if(shouldEnable) {
if(e.hasAttribute("disabled"))
e.removeAttribute("disabled");
}
else {
e.setAttribute("disabled", "1");
}
}
function toggleRowSelectionStatus(sender) {
rowID = sender.value;
tr = document.getElementById(rowID);
if(sender.checked) {
tr.className = "tableview_selected";
rowSelectionCount += 1;
}
else {
tr.className = "tableview";
rowSelectionCount -= 1;
}
this.validateControls();
}
function validateControls() {
var e = document.getElementById("moveto");
this.enableElement(e, rowSelectionCount > 0);
}
function moveTo(uri) {
alert("MoveTo: " + uri);
}
function popupSearchMenu(event, menuId)
{
var node = event.target;
superNode = node.parentNode.parentNode.parentNode;
relX = (event.pageX - superNode.offsetLeft - node.offsetLeft);
relY = (event.pageY - superNode.offsetTop - node.offsetTop);
if (event.button == 0
&& relX < 24) {
event.cancelBubble = true;
event.returnValue = false;
var popup = document.getElementById(menuId);
hideMenu(event, popup);
var menuTop = superNode.offsetTop + node.offsetTop + node.offsetHeight;
var menuLeft = superNode.offsetLeft + node.offsetLeft;
var heightDiff = (window.innerHeight
- (menuTop + popup.offsetHeight));
if (heightDiff < 0)
menuTop += heightDiff;
var leftDiff = (window.innerWidth
- (menuLeft + popup.offsetWidth));
if (leftDiff < 0)
menuLeft -= popup.offsetWidth;
popup.style.top = menuTop + "px";
popup.style.left = menuLeft + "px";
popup.style.visibility = "visible";
bodyOnClick = "" + document.body.getAttribute("onclick");
document.body.setAttribute("onclick", "onBodyClick('" + menuId + "');");
document.currentPopupMenu = popup;
}
}
function setSearchCriteria(event)
{
searchField = document.getElementById('searchValue');
searchCriteria = document.getElementById('searchCriteria');
var node = event.target;
searchField.setAttribute("ghost-phrase", node.innerHTML);
searchCriteria = node.getAttribute('id');
}
function checkSearchValue(event)
{
var form = event.target;
var searchField = document.getElementById('searchValue');
var ghostPhrase = searchField.getAttribute('ghost-phrase');
if (searchField.value == ghostPhrase)
searchField.value = "";
}
function onSearchChange()
{
}
function onSearchMouseDown(event)
{
searchField = document.getElementById('searchValue');
superNode = searchField.parentNode.parentNode.parentNode;
relX = (event.pageX - superNode.offsetLeft - searchField.offsetLeft);
relY = (event.pageY - superNode.offsetTop - searchField.offsetTop);
if (relY < 24) {
event.cancelBubble = true;
event.returnValue = false;
}
}
function onSearchFocus(event)
{
searchField = document.getElementById('searchValue');
ghostPhrase = searchField.getAttribute("ghost-phrase");
if (searchField.value == ghostPhrase) {
searchField.value = "";
searchField.setAttribute("modified", "");
} else {
searchField.select();
}
searchField.style.color = "#000";
}
function onSearchBlur()
{
var searchField = document.getElementById('searchValue');
var ghostPhrase = searchField.getAttribute("ghost-phrase");
if (searchField.value == "") {
searchField.setAttribute("modified", "");
searchField.style.color = "#aaa";
searchField.value = ghostPhrase;
} else if (searchField.value == ghostPhrase) {
searchField.setAttribute("modified", "");
searchField.style.color = "#aaa";
} else {
searchField.setAttribute("modified", "yes");
searchField.style.color = "#000";
}
}
function initCriteria()
{
var searchCriteria = document.getElementById('searchCriteria');
var searchField = document.getElementById('searchValue');
var firstOption;
if (searchCriteria.value == ''
|| searchField.value == '') {
firstOption = document.getElementById('searchOptions').childNodes[1];
searchCriteria.value = firstOption.getAttribute('id');
searchField.value = firstOption.innerHTML;
searchField.setAttribute('ghost-phrase', firstOption.innerHTML);
searchField.setAttribute("modified", "");
searchField.style.color = "#aaa";
}
}
function deleteSelectedMails()
{
}
/* message menu entries */
function onMenuOpenMessage(event)
{
var node = getParentMenu(event.target).menuTarget.parentNode;
var msgId = node.getAttribute('id').substr(4);
openMessageWindow(null, msgId,
ApplicationBaseURL + currentMailbox + "/" + msgId + "/view");
return false;
}
function onMenuReplyToSender(event)
{
openMessageWindowsForSelection(null, 'reply');
}
function onMenuReplyToAll(event)
{
openMessageWindowsForSelection(null, 'replyall');
}
function onMenuForwardMessage(event)
{
openMessageWindowsForSelection(null, 'forward');
}
function onMenuDeleteMessage(event)
{
uixDeleteSelectedMessages(null);
return false;
}
/* contacts */
function newContactFromEmail(sender) {
var emailre
= /([a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])/g;
emailre.exec(sender.parentNode.parentNode.menuTarget.innerHTML);
email = RegExp.$1;
if (email.length > 0)
{
emailre.exec("");
w = window.open(UserFolderURL + "/Contacts/new?contactEmail=" + email,
"SOGo_new_contact",
"width=680,height=520,resizable=1,scrollbars=1,toolbar=0,"
+ "location=0,directories=0,status=0,menubar=0,"
+ "copyhistory=0");
w.focus();
}
return false; /* stop following the link */
}
function newEmailTo(sender) {
var mailto = sanitizeMailTo(sender.parentNode.parentNode.menuTarget.innerHTML);
if (mailto.length > 0)
{
w = window.open("compose?mailto=" + mailto,
"SOGo_compose",
"width=680,height=520,resizable=1,scrollbars=1,toolbar=0," +
"location=0,directories=0,status=0,menubar=0,copyhistory=0");
w.focus();
}
return false; /* stop following the link */
}
function initMailboxSelection(mailboxName)
{
currentMailbox = mailboxName;
var tree = document.getElementById("d");
var treeNodes = getElementsByClassName('DIV', 'dTreeNode', tree);
var i = 0;
while (i < treeNodes.length
&& treeNodes[i].getAttribute("dataname") != currentMailbox)
i++;
if (i < treeNodes.length) {
var links = getElementsByClassName('A', 'node', treeNodes[i]);
if (tree.selectedEntry)
deselectNode(tree.selectedEntry);
selectNode(links[0]);
tree.selectedEntry = links[0];
}
}
function initMailboxAppearance()
{
var mailboxContent = document.getElementById('mailboxContent');
var messageContent = document.getElementById('messageContent');
var mailboxDragHandle = document.getElementById('mailboxDragHandle');
mailboxContent.style.height = (mailboxDragHandle.offsetTop
- mailboxContent.offsetTop + 'px;');
messageContent.style.top = (mailboxDragHandle.offsetTop
+ mailboxDragHandle.offsetHeight
+ 'px;');
}
function registerDraggableMessageNodes()
{
log ("can we drag...");
}

View File

@ -3,7 +3,7 @@ var rowSelectionCount = 0;
validateControls();
function showElement(e, shouldShow) {
e.style.display = shouldShow ? "" : "none";
e.style.display = shouldShow ? "" : "none";
}
function enableElement(e, shouldEnable) {
@ -51,7 +51,6 @@ function popupSearchMenu(event, menuId)
if (event.button == 0
&& relX < 24) {
log('popup');
event.cancelBubble = true;
event.returnValue = false;
@ -85,27 +84,33 @@ function setSearchCriteria(event)
searchField = document.getElementById('searchValue');
searchCriteria = document.getElementById('searchCriteria');
node = event.target;
var node = event.target;
searchField.setAttribute("ghost-phrase", node.innerHTML);
searchCriteria = node.getAttribute('id');
}
function checkSearchValue(event)
{
var form = event.target;
var searchField = document.getElementById('searchValue');
var ghostPhrase = searchField.getAttribute('ghost-phrase');
if (searchField.value == ghostPhrase)
searchField.value = "";
}
function onSearchChange()
{
log('onSearchChange');
}
function onSearchMouseDown(event)
{
log('onSearchMouseDown');
searchField = document.getElementById('searchValue');
superNode = searchField.parentNode.parentNode.parentNode;
relX = (event.pageX - superNode.offsetLeft - searchField.offsetLeft);
relY = (event.pageY - superNode.offsetTop - searchField.offsetTop);
if (relY < 24) {
log('menu');
event.cancelBubble = true;
event.returnValue = false;
}
@ -113,7 +118,6 @@ function onSearchMouseDown(event)
function onSearchFocus(event)
{
log('onSearchFocus');
searchField = document.getElementById('searchValue');
ghostPhrase = searchField.getAttribute("ghost-phrase");
if (searchField.value == ghostPhrase) {
@ -128,7 +132,6 @@ function onSearchFocus(event)
function onSearchBlur()
{
log('onSearchBlur');
var searchField = document.getElementById('searchValue');
var ghostPhrase = searchField.getAttribute("ghost-phrase");
@ -159,7 +162,45 @@ function initCriteria()
searchField.setAttribute('ghost-phrase', firstOption.innerHTML);
searchField.setAttribute("modified", "");
searchField.style.color = "#aaa";
log(searchField.value);
}
}
function deleteSelectedMails()
{
}
/* message menu entries */
function onMenuOpenMessage(event)
{
var node = getParentMenu(event.target).menuTarget.parentNode;
var msgId = node.getAttribute('id').substr(4);
openMessageWindow(null, msgId, msgId + "/view");
return false;
}
function onMenuReplyToSender(event)
{
openMessageWindowsForSelection(null, 'reply');
}
function onMenuReplyToAll(event)
{
openMessageWindowsForSelection(null, 'replyall');
}
function onMenuForwardMessage(event)
{
openMessageWindowsForSelection(null, 'forward');
}
function onMenuDeleteMessage(event)
{
uixDeleteSelectedMessages(null);
return false;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 B

View File

@ -24,16 +24,76 @@
/* generic stuff */
logWindow = window.open('', 'logWindow');
logWindow.document.write('<html><head><title>JavaScript log</title></head>'
+ '<body style="font-family: monospace;'
+ 'font-size: 10pt; overflow: scroll;">'
+ '<div class="log" id="logArea"'
+ ' onclick="this.innerHTML=\'\';"></div></body>'
+ '</html>');
logWindow.resizeTo(640,480);
logArea = logWindow.document.getElementById('logArea');
logArea.innerHTML = '';
var logConsole;
// logArea = null;
var allDocumentElements = null;
/* a W3C compliant document.all */
function getAllScopeElements(scope)
{
var elements = new Array();
for (var i = 0; i < scope.childNodes.length; i++)
if (typeof(scope.childNodes[i]) == "object"
&& scope.childNodes[i].tagName
&& scope.childNodes[i].tagName != '')
{
elements.push(scope.childNodes[i]);
var childElements = getAllElements(scope.childNodes[i]);
if (childElements.length > 0)
elements.push(childElements);
}
return elements;
}
function getAllElements(scope)
{
var elements;
if (scope == null)
scope = document;
if (scope == document
&& allDocumentElements != null)
elements = allDocumentElements;
else
{
elements = getAllScopeElements(scope);
if (scope == document)
allDocumentElements = elements;
}
return elements;
}
/* from
http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/ */
function getElementsByClassName(_tag, _class, _scope) {
var regexp, classes, elements, element, returnElements;
_scope = _scope || document;
elements = (!_tag || _tag == "*"
? getAllElements(null)
: _scope.getElementsByTagName(_tag));
returnElements = [];
classes = _class.split(/\s+/);
regexp = new RegExp("(^|\s+)("+ classes.join("|") +")(\s+|$)","i");
if (_class) {
for(var i = 0; element = elements[i]; i++) {
if (regexp.test(element.className)) {
returnElements.push(element);
}
}
return returnElements;
} else {
return elements;
}
}
function ml_stripActionInURL(url) {
if (url[url.length - 1] != '/') {
@ -204,37 +264,45 @@ function triggerOpenerCallback() {
}
}
/* selection mechanism */
function addClassName(node, className) {
var classStr = '' + node.getAttribute("class");
function selectNode(node) {
var classStr = '' + node.getAttribute('class');
position = classStr.indexOf('_selected', 0);
position = classStr.indexOf(className, 0);
if (position < 0) {
classStr = classStr + ' _selected';
classStr = classStr + ' ' + className;
node.setAttribute('class', classStr);
}
}
function deselectNode(node) {
function removeClassName(node, className) {
var classStr = '' + node.getAttribute('class');
position = classStr.indexOf('_selected', 0);
position = classStr.indexOf(className, 0);
while (position > -1) {
classStr1 = classStr.substring(0, position);
classStr2 = classStr.substring(position + 10, classStr.length);
classStr = classStr1 + classStr2;
position = classStr.indexOf('_selected', 0);
position = classStr.indexOf(className, 0);
}
node.setAttribute('class', classStr);
}
/* selection mechanism */
function selectNode(node) {
addClassName(node, '_selected');
}
function deselectNode(node) {
removeClassName(node, '_selected');
}
function deselectAll(parent) {
for (var i = 0; i < parent.childNodes.length; i++) {
var node = parent.childNodes.item(i);
if (node.nodeType == 1) {
deselectNode(node);
removeClassName(node, '_selected');
}
}
}
@ -258,18 +326,17 @@ function getSelectedNodes(parentNode) {
for (var i = 0; i < parentNode.childNodes.length; i++) {
node = parentNode.childNodes.item(i);
if (node.nodeType == 1
&& isNodeSelected(node)) {
selArray.push(i);
}
&& isNodeSelected(node))
selArray.push(node);
}
return selArray.join('|');
return selArray;
}
function onRowClick(event) {
var node = event.target;
// var text = document.getElementById('list');
// text.innerHTML = '';
if (node.tagName == 'TD')
node = node.parentNode;
var startSelection = getSelectedNodes(node.parentNode);
if (event.shiftKey == 1
@ -285,7 +352,10 @@ function onRowClick(event) {
selectNode(node);
}
if (startSelection != getSelectedNodes(node.parentNode)) {
var code = '' + node.parentNode.getAttribute('onselectionchange');
var parentNode = node.parentNode;
if (parentNode.tagName == 'TBODY')
parentNode = parentNode.parentNode;
var code = '' + parentNode.getAttribute('onselectionchange');
if (code.length > 0) {
node.eval(code);
}
@ -296,8 +366,6 @@ function onRowClick(event) {
var bodyOnClick = "";
// var acceptClick = false;
var menuClickNode = null;
var currentSubmenu = null;
function onMenuClick(event, menuId)
{
@ -306,8 +374,10 @@ function onMenuClick(event, menuId)
event.cancelBubble = true;
event.returnValue = false;
if (document.currentPopupMenu)
hideMenu(event, document.currentPopupMenu);
var popup = document.getElementById(menuId);
hideMenu(popup);
var menuTop = event.pageY;
var menuLeft = event.pageX;
@ -321,86 +391,172 @@ function onMenuClick(event, menuId)
if (leftDiff < 0)
menuLeft -= popup.offsetWidth;
popup.style.top = menuTop + "px";
popup.style.left = menuLeft + "px";
popup.style.visibility = "visible";
menuClickNode = node;
popup.style.top = menuTop + "px;";
popup.style.left = menuLeft + "px;";
popup.style.visibility = "visible;";
setupMenuTarget(popup, node);
bodyOnClick = "" + document.body.getAttribute("onclick");
document.body.setAttribute("onclick", "onBodyClick('" + menuId + "');");
}
function onBodyClick(menuId)
{
// if (!acceptClick)
// acceptClick = true;
// else
// {
popup = document.getElementById(menuId);
hideMenu(popup);
document.body.setAttribute("onclick", bodyOnClick);
menuClickNode = null;
// }
document.body.setAttribute("onclick", "onBodyClick(event);");
document.currentPopupMenu = popup;
return false;
}
function hideMenu(menuNode)
function setupMenuTarget(menu, target)
{
menu.menuTarget = target;
var menus = getElementsByClassName("*", "menu", menu);
for (var i = 0; i < menus.length; i++) {
menus[i].menuTarget = target;
}
}
function getParentMenu(node)
{
var currentNode, menuNode;
menuNode = null;
currentNode = node;
var menure = new RegExp("(^|\s+)menu(\s+|$)", "i");
while (menuNode == null
&& currentNode)
if (menure.test(currentNode.className))
menuNode = currentNode;
else
currentNode = currentNode.parentNode;
return menuNode;
}
function onBodyClick(event)
{
document.currentPopupMenu.menuTarget = null;
hideMenu(event, document.currentPopupMenu);
document.body.setAttribute("onclick", bodyOnClick);
return false;
}
function hideMenu(event, menuNode)
{
var onHide;
// log('hiding menu "' + menuNode.getAttribute('id') + '"');
if (menuNode.submenu)
{
hideMenu(menuNode.submenu);
hideMenu(event, menuNode.submenu);
menuNode.submenu = null;
}
menuNode.style.visibility = "hidden";
if (menuNode.parentMenuItem)
{
menuNode.parentMenuItem.setAttribute('class', 'submenu');
menuNode.parentMenuItem = null;
menuNode.parentMenu.setAttribute('onmousemove', null);
menuNode.parentMenu.submenuItem = null;
menuNode.parentMenu.submenu = null;
menuNode.parentMenu = null;
}
var onhideEvent = document.createEvent("Event");
onhideEvent.initEvent("hideMenu", true, true);
menuNode.dispatchEvent(onhideEvent);
}
function onMenuEntryClick(node, event, menuId)
function onMenuEntryClick(event, menuId)
{
id = node.getAttribute("id");
window.alert("clicked " + menuClickNode.tagName);
var node = event.target;
id = getParentMenu(node).menuTarget;
// log("clicked " + id + "/" + id.tagName);
return false;
}
function initLogConsole() {
logConsole = document.getElementById('logConsole');
logConsole.innerHTML = '';
}
function toggleLogConsole() {
var visibility = '' + logConsole.style.visibility;
if (visibility.length == 0) {
logConsole.style.visibility = 'visible;';
} else {
logConsole.style.visibility = '';
}
return false;
}
function log(message) {
if (logArea)
logArea.innerHTML = logArea.innerHTML + message + '<br />' + "\n";
logConsole.innerHTML += message + '<br />' + "\n";
}
function dropDownSubmenu(event)
{
var node = event.target;
var submenu = node.getAttribute("submenu");
if (submenu && submenu != "") {
if (node.parentNode.parentNode.submenu)
hideMenu(node.parentNode.parentNode.submenu);
var submenuNode = document.getElementById(submenu);
node.parentNode.parentNode.submenu = submenuNode;
var menuTop = (node.parentNode.parentNode.offsetTop
+ node.offsetTop - 1);
if (submenu && submenu != "")
{
var submenuNode = document.getElementById(submenu);
var parentNode = getParentMenu(node);
if (parentNode.submenu)
hideMenu(event, parentNode.submenu);
var menuTop = (node.parentNode.parentNode.offsetTop
+ node.offsetTop - 1);
var heightDiff = (window.innerHeight
- (menuTop + submenuNode.offsetHeight));
if (heightDiff < 0)
menuTop += heightDiff;
var menuLeft = (node.parentNode.parentNode.offsetLeft
+ node.parentNode.parentNode.offsetWidth
- 2);
var leftDiff = (window.innerWidth
- (menuLeft + submenuNode.offsetWidth));
if (leftDiff < 0)
menuLeft -= (node.parentNode.parentNode.offsetWidth
+ submenuNode.offsetWidth
- 4);
var heightDiff = (window.innerHeight
- (menuTop + submenuNode.offsetHeight));
if (heightDiff < 0)
menuTop += heightDiff;
var menuLeft = (node.parentNode.parentNode.offsetLeft
+ node.parentNode.parentNode.offsetWidth
- 2);
var leftDiff = (window.innerWidth
- (menuLeft + submenuNode.offsetWidth));
if (leftDiff < 0)
menuLeft -= (node.parentNode.parentNode.offsetWidth
+ submenuNode.offsetWidth
- 4);
submenuNode.parentMenuItem = node;
submenuNode.parentMenu = parentNode;
parentNode.submenuItem = node;
parentNode.submenu = submenuNode;
parentNode.setAttribute('onmousemove', 'checkDropDown(event);');
node.setAttribute('class', 'submenu-selected');
submenuNode.style.top = menuTop + "px;";
submenuNode.style.left = menuLeft + "px;";
submenuNode.style.visibility = "visible;";
}
}
submenuNode.style.top = menuTop + "px";
submenuNode.style.left = menuLeft + "px";
submenuNode.style.visibility = "visible";
}
function checkDropDown(event)
{
var parentNode = getParentMenu(event.target);
var submenuNode = parentNode.submenu;
if (submenuNode)
{
var submenuItem = parentNode.submenuItem;
var itemX = submenuItem.offsetLeft + parentNode.offsetLeft;
var itemY = submenuItem.offsetTop + parentNode.offsetTop;
if (event.clientX >= itemX
&& event.clientX < submenuNode.offsetLeft
&& (event.clientY < itemY
|| event.clientY > (itemY
+ submenuItem.offsetHeight)))
{
hideMenu(event, submenuNode);
parentNode.submenu = null;
parentNode.submenuItem = null;
parentNode.setAttribute('onmousemove', null);
}
}
}
/* drag handle */
@ -409,26 +565,41 @@ var dragHandle;
var dragHandleOrigX;
var dragHandleOrigLeft;
var dragHandleOrigRight;
var dragHandleOrigY;
var dragHandleOrigUpper;
var dragHandleOrigLower;
var dragHandleDiff;
function startHandleDragging(event) {
if (event.button == 0) {
var leftBlock = event.target.getAttribute('leftblock');
var rightBlock = event.target.getAttribute('rightblock');
var upperBlock = event.target.getAttribute('upperblock');
var lowerBlock = event.target.getAttribute('lowerblock');
dragHandle = event.target;
dragHandleOrigX = dragHandle.offsetLeft;
dragHandleOrigLeft = document.getElementById(leftBlock).offsetWidth;
dragHandleOrigRight = document.getElementById(rightBlock).offsetLeft;
if (leftBlock && rightBlock) {
dragHandle.dhType = 'horizontal';
dragHandleOrigX = dragHandle.offsetLeft;
dragHandleOrigLeft = document.getElementById(leftBlock).offsetWidth;
dragHandleDiff = 0;
dragHandleOrigRight = document.getElementById(rightBlock).offsetLeft;
document.body.style.cursor = "e-resize";
} else if (upperBlock && lowerBlock) {
dragHandle.dhType = 'vertical';
var uBlock = document.getElementById(upperBlock);
var lBlock = document.getElementById(lowerBlock);
dragHandleOrigY = dragHandle.offsetTop;
dragHandleOrigUpper = uBlock.offsetHeight;
dragHandleDiff = event.clientY - dragHandle.offsetTop;
dragHandleOrigLower = lBlock.offsetTop;
document.body.style.cursor = "n-resize";
}
document.body.setAttribute('onmouseup', 'stopHandleDragging(event);');
document.body.setAttribute('onmousemove', 'dragHandleMove(event, "'
+ leftBlock
+ '", "'
+ rightBlock
+ '");');
document.body.style.cursor = "e-resize";
document.addEventListener('mouseup', stopHandleDragging, true);
document.addEventListener('mousemove', dragHandleMove, true);
dragHandleMove(event, leftBlock, rightBlock);
dragHandleMove(event);
event.cancelBubble = true;
}
@ -436,38 +607,58 @@ function startHandleDragging(event) {
}
function stopHandleDragging(event) {
var diffX = (event.clientX - dragHandleOrigX
- (dragHandle.offsetWidth / 2));
var lBlock
= document.getElementById(dragHandle.getAttribute('leftblock'));
var rBlock
= document.getElementById(dragHandle.getAttribute('rightblock'));
if (dragHandle.dhType == 'horizontal') {
var diffX = Math.floor(event.clientX - dragHandleOrigX
- (dragHandle.offsetWidth / 2));
var lBlock
= document.getElementById(dragHandle.getAttribute('leftblock'));
var rBlock
= document.getElementById(dragHandle.getAttribute('rightblock'));
rBlock.style.left = (dragHandleOrigRight + diffX) + 'px;';
lBlock.style.width = (dragHandleOrigLeft + diffX) + 'px;';
} else if (dragHandle.dhType == 'vertical') {
var diffY = Math.floor(event.clientY - dragHandleOrigY
- (dragHandle.offsetHeight / 2));
var uBlock
= document.getElementById(dragHandle.getAttribute('upperblock'));
var lBlock
= document.getElementById(dragHandle.getAttribute('lowerblock'));
lBlock.style.width = (dragHandleOrigLeft + diffX) + 'px';
rBlock.style.left = (dragHandleOrigRight + diffX) + 'px';
document.body.setAttribute('onmousemove', '');
document.body.setAttribute('onmouseup', '');
lBlock.style.top = (dragHandleOrigLower + diffY
- dragHandleDiff) + 'px;';
uBlock.style.height = (dragHandleOrigUpper + diffY - dragHandleDiff) + 'px;';
}
document.removeEventListener('mouseup', stopHandleDragging, true);
document.removeEventListener('mousemove', dragHandleMove, true);
document.body.setAttribute('style', '');
event.cancelBubble = true;
dragHandleMove(event);
return false;
}
function dragHandleMove(event, leftBlock, rightBlock) {
if (typeof(dragHandle) == undefined
|| !dragHandle)
stopHandling(event);
else {
function dragHandleMove(event) {
if (dragHandle.dhType == 'horizontal') {
var width = dragHandle.offsetWidth;
var hX = event.clientX;
if (hX > -1) {
var newLeft = hX - (width / 2);
dragHandle.style.left = newLeft + 'px';
var newLeft = Math.floor(hX - (width / 2));
dragHandle.style.left = newLeft + 'px;';
event.cancelBubble = true;
return false;
}
} else if (dragHandle.dhType == 'vertical') {
var height = dragHandle.offsetHeight;
var hY = event.clientY;
if (hY > -1) {
var newTop = Math.floor(hY - (height / 2)) - dragHandleDiff;
dragHandle.style.top = newTop + 'px;';
event.cancelBubble = true;
return false;
}
}
@ -475,18 +666,34 @@ function dragHandleMove(event, leftBlock, rightBlock) {
function dragHandleDoubleClick(event) {
dragHandle = event.target;
var lBlock
= document.getElementById(dragHandle.getAttribute('leftblock'));
var lLeft = lBlock.offsetLeft;
if (dragHandle.offsetLeft > lLeft) {
var rBlock
= document.getElementById(dragHandle.getAttribute('rightblock'));
var leftDiff = rBlock.offsetLeft - dragHandle.offsetLeft;
if (dragHandle.dhType == 'horizontal') {
var lBlock
= document.getElementById(dragHandle.getAttribute('leftblock'));
var lLeft = lBlock.offsetLeft;
dragHandle.style.left = lLeft + 'px';
lBlock.style.width = '0px';
rBlock.style.left = (lLeft + leftDiff) + 'px';
if (dragHandle.offsetLeft > lLeft) {
var rBlock
= document.getElementById(dragHandle.getAttribute('rightblock'));
var leftDiff = rBlock.offsetLeft - dragHandle.offsetLeft;
dragHandle.style.left = lLeft + 'px;';
lBlock.style.width = '0px';
rBlock.style.left = (lLeft + leftDiff) + 'px;';
}
} else if (dragHandle.dhType == 'vertical') {
var uBlock
= document.getElementById(dragHandle.getAttribute('upperblock'));
var uTop = uBlock.offsetTop;
if (dragHandle.offsetTop > uTop) {
var lBlock
= document.getElementById(dragHandle.getAttribute('lowerblock'));
var topDiff = lBlock.offsetTop - dragHandle.offsetTop;
dragHandle.style.top = uTop + 'px;';
uBlock.style.width = '0px';
lBlock.style.top = (uTop + topDiff) + 'px;';
}
}
}

View File

@ -60,19 +60,19 @@ function toggleMailSelect(sender) {
row = document.getElementById(sender.name);
row.className = sender.checked ? "tableview_selected" : "tableview";
}
function collectSelectedRows() {
var pageform = document.forms['pageform'];
var rows = new Array();
var messageList = document.getElementById('messageList');
var tbody = (messageList.getElementsByTagName('tbody'))[0];
var selectedRows = getSelectedNodes(tbody);
for (key in pageform) {
if (key.indexOf("row_") != 0)
continue;
if (!pageform[key].checked)
continue;
rows[rows.length] = key.substring(4, key.length);
for (var i = 0; i < selectedRows.length; i++) {
var row = selectedRows[i];
var rowId = row.getAttribute('id').substring(4);
rows[rows.length] = rowId;
}
return rows;
}
@ -308,7 +308,7 @@ function openMessageWindowsForSelection(sender, action) {
var idset = "";
for (var i = 0; i < rows.length; i++) {
win = openMessageWindow(sender,
win = openMessageWindow(sender,
rows[i] /* msguid */,
rows[i] + "/" + action /* url */);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 B

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 B

After

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 602 B

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 B

After

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB