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

View File

@ -31,9 +31,23 @@
@interface UIxPageFrame : UIxComponent @interface UIxPageFrame : UIxComponent
{ {
NSString *title; 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 @end
#endif /* UIXPAGEFRAME_H */ #endif /* UIXPAGEFRAME_H */

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
"Get Mail" = "Relever"; "Get Mail" = "Relever";
"Junk" = "Indésirable"; "Junk" = "Indésirable";
"Reply" = "Répondre"; "Reply" = "Répondre";
"Reply All" = "Répo. à tous"; "Reply All" = "Rép. à tous";
"Print" = "Imprimer"; "Print" = "Imprimer";
"Stop" = "Stop"; "Stop" = "Stop";
"Write" = "Écrire"; "Write" = "Écrire";
@ -19,7 +19,7 @@
"Home" = "Accueil"; "Home" = "Accueil";
"Calendar" = "Agenda"; "Calendar" = "Agenda";
"Addressbook" = "Carnet d'adresses"; "Addressbook" = "Adresses";
"Mail" = "Mail"; "Mail" = "Mail";
"Right Administration" = "Administration"; "Right Administration" = "Administration";
"Help" = "Aide"; "Help" = "Aide";
@ -54,7 +54,7 @@
"all" = "Tous"; "all" = "Tous";
"read" = "Lus"; "read" = "Lus";
"unread" = "Non Lus"; "unread" = "Non Lus";
"deleted" = "Éffacés"; "deleted" = "Effacés";
"flagged" = "Drapeau"; "flagged" = "Drapeau";
/* MailListView */ /* MailListView */
@ -80,7 +80,7 @@
"SentFolderName" = "Éléments envoyés"; "SentFolderName" = "Éléments envoyés";
"TrashFolderName" = "Corbeille"; "TrashFolderName" = "Corbeille";
"InboxFolderName" = "Boite de Réception"; "InboxFolderName" = "Boite de réception";
"DraftsFolderName" = "Brouillons"; "DraftsFolderName" = "Brouillons";
"SieveFolderName" = "Filtres"; "SieveFolderName" = "Filtres";
"Folders" = "Dossiers"; "Folders" = "Dossiers";
@ -93,3 +93,50 @@
"Add to Address Book..." = "Ajouter au carnet d'adresses"; "Add to Address Book..." = "Ajouter au carnet d'adresses";
"Compose Mail To" = "Écrire à"; "Compose Mail To" = "Écrire à";
"Create Filter From Message..." = "Créer un filtre à partir du message..."; "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 \ UIxMailMainFrame.m \
UIxMailTree.m \ UIxMailTree.m \
UIxMailTreeBlock.m \ UIxMailTreeBlock.m \
UIxMailTreeBlockJS.m \
UIxMailFolderMenu.m \
\ \
UIxMailAccountsView.m \ UIxMailAccountsView.m \
UIxMailAccountView.m \ UIxMailAccountView.m \
UIxMailAccountViewContainer.m \
UIxMailListView.m \ UIxMailListView.m \
UIxMailListViewContainer.m \
UIxMailView.m \ UIxMailView.m \
UIxMailViewContainer.m \
UIxMailSortableTableHeader.m \ UIxMailSortableTableHeader.m \
UIxMailMoveToPopUp.m \ UIxMailMoveToPopUp.m \
UIxMailFilterPanel.m \ UIxMailFilterPanel.m \
@ -40,12 +45,11 @@ MailerUI_OBJC_FILES += \
UIxFilterList.m \ UIxFilterList.m \
UIxSieveEditor.m \ UIxSieveEditor.m \
\ \
UIxMailFolderACLEditor.m \ UIxMailFolderACLEditor.m
MailerUI_RESOURCE_FILES += \ MailerUI_RESOURCE_FILES += \
Version \ Version \
product.plist \ product.plist \
UIxMailView.js \
Toolbars/*.toolbar \ Toolbars/*.toolbar \
Images/*.png Images/*.png

View File

@ -6,12 +6,12 @@
cssClass = "tbicon_send"; label = "Send"; }, cssClass = "tbicon_send"; label = "Send"; },
{ link = "#"; target = "addressbook"; { link = "#"; target = "addressbook";
onclick = "openAddressbook(this);return false;"; onclick = "openAddressbook(this);return false;";
image = "tb-mail-addressbook-flat-24x24.png"; image = "tb-compose-contacts-flat-24x24.png";
cssClass = "tbicon_addressbook"; label = "Addressbook"; }, cssClass = "tbicon_addressbook"; label = "Contacts"; },
{ link = "#"; target = "anais"; /* { link = "#"; target = "anais";
onclick = "openAnais(this);return false;"; onclick = "openAnais(this);return false;";
image = "tbtb_anais.png"; image = "tbtb_anais.png";
cssClass = "tbicon_anais"; label = "Anais"; }, cssClass = "tbicon_anais"; label = "Anais"; }, */
{ link = "#"; isSafe = NO; { link = "#"; isSafe = NO;
onclick = "clickedEditorAttach(this)"; onclick = "clickedEditorAttach(this)";
image = "tb-compose-attach-flat-24x24.png"; image = "tb-compose-attach-flat-24x24.png";
@ -20,8 +20,5 @@
onclick = "clickedEditorSave(this);return false;"; onclick = "clickedEditorSave(this);return false;";
image = "tb-mail-file-flat-24x24.png"; image = "tb-mail-file-flat-24x24.png";
cssClass = "tbicon_save"; label = "Save"; }, 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"; image = "tb-mail-write-flat-24x24.png";
onclick = "clickedCompose(this);return false;"; onclick = "clickedCompose(this);return false;";
cssClass = "tbicon_compose"; label = "Write"; }, 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 ( // second group
@ -30,28 +34,25 @@
), ),
( // third group ( // third group
{ link = "delete"; isSafe = NO; { link = "delete";
isSafe = NO;
enabled = showMarkDeletedButton; enabled = showMarkDeletedButton;
image = "tb-mail-delete-flat-24x24.png"; image = "tb-mail-delete-flat-24x24.png";
cssClass = "tbicon_delete"; label = "Delete"; }, cssClass = "tbicon_delete"; label = "Delete"; },
{ link = "#";
{ link = "trash"; isSafe = NO; isSafe = NO;
enabled = showTrashButton; image = "tb-mail-junk-flat-24x24.png";
image = "tb-mail-delete-flat-24x24.png"; cssClass = "tbicon_junk"; label = "Junk";
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"; },
*/
), ),
/* (
( // fourth group { link = "#";
// TODO: enable when we can print (#1207) cssClass = "tbicon_print";
// { link = "#"; cssClass = "tbicon_print"; label = "Print"; }, image = "tb-mail-print-flat-24x24.png";
{ link = "#"; cssClass = "tbicon_stop"; label = "Stop"; }, 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]; return [self->inbox isCreateAllowedInACL];
} }
- (NSString *) mailFolderName
{
return [NSString stringWithFormat: @"/%@",
[[self clientObject] nameInContainer]];
}
/* error redirects */ /* error redirects */
- (id)redirectToViewWithError:(id)_error { - (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"]; 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 */ @end /* UIxMailAccountsView */

View File

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

View File

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

View File

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

View File

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

View File

@ -41,6 +41,9 @@ extern id UIxMailTreeHasChildrenMarker;
NSString *link; NSString *link;
NSArray *blocks; NSArray *blocks;
NSString *iconName; NSString *iconName;
NSString *folderType;
int serial;
int parent;
struct { struct {
int isPath:1; int isPath:1;
int isActive:1; int isActive:1;
@ -48,19 +51,48 @@ extern id UIxMailTreeHasChildrenMarker;
} flags; } flags;
} }
+ (id)blockWithName:(NSString *)_n title:(NSString *)_t iconName:(NSString *)_i + (id) blockWithName: (NSString *)_n
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive title: (NSString *)_t
childBlocks:(NSArray *)_blocks; 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 - (id)initWithName: (NSString *)_n
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive title: (NSString *)_t
childBlocks:(NSArray *)_blocks; iconName: (NSString *)_i
link: (NSString *)_link
isPathNode: (BOOL)_isPath
isActiveNode: (BOOL)_isActive
childBlocks: (NSArray *)_blocks;
/* accessors */ /* accessors */
- (BOOL)hasChildren; - (BOOL) hasChildren;
- (BOOL)areChildrenLoaded; - (BOOL) areChildrenLoaded;
- (NSArray *)children; - (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 @end

View File

@ -19,53 +19,65 @@
02111-1307, USA. 02111-1307, USA.
*/ */
#include "UIxMailTreeBlock.h" #import "UIxMailTreeBlock.h"
#include "common.h" #import "common.h"
@implementation UIxMailTreeBlock @implementation UIxMailTreeBlock
id UIxMailTreeHasChildrenMarker = nil; id UIxMailTreeHasChildrenMarker = nil;
+ (void)initialize { + (void) initialize
{
// TODO: needs to be an array because the WETreeView requires a // TODO: needs to be an array because the WETreeView requires a
// children array // children array
UIxMailTreeHasChildrenMarker = UIxMailTreeHasChildrenMarker =
[[NSArray alloc] initWithObjects:@"FAKE", nil]; [[NSArray alloc] initWithObjects:@"FAKE", nil];
} }
+ (id)blockWithName:(NSString *)_name title:(NSString *)_title + (id) blockWithName: (NSString *) _name
iconName:(NSString *)_icon title: (NSString *) _title
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive iconName: (NSString *) _icon
childBlocks:(NSArray *)_blocks link: (NSString *) _link
isPathNode: (BOOL) _isPath
isActiveNode: (BOOL) _isActive
childBlocks: (NSArray *) _blocks
{ {
UIxMailTreeBlock *block; UIxMailTreeBlock *block;
block = [[self alloc] initWithName:_name title:_title iconName:_icon block = [[self alloc] initWithName:_name
title:_title
iconName:_icon
link:_link link:_link
isPathNode:_isPath isActiveNode:_isActive isPathNode:_isPath
isActiveNode:_isActive
childBlocks:_blocks]; childBlocks:_blocks];
return [block autorelease]; return [block autorelease];
} }
- (id)initWithName:(NSString *)_name title:(NSString *)_title - (id) initWithName: (NSString *) _name
iconName:(NSString *)_icon title: (NSString *) _title
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive iconName: (NSString *) _icon
childBlocks:(NSArray *)_blocks link: (NSString *) _link
isPathNode: (BOOL) _isPath
isActiveNode: (BOOL) _isActive
childBlocks: (NSArray *) _blocks
{ {
if ((self = [self init])) { if ((self = [self init]))
self->name = [_name copy]; {
self->title = [_title copy]; self->name = [_name copy];
self->iconName = [_icon copy]; self->title = [_title copy];
self->link = [_link copy]; self->iconName = [_icon copy];
self->blocks = [_blocks retain]; self->link = [_link copy];
self->blocks = [_blocks retain];
self->flags.isPath = _isPath ? 1 : 0; self->flags.isPath = _isPath ? 1 : 0;
self->flags.isActive = _isActive ? 1 : 0; self->flags.isActive = _isActive ? 1 : 0;
} }
return self; return self;
} }
- (void)dealloc { - (void) dealloc
{
[self->iconName release]; [self->iconName release];
[self->blocks release]; [self->blocks release];
[self->name release]; [self->name release];
@ -76,30 +88,49 @@ id UIxMailTreeHasChildrenMarker = nil;
/* accessors */ /* accessors */
- (NSString *)name { - (NSString *) name
{
return self->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; return self->title;
} }
- (NSString *)link {
- (NSString *) link
{
return self->link; return self->link;
} }
- (NSString *)iconName {
- (NSString *) iconName
{
return self->iconName; return self->iconName;
} }
- (BOOL)hasChildren { - (BOOL) hasChildren
{
if (self->blocks == UIxMailTreeHasChildrenMarker) if (self->blocks == UIxMailTreeHasChildrenMarker)
return YES; return YES;
return [self->blocks count] > 0 ? YES : NO; return [self->blocks count] > 0 ? YES : NO;
} }
- (BOOL)areChildrenLoaded { - (BOOL) areChildrenLoaded
{
return self->blocks != UIxMailTreeHasChildrenMarker ? YES : NO; return self->blocks != UIxMailTreeHasChildrenMarker ? YES : NO;
} }
- (NSArray *)children { - (NSArray *) children
{
if (self->blocks == UIxMailTreeHasChildrenMarker) if (self->blocks == UIxMailTreeHasChildrenMarker)
// TODO: print a warning // TODO: print a warning
return self->blocks; return self->blocks;
@ -107,16 +138,20 @@ id UIxMailTreeHasChildrenMarker = nil;
return self->blocks; return self->blocks;
} }
- (BOOL)isPathNode { - (BOOL) isPathNode
{
return self->flags.isPath ? YES : NO; return self->flags.isPath ? YES : NO;
} }
- (BOOL)isActiveNode {
- (BOOL) isActiveNode
{
return self->flags.isActive ? YES : NO; return self->flags.isActive ? YES : NO;
} }
/* description */ /* description */
- (void)appendAttributesToDescription:(NSMutableString *)_ms { - (void) appendAttributesToDescription: (NSMutableString *) _ms
{
if (self->name != nil) [_ms appendFormat:@" name='%@'", self->name]; if (self->name != nil) [_ms appendFormat:@" name='%@'", self->name];
if (self->title != nil) [_ms appendFormat:@" title='%@'", self->title]; if (self->title != nil) [_ms appendFormat:@" title='%@'", self->title];
@ -129,7 +164,8 @@ id UIxMailTreeHasChildrenMarker = nil;
[_ms appendFormat:@" children=%@", self->blocks]; [_ms appendFormat:@" children=%@", self->blocks];
} }
- (NSString *)description { - (NSString *) description
{
NSMutableString *ms; NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64]; ms = [NSMutableString stringWithCapacity:64];
@ -139,4 +175,49 @@ id UIxMailTreeHasChildrenMarker = nil;
return ms; 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 */ @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", "UIxMailToSelection.js",
"lori_32x32.png", "lori_32x32.png",
"tbtv_account_17x17.gif", "tbtv_account_17x17.gif",
"tbtv_drafts_17x17.gif", "tbtv_drafts_17x17.gif",
"tbtv_inbox_17x17.gif", "tbtv_inbox_17x17.gif",
@ -27,7 +27,7 @@
"tbtv_corner_plus_17x17.gif", "tbtv_corner_plus_17x17.gif",
"tbtv_sent_17x17.gif", "tbtv_sent_17x17.gif",
"tbtv_trash_17x17.gif", "tbtv_trash_17x17.gif",
"tbtb_addressbook.png", "tbtb_addressbook.png",
"tbtb_compose.png", "tbtb_compose.png",
"tbtb_delete.png", "tbtb_delete.png",
@ -81,52 +81,55 @@
slots = { slots = {
toolbar = { toolbar = {
protectedBy = "View"; protectedBy = "View";
value = "SOGoMailFolder.toolbar"; value = "SOGoMailObject.toolbar";
}; };
}; };
methods = { methods = {
view = { view = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
};
ajax = {
protectedBy = "View";
pageName = "UIxMailAjaxRequest";
}; };
index = { index = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
}; };
GET = { /* hack to make it work as the default method */ GET = { /* hack to make it work as the default method */
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
}; };
markMessageUnread = { markMessageUnread = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
actionName = "markMessageUnread"; actionName = "markMessageUnread";
}; };
markMessageRead = { markMessageRead = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
actionName = "markMessageRead"; actionName = "markMessageRead";
}; };
getMail = { getMail = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
actionName = "getMail"; actionName = "getMail";
}; };
expunge = { expunge = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
actionName = "expunge"; actionName = "expunge";
}; };
createFolder = { createFolder = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
actionName = "createFolder"; actionName = "createFolder";
}; };
deleteFolder = { deleteFolder = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
actionName = "deleteFolder"; actionName = "deleteFolder";
}; };
@ -134,10 +137,10 @@
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailFolderACLEditor"; pageName = "UIxMailFolderACLEditor";
}; };
compose = { compose = {
protectedBy = "View"; protectedBy = "View";
actionClass = "UIxMailEditorAction"; actionClass = "UIxMailEditorAction";
actionName = "compose"; actionName = "compose";
}; };
}; };
@ -148,13 +151,13 @@
slots = { slots = {
toolbar = { toolbar = {
protectedBy = "View"; protectedBy = "View";
value = "SOGoTrashFolder.toolbar"; value = "SOGoMailObject.toolbar";
}; };
}; };
methods = { methods = {
emptyTrash = { emptyTrash = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
actionName = "emptyTrash"; actionName = "emptyTrash";
}; };
}; };
@ -168,103 +171,97 @@
}; };
}; };
methods = { methods = {
view = { view = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailView"; pageName = "UIxMailViewContainer";
}; };
getMail = { getMail = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailView"; pageName = "UIxMailViewContainer";
actionName = "getMail"; actionName = "getMail";
}; };
delete = { delete = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailView"; pageName = "UIxMailViewContainer";
actionName = "delete"; actionName = "delete";
}; };
trash = { trash = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailView"; pageName = "UIxMailViewContainer";
actionName = "trash"; actionName = "trash";
}; };
junk = { junk = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailView"; pageName = "UIxMailViewContainer";
actionName = "junk"; actionName = "junk";
}; };
edit = { edit = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailEditor"; pageName = "UIxMailEditor";
}; };
compose = { compose = {
protectedBy = "View"; protectedBy = "View";
actionClass = "UIxMailEditorAction"; actionClass = "UIxMailEditorAction";
actionName = "compose"; actionName = "compose";
}; };
reply = { reply = {
protectedBy = "View"; protectedBy = "View";
actionClass = "UIxMailReplyAction"; actionClass = "UIxMailReplyAction";
actionName = "reply"; actionName = "reply";
}; };
replyall = { replyall = {
protectedBy = "View"; protectedBy = "View";
actionClass = "UIxMailReplyAction"; actionClass = "UIxMailReplyAction";
actionName = "replyall"; actionName = "replyall";
}; };
forward = { forward = {
protectedBy = "View"; protectedBy = "View";
actionClass = "UIxMailForwardAction"; actionClass = "UIxMailForwardAction";
actionName = "forward"; actionName = "forward";
}; };
}; };
}; };
SOGoMailAccounts = { SOGoMailAccounts = {
slots = { slots = {
toolbar = { toolbar = {
protectedBy = "View"; protectedBy = "View";
value = ( /* the toolbar groups */ value = "SOGoMailObject.toolbar";
( /* first group */
{ link = "getMail";
image = "tb-mail-getmail-flat-24x24.png";
cssClass = "tbicon_getmail"; label = "Get Mail"; },
)
);
}; };
}; };
methods = { methods = {
view = { view = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailAccountsView"; pageName = "UIxMailAccountsView";
}; };
getMail = { getMail = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailAccountsView"; pageName = "UIxMailAccountsView";
}; };
}; };
}; };
SOGoMailAccount = { SOGoMailAccount = {
slots = { slots = {
toolbar = { toolbar = {
protectedBy = "View"; protectedBy = "View";
value = "SOGoMailAccount.toolbar"; value = "SOGoMailObject.toolbar";
}; };
}; };
methods = { methods = {
view = { view = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailAccountView"; pageName = "UIxMailAccountView";
}; };
getMail = { getMail = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailAccountView"; pageName = "UIxMailAccountView";
}; };
addressbook = { addressbook = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailAddressbook"; pageName = "UIxMailAddressbook";
}; };
anais = { anais = {
protectedBy = "View"; protectedBy = "View";
@ -273,12 +270,12 @@
}; };
compose = { compose = {
protectedBy = "View"; protectedBy = "View";
actionClass = "UIxMailEditorAction"; actionClass = "UIxMailEditorAction";
actionName = "compose"; actionName = "compose";
}; };
createFolder = { createFolder = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailAccountView"; pageName = "UIxMailAccountView";
actionName = "createFolder"; actionName = "createFolder";
}; };
}; };
@ -330,43 +327,43 @@
methods = { methods = {
view = { /* somewhat hackish */ view = { /* somewhat hackish */
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailEditor"; pageName = "UIxMailEditor";
}; };
edit = { edit = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailEditor"; pageName = "UIxMailEditor";
actionName = "edit"; actionName = "edit";
}; };
save = { save = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailEditor"; pageName = "UIxMailEditor";
actionName = "save"; actionName = "save";
}; };
delete = { delete = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailEditor"; pageName = "UIxMailEditor";
actionName = "delete"; actionName = "delete";
}; };
viewAttachments = { viewAttachments = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailEditorAttach"; pageName = "UIxMailEditorAttach";
actionName = "viewAttachments"; actionName = "viewAttachments";
}; };
attach = { attach = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailEditorAttach"; pageName = "UIxMailEditorAttach";
actionName = "attach"; actionName = "attach";
}; };
deleteAttachment = { deleteAttachment = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailEditorAttach"; pageName = "UIxMailEditorAttach";
actionName = "deleteAttachment"; actionName = "deleteAttachment";
}; };
send = { send = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailEditor"; pageName = "UIxMailEditor";
actionName = "send"; actionName = "send";
}; };
addressbook = { addressbook = {
@ -382,7 +379,7 @@
}; };
/* Sieve */ /* Sieve */
SOGoSieveScriptsFolder = { SOGoSieveScriptsFolder = {
slots = { slots = {
toolbar = { toolbar = {
@ -402,7 +399,7 @@
}, },
), ),
( /* second group ( /* second group
{ link = "#"; { link = "#";
cssClass = "tbicon_delete"; label = "Delete"; },*/ cssClass = "tbicon_delete"; label = "Delete"; },*/
), ),
); );
@ -411,11 +408,11 @@
methods = { methods = {
view = { view = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxFilterList"; pageName = "UIxFilterList";
}; };
create = { create = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxFilterList"; pageName = "UIxFilterList";
actionName = "create"; actionName = "create";
}; };
}; };
@ -442,17 +439,17 @@
methods = { methods = {
edit = { edit = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxSieveEditor"; pageName = "UIxSieveEditor";
actionName = "edit"; actionName = "edit";
}; };
save = { save = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxSieveEditor"; pageName = "UIxSieveEditor";
actionName = "save"; actionName = "save";
}; };
delete = { delete = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxSieveEditor"; pageName = "UIxSieveEditor";
actionName = "delete"; actionName = "delete";
}; };
}; };

View File

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

View File

@ -19,10 +19,12 @@
02111-1307, USA. 02111-1307, USA.
*/ */
#include "UIxComponent.h" #import "UIxComponent.h"
#include "SOGoJSStringFormatter.h" #import "SOGoJSStringFormatter.h"
#include "common.h" #import "NSString+URL.h"
#include <NGObjWeb/SoHTTPAuthenticator.h> #import "common.h"
#import <NGObjWeb/SoHTTPAuthenticator.h>
#import <NGObjWeb/WOResourceManager.h>
@interface UIxComponent (PrivateAPI) @interface UIxComponent (PrivateAPI)
- (void)_parseQueryString:(NSString *)_s; - (void)_parseQueryString:(NSString *)_s;
@ -244,7 +246,8 @@ static BOOL uixDebugEnabled = NO;
return [uri substringFromIndex:(r.location + 1)]; return [uri substringFromIndex:(r.location + 1)];
} }
- (NSString *)userFolderPath { - (NSString *) _urlForTraversalObject: (int) traversal
{
WOContext *ctx; WOContext *ctx;
NSArray *traversalObjects; NSArray *traversalObjects;
NSString *url; NSString *url;
@ -252,13 +255,34 @@ static BOOL uixDebugEnabled = NO;
ctx = [self context]; ctx = [self context];
traversalObjects = [ctx objectTraversalStack]; traversalObjects = [ctx objectTraversalStack];
url = [[traversalObjects objectAtIndex:0] url = [[traversalObjects objectAtIndex: traversal]
baseURLInContext:ctx]; baseURLInContext:ctx];
path = [[NSURL URLWithString:url] path]; path = [[NSURL URLWithString:url] path];
path = [path stringByAppendingPathComponent:[[ctx activeUser] login]]; // path = [path stringByAppendingPathComponent:[[ctx activeUser] login]];
return path; 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 *)ownPath {
NSString *uri; NSString *uri;
NSRange r; NSRange r;
@ -325,6 +349,10 @@ static BOOL uixDebugEnabled = NO;
calendarFormat:@"%Y%m%d"]; calendarFormat:@"%Y%m%d"];
} }
- (BOOL) hideFrame
{
return ([[self queryParameterForKey: @"noframe"] boolValue]);
}
/* SoUser */ /* SoUser */
@ -410,9 +438,6 @@ static BOOL uixDebugEnabled = NO;
label = [rm stringForKey:lKey inTableNamed:lTable withDefaultValue:lVal label = [rm stringForKey:lKey inTableNamed:lTable withDefaultValue:lVal
languages:languages]; languages:languages];
NSLog (@"string '%s' = '%s' (default: '%s')",
[lKey cString], [label cString], [lVal cString]);
return label; return label;
} }
@ -455,6 +480,50 @@ static BOOL uixDebugEnabled = NO;
return [[self context] valueForKey:@"locale"]; 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 */ /* debugging */
- (BOOL)isUIxDebugEnabled { - (BOOL)isUIxDebugEnabled {

View File

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

View File

@ -6,29 +6,27 @@
xmlns:uix="OGo:uix" xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url" xmlns:rsrc="OGo:url"
xmlns:label="OGo:label" xmlns:label="OGo:label"
className="UIxMailMainFrame" className="UIxMailAccountViewContainer"
title="panelTitle" title="title"
> >
<div class="mailAccount"> <div style="padding: 1em;" oncontextmenu="return false;">
<h2> <h2>
SOGo Mail - SOGo Mail - <var:string value="objectTitle" />
<var:if condition="clientObject.isSharedAccount"> <var:if condition="clientObject.isSharedAccount">
<var:string label:value="Shared Account: " /> <var:string label:value="Shared Account: " />
</var:if> </var:if>
<!-- <div class="titlediv"> <!-- <div class="titlediv">
<var:if condition="clientObject.isSharedAccount"> <var:if condition="clientObject.isSharedAccount">
<var:string label:value="Share: " /> <var:string label:value="Share: " />
</var:if> </var:if>
<var:if condition="clientObject.isSharedAccount" const:negate="1"> <var:if condition="clientObject.isSharedAccount" const:negate="1">
<var:string label:value="Account: " /> <var:string label:value="Account: " />
</var:if> </var:if>
<var:string value="objectTitle"/>
</div>
-->
<var:string value="objectTitle"/> <var:string value="objectTitle"/>
</div>
-->
</h2> </h2>
<var:if condition="clientObject.isSharedAccount"> <var:if condition="clientObject.isSharedAccount">
<div> <div>
@ -36,25 +34,25 @@
<var:string value="clientObject.sharedAccountName" /> <var:string value="clientObject.sharedAccountName" />
</div> </div>
</var:if> </var:if>
<h3>Email</h3> <h3>Email</h3>
<p> <p>
<a href="INBOX/"><img rsrc:src="read-messages.png" /><var:string label:value="Read messages" /></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 /> <a href="#" onclick="clickedCompose(this);"><img rsrc:src="write-message.png" /><var:string label:value="Write a new message" /></a><br />
</p> </p>
<h3>Accounts</h3> <h3>Accounts</h3>
<p> <p>
<a href=""><img rsrc:src="account-settings.png" />View settings for this account</a><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 /> <a href=""><img rsrc:src="create-account.png" />Create a new account</a> [TBD: not in Agenor]<br />
</p> </p>
<h3>Advanced Features</h3> <h3>Advanced Features</h3>
<p> <p>
<a href=""><img rsrc:src="search-messages.png" />Search messages</a><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-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="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="offline-settings.png" />Offline settings</a> [TBD: not in Agenor]<br />
</p> </p>
</div> </div>
</var:component> </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:label="OGo:label"
xmlns:rsrc="OGo:url" xmlns:rsrc="OGo:url"
className="UIxMailMainFrame" className="UIxMailMainFrame"
title="panelTitle" title="name"
> >
<div class="titlediv"> <div id="mailboxContent" style="visibility: hidden;">
<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> </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'?> <?xml version='1.0' standalone='yes'?>
<var:component xmlns="http://www.w3.org/1999/xhtml" <var:component
xmlns:var="http://www.skyrix.com/od/binding" xmlns="http://www.w3.org/1999/xhtml"
xmlns:const="http://www.skyrix.com/od/constant" xmlns:var="http://www.skyrix.com/od/binding"
xmlns:uix="OGo:uix" xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url" xmlns:uix="OGo:uix"
xmlns:label="OGo:label" xmlns:rsrc="OGo:url"
className="UIxMailPanelFrame" xmlns:label="OGo:label"
title="panelTitle" className="UIxMailMainFrame"
> title="panelTitle"
<script rsrc:src="layout2or3_xlib.js" > <!-- space required --></script> const:popup="YES"
<div id="compose_panel"> >
<var:if condition="showInternetMarker"> <div id="compose_panel">
<div id="compose_internetmarker"> <var:if condition="showInternetMarker">
<var:string <div id="compose_internetmarker">
<var:string
label:value="This mail is being sent from an unsecure network!" /> label:value="This mail is being sent from an unsecure network!" />
</div> </div>
</var:if> </var:if>
<table border="0" width="100%" id="compose_table"> <table id="compose_table">
<tr> <tr>
<td id="compose_leftside" var:style="initialLeftsideStyle"> <td id="compose_leftside" var:style="initialLeftsideStyle">
<div id="compose_fromline"> <div id="compose_fromline">
<table border="0" width="100%"> <table>
<tr> <tr>
<td class="compose_label" width="20%"> <td class="compose_label" width="20%">
<var:string label:value="From" />: <var:string label:value="From" />:
</td> </td>
<td width="80%"> <td width="80%">
<var:popup const:name="from" list="fromEMails" item="item" <var:popup const:name="from" list="fromEMails" item="item"
selection="from" selection="from"
const:style="width: 100%;" const:style="width: 100%;"
/> />
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="compose_toselection"> <div id="compose_toselection">
<var:component className="UIxMailToSelection" <var:component className="UIxMailToSelection"
to="to" to="to"
cc="cc" cc="cc"
bcc="bcc" 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>-->
</div> </div>
<div id="compose_attachments_list" <!-- moved below to selection to make it look better -->
onclick="clickedEditorAttach(this);" <div id="compose_subject">
> <table>
<var:foreach list="attachmentNames" item="attachmentName"> <tr>
<var:string value="attachmentName" /><br /> <td class="compose_label" width="20%">
</var:foreach> <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>
</div> </td>
</td> <td id="compose_rightside" var:style="initialRightsideStyle">
</tr> <div id="compose_attachments">
</table> <div id="compose_attachments_header">
<!-- separator line --> <span class="compose_label"
<div id="compose_text"> ><var:string label:value="Attachments" />:</span>
<textarea name="content" var:value="text" /> <!--<a href="#"
</div> 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" / --> <!-- img rsrc:src="tbird_073_compose.png" alt="screenshot" / -->
</div> </div>
</var:component> </var:component>

View File

@ -4,56 +4,47 @@
xmlns:var="http://www.skyrix.com/od/binding" xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant" xmlns:const="http://www.skyrix.com/od/constant"
> >
<div class="menu" id="searchMenu"> <div class="menu" id="searchMenu">
<ul id="searchOptions"> <ul id="searchOptions">
<li id="subject" <li id="subject"
onmousedown="return false;" onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="Subject"/></li> onmouseup="setSearchCriteria(event);"><var:string label:value="Subject"/></li>
<li id="sender" <li id="sender"
onmousedown="return false;" onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="Sender"/></li> onmouseup="setSearchCriteria(event);"><var:string label:value="Sender"/></li>
<li id="subject_or_sender" <li id="subject_or_sender"
onmousedown="return false;" onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="Subject or Sender"/></li> onmouseup="setSearchCriteria(event);"><var:string label:value="Subject or Sender"/></li>
<li id="to_or_cc" <li id="to_or_cc"
onmousedown="return false;" onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="To or Cc"/></li> onmouseup="setSearchCriteria(event);"><var:string label:value="To or Cc"/></li>
<li id="entire_message" <li id="entire_message"
onmousedown="return false;" onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="Entire Message"/></li> onmouseup="setSearchCriteria(event);"><var:string label:value="Entire Message"/></li>
<li id="find_in_message" <li id="find_in_message"
onmousedown="return false;" onmousedown="return false;"
onclick="setSearchCriteria(event);"><var:string label:value="Find In Message"/></li> onmouseup="setSearchCriteria(event);"><var:string label:value="Find In Message"/></li>
</ul> </ul>
</div> </div>
<var:if condition="hideFrame" const:negate="YES"> <div id="filterPanel">
<span class="searchBox" style="float: right"> <var:if condition="hideFrame" const:negate="YES"
<input id="searchCriteria" name="criteria" type="hidden" var:value="searchCriteria" /> ><span class="searchBox" style="float: right">
<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);" /> <input id="searchCriteria" name="criteria" type="hidden" var:value="searchCriteria" />
</span> <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"> <var:string label:value="View" />:
initCriteria(); <var:popup list="filters"
document.pageform.search.focus(); item="filter" string="filterLabel" value="filter"
</script> selection="selectedFilter"
</var:if> const:name="filterpopup"
const:onchange="document.pageform.submit()" />
<var:string label:value="View" />: </var:if>
<var:popup list="filters" </div>
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>
</container> </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:uix="OGo:uix"
xmlns:rsrc="OGo:url" xmlns:rsrc="OGo:url"
xmlns:label="OGo:label" xmlns:label="OGo:label"
className="UIxMailMainFrame" className="UIxMailListViewContainer"
title="panelTitle" title="name"
hideFrame="hideFrame"
> >
<var:component className="UIxMailFilterPanel" qualifier="qualifier" />
<var:string value="patate" />
<div class="menu" id="messageListMenu"> <table multiselect="yes" id="messageList"
<ul id="sourceList"> onselectionchange="onMessageSelectionChange();">
<li <thead>
onmousedown="return false;" <tr class="tableview"
var:onclick="clickedMsgJS"><var:string label:value="Open Message In New Window"/></li> ><td class="tbtv_headercell"
<li class="separator"></li> ><var:entity const:name="nbsp"
<li /></td
onmousedown="return false;" ><td class="tbtv_headercell">
onclick=""><var:string label:value="Reply to Sender Only"/></li> <img rsrc:src="title_attachment_14x14.png" width="14"
<li height="14"
onmousedown="return false;" /></td
onclick=""><var:string label:value="Reply to All"/></li> ><td class="tbtv_headercell tbtv_subject_headercell"
<li ><var:component className="UIxMailSortableTableHeader"
onmousedown="return false;" label:label="Subject"
onclick=""><var:string label:value="Forward"/></li> const:sortKey="subject"
<li const:href="view"
onmousedown="return false;" var:queryDictionary="context.request.formValues"
onclick=""><var:string label:value="Edit As New..."/></li> /></td
<li class="separator"></li> ><td class="tbtv_headercell"
<li ><var:if condition="showToAddress" const:negate="YES"
class="submenu" ><var:component className="UIxMailSortableTableHeader"
submenu="mailboxes-menu" label:label="From"
onmouseover="dropDownSubmenu(event);" const:sortKey="from"
onmousedown="return false;" const:href="view"
onclick=""><var:string label:value="Move To"/></li> var:queryDictionary="context.request.formValues"
<li /></var:if
class="submenu" ><var:if condition="showToAddress"
submenu="mailboxes-menu" ><var:component className="UIxMailSortableTableHeader"
onmouseover="dropDownSubmenu(event);" label:label="To"
onmousedown="return false;" const:sortKey="to"
onclick=""><var:string label:value="Copy To"/></li> const:href="view"
<li var:queryDictionary="context.request.formValues"
class="submenu" /></var:if
submenu="label-menu" ></td
onmouseover="dropDownSubmenu(event);" ><td class="tbtv_headercell"
onmousedown="return false;" ><img rsrc:src="title_read_14x14.png" width="14" height="14"
onclick=""><var:string label:value="Label"/></li> /></td
<li ><td class="tbtv_headercell"
class="submenu" ><var:component className="UIxMailSortableTableHeader"
submenu="mark-menu" label:label="Date"
onmouseover="dropDownSubmenu(event);" const:sortKey="date"
onmousedown="return false;" const:href="view"
onclick=""><var:string label:value="Mark"/></li> var:queryDictionary="context.request.formValues"
<li class="separator"></li> const:isDefault="YES"
<li /></td
onmousedown="return false;" ></tr>
onclick=""><var:string label:value="Save As..."/></li> <var:if condition="showsAllMessages" const:negate="YES"
<li ><tr class="tableview"
onmousedown="return false;" ><td colspan="6" class="tbtv_navcell" align="right"
onclick=""><var:string label:value="Print Preview"/></li> ><var:if condition="hasPrevious">
<li <a href="#"
onmousedown="return false;" onclick="openMailboxAtIndex(this);"
onclick=""><var:string label:value="Print..."/></li> idx="1"><var:string label:value="first"/></a> |
<li <a href="#"
onmousedown="return false;" onclick="openMailboxAtIndex(this);"
onclick=""><var:string label:value="Delete Message"/></li> var:idx="prevFirstMessageNumber"
</ul> ><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"> <tbody>
<ul id=""> <var:foreach list="messages" item="message"
<li onmousedown="return false;">really</li> ><tr class="tableview" var:id="msgRowID"
<li onmousedown="return false;">is</li> onclick="return onRowClick(event);"
<li onmousedown="return false;">a</li> oncontextmenu="onMenuClick(event, 'messageListMenu'); onRowClick(event); return false;"
<li onmousedown="return false;">dumb dummy!</li> ><td onmousedown="return false;"
</ul> ></td
</div> ><td onmousedown="return false;"
<div class="menu" id="label-menu"> ><var:if condition="hasMessageAttachment"
<ul id=""> ><img rsrc:src="title_attachment_14x14.png"
<li onmousedown="return false;"><var:string label:value="None" /></li> /></var:if
<li class="separator"></li> ></td
<li onmousedown="return false;"><var:string label:value="Important" /></li>
<li onmousedown="return false;"><var:string label:value="Work" /></li> ><td
<li onmousedown="return false;"><var:string label:value="Personal" /></li> onmousedown="return false;"
<li onmousedown="return false;"><var:string label:value="To Do" /></li> var:class="messageSubjectCellStyleClass"
<li onmousedown="return false;"><var:string label:value="Later" /></li> var:ondblclick="clickedMsgJS"
</ul> var:id="msgDivID"
</div> ><var:string value="message.envelope.subject"
<div class="menu" id="mark-menu"> formatter="context.mailSubjectFormatter"
<ul id=""> /></td
<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>
<div id="mailboxContent" oncontextmenu="return false;"> ><td
<var:component className="UIxMailFilterPanel" qualifier="qualifier" onmousedown="return false;"
hideFrame="hideFrame" /> var:class="messageCellStyleClass"
var:ondblclick="clickedMsgJS"
<table multiselect="yes" id="messageList" oncontextmenu="return false;"> ><var:if condition="showToAddress" const:negate="YES"
<thead> ><var:string value="message.envelope.from"
<tr class="tableview"> formatter="context.mailEnvelopeAddressFormatter"
<td class="tbtv_headercell" width="17"> /></var:if
<var:entity const:name="nbsp" /> ><var:if condition="showToAddress"
</td> ><var:string value="message.envelope.to"
<td class="tbtv_headercell" width="17"> formatter="context.mailEnvelopeAddressFormatter"
<img rsrc:src="title_attachment_14x14.png" width="14" height="14" /> /></var:if
</td> ></td
<td class="tbtv_headercell" width="50%">
<var:component className="UIxMailSortableTableHeader" ><td onmousedown="return false;"
label:label="Subject" var:class="messageCellStyleClass"
const:sortKey="subject" ><var:if condition="isMessageRead"
const:href="view" ><img rsrc:src="icon_read.gif"
var:queryDictionary="context.request.formValues" class="mailerReadIcon"
/> var:onclick="markUnreadJS"
</td> label:title="Mark Unread"
<td class="tbtv_headercell"> var:id="msgIconReadImgID"
<var:if condition="showToAddress" const:negate="YES"> /></var:if
<var:component className="UIxMailSortableTableHeader" ><var:if condition="isMessageRead" const:negate="YES"
label:label="From" ><img rsrc:src="icon_unread.gif"
const:sortKey="from" class="mailerUnreadIcon"
const:href="view" var:onclick="markReadJS"
var:queryDictionary="context.request.formValues" label:title="Mark Read"
/> var:id="msgIconUnreadImgID"
</var:if> /></var:if
<var:if condition="showToAddress"> ></td
<var:component className="UIxMailSortableTableHeader"
label:label="To" ><td onmousedown="return false;"
const:sortKey="to" var:class="messageCellStyleClass"
const:href="view" var:ondblclick="clickedMsgJS"
var:queryDictionary="context.request.formValues" ><span class="mailer_datefield"
/> ><var:string value="message.envelope.date"
</var:if> formatter="context.mailDateFormatter"
</td> /></span
<td class="tbtv_headercell" width="17"> ><entity name="nbsp"
<img rsrc:src="title_read_14x14.png" width="14" height="14" /> /></td
</td> ></tr>
<td class="tbtv_headercell"> </var:foreach>
<var:component className="UIxMailSortableTableHeader" </tbody>
label:label="Date" </table>
const:sortKey="date" <script type="text/javascript">
const:href="view" registerDraggableMessageNodes();
var:queryDictionary="context.request.formValues" </script>
const:isDefault="YES" <!--
/> <tr class="tableview">
</td> <td colspan="6" class="tbtv_actcell">
</tr> <! TODO: fix used tree, treeNavigationNodes is the _wrong_ choice
<tr class="tableview"> <var:component className="UIxMailMoveToPopUp"
<td colspan="6" class="tbtv_navcell" align="right"> const:identifier="moveto"
<var:if condition="showsAllMessages"> const:callback="moveTo"
<var:string value="sortedUIDs.count" /> rootNodes="clientObject.treeNavigationNodes"
<var:string label:value="messages" /> />
</var:if> >
<! enable once we have buttons and functionality to actually move sth #1211
<var:if condition="showsAllMessages" const:negate="YES"> <var:popup const:name="moveto" const:id="moveto"
<var:if condition="hasPrevious"> list="clientObject.mailAccountFolder.allFolderPathes"
<a href="view" item="item" value="item" displayString="item" />
_idx="1" ->
var:queryDictionary="queryParameters" </td>
><var:string label:value="first"/></a> | </tr>
<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>
</var:component> </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"?> <?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:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant" xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url" xmlns:uix="OGo:uix"
xmlns:label="OGo:label" xmlns:label="OGo:label"
className="UIxPageFrame"
title="title"
popup="isPopup"
> >
<var:if condition="hideFrame" const:negate="YES"> <var:if condition="hideFrame" const:negate="YES">
<html xmlns="http://www.w3.org/1999/xhtml" <div class="menu" id="accountIconMenu">
xmlns:var="http://www.skyrix.com/od/binding" <ul id="sourceList">
xmlns:const="http://www.skyrix.com/od/constant" <li
xmlns:rsrc="OGo:url" onmousedown="return false;"
xmlns:label="OGo:label" onmouseup="return false;"><var:string label:value="Subscribe..." /></li>
> <li
<head> onmousedown="return false;"
<title> onmouseup="return false;"><var:string label:value="Get Messages for Account" /></li>
<var:string value="title"/> <li
</title> onmousedown="return false;"
onmouseup="return false;"><var:string label:value="New Folder..." /></li>
<meta name="templatename" content="UIXMailMainFrame.wox"/> <li class="separator"></li>
<meta name="description" content="SOGo Web Interface"/> <li
<meta name="author" content="SKYRIX Software AG"/> onmousedown="return false;"
<meta name="robots" content="stop"/> onmouseup="return false;"><var:string label:value="Search Messages..." /></li>
<li
<script rsrc:src="generic.js"> <!-- space required --></script> onmousedown="return false;"
<script rsrc:src="mailer.js" > <!-- space required --></script> onmouseup="return false;"><var:string label:value="Properties..." /></li>
</ul>
</div>
<var:if condition="hasProductSpecificJavaScript"> <div class="menu" id="inboxIconMenu">
<script var:src="productJavaScriptURL"> <!-- space required --></script> <ul id="sourceList">
</var:if> <li
<var:if condition="hasPageSpecificJavaScript"> onmousedown="return false;"
<script var:src="pageJavaScriptURL"> <!-- space required --></script> onmouseup="return false;"><var:string label:value="Open in New Mail Window" /></li>
</var:if> <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"/> <div class="menu" id="mailboxIconMenu">
<link type="text/css" rel="stylesheet" rsrc:href="mailer.css"/> <ul id="sourceList">
<link type="text/css" rel="stylesheet" rsrc:href="mailer-toolbar.css"/> <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"/> <div class="menu" id="addressMenu">
</head> <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;"> <div class="menu" id="messageListMenu">
<!-- <ul id="sourceList">
Note: the 'href' is required, otherwise an element-id will get created <li
--> onmousedown="return false;"
<var:if condition="showLinkBanner"> onmouseup="onMenuOpenMessage(event);"><var:string label:value="Open Message In New Window"/></li>
<div class="linkbanner"> <li class="separator"></li>
<!-- span style="float: left" --> <li
<a var:href="relativeHomePath" onmousedown="return false;"
><var:string label:value="Home" /></a> | onmouseup="onMenuReplyToSender(event);"><var:string label:value="Reply to Sender Only"/></li>
<a var:href="relativeCalendarPath" <li
><var:string label:value="Calendar" /></a> | onmousedown="return false;"
<a var:href="relativeContactsPath" onmouseup="onMenuReplyToAll(event);"><var:string label:value="Reply to All"/></li>
><var:string label:value="Addressbook" /></a> | <li
<a var:href="relativeMailPath" onmousedown="return false;"
><var:string label:value="Mail" /></a> | onmouseup="onMenuForwardMessage(event);"><var:string label:value="Forward"/></li>
<a var:href="logoffPath" <li
><var:string label:value="Logoff" /></a> | onmousedown="return false;"
<a href="http://to.be.done/" onmouseup="onMenuEditMessageAsNew(event);"><var:string label:value="Edit As New..."/></li>
><var:string label:value="Right Administration" /></a> <li class="separator"></li>
</div> <li
</var:if> 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:component
<var:if condition="hideFolderTree"> className="UIxMailFolderMenu"
<var:component-content/> const:menuId="mailboxes-menu"
</var:if> const:parentMenu="0"
rootClassName="treeRootClassName"
const:treeFolderAction="view"
/>
<var:if condition="hideFolderTree" const:negate="YES"> <div class="menu" id="mark-menu">
<div class="titlediv"><var:string label:value="Folders" /></div> <ul id="">
<var:component className="UIxMailTree" <li onmousedown="return false;"
rootClassName="treeRootClassName" onmouseup="onMenuMarkMessage(event, 'read');"><var:string label:value="As Read" /></li>
const:treeFolderAction="view" <li onmousedown="return false;"
/> onmouseup="onMenuMarkMessage(event, 'threadread');"><var:string label:value="Thread As Read" /></li>
</var:if> <li onmousedown="return false;"
</div> 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" <form name="pageform" var:href="pageFormURL" _wosid="0" onsubmit="checkSearchValue(event);">
onmousedown="startHandleDragging(event);" <var:if condition="isPopup" const:negate="YES">
onmousemove="" <var:if condition="hideFolderTree" const:negate="YES">
ondblclick="dragHandleDoubleClick(event);" <div class="folderTree" id="mailerFolderTree">
leftblock="mailerFolderTree" <div class="titlediv"><var:string label:value="Folders" /></div>
rightblock="mailerPageContent"> <var:component className="UIxMailTree"
</div> 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"> <div id="mailerPageContent">
<var:component-content/> <var:component-content/>
</div> </div>
</form> </var:if>
<var:string value="errorAlertJavaScript" const:escapeHTML="NO" /> <var:if condition="isPopup">
</body> <var:component-content/>
</html> </var:if>
</form>
<var:string value="errorAlertJavaScript" const:escapeHTML="NO" />
</var:if> </var:if>
<var:if condition="hideFrame"> <var:if condition="hideFrame">
<var:component-content/> <var:component-content/>
</var:if> </var:if>
</container> </var:component>

View File

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

View File

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

View File

@ -1,39 +1,72 @@
<?xml version="1.0" standalone="yes"?> <?xml version="1.0" standalone="yes"?>
<div class="folderTreeContent" <div id="folderTreeContent"
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding" xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant" xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url" xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"> xmlns:label="OGo:label">
<!-- TODO: extend treeview to use CSS --> <!-- TODO: extend treeview to use CSS -->
<var:treeview
list="rootNodes" item="item" sublist="item.children" <script type="text/javascript" rsrc:src="dtree.js"> <!-- space --></script>
zoom="item.isPathNode" <script type="text/javascript">
const:iconWidth = "17" d = new dTree('d');
const:plusIcon = "tbtv_plus_17x17.gif" d.config.folderLlinks = true;
const:minusIcon = "tbtv_minus_17x17.gif" d.config.hideRoot = true;
const:lineIcon = "tbtv_line_17x17.gif"
const:cornerIcon = "tbtv_corner_17x17.gif" d.icon.root = '<var:string rsrc:value="tbtv_account_17x17.gif" />';
const:junctionIcon = "tbtv_junction_17x17.gif" d.icon.folder = '<var:string rsrc:value="tbtv_leaf_corner_17x17.gif" />';
const:leafIcon = "tbtv_leaf_corner_17x17.gif" d.icon.folderOpen = '<var:string rsrc:value="tbtv_leaf_corner_17x17.gif" />';
const:leafCornerIcon = "tbtv_leaf_corner_17x17.gif" d.icon.node = '<var:string rsrc:value="tbtv_leaf_corner_17x17.gif" />';
const:cornerPlusIcon = "tbtv_corner_plus_17x17.gif" d.icon.line = '<var:string rsrc:value="tbtv_line_17x17.gif" />';
const:cornerMinusIcon = "tbtv_corner_minus_17x17.gif" d.icon.join = '<var:string rsrc:value="tbtv_junction_17x17.gif" />';
const:spaceIcon = "tbtv_space_17x17.gif" d.icon.joinBottom = '<var:string rsrc:value="tbtv_corner_17x17.gif" />';
> d.icon.plus = '<var:string rsrc:value="tbtv_plus_17x17.gif" />';
<var:tree-data const:isTreeElement="YES" const:treeLink="" d.icon.plusBottom = '<var:string rsrc:value="tbtv_corner_plus_17x17.gif" />';
var:icon="item.iconName" d.icon.minus = '<var:string rsrc:value="tbtv_minus_17x17.gif" />';
var:cornerIcon="item.iconName"> d.icon.minusBottom = '<var:string rsrc:value="tbtv_corner_minus_17x17.gif" />';
<a var:href="item.link"> d.icon.nlPlus = '<var:string rsrc:value="tbtv_corner_plus_17x17.gif" />';
<span class="treecell"> d.icon.nlMinus = '<var:string rsrc:value="tbtv_corner_minus_17x17.gif" />';
<var:if condition="item.isActiveNode"> d.icon.empty = '<var:string rsrc:value="empty.gif" />';
<b><var:string value="item.title" /></b>
</var:if> d.add(0, -1, '');
<var:if condition="item.isActiveNode" const:negate="YES"> <var:foreach list="flattenedNodes" item="item"
<var:string value="item.title" /> ><var:component className="UIxMailTreeBlockJS"
</var:if> const:treeObjectName="d"
</span> var:item="item"
</a> /></var:foreach>
</var:tree-data> document.write(d);
</var:treeview> </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> </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'?> <?xml version='1.0' standalone='yes'?>
<var:component <container
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding" xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant" xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix" xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url" xmlns:rsrc="OGo:url"
xmlns:label="OGo:label" xmlns:label="OGo:label"
className="UIxMailPanelFrame" >
title="panelTitle" <var:if condition="clientObject.isKolabObject" const:negate="YES">
> <!--
Note: We cannot make this section static (like the toolbar) because the CC
<div class="menu" id="addressMenu"> list has a dynamic height (would require some tricky JavaScript).
<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>
--> -->
</var:if> <table class="mailer_fieldtable">
</table> <tr class="mailer_fieldrow">
</var:if><!-- !Kolab --> <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"> <!-- TODO:
<var:component value="contentViewerComponent" (<a rsrc:href="tbird_073_viewer.png">screenshot</a>)
bodyInfo="clientObject.bodyStructure" /> -->
</div> </td>
</tr>
<script language="JavaScript"> <tr class="mailer_fieldrow">
if (window.opener) { <td class="mailer_fieldname" ><var:string label:value="To"/>:</td>
markMailReadInWindow(window.opener, <td class="mailer_fieldvalue">
'<var:string value="clientObject.nameInContainer"/>'); <var:foreach list="clientObject.toEnvelopeAddresses"
} item="currentAddress">
</script> <a var:href="currentAddressLink" onclick="onMenuClick(event, 'addressMenu');" oncontextmenu="onMenuClick(event, 'addressMenu');" onmousedown="return false;">
</var:component> <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"?> <?xml version="1.0" standalone="yes"?>
<html xmlns="http://www.w3.org/1999/xhtml" <container
xmlns:var="http://www.skyrix.com/od/binding" xmlns="http://www.w3.org/1999/xhtml"
xmlns:const="http://www.skyrix.com/od/constant" xmlns:var="http://www.skyrix.com/od/binding"
xmlns:rsrc="OGo:url" xmlns:const="http://www.skyrix.com/od/constant"
xmlns:label="OGo:label" xmlns:rsrc="OGo:url"
> xmlns:label="OGo:label">
<head> <var:if condition="hideFrame" const:negate="YES">
<title> <html>
<var:string value="title"/> <head>
</title> <title>
<meta name="description" content="SOGo Web Interface"/> <var:string value="title"/>
<meta name="author" content="SKYRIX Software AG"/> </title>
<meta name="robots" content="stop"/> <meta name="hideFrame" var:content="hideFrame" />
<meta name="test" var:content="patate"/> <meta name="description" content="SOGo Web Interface"/>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"/> <meta name="author" content="SKYRIX Software AG"/>
<link type="text/css" rel="stylesheet" rsrc:href="uix.css"/> <meta name="robots" content="stop"/>
<link type="text/css" rel="stylesheet" rsrc:href="calendar.css"/> <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"/>
<link href="mailto:hh@skyrix.com" rev="made"/> <link href="mailto:hh@skyrix.com" rev="made"/>
<script rsrc:src="generic.js"> <!-- space required --></script> <link type="text/css" rel="stylesheet" rsrc:href="generic.css" />
<var:if condition="hasProductSpecificJavaScript"> <link type="text/css" rel="stylesheet" rsrc:href="dtree.css" />
<script var:src="productJavaScriptURL"> <!-- space required --></script> <var:if condition="hasProductSpecificCSS"
</var:if> ><link type="text/css" rel="stylesheet" var:href="productCSSURL"
<var:if condition="hasPageSpecificJavaScript"> /></var:if>
<script var:src="pageJavaScriptURL"> <!-- space required --></script> <var:if condition="hasPageSpecificCSS"
</var:if> ><link type="text/css" rel="stylesheet" var:href="pageCSSURL"
</head> /></var:if>
</head>
<body> <body oncontextmenu="return false;">
<var:if condition="isPopup" const:negate="YES"> <script type="text/javascript">
<div class="linkbanner"> var UserFolderURL = '<var:string value="userFolderPath" />';
<a var:href="relativeHomePath" var ApplicationBaseURL = '<var:string value="applicationPath" />';
><var:string label:value="Home" /></a> | var ResourcesURL = '/SOGo.woa/WebServerResources'
<a var:href="relativeCalendarPath" </script>
><var:string label:value="Calendar" /></a> |
<a var:href="relativeContactsPath" <script type="text/javascript" rsrc:src="prototype.js"> <!-- space required --></script>
><var:string label:value="Addressbook" /></a> | <script type="text/javascript" rsrc:src="yul/yahoo/yahoo-min.js"> <!-- space required --></script>
<a var:href="relativeMailPath" <script type="text/javascript" rsrc:src="yul/dom/dom-min.js"> <!-- space required --></script>
><var:string label:value="Mail" /></a> | <script type="text/javascript" rsrc:src="yul/event/event-min.js"> <!-- space required --></script>
<a var:href="logoffPath" <script type="text/javascript" rsrc:src="yul/dragdrop/dragdrop-min.js"> <!-- space required --></script>
><var:string label:value="Logoff" /></a> |
<a href="http://to.be.done/" <script type="text/javascript" rsrc:src="generic.js"> <!-- space required --></script>
><var:string label:value="Right Administration" /></a> <var:if condition="hasProductSpecificJavaScript"
</div> ><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:if>
<var:component className="UIxToolbar" /> <var:if condition="hideFrame">
<var:component-content />
<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> </var:if>
</body> </container>
</html>
<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-omittag:nil
sgml-shorttag:nil
End:
-->

View File

@ -1,39 +1,51 @@
<?xml version="1.0" standalone="yes"?> <?xml version="1.0" standalone="yes"?>
<var:if condition="hasButtons" <var:if condition="hasButtons"
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding" xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant" xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url" xmlns:rsrc="OGo:url"
xmlns:label="OGo:label" xmlns:label="OGo:label"
xmlns:so="http://www.skyrix.com/od/so-lookup"> xmlns:so="http://www.skyrix.com/od/so-lookup">
<div class="toolbar"> <div id="toolbar" class="toolbar">
<var:foreach list="toolbarConfig" item="toolbarGroup"> <var:foreach list="toolbarConfig" item="toolbarGroup"
<var:foreach list="toolbarGroup" item="buttonInfo"> ><var:foreach list="toolbarGroup" item="buttonInfo"
<var:if condition="isButtonEnabled"> ><var:if condition="isButtonEnabled"
><a class="toolbarButton"
<a class="toolbarButton" var:href="buttonInfo.link"
var:href="buttonInfo.link" var:target="buttonInfo.target"
var:target="buttonInfo.target" var:onclick="buttonInfo.onclick"
var:onclick="buttonInfo.onclick" var:title="buttonInfo.tooltip"
var:alt="buttonInfo.tooltip" ><span class="toolbarButton"
var:title="buttonInfo.tooltip"> ><img class="buttonImage"
<span class="toolbarButton"> var:src="buttonImage"
<img class="buttonImage" var:alt="buttonInfo.image"
var:src="buttonImage" /><br
var:alt="buttonInfo.image" /><br /> /><span class="buttonLabel"
<span class="buttonLabel"><var:string ><var:string
value="buttonLabel" /></span> value="buttonLabel"
</span> /></span
</a> ></span
></a>
</var:if> </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:foreach>
</div>
<var:if condition="isLastGroup" const:negate="YES"> </var:if>
<span class="toolbarSeparator">
<var:entity const:name="nbsp" />
</span>
</var:if>
</var:foreach>
</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(); validateControls();
function showElement(e, shouldShow) { function showElement(e, shouldShow) {
e.style.display = shouldShow ? "" : "none"; e.style.display = shouldShow ? "" : "none";
} }
function enableElement(e, shouldEnable) { function enableElement(e, shouldEnable) {
@ -51,7 +51,6 @@ function popupSearchMenu(event, menuId)
if (event.button == 0 if (event.button == 0
&& relX < 24) { && relX < 24) {
log('popup');
event.cancelBubble = true; event.cancelBubble = true;
event.returnValue = false; event.returnValue = false;
@ -85,27 +84,33 @@ function setSearchCriteria(event)
searchField = document.getElementById('searchValue'); searchField = document.getElementById('searchValue');
searchCriteria = document.getElementById('searchCriteria'); searchCriteria = document.getElementById('searchCriteria');
node = event.target; var node = event.target;
searchField.setAttribute("ghost-phrase", node.innerHTML); searchField.setAttribute("ghost-phrase", node.innerHTML);
searchCriteria = node.getAttribute('id'); 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 onSearchChange()
{ {
log('onSearchChange');
} }
function onSearchMouseDown(event) function onSearchMouseDown(event)
{ {
log('onSearchMouseDown');
searchField = document.getElementById('searchValue'); searchField = document.getElementById('searchValue');
superNode = searchField.parentNode.parentNode.parentNode; superNode = searchField.parentNode.parentNode.parentNode;
relX = (event.pageX - superNode.offsetLeft - searchField.offsetLeft); relX = (event.pageX - superNode.offsetLeft - searchField.offsetLeft);
relY = (event.pageY - superNode.offsetTop - searchField.offsetTop); relY = (event.pageY - superNode.offsetTop - searchField.offsetTop);
if (relY < 24) { if (relY < 24) {
log('menu');
event.cancelBubble = true; event.cancelBubble = true;
event.returnValue = false; event.returnValue = false;
} }
@ -113,7 +118,6 @@ function onSearchMouseDown(event)
function onSearchFocus(event) function onSearchFocus(event)
{ {
log('onSearchFocus');
searchField = document.getElementById('searchValue'); searchField = document.getElementById('searchValue');
ghostPhrase = searchField.getAttribute("ghost-phrase"); ghostPhrase = searchField.getAttribute("ghost-phrase");
if (searchField.value == ghostPhrase) { if (searchField.value == ghostPhrase) {
@ -128,7 +132,6 @@ function onSearchFocus(event)
function onSearchBlur() function onSearchBlur()
{ {
log('onSearchBlur');
var searchField = document.getElementById('searchValue'); var searchField = document.getElementById('searchValue');
var ghostPhrase = searchField.getAttribute("ghost-phrase"); var ghostPhrase = searchField.getAttribute("ghost-phrase");
@ -159,7 +162,45 @@ function initCriteria()
searchField.setAttribute('ghost-phrase', firstOption.innerHTML); searchField.setAttribute('ghost-phrase', firstOption.innerHTML);
searchField.setAttribute("modified", ""); searchField.setAttribute("modified", "");
searchField.style.color = "#aaa"; 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 */ /* generic stuff */
logWindow = window.open('', 'logWindow'); var logConsole;
logWindow.document.write('<html><head><title>JavaScript log</title></head>'
+ '<body style="font-family: monospace;' // logArea = null;
+ 'font-size: 10pt; overflow: scroll;">' var allDocumentElements = null;
+ '<div class="log" id="logArea"'
+ ' onclick="this.innerHTML=\'\';"></div></body>' /* a W3C compliant document.all */
+ '</html>'); function getAllScopeElements(scope)
logWindow.resizeTo(640,480); {
logArea = logWindow.document.getElementById('logArea'); var elements = new Array();
logArea.innerHTML = '';
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) { function ml_stripActionInURL(url) {
if (url[url.length - 1] != '/') { 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) { position = classStr.indexOf(className, 0);
var classStr = '' + node.getAttribute('class');
position = classStr.indexOf('_selected', 0);
if (position < 0) { if (position < 0) {
classStr = classStr + ' _selected'; classStr = classStr + ' ' + className;
node.setAttribute('class', classStr); node.setAttribute('class', classStr);
} }
} }
function deselectNode(node) { function removeClassName(node, className) {
var classStr = '' + node.getAttribute('class'); var classStr = '' + node.getAttribute('class');
position = classStr.indexOf('_selected', 0); position = classStr.indexOf(className, 0);
while (position > -1) { while (position > -1) {
classStr1 = classStr.substring(0, position); classStr1 = classStr.substring(0, position);
classStr2 = classStr.substring(position + 10, classStr.length); classStr2 = classStr.substring(position + 10, classStr.length);
classStr = classStr1 + classStr2; classStr = classStr1 + classStr2;
position = classStr.indexOf('_selected', 0); position = classStr.indexOf(className, 0);
} }
node.setAttribute('class', classStr); node.setAttribute('class', classStr);
} }
/* selection mechanism */
function selectNode(node) {
addClassName(node, '_selected');
}
function deselectNode(node) {
removeClassName(node, '_selected');
}
function deselectAll(parent) { function deselectAll(parent) {
for (var i = 0; i < parent.childNodes.length; i++) { for (var i = 0; i < parent.childNodes.length; i++) {
var node = parent.childNodes.item(i); var node = parent.childNodes.item(i);
if (node.nodeType == 1) { 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++) { for (var i = 0; i < parentNode.childNodes.length; i++) {
node = parentNode.childNodes.item(i); node = parentNode.childNodes.item(i);
if (node.nodeType == 1 if (node.nodeType == 1
&& isNodeSelected(node)) { && isNodeSelected(node))
selArray.push(i); selArray.push(node);
}
} }
return selArray.join('|'); return selArray;
} }
function onRowClick(event) { function onRowClick(event) {
var node = event.target; var node = event.target;
// var text = document.getElementById('list'); if (node.tagName == 'TD')
// text.innerHTML = ''; node = node.parentNode;
var startSelection = getSelectedNodes(node.parentNode); var startSelection = getSelectedNodes(node.parentNode);
if (event.shiftKey == 1 if (event.shiftKey == 1
@ -285,7 +352,10 @@ function onRowClick(event) {
selectNode(node); selectNode(node);
} }
if (startSelection != getSelectedNodes(node.parentNode)) { 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) { if (code.length > 0) {
node.eval(code); node.eval(code);
} }
@ -296,8 +366,6 @@ function onRowClick(event) {
var bodyOnClick = ""; var bodyOnClick = "";
// var acceptClick = false; // var acceptClick = false;
var menuClickNode = null;
var currentSubmenu = null;
function onMenuClick(event, menuId) function onMenuClick(event, menuId)
{ {
@ -306,8 +374,10 @@ function onMenuClick(event, menuId)
event.cancelBubble = true; event.cancelBubble = true;
event.returnValue = false; event.returnValue = false;
if (document.currentPopupMenu)
hideMenu(event, document.currentPopupMenu);
var popup = document.getElementById(menuId); var popup = document.getElementById(menuId);
hideMenu(popup);
var menuTop = event.pageY; var menuTop = event.pageY;
var menuLeft = event.pageX; var menuLeft = event.pageX;
@ -321,86 +391,172 @@ function onMenuClick(event, menuId)
if (leftDiff < 0) if (leftDiff < 0)
menuLeft -= popup.offsetWidth; menuLeft -= popup.offsetWidth;
popup.style.top = menuTop + "px"; popup.style.top = menuTop + "px;";
popup.style.left = menuLeft + "px"; popup.style.left = menuLeft + "px;";
popup.style.visibility = "visible"; popup.style.visibility = "visible;";
menuClickNode = node; setupMenuTarget(popup, node);
bodyOnClick = "" + document.body.getAttribute("onclick"); bodyOnClick = "" + document.body.getAttribute("onclick");
document.body.setAttribute("onclick", "onBodyClick('" + menuId + "');"); document.body.setAttribute("onclick", "onBodyClick(event);");
} document.currentPopupMenu = popup;
function onBodyClick(menuId)
{
// if (!acceptClick)
// acceptClick = true;
// else
// {
popup = document.getElementById(menuId);
hideMenu(popup);
document.body.setAttribute("onclick", bodyOnClick);
menuClickNode = null;
// }
return false; 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') + '"'); // log('hiding menu "' + menuNode.getAttribute('id') + '"');
if (menuNode.submenu) if (menuNode.submenu)
{ {
hideMenu(menuNode.submenu); hideMenu(event, menuNode.submenu);
menuNode.submenu = null; menuNode.submenu = null;
} }
menuNode.style.visibility = "hidden"; 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"); var node = event.target;
window.alert("clicked " + menuClickNode.tagName);
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; return false;
} }
function log(message) { function log(message) {
if (logArea) logConsole.innerHTML += message + '<br />' + "\n";
logArea.innerHTML = logArea.innerHTML + message + '<br />' + "\n";
} }
function dropDownSubmenu(event) function dropDownSubmenu(event)
{ {
var node = event.target; var node = event.target;
var submenu = node.getAttribute("submenu"); var submenu = node.getAttribute("submenu");
if (submenu && submenu != "") { if (submenu && submenu != "")
if (node.parentNode.parentNode.submenu) {
hideMenu(node.parentNode.parentNode.submenu); var submenuNode = document.getElementById(submenu);
var parentNode = getParentMenu(node);
var submenuNode = document.getElementById(submenu); if (parentNode.submenu)
node.parentNode.parentNode.submenu = submenuNode; hideMenu(event, parentNode.submenu);
var menuTop = (node.parentNode.parentNode.offsetTop var menuTop = (node.parentNode.parentNode.offsetTop
+ node.offsetTop - 1); + 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 submenuNode.parentMenuItem = node;
- (menuTop + submenuNode.offsetHeight)); submenuNode.parentMenu = parentNode;
if (heightDiff < 0) parentNode.submenuItem = node;
menuTop += heightDiff; parentNode.submenu = submenuNode;
var menuLeft = (node.parentNode.parentNode.offsetLeft parentNode.setAttribute('onmousemove', 'checkDropDown(event);');
+ node.parentNode.parentNode.offsetWidth node.setAttribute('class', 'submenu-selected');
- 2); submenuNode.style.top = menuTop + "px;";
var leftDiff = (window.innerWidth submenuNode.style.left = menuLeft + "px;";
- (menuLeft + submenuNode.offsetWidth)); submenuNode.style.visibility = "visible;";
if (leftDiff < 0) }
menuLeft -= (node.parentNode.parentNode.offsetWidth }
+ submenuNode.offsetWidth
- 4);
submenuNode.style.top = menuTop + "px"; function checkDropDown(event)
submenuNode.style.left = menuLeft + "px"; {
submenuNode.style.visibility = "visible"; 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 */ /* drag handle */
@ -409,26 +565,41 @@ var dragHandle;
var dragHandleOrigX; var dragHandleOrigX;
var dragHandleOrigLeft; var dragHandleOrigLeft;
var dragHandleOrigRight; var dragHandleOrigRight;
var dragHandleOrigY;
var dragHandleOrigUpper;
var dragHandleOrigLower;
var dragHandleDiff;
function startHandleDragging(event) { function startHandleDragging(event) {
if (event.button == 0) { if (event.button == 0) {
var leftBlock = event.target.getAttribute('leftblock'); var leftBlock = event.target.getAttribute('leftblock');
var rightBlock = event.target.getAttribute('rightblock'); var rightBlock = event.target.getAttribute('rightblock');
var upperBlock = event.target.getAttribute('upperblock');
var lowerBlock = event.target.getAttribute('lowerblock');
dragHandle = event.target; dragHandle = event.target;
dragHandleOrigX = dragHandle.offsetLeft; if (leftBlock && rightBlock) {
dragHandleOrigLeft = document.getElementById(leftBlock).offsetWidth; dragHandle.dhType = 'horizontal';
dragHandleOrigRight = document.getElementById(rightBlock).offsetLeft; 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.addEventListener('mouseup', stopHandleDragging, true);
document.body.setAttribute('onmousemove', 'dragHandleMove(event, "' document.addEventListener('mousemove', dragHandleMove, true);
+ leftBlock
+ '", "'
+ rightBlock
+ '");');
document.body.style.cursor = "e-resize";
dragHandleMove(event, leftBlock, rightBlock); dragHandleMove(event);
event.cancelBubble = true; event.cancelBubble = true;
} }
@ -436,38 +607,58 @@ function startHandleDragging(event) {
} }
function stopHandleDragging(event) { function stopHandleDragging(event) {
var diffX = (event.clientX - dragHandleOrigX if (dragHandle.dhType == 'horizontal') {
- (dragHandle.offsetWidth / 2)); var diffX = Math.floor(event.clientX - dragHandleOrigX
var lBlock - (dragHandle.offsetWidth / 2));
= document.getElementById(dragHandle.getAttribute('leftblock')); var lBlock
var rBlock = document.getElementById(dragHandle.getAttribute('leftblock'));
= document.getElementById(dragHandle.getAttribute('rightblock')); 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'; lBlock.style.top = (dragHandleOrigLower + diffY
rBlock.style.left = (dragHandleOrigRight + diffX) + 'px'; - dragHandleDiff) + 'px;';
uBlock.style.height = (dragHandleOrigUpper + diffY - dragHandleDiff) + 'px;';
document.body.setAttribute('onmousemove', ''); }
document.body.setAttribute('onmouseup', '');
document.removeEventListener('mouseup', stopHandleDragging, true);
document.removeEventListener('mousemove', dragHandleMove, true);
document.body.setAttribute('style', ''); document.body.setAttribute('style', '');
event.cancelBubble = true; event.cancelBubble = true;
dragHandleMove(event);
return false; return false;
} }
function dragHandleMove(event, leftBlock, rightBlock) { function dragHandleMove(event) {
if (typeof(dragHandle) == undefined if (dragHandle.dhType == 'horizontal') {
|| !dragHandle)
stopHandling(event);
else {
var width = dragHandle.offsetWidth; var width = dragHandle.offsetWidth;
var hX = event.clientX; var hX = event.clientX;
if (hX > -1) { if (hX > -1) {
var newLeft = hX - (width / 2); var newLeft = Math.floor(hX - (width / 2));
dragHandle.style.left = newLeft + 'px;';
dragHandle.style.left = newLeft + 'px';
event.cancelBubble = true; 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; return false;
} }
} }
@ -475,18 +666,34 @@ function dragHandleMove(event, leftBlock, rightBlock) {
function dragHandleDoubleClick(event) { function dragHandleDoubleClick(event) {
dragHandle = event.target; dragHandle = event.target;
var lBlock
= document.getElementById(dragHandle.getAttribute('leftblock'));
var lLeft = lBlock.offsetLeft;
if (dragHandle.offsetLeft > lLeft) { if (dragHandle.dhType == 'horizontal') {
var rBlock var lBlock
= document.getElementById(dragHandle.getAttribute('rightblock')); = document.getElementById(dragHandle.getAttribute('leftblock'));
var leftDiff = rBlock.offsetLeft - dragHandle.offsetLeft; var lLeft = lBlock.offsetLeft;
dragHandle.style.left = lLeft + 'px'; if (dragHandle.offsetLeft > lLeft) {
lBlock.style.width = '0px'; var rBlock
rBlock.style.left = (lLeft + leftDiff) + 'px'; = 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 = document.getElementById(sender.name);
row.className = sender.checked ? "tableview_selected" : "tableview"; row.className = sender.checked ? "tableview_selected" : "tableview";
} }
function collectSelectedRows() { function collectSelectedRows() {
var pageform = document.forms['pageform'];
var rows = new Array(); var rows = new Array();
var messageList = document.getElementById('messageList');
var tbody = (messageList.getElementsByTagName('tbody'))[0];
var selectedRows = getSelectedNodes(tbody);
for (key in pageform) { for (var i = 0; i < selectedRows.length; i++) {
if (key.indexOf("row_") != 0) var row = selectedRows[i];
continue; var rowId = row.getAttribute('id').substring(4);
rows[rows.length] = rowId;
if (!pageform[key].checked)
continue;
rows[rows.length] = key.substring(4, key.length);
} }
return rows; return rows;
} }
@ -308,7 +308,7 @@ function openMessageWindowsForSelection(sender, action) {
var idset = ""; var idset = "";
for (var i = 0; i < rows.length; i++) { for (var i = 0; i < rows.length; i++) {
win = openMessageWindow(sender, win = openMessageWindow(sender,
rows[i] /* msguid */, rows[i] /* msguid */,
rows[i] + "/" + action /* url */); 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