Monotone-Parent: 8566d6fbfa896a774b9907c3125e7b3de87296cd
Monotone-Revision: 2ad8b0c019808014c990f51cc69c4457fdb537c6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-07-28T22:59:11 Monotone-Branch: ca.inverse.sogomaint-2.0.2
|
@ -113,9 +113,11 @@ static NSString *AgenorShareLoginMarker = @".-.";
|
|||
|
||||
return [[ctx activeUser] fetchAllMailIdentitiesWithOnlyEmitterAccess:_flag];
|
||||
}
|
||||
|
||||
- (NSArray *)fetchAllIdentities {
|
||||
return [self fetchIdentitiesWithOnlyEmitterAccess:NO];
|
||||
}
|
||||
|
||||
- (NSArray *)fetchIdentitiesWithEmitterPermissions {
|
||||
return [self fetchIdentitiesWithOnlyEmitterAccess:YES];
|
||||
}
|
||||
|
@ -143,6 +145,7 @@ static NSString *AgenorShareLoginMarker = @".-.";
|
|||
ct = [[ctClass alloc] initWithName:_key inContainer:self];
|
||||
return [ct autorelease];
|
||||
}
|
||||
|
||||
- (id)sharedMailAccountWithName:(NSString *)_key inContext:(id)_ctx {
|
||||
static Class ctClass = Nil;
|
||||
id ct;
|
||||
|
|
|
@ -32,8 +32,22 @@
|
|||
{
|
||||
NSString *title;
|
||||
id item;
|
||||
BOOL isPopup;
|
||||
}
|
||||
|
||||
- (NSString *) pageJavaScriptURL;
|
||||
- (NSString *) productJavaScriptURL;
|
||||
- (BOOL) hasPageSpecificJavaScript;
|
||||
- (BOOL) hasProductSpecificJavaScript;
|
||||
|
||||
- (NSString *) pageCSSURL;
|
||||
- (NSString *) productCSSURL;
|
||||
- (BOOL) hasPageSpecificCSS;
|
||||
- (BOOL) hasProductSpecificCSS;
|
||||
|
||||
- (void) setPopup: (BOOL) popup;
|
||||
- (BOOL) isPopup;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* UIXPAGEFRAME_H */
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
- (void)setTitle:(NSString *)_value {
|
||||
ASSIGNCOPY(self->title, _value);
|
||||
}
|
||||
|
||||
- (NSString *)title {
|
||||
if ([self isUIxDebugEnabled])
|
||||
return self->title;
|
||||
|
@ -49,6 +50,7 @@
|
|||
- (void)setItem:(id)_item {
|
||||
ASSIGN(self->item, _item);
|
||||
}
|
||||
|
||||
- (id)item {
|
||||
return self->item;
|
||||
}
|
||||
|
@ -59,14 +61,16 @@
|
|||
|
||||
/* Help URL/target */
|
||||
|
||||
- (NSString *)helpURL {
|
||||
- (NSString *)helpURL
|
||||
{
|
||||
return [NSString stringWithFormat: @"help/%@.html", self->title];
|
||||
}
|
||||
- (NSString *)helpWindowTarget {
|
||||
|
||||
- (NSString *)helpWindowTarget
|
||||
{
|
||||
return [NSString stringWithFormat: @"Help_%@", self->title];
|
||||
}
|
||||
|
||||
|
||||
/* notifications */
|
||||
|
||||
- (void)sleep {
|
||||
|
@ -77,108 +81,66 @@
|
|||
/* URL generation */
|
||||
// TODO: I think all this should be done by the clientObject?!
|
||||
|
||||
- (NSString *)relativeHomePath {
|
||||
- (NSString *) relativeHomePath
|
||||
{
|
||||
return [self relativePathToUserFolderSubPath: @""];
|
||||
}
|
||||
|
||||
- (NSString *)relativeCalendarPath {
|
||||
- (NSString *)relativeCalendarPath
|
||||
{
|
||||
return [self relativePathToUserFolderSubPath: @"Calendar/"];
|
||||
}
|
||||
|
||||
- (NSString *)relativeContactsPath {
|
||||
- (NSString *)relativeContactsPath
|
||||
{
|
||||
return [self relativePathToUserFolderSubPath: @"Contacts/"];
|
||||
}
|
||||
|
||||
- (NSString *)relativeMailPath {
|
||||
- (NSString *)relativeMailPath
|
||||
{
|
||||
return [self relativePathToUserFolderSubPath: @"Mail/"];
|
||||
}
|
||||
|
||||
- (NSString *)logoffPath {
|
||||
- (NSString *)logoffPath
|
||||
{
|
||||
return [self relativePathToUserFolderSubPath: @"logoff"];
|
||||
}
|
||||
|
||||
/* page based JavaScript */
|
||||
|
||||
- (WOResourceManager *)pageResourceManager {
|
||||
WOResourceManager *rm;
|
||||
|
||||
if ((rm = [[[self context] page] resourceManager]) == nil)
|
||||
rm = [[WOApplication application] resourceManager];
|
||||
return rm;
|
||||
/* popup handling */
|
||||
- (void) setPopup: (BOOL) popup
|
||||
{
|
||||
isPopup = popup;
|
||||
}
|
||||
|
||||
- (BOOL) isPopup
|
||||
{
|
||||
WOComponent *page;
|
||||
|
||||
page = [[self context] page];
|
||||
|
||||
return ([page respondsToSelector: @selector(isPopup)]
|
||||
&& [page isPopup]);
|
||||
return isPopup;
|
||||
}
|
||||
|
||||
/* page based JavaScript */
|
||||
|
||||
- (NSString *) pageJavaScriptURL
|
||||
{
|
||||
static NSMutableDictionary *pageToURL = nil;
|
||||
WOResourceManager *rm;
|
||||
WOComponent *page;
|
||||
NSString *jsname, *pageName;
|
||||
NSString *url;
|
||||
NSString *pageJSFilename;
|
||||
|
||||
page = [[self context] page];
|
||||
pageName = NSStringFromClass([page class]);
|
||||
// TODO: does not seem to work! (gets reset): pageName = [page name];
|
||||
pageJSFilename = [NSString stringWithFormat: @"%@.js",
|
||||
NSStringFromClass([page class])];
|
||||
|
||||
if ((url = [pageToURL objectForKey:pageName]) != nil)
|
||||
return [url isNotNull] ? url : nil;
|
||||
|
||||
if (pageToURL == nil)
|
||||
pageToURL = [[NSMutableDictionary alloc] initWithCapacity:32];
|
||||
|
||||
rm = [self pageResourceManager];
|
||||
jsname = [pageName stringByAppendingString: @".js"];
|
||||
|
||||
url = [rm urlForResourceNamed: jsname
|
||||
inFramework: [[NSBundle bundleForClass: [page class]] bundlePath]
|
||||
languages:nil
|
||||
request:[[self context] request]];
|
||||
|
||||
/* cache */
|
||||
[pageToURL setObject:(url ? url : (id)[NSNull null]) forKey:pageName];
|
||||
|
||||
return url;
|
||||
return [self urlForResourceFilename: pageJSFilename];
|
||||
}
|
||||
|
||||
- (NSString *) productJavaScriptURL
|
||||
{
|
||||
static NSMutableDictionary *pageToURL = nil;
|
||||
WOResourceManager *rm;
|
||||
WOComponent *page;
|
||||
NSString *jsname, *pageName;
|
||||
NSString *url;
|
||||
NSString *fwJSFilename;
|
||||
|
||||
page = [[self context] page];
|
||||
pageName = NSStringFromClass([page class]);
|
||||
// TODO: does not seem to work! (gets reset): pageName = [page name];
|
||||
fwJSFilename = [NSString stringWithFormat: @"%@.js",
|
||||
[page frameworkName]];
|
||||
|
||||
if ((url = [pageToURL objectForKey:pageName]) != nil)
|
||||
return [url isNotNull] ? url : nil;
|
||||
|
||||
if (pageToURL == nil)
|
||||
pageToURL = [[NSMutableDictionary alloc] initWithCapacity:32];
|
||||
|
||||
rm = [self pageResourceManager];
|
||||
jsname = [[page frameworkName] stringByAppendingString: @".js"];
|
||||
|
||||
url = [rm urlForResourceNamed: jsname
|
||||
inFramework: [[NSBundle bundleForClass: [page class]] bundlePath]
|
||||
languages:nil
|
||||
request:[[self context] request]];
|
||||
|
||||
/* cache */
|
||||
[pageToURL setObject:(url ? url : (id)[NSNull null]) forKey:pageName];
|
||||
|
||||
return url;
|
||||
return [self urlForResourceFilename: fwJSFilename];
|
||||
}
|
||||
|
||||
- (BOOL) hasPageSpecificJavaScript
|
||||
|
@ -191,4 +153,38 @@
|
|||
return ([[self productJavaScriptURL] length] > 0);
|
||||
}
|
||||
|
||||
- (NSString *) pageCSSURL
|
||||
{
|
||||
WOComponent *page;
|
||||
NSString *pageJSFilename;
|
||||
|
||||
page = [[self context] page];
|
||||
pageJSFilename = [NSString stringWithFormat: @"%@.css",
|
||||
NSStringFromClass([page class])];
|
||||
|
||||
return [self urlForResourceFilename: pageJSFilename];
|
||||
}
|
||||
|
||||
- (NSString *) productCSSURL
|
||||
{
|
||||
WOComponent *page;
|
||||
NSString *fwJSFilename;
|
||||
|
||||
page = [[self context] page];
|
||||
fwJSFilename = [NSString stringWithFormat: @"%@.css",
|
||||
[page frameworkName]];
|
||||
|
||||
return [self urlForResourceFilename: fwJSFilename];
|
||||
}
|
||||
|
||||
- (BOOL) hasPageSpecificCSS
|
||||
{
|
||||
return ([[self pageCSSURL] length] > 0);
|
||||
}
|
||||
|
||||
- (BOOL) hasProductSpecificCSS
|
||||
{
|
||||
return ([[self productCSSURL] length] > 0);
|
||||
}
|
||||
|
||||
@end /* UIxPageFrame */
|
||||
|
|
|
@ -19,18 +19,13 @@
|
|||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
# include <Foundation/exceptions/GeneralExceptions.h>
|
||||
#elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
|
||||
# include <NGExtensions/NGObjectMacros.h>
|
||||
# include <NGExtensions/NSString+Ext.h>
|
||||
#endif
|
||||
#import <NGExtensions/NGExtensions.h>
|
||||
#import <NGObjWeb/NGObjWeb.h>
|
||||
#import <NGObjWeb/SoObjects.h>
|
||||
|
||||
#include <NGExtensions/NGExtensions.h>
|
||||
#include <NGObjWeb/NGObjWeb.h>
|
||||
#include <NGObjWeb/SoObjects.h>
|
||||
#import <SOGoUI/UIxComponent.h>
|
||||
|
||||
#include <SOGoUI/UIxComponent.h>
|
||||
#import <NGObjWeb/SoComponent.h>
|
||||
|
||||
@class NSArray, NSDictionary;
|
||||
|
||||
|
@ -42,8 +37,6 @@
|
|||
}
|
||||
@end
|
||||
|
||||
#include <NGObjWeb/SoComponent.h>
|
||||
|
||||
@implementation UIxToolbar
|
||||
|
||||
- (void)dealloc {
|
||||
|
@ -192,14 +185,13 @@
|
|||
return label;
|
||||
}
|
||||
|
||||
- (id) buttonImage {
|
||||
WOResourceManager *rm;
|
||||
- (id) buttonImage
|
||||
{
|
||||
NSString *image;
|
||||
|
||||
rm = [self pageResourceManager];
|
||||
image = [buttonInfo objectForKey: @"image"];
|
||||
if (image && [image length] > 0)
|
||||
image = [rm urlForResourceNamed: image];
|
||||
image = [self urlForResourceFilename: image];
|
||||
|
||||
return image;
|
||||
}
|
||||
|
|
|
@ -30,15 +30,6 @@
|
|||
};
|
||||
|
||||
categories = {
|
||||
SOGoUserLogin = {
|
||||
methods = {
|
||||
logoff = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxUserLogoff";
|
||||
actionName = "logoffUser";
|
||||
}
|
||||
};
|
||||
};
|
||||
SOGoObject = {
|
||||
methods = {
|
||||
};
|
||||
|
|
|
@ -279,9 +279,4 @@
|
|||
return [self redirectToLocation:uri];
|
||||
}
|
||||
|
||||
- (BOOL) isPopup
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end /* UIxContactEditorBase */
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"Get Mail" = "Relever";
|
||||
"Junk" = "Indésirable";
|
||||
"Reply" = "Répondre";
|
||||
"Reply All" = "Répo. à tous";
|
||||
"Reply All" = "Rép. à tous";
|
||||
"Print" = "Imprimer";
|
||||
"Stop" = "Stop";
|
||||
"Write" = "Écrire";
|
||||
|
@ -19,7 +19,7 @@
|
|||
|
||||
"Home" = "Accueil";
|
||||
"Calendar" = "Agenda";
|
||||
"Addressbook" = "Carnet d'adresses";
|
||||
"Addressbook" = "Adresses";
|
||||
"Mail" = "Mail";
|
||||
"Right Administration" = "Administration";
|
||||
"Help" = "Aide";
|
||||
|
@ -54,7 +54,7 @@
|
|||
"all" = "Tous";
|
||||
"read" = "Lus";
|
||||
"unread" = "Non Lus";
|
||||
"deleted" = "Éffacés";
|
||||
"deleted" = "Effacés";
|
||||
"flagged" = "Drapeau";
|
||||
|
||||
/* MailListView */
|
||||
|
@ -80,7 +80,7 @@
|
|||
|
||||
"SentFolderName" = "Éléments envoyés";
|
||||
"TrashFolderName" = "Corbeille";
|
||||
"InboxFolderName" = "Boite de Réception";
|
||||
"InboxFolderName" = "Boite de réception";
|
||||
"DraftsFolderName" = "Brouillons";
|
||||
"SieveFolderName" = "Filtres";
|
||||
"Folders" = "Dossiers";
|
||||
|
@ -93,3 +93,50 @@
|
|||
"Add to Address Book..." = "Ajouter au carnet d'adresses";
|
||||
"Compose Mail To" = "Écrire à";
|
||||
"Create Filter From Message..." = "Créer un filtre à partir du message...";
|
||||
|
||||
/* Mailbox popup menus */
|
||||
"Open in New Mail Window" = "Ouvrir dans une nouvelle fenétre";
|
||||
"Copy Folder Location" = "Copier l'adresse du dossier";
|
||||
"Subscribe..." = "S'abonner...";
|
||||
"Mark Folder Read..." = "Marquer le dossier comme lu";
|
||||
"New Folder..." = "Nouveau dossier...";
|
||||
"Compact This Folder" = "Compacter ce dossier";
|
||||
"Search Messages..." = "Rechercher dans les messages...";
|
||||
"Properties..." = "Propriétés";
|
||||
"New Subfolder..." = "Nouveau sous-dossier...";
|
||||
"Rename Folder..." = "Renommer le dossier...";
|
||||
"Delete Folder" = "Supprimer le dossier...";
|
||||
"Get Messages for Account" = "Relever les messages de ce compte";
|
||||
|
||||
/* Message list popup menu */
|
||||
"Open Message In New Window" = "Ouvrir dans une nouvelle fenétre";
|
||||
"Reply to Sender Only" = "Répondre à l'expéditeur";
|
||||
"Reply to All" = "Répondre à tout le monde";
|
||||
"Forward" = "Transférer";
|
||||
"Edit As New..." = "Modifier comme un nouveau message";
|
||||
"Move To" = "Déplacer vers";
|
||||
"Copy To" = "Copier vers";
|
||||
"Label" = "Étiquette";
|
||||
"Mark" = "Marquer";
|
||||
"Save As..." = "Enregistrer comme...";
|
||||
"Print Preview" = "Aperçu avant impression";
|
||||
"Print..." = "Imprimer...";
|
||||
"Delete Message" = "Supprimer le message";
|
||||
|
||||
/* Label popup menu */
|
||||
"None" = "Aucune";
|
||||
"Important" = "Important";
|
||||
"Work" = "Travail";
|
||||
"Personal" = "Personnel";
|
||||
"To Do" = "À faire";
|
||||
"Later" = "Peut attendre";
|
||||
|
||||
/* Mark popup menu */
|
||||
"As Read" = "Comme lu";
|
||||
"Thread As Read" = "La discussion comme lue";
|
||||
"As Read By Date..." = "Comme lus par date...";
|
||||
"All Read" = "Tous les messages comme lus";
|
||||
"Flag" = "Avec un drapeau";
|
||||
"As Junk" = "Comme indésirable";
|
||||
"As Not Junk" = "Comme acceptable";
|
||||
"Run Junk Mail Controls" = "Lancer le contrôle des indésirables";
|
||||
|
|
|
@ -19,11 +19,16 @@ MailerUI_OBJC_FILES += \
|
|||
UIxMailMainFrame.m \
|
||||
UIxMailTree.m \
|
||||
UIxMailTreeBlock.m \
|
||||
UIxMailTreeBlockJS.m \
|
||||
UIxMailFolderMenu.m \
|
||||
\
|
||||
UIxMailAccountsView.m \
|
||||
UIxMailAccountView.m \
|
||||
UIxMailAccountViewContainer.m \
|
||||
UIxMailListView.m \
|
||||
UIxMailListViewContainer.m \
|
||||
UIxMailView.m \
|
||||
UIxMailViewContainer.m \
|
||||
UIxMailSortableTableHeader.m \
|
||||
UIxMailMoveToPopUp.m \
|
||||
UIxMailFilterPanel.m \
|
||||
|
@ -40,12 +45,11 @@ MailerUI_OBJC_FILES += \
|
|||
UIxFilterList.m \
|
||||
UIxSieveEditor.m \
|
||||
\
|
||||
UIxMailFolderACLEditor.m \
|
||||
UIxMailFolderACLEditor.m
|
||||
|
||||
MailerUI_RESOURCE_FILES += \
|
||||
Version \
|
||||
product.plist \
|
||||
UIxMailView.js \
|
||||
Toolbars/*.toolbar \
|
||||
Images/*.png
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
cssClass = "tbicon_send"; label = "Send"; },
|
||||
{ link = "#"; target = "addressbook";
|
||||
onclick = "openAddressbook(this);return false;";
|
||||
image = "tb-mail-addressbook-flat-24x24.png";
|
||||
cssClass = "tbicon_addressbook"; label = "Addressbook"; },
|
||||
{ link = "#"; target = "anais";
|
||||
image = "tb-compose-contacts-flat-24x24.png";
|
||||
cssClass = "tbicon_addressbook"; label = "Contacts"; },
|
||||
/* { link = "#"; target = "anais";
|
||||
onclick = "openAnais(this);return false;";
|
||||
image = "tbtb_anais.png";
|
||||
cssClass = "tbicon_anais"; label = "Anais"; },
|
||||
cssClass = "tbicon_anais"; label = "Anais"; }, */
|
||||
{ link = "#"; isSafe = NO;
|
||||
onclick = "clickedEditorAttach(this)";
|
||||
image = "tb-compose-attach-flat-24x24.png";
|
||||
|
@ -20,8 +20,5 @@
|
|||
onclick = "clickedEditorSave(this);return false;";
|
||||
image = "tb-mail-file-flat-24x24.png";
|
||||
cssClass = "tbicon_save"; label = "Save"; },
|
||||
{ link = "delete"; isSafe = NO;
|
||||
image = "tb-mail-delete-flat-24x24.png";
|
||||
cssClass = "tbicon_delete"; label = "Delete"; },
|
||||
)
|
||||
)
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
image = "tb-mail-write-flat-24x24.png";
|
||||
onclick = "clickedCompose(this);return false;";
|
||||
cssClass = "tbicon_compose"; label = "Write"; },
|
||||
{ link = "#"; target = "addressbook";
|
||||
onclick = "openAddressbook(this);return false;";
|
||||
image = "tb-mail-addressbook-flat-24x24.png";
|
||||
cssClass = "tbicon_addressbook"; label = "Addressbook"; },
|
||||
),
|
||||
|
||||
( // second group
|
||||
|
@ -30,28 +34,25 @@
|
|||
),
|
||||
|
||||
( // third group
|
||||
{ link = "delete"; isSafe = NO;
|
||||
{ link = "delete";
|
||||
isSafe = NO;
|
||||
enabled = showMarkDeletedButton;
|
||||
image = "tb-mail-delete-flat-24x24.png";
|
||||
cssClass = "tbicon_delete"; label = "Delete"; },
|
||||
|
||||
{ link = "trash"; isSafe = NO;
|
||||
enabled = showTrashButton;
|
||||
image = "tb-mail-delete-flat-24x24.png";
|
||||
cssClass = "tbicon_delete"; label = "Delete"; },
|
||||
|
||||
/* TODO: enable when we know how to mark junk (#971)
|
||||
=> we could move the mail to the Junk folder?!
|
||||
{ link = "#";
|
||||
isSafe = NO;
|
||||
cssClass = "tbicon_junk"; label = "Junk"; },
|
||||
*/
|
||||
image = "tb-mail-junk-flat-24x24.png";
|
||||
cssClass = "tbicon_junk"; label = "Junk";
|
||||
},
|
||||
),
|
||||
/*
|
||||
( // fourth group
|
||||
// TODO: enable when we can print (#1207)
|
||||
// { link = "#"; cssClass = "tbicon_print"; label = "Print"; },
|
||||
{ link = "#"; cssClass = "tbicon_stop"; label = "Stop"; },
|
||||
(
|
||||
{ link = "#";
|
||||
cssClass = "tbicon_print";
|
||||
image = "tb-mail-print-flat-24x24.png";
|
||||
label = "Print"; },
|
||||
{ link = "#";
|
||||
image = "tb-mail-stop-flat-24x24.png";
|
||||
cssClass = "tbicon_stop";
|
||||
label = "Stop"; },
|
||||
),
|
||||
*/
|
||||
)
|
||||
|
|
|
@ -113,6 +113,12 @@ static BOOL useAltNamespace = NO;
|
|||
return [self->inbox isCreateAllowedInACL];
|
||||
}
|
||||
|
||||
- (NSString *) mailFolderName
|
||||
{
|
||||
return [NSString stringWithFormat: @"/%@",
|
||||
[[self clientObject] nameInContainer]];
|
||||
}
|
||||
|
||||
/* error redirects */
|
||||
|
||||
- (id)redirectToViewWithError:(id)_error {
|
||||
|
|
|
@ -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 */
|
|
@ -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
|
|
@ -35,4 +35,23 @@
|
|||
return [self labelForKey:@"SOGo Mail Accounts"];
|
||||
}
|
||||
|
||||
- (id) defaultAction
|
||||
{
|
||||
NSArray *c;
|
||||
NSString *inbox;
|
||||
id actionResult;
|
||||
|
||||
c = [[self clientObject] toManyRelationshipKeys];
|
||||
if ([c count] == 1)
|
||||
{
|
||||
inbox = [NSString stringWithFormat: @"%@/INBOX",
|
||||
[c objectAtIndex: 0]];
|
||||
actionResult = [self redirectToLocation: inbox];
|
||||
}
|
||||
else
|
||||
actionResult = self;
|
||||
|
||||
return actionResult;
|
||||
}
|
||||
|
||||
@end /* UIxMailAccountsView */
|
||||
|
|
|
@ -306,7 +306,7 @@ static NSArray *infoKeys = nil;
|
|||
return;
|
||||
}
|
||||
|
||||
[self setFrom:[identity email]];
|
||||
[self setFrom: [identity email]];
|
||||
}
|
||||
|
||||
- (SOGoMailIdentity *)selectedMailIdentity {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <SoObjects/Mailer/SOGoMailObject.h>
|
||||
#include "common.h"
|
||||
|
||||
#import "../Common/NSString+URL.h"
|
||||
#import "../SOGoUI/NSString+URL.h"
|
||||
|
||||
@implementation UIxMailEditorAction
|
||||
|
||||
|
|
|
@ -25,10 +25,6 @@
|
|||
{
|
||||
NSString *searchText;
|
||||
NSString *searchCriteria;
|
||||
struct {
|
||||
int hideFrame:1;
|
||||
int reserved:31;
|
||||
} mfFlags;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -79,8 +75,6 @@ static NSDictionary *filterToQualifier = nil;
|
|||
{
|
||||
searchText = nil;
|
||||
searchCriteria = nil;
|
||||
mfFlags.hideFrame = 0;
|
||||
mfFlags.reserved = 0;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -94,16 +88,6 @@ static NSDictionary *filterToQualifier = nil;
|
|||
|
||||
/* accessors */
|
||||
|
||||
- (void)setHideFrame:(BOOL)_flag
|
||||
{
|
||||
self->mfFlags.hideFrame = _flag ? 1 : 0;
|
||||
}
|
||||
|
||||
- (BOOL)hideFrame
|
||||
{
|
||||
return self->mfFlags.hideFrame ? YES : NO;
|
||||
}
|
||||
|
||||
- (void)setSearchText: (NSString *)_txt
|
||||
{
|
||||
ASSIGNCOPY(self->searchText, _txt);
|
||||
|
|
|
@ -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 */
|
|
@ -19,8 +19,6 @@
|
|||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <SOGoUI/UIxComponent.h>
|
||||
|
||||
/*
|
||||
UIxMailListView
|
||||
|
||||
|
@ -28,35 +26,20 @@
|
|||
object.
|
||||
*/
|
||||
|
||||
@class EOQualifier;
|
||||
|
||||
@interface UIxMailListView : UIxComponent
|
||||
{
|
||||
NSArray *sortedUIDs; /* we always need to retrieve all anyway! */
|
||||
NSArray *messages;
|
||||
unsigned firstMessageNumber;
|
||||
id message;
|
||||
EOQualifier *qualifier;
|
||||
}
|
||||
|
||||
- (NSString *)defaultSortKey;
|
||||
- (NSString *)imap4SortKey;
|
||||
- (NSString *)imap4SortOrdering;
|
||||
|
||||
- (BOOL)isSortedDescending;
|
||||
|
||||
@end
|
||||
|
||||
#include "common.h"
|
||||
#include <SoObjects/Mailer/SOGoMailFolder.h>
|
||||
#include <SoObjects/Mailer/SOGoMailObject.h>
|
||||
#include <NGObjWeb/SoObject+SoDAV.h>
|
||||
|
||||
@implementation UIxMailListView
|
||||
#import "UIxMailListView.h"
|
||||
|
||||
static int attachmentFlagSize = 8096;
|
||||
|
||||
- (void)dealloc {
|
||||
@implementation UIxMailListView
|
||||
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[self->qualifier release];
|
||||
[self->sortedUIDs release];
|
||||
[self->messages release];
|
||||
|
@ -64,15 +47,10 @@ static int attachmentFlagSize = 8096;
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
/* frame */
|
||||
|
||||
- (BOOL)hideFrame {
|
||||
return [[[[self context] request] formValueForKey:@"noframe"] boolValue];
|
||||
}
|
||||
|
||||
/* notifications */
|
||||
|
||||
- (void)sleep {
|
||||
- (void) sleep
|
||||
{
|
||||
[self->qualifier release]; self->qualifier = nil;
|
||||
[self->sortedUIDs release]; self->sortedUIDs = nil;
|
||||
[self->messages release]; self->messages = nil;
|
||||
|
@ -82,21 +60,28 @@ static int attachmentFlagSize = 8096;
|
|||
|
||||
/* accessors */
|
||||
|
||||
- (void)setMessage:(id)_msg {
|
||||
- (void)setMessage:(id)_msg
|
||||
{
|
||||
ASSIGN(self->message, _msg);
|
||||
}
|
||||
- (id)message {
|
||||
|
||||
- (id) message
|
||||
{
|
||||
return self->message;
|
||||
}
|
||||
|
||||
- (void)setQualifier:(EOQualifier *)_msg {
|
||||
- (void) setQualifier: (EOQualifier *) _msg
|
||||
{
|
||||
ASSIGN(self->qualifier, _msg);
|
||||
}
|
||||
- (EOQualifier *)qualifier {
|
||||
|
||||
- (EOQualifier *) qualifier
|
||||
{
|
||||
return self->qualifier;
|
||||
}
|
||||
|
||||
- (BOOL)showToAddress {
|
||||
- (BOOL) showToAddress
|
||||
{
|
||||
NSString *ftype;
|
||||
|
||||
ftype = [[self clientObject] valueForKey:@"outlookFolderClass"];
|
||||
|
@ -105,10 +90,13 @@ static int attachmentFlagSize = 8096;
|
|||
|
||||
/* title */
|
||||
|
||||
- (NSString *)objectTitle {
|
||||
- (NSString *) objectTitle
|
||||
{
|
||||
return [[self clientObject] nameInContainer];
|
||||
}
|
||||
- (NSString *)panelTitle {
|
||||
|
||||
- (NSString *) panelTitle
|
||||
{
|
||||
NSString *s;
|
||||
|
||||
s = [self labelForKey:@"View Mail Folder"];
|
||||
|
@ -119,24 +107,35 @@ static int attachmentFlagSize = 8096;
|
|||
|
||||
/* derived accessors */
|
||||
|
||||
- (BOOL)isMessageDeleted {
|
||||
- (BOOL) isMessageDeleted
|
||||
{
|
||||
NSArray *flags;
|
||||
|
||||
flags = [[self message] valueForKey:@"flags"];
|
||||
return [flags containsObject:@"deleted"];
|
||||
}
|
||||
|
||||
- (BOOL)isMessageRead {
|
||||
- (BOOL) isMessageRead
|
||||
{
|
||||
NSArray *flags;
|
||||
|
||||
flags = [[self message] valueForKey:@"flags"];
|
||||
return [flags containsObject:@"seen"];
|
||||
}
|
||||
- (NSString *)messageUidString {
|
||||
- (NSString *) messageUidString
|
||||
{
|
||||
return [[[self message] valueForKey:@"uid"] stringValue];
|
||||
}
|
||||
|
||||
- (NSString *)messageSubjectCellStyleClass {
|
||||
- (NSString *) messageCellStyleClass
|
||||
{
|
||||
return [self isMessageDeleted]
|
||||
? @"mailer_listcell_deleted"
|
||||
: @"mailer_listcell_regular";
|
||||
}
|
||||
|
||||
- (NSString *) messageSubjectCellStyleClass
|
||||
{
|
||||
return [NSString stringWithFormat: @"%@ %@",
|
||||
[self messageCellStyleClass],
|
||||
([self isMessageRead]
|
||||
|
@ -144,13 +143,8 @@ static int attachmentFlagSize = 8096;
|
|||
: @"mailer_unreadmailsubject")];
|
||||
}
|
||||
|
||||
- (NSString *)messageCellStyleClass {
|
||||
return [self isMessageDeleted]
|
||||
? @"mailer_listcell_deleted"
|
||||
: @"mailer_listcell_regular";
|
||||
}
|
||||
|
||||
- (BOOL)hasMessageAttachment {
|
||||
- (BOOL) hasMessageAttachment
|
||||
{
|
||||
/* we detect attachments by size ... */
|
||||
unsigned size;
|
||||
|
||||
|
@ -160,7 +154,8 @@ static int attachmentFlagSize = 8096;
|
|||
|
||||
/* fetching messages */
|
||||
|
||||
- (NSArray *)fetchKeys {
|
||||
- (NSArray *) fetchKeys
|
||||
{
|
||||
/* Note: see SOGoMailManager.m for allowed IMAP4 keys */
|
||||
static NSArray *keys = nil;
|
||||
if (keys == nil) {
|
||||
|
@ -170,10 +165,12 @@ static int attachmentFlagSize = 8096;
|
|||
return keys;
|
||||
}
|
||||
|
||||
- (NSString *)defaultSortKey {
|
||||
- (NSString *) defaultSortKey
|
||||
{
|
||||
return @"DATE";
|
||||
}
|
||||
- (NSString *)imap4SortKey {
|
||||
- (NSString *) imap4SortKey
|
||||
{
|
||||
NSString *sort;
|
||||
|
||||
sort = [[[self context] request] formValueForKey:@"sort"];
|
||||
|
@ -183,7 +180,8 @@ static int attachmentFlagSize = 8096;
|
|||
return [sort uppercaseString];
|
||||
}
|
||||
|
||||
- (BOOL)isSortedDescending {
|
||||
- (BOOL) isSortedDescending
|
||||
{
|
||||
NSString *desc;
|
||||
|
||||
desc = [[[self context] request] formValueForKey:@"desc"];
|
||||
|
@ -192,7 +190,8 @@ static int attachmentFlagSize = 8096;
|
|||
return [desc boolValue] ? YES : NO;
|
||||
}
|
||||
|
||||
- (NSString *)imap4SortOrdering {
|
||||
- (NSString *) imap4SortOrdering
|
||||
{
|
||||
NSString *sort;
|
||||
|
||||
sort = [self imap4SortKey];
|
||||
|
@ -201,13 +200,15 @@ static int attachmentFlagSize = 8096;
|
|||
return [@"REVERSE " stringByAppendingString:sort];
|
||||
}
|
||||
|
||||
- (NSRange)fetchRange {
|
||||
- (NSRange) fetchRange
|
||||
{
|
||||
if (self->firstMessageNumber == 0)
|
||||
return NSMakeRange(0, 50);
|
||||
return NSMakeRange(self->firstMessageNumber - 1, 50);
|
||||
}
|
||||
|
||||
- (NSArray *)sortedUIDs {
|
||||
- (NSArray *) sortedUIDs
|
||||
{
|
||||
if (self->sortedUIDs != nil)
|
||||
return self->sortedUIDs;
|
||||
|
||||
|
@ -216,14 +217,19 @@ static int attachmentFlagSize = 8096;
|
|||
sortOrdering:[self imap4SortOrdering]] retain];
|
||||
return self->sortedUIDs;
|
||||
}
|
||||
- (unsigned int)totalMessageCount {
|
||||
|
||||
- (unsigned int) totalMessageCount
|
||||
{
|
||||
return [self->sortedUIDs count];
|
||||
}
|
||||
- (BOOL)showsAllMessages {
|
||||
|
||||
- (BOOL) showsAllMessages
|
||||
{
|
||||
return ([[self sortedUIDs] count] <= [self fetchRange].length) ? YES : NO;
|
||||
}
|
||||
|
||||
- (NSRange)fetchBlock {
|
||||
- (NSRange) fetchBlock
|
||||
{
|
||||
NSRange r;
|
||||
unsigned len;
|
||||
NSArray *uids;
|
||||
|
@ -249,27 +255,33 @@ static int attachmentFlagSize = 8096;
|
|||
r.length = len - r.location;
|
||||
return r;
|
||||
}
|
||||
- (unsigned int)firstMessageNumber {
|
||||
- (unsigned int) firstMessageNumber
|
||||
{
|
||||
return [self fetchBlock].location + 1;
|
||||
}
|
||||
- (unsigned int)lastMessageNumber {
|
||||
- (unsigned int) lastMessageNumber
|
||||
{
|
||||
NSRange r;
|
||||
|
||||
r = [self fetchBlock];
|
||||
return r.location + r.length;
|
||||
}
|
||||
- (BOOL)hasPrevious {
|
||||
- (BOOL) hasPrevious
|
||||
{
|
||||
return [self fetchBlock].location == 0 ? NO : YES;
|
||||
}
|
||||
- (BOOL)hasNext {
|
||||
- (BOOL) hasNext
|
||||
{
|
||||
NSRange r = [self fetchBlock];
|
||||
return r.location + r.length >= [[self sortedUIDs] count] ? NO : YES;
|
||||
}
|
||||
|
||||
- (unsigned int)nextFirstMessageNumber {
|
||||
- (unsigned int) nextFirstMessageNumber
|
||||
{
|
||||
return [self firstMessageNumber] + [self fetchRange].length;
|
||||
}
|
||||
- (unsigned int)prevFirstMessageNumber {
|
||||
- (unsigned int) prevFirstMessageNumber
|
||||
{
|
||||
NSRange r;
|
||||
unsigned idx;
|
||||
|
||||
|
@ -280,7 +292,8 @@ static int attachmentFlagSize = 8096;
|
|||
return 1;
|
||||
}
|
||||
|
||||
- (NSArray *)messages {
|
||||
- (NSArray *) messages
|
||||
{
|
||||
NSArray *uids;
|
||||
NSArray *msgs;
|
||||
NSRange r;
|
||||
|
@ -302,10 +315,14 @@ static int attachmentFlagSize = 8096;
|
|||
|
||||
/* URL processing */
|
||||
|
||||
- (NSString *)messageViewTarget {
|
||||
return [@"SOGo_msg_" stringByAppendingString:[self messageUidString]];
|
||||
- (NSString *) messageViewTarget
|
||||
{
|
||||
return [NSString stringWithFormat: @"SOGo_msg_%@",
|
||||
[self messageUidString]];
|
||||
}
|
||||
- (NSString *)messageViewURL {
|
||||
|
||||
- (NSString *) messageViewURL
|
||||
{
|
||||
// TODO: noframe only when view-target is empty
|
||||
// TODO: markread only if the message is unread
|
||||
NSString *s;
|
||||
|
@ -314,11 +331,13 @@ static int attachmentFlagSize = 8096;
|
|||
if (![self isMessageRead]) s = [s stringByAppendingString:@"&markread=1"];
|
||||
return s;
|
||||
}
|
||||
- (NSString *)markReadURL {
|
||||
- (NSString *) markReadURL
|
||||
{
|
||||
return [@"markMessageRead?uid=" stringByAppendingString:
|
||||
[self messageUidString]];
|
||||
}
|
||||
- (NSString *)markUnreadURL {
|
||||
- (NSString *) markUnreadURL
|
||||
{
|
||||
return [@"markMessageUnread?uid=" stringByAppendingString:
|
||||
[self messageUidString]];
|
||||
}
|
||||
|
@ -345,35 +364,41 @@ static int attachmentFlagSize = 8096;
|
|||
return [@"unreaddiv_" stringByAppendingString:[self messageUidString]];
|
||||
}
|
||||
|
||||
- (NSString *)clickedMsgJS {
|
||||
- (NSString *) clickedMsgJS
|
||||
{
|
||||
/* return 'false' aborts processing */
|
||||
return [NSString stringWithFormat:@"clickedUid(this, '%@'); return false",
|
||||
[self messageUidString]];
|
||||
}
|
||||
|
||||
// the following are unused?
|
||||
- (NSString *)dblClickedMsgJS {
|
||||
- (NSString *) dblClickedMsgJS
|
||||
{
|
||||
return [NSString stringWithFormat:@"doubleClickedUid(this, '%@')",
|
||||
[self messageUidString]];
|
||||
}
|
||||
|
||||
// the following are unused?
|
||||
- (NSString *)highlightRowJS {
|
||||
- (NSString *) highlightRowJS
|
||||
{
|
||||
return [NSString stringWithFormat:@"highlightUid(this, '%@')",
|
||||
[self messageUidString]];
|
||||
}
|
||||
- (NSString *)lowlightRowJS {
|
||||
- (NSString *) lowlightRowJS
|
||||
{
|
||||
return [NSString stringWithFormat:@"lowlightUid(this, '%@')",
|
||||
[self messageUidString]];
|
||||
}
|
||||
|
||||
- (NSString *)markUnreadJS {
|
||||
- (NSString *) markUnreadJS
|
||||
{
|
||||
return [NSString stringWithFormat:
|
||||
@"mailListMarkMessage(this, 'markMessageUnread', "
|
||||
@"'%@', false)",
|
||||
[self messageUidString]];
|
||||
}
|
||||
- (NSString *)markReadJS {
|
||||
- (NSString *) markReadJS
|
||||
{
|
||||
return [NSString stringWithFormat:
|
||||
@"mailListMarkMessage(this, 'markMessageRead', "
|
||||
@"'%@', true)",
|
||||
|
@ -382,7 +407,8 @@ static int attachmentFlagSize = 8096;
|
|||
|
||||
/* error redirects */
|
||||
|
||||
- (id)redirectToViewWithError:(id)_error {
|
||||
- (id) redirectToViewWithError: (id) _error
|
||||
{
|
||||
// TODO: DUP in UIxMailAccountView
|
||||
// TODO: improve, localize
|
||||
// TODO: there is a bug in the treeview which preserves the current URL for
|
||||
|
@ -404,7 +430,8 @@ static int attachmentFlagSize = 8096;
|
|||
|
||||
/* active message */
|
||||
|
||||
- (SOGoMailObject *)lookupActiveMessage {
|
||||
- (SOGoMailObject *) lookupActiveMessage
|
||||
{
|
||||
NSString *uid;
|
||||
|
||||
if ((uid = [[[self context] request] formValueForKey:@"uid"]) == nil)
|
||||
|
@ -416,16 +443,13 @@ static int attachmentFlagSize = 8096;
|
|||
|
||||
/* actions */
|
||||
|
||||
- (id)defaultAction {
|
||||
self->firstMessageNumber =
|
||||
[[[[self context] request] formValueForKey:@"idx"] intValue];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)isJavaScriptRequest {
|
||||
- (BOOL) isJavaScriptRequest
|
||||
{
|
||||
return [[[[self context] request] formValueForKey:@"jsonly"] boolValue];
|
||||
}
|
||||
- (id)javaScriptOK {
|
||||
|
||||
- (id) javaScriptOK
|
||||
{
|
||||
WOResponse *r;
|
||||
|
||||
r = [[self context] response];
|
||||
|
@ -433,7 +457,21 @@ static int attachmentFlagSize = 8096;
|
|||
return r;
|
||||
}
|
||||
|
||||
- (id)markMessageUnreadAction {
|
||||
- (id) defaultAction
|
||||
{
|
||||
self->firstMessageNumber =
|
||||
[[[[self context] request] formValueForKey:@"idx"] intValue];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) viewAction
|
||||
{
|
||||
return [self defaultAction];
|
||||
}
|
||||
|
||||
- (id) markMessageUnreadAction
|
||||
{
|
||||
NSException *error;
|
||||
|
||||
if ((error = [[self lookupActiveMessage] removeFlags:@"seen"]) != nil)
|
||||
|
@ -445,7 +483,9 @@ static int attachmentFlagSize = 8096;
|
|||
|
||||
return [self redirectToLocation:@"view"];
|
||||
}
|
||||
- (id)markMessageReadAction {
|
||||
|
||||
- (id) markMessageReadAction
|
||||
{
|
||||
NSException *error;
|
||||
|
||||
if ((error = [[self lookupActiveMessage] addFlags:@"seen"]) != nil)
|
||||
|
@ -458,7 +498,8 @@ static int attachmentFlagSize = 8096;
|
|||
return [self redirectToLocation:@"view"];
|
||||
}
|
||||
|
||||
- (id)getMailAction {
|
||||
- (id) getMailAction
|
||||
{
|
||||
// TODO: we might want to flush the caches?
|
||||
id client;
|
||||
|
||||
|
@ -467,17 +508,20 @@ static int attachmentFlagSize = 8096;
|
|||
reason:@"did not find mail folder"];
|
||||
}
|
||||
|
||||
if (![client respondsToSelector:@selector(flushMailCaches)]) {
|
||||
if (![client respondsToSelector:@selector(flushMailCaches) ])
|
||||
{
|
||||
return [NSException exceptionWithHTTPStatus:500 /* Server Error */
|
||||
reason:
|
||||
@"invalid client object (does not support flush)"];
|
||||
}
|
||||
|
||||
[client flushMailCaches];
|
||||
|
||||
return [self redirectToLocation:@"view"];
|
||||
}
|
||||
|
||||
- (id)expungeAction {
|
||||
- (id) expungeAction
|
||||
{
|
||||
// TODO: we might want to flush the caches?
|
||||
NSException *error;
|
||||
id client;
|
||||
|
@ -495,7 +539,8 @@ static int attachmentFlagSize = 8096;
|
|||
return [self redirectToLocation:@"view"];
|
||||
}
|
||||
|
||||
- (id)emptyTrashAction {
|
||||
- (id) emptyTrashAction
|
||||
{
|
||||
// TODO: we might want to flush the caches?
|
||||
NSException *error;
|
||||
id client;
|
||||
|
@ -536,7 +581,8 @@ static int attachmentFlagSize = 8096;
|
|||
|
||||
/* folder operations */
|
||||
|
||||
- (id)createFolderAction {
|
||||
- (id) createFolderAction
|
||||
{
|
||||
NSException *error;
|
||||
NSString *folderName;
|
||||
id client;
|
||||
|
@ -562,7 +608,8 @@ static int attachmentFlagSize = 8096;
|
|||
return [self redirectToLocation:[folderName stringByAppendingString:@"/"]];
|
||||
}
|
||||
|
||||
- (id)deleteFolderAction {
|
||||
- (id) deleteFolderAction
|
||||
{
|
||||
NSException *error;
|
||||
NSString *url;
|
||||
id client;
|
||||
|
@ -583,4 +630,6 @@ static int attachmentFlagSize = 8096;
|
|||
return [self redirectToLocation:url];
|
||||
}
|
||||
|
||||
@end /* UIxMailListView */
|
||||
@end
|
||||
|
||||
/* UIxMailListView */
|
||||
|
|
|
@ -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 */
|
|
@ -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
|
|
@ -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 */
|
|
@ -19,31 +19,11 @@
|
|||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <SOGoUI/UIxComponent.h>
|
||||
#include "../Common/UIxPageFrame.h"
|
||||
#import <SOGoUI/UIxComponent.h>
|
||||
#import "UIxMailMainFrame.h"
|
||||
|
||||
@interface UIxMailMainFrame : UIxPageFrame
|
||||
{
|
||||
NSString *rootURL;
|
||||
NSString *userRootURL;
|
||||
struct {
|
||||
int hideFolderTree:1;
|
||||
int hideFrame:1; /* completely disables all the frame around the comp. */
|
||||
int reserved:30;
|
||||
} mmfFlags;
|
||||
}
|
||||
|
||||
- (NSString *)rootURL;
|
||||
- (NSString *)userRootURL;
|
||||
- (NSString *)calendarRootURL;
|
||||
|
||||
@end
|
||||
|
||||
@interface UIxMailPanelFrame : UIxMailMainFrame
|
||||
@end
|
||||
|
||||
#include "common.h"
|
||||
#include <NGObjWeb/SoComponent.h>
|
||||
#import "common.h"
|
||||
#import <NGObjWeb/SoComponent.h>
|
||||
|
||||
@implementation UIxMailMainFrame
|
||||
|
||||
|
@ -78,14 +58,7 @@ static NSString *treeRootClassName = nil;
|
|||
return self->mmfFlags.hideFolderTree ? YES : NO;
|
||||
}
|
||||
|
||||
- (void)setHideFrame:(BOOL)_flag {
|
||||
self->mmfFlags.hideFrame = _flag ? 1 : 0;
|
||||
}
|
||||
- (BOOL)hideFrame {
|
||||
return self->mmfFlags.hideFrame ? YES : NO;
|
||||
}
|
||||
|
||||
- (NSString *)pageFormURL {
|
||||
- (NSString *) pageFormURL {
|
||||
NSString *u;
|
||||
NSRange r;
|
||||
|
||||
|
@ -179,6 +152,7 @@ static NSString *treeRootClassName = nil;
|
|||
- (NSString *)calendarRootURL {
|
||||
return [[self userRootURL] stringByAppendingString:@"Calendar/"];
|
||||
}
|
||||
|
||||
- (NSString *)contactsRootURL {
|
||||
return [[self userRootURL] stringByAppendingString:@"Contacts/"];
|
||||
}
|
||||
|
@ -210,14 +184,3 @@ static NSString *treeRootClassName = nil;
|
|||
}
|
||||
|
||||
@end /* UIxMailMainFrame */
|
||||
|
||||
@implementation UIxMailPanelFrame
|
||||
|
||||
- (BOOL)hideFolderTree {
|
||||
return YES;
|
||||
}
|
||||
- (BOOL)showLinkBanner {
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end /* UIxMailPanelFrame */
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
- (void)setSortKey:(NSString *)_sortKey {
|
||||
ASSIGNCOPY(self->sortKey, _sortKey);
|
||||
}
|
||||
|
||||
- (NSString *)sortKey {
|
||||
return self->sortKey;
|
||||
}
|
||||
|
|
|
@ -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 */
|
|
@ -19,23 +19,16 @@
|
|||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <SOGoUI/UIxComponent.h>
|
||||
#import "common.h"
|
||||
|
||||
@interface UIxMailTree : UIxComponent
|
||||
{
|
||||
NSString *rootClassName;
|
||||
NSString *treeFolderAction;
|
||||
id rootNodes;
|
||||
id item;
|
||||
}
|
||||
@end
|
||||
#import <SoObjects/Mailer/SOGoMailBaseObject.h>
|
||||
#import <SoObjects/Mailer/SOGoMailAccount.h>
|
||||
#import <SoObjects/Mailer/SOGoMailFolder.h>
|
||||
#import <NGObjWeb/SoComponent.h>
|
||||
#import <NGObjWeb/SoObject+SoDAV.h>
|
||||
|
||||
#include "UIxMailTreeBlock.h"
|
||||
#include <SoObjects/Mailer/SOGoMailBaseObject.h>
|
||||
#include <SoObjects/Mailer/SOGoMailAccount.h>
|
||||
#include "common.h"
|
||||
#include <NGObjWeb/SoComponent.h>
|
||||
#include <NGObjWeb/SoObject+SoDAV.h>
|
||||
#import "UIxMailTree.h"
|
||||
#import "UIxMailTreeBlock.h"
|
||||
|
||||
/*
|
||||
Support special icons:
|
||||
|
@ -58,21 +51,34 @@
|
|||
|
||||
static BOOL debugBlocks = NO;
|
||||
|
||||
+ (void)initialize {
|
||||
+ (void)initialize
|
||||
{
|
||||
[UIxMailTreeBlock class]; // ensure that globals are initialized
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
- (id) init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
flattenedNodes = [NSMutableDictionary new];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[self->treeFolderAction release];
|
||||
[self->rootClassName release];
|
||||
[self->rootNodes release];
|
||||
[self->item release];
|
||||
[flattenedNodes release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/* icons */
|
||||
|
||||
- (NSString *)defaultIconName {
|
||||
- (NSString *) defaultIconName
|
||||
{
|
||||
return @"tbtv_leaf_corner_17x17.gif";
|
||||
}
|
||||
|
||||
|
@ -180,40 +186,48 @@ static BOOL debugBlocks = NO;
|
|||
return [_object isKindOfClass:NSClassFromString([self rootClassName])];
|
||||
}
|
||||
|
||||
- (NSString *)treeNavigationLinkForObject:(id)_object atDepth:(int)_depth {
|
||||
NSString *link;
|
||||
unsigned i;
|
||||
- (NSString *)treeNavigationLinkForObject:(id)_object
|
||||
atDepth:(int)_depth
|
||||
{
|
||||
NSMutableString *link;
|
||||
int i;
|
||||
|
||||
link = [[_object nameInContainer] stringByAppendingString:@"/"];
|
||||
link = [link stringByAppendingString:[self treeFolderAction]];
|
||||
|
||||
switch (_depth) {
|
||||
case 0: return link;
|
||||
case 1: return [@"../" stringByAppendingString:link];
|
||||
case 2: return [@"../../" stringByAppendingString:link];
|
||||
case 3: return [@"../../../" stringByAppendingString:link];
|
||||
}
|
||||
link = [NSMutableString new];
|
||||
[link autorelease];
|
||||
|
||||
for (i = 0; i < _depth; i++)
|
||||
link = [@"../" stringByAppendingString:link];
|
||||
[link appendString: @"../"];
|
||||
|
||||
[link appendFormat: @"%@/%@",
|
||||
[_object nameInContainer],
|
||||
[self treeFolderAction]];
|
||||
|
||||
return link;
|
||||
}
|
||||
|
||||
- (void)getTitle:(NSString **)_t andIcon:(NSString **)_icon
|
||||
forObject:(id)_object
|
||||
- (void) getTitle: (NSString **)_t
|
||||
folderType: (NSString **)_ft
|
||||
andIcon: (NSString **)_icon
|
||||
forObject: (id)_object
|
||||
{
|
||||
// TODO: need to refactor for reuse!
|
||||
NSString *ftype;
|
||||
unsigned len;
|
||||
|
||||
// if ([_object respondsToSelector: @selector (outlookFolderClass)])
|
||||
// ftype = [_object outlookFolderClass];
|
||||
// else
|
||||
ftype = [_object valueForKey:@"outlookFolderClass"];
|
||||
len = [ftype length];
|
||||
|
||||
*_ft = nil;
|
||||
|
||||
switch (len) {
|
||||
case 8:
|
||||
if ([ftype isEqualToString:@"IPF.Sent"]) {
|
||||
*_t = [self labelForKey:@"SentFolderName"];
|
||||
*_icon = @"tbtv_sent_17x17.gif";
|
||||
*_ft = @"sent";
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
@ -221,11 +235,13 @@ static BOOL debugBlocks = NO;
|
|||
if ([ftype isEqualToString:@"IPF.Inbox"]) {
|
||||
*_t = [self labelForKey:@"InboxFolderName"];
|
||||
*_icon = @"tbtv_inbox_17x17.gif";
|
||||
*_ft = @"inbox";
|
||||
return;
|
||||
}
|
||||
if ([ftype isEqualToString:@"IPF.Trash"]) {
|
||||
*_t = [self labelForKey:@"TrashFolderName"];
|
||||
*_icon = @"tbtv_trash_17x17.gif";
|
||||
*_ft = @"trash";
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
@ -233,11 +249,13 @@ static BOOL debugBlocks = NO;
|
|||
if ([ftype isEqualToString:@"IPF.Drafts"]) {
|
||||
*_t = [self labelForKey:@"DraftsFolderName"];
|
||||
*_icon = @"tbtv_drafts_17x17.gif";
|
||||
*_ft = @"drafts";
|
||||
return;
|
||||
}
|
||||
if ([ftype isEqualToString:@"IPF.Filter"]) {
|
||||
*_t = [self labelForKey:@"SieveFolderName"];
|
||||
*_icon = nil;
|
||||
*_ft = @"sieve";
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
@ -249,30 +267,28 @@ static BOOL debugBlocks = NO;
|
|||
if ([_object isKindOfClass:NSClassFromString(@"SOGoMailFolder")])
|
||||
*_icon = nil;
|
||||
else if ([_object isKindOfClass:NSClassFromString(@"SOGoMailAccount")]) {
|
||||
*_icon = @"tbtv_inbox_17x17.gif";
|
||||
*_icon = @"tbtv_account_17x17.gif";
|
||||
|
||||
*_ft = @"account";
|
||||
|
||||
/* title processing is somehow Agenor specific and should be done in UI */
|
||||
*_t = [[_object nameInContainer] titleForSOGoIMAP4String];
|
||||
}
|
||||
else if ([_object isKindOfClass:NSClassFromString(@"SOGoMailAccounts")])
|
||||
*_icon = @"tbtv_inbox_17x17.gif";
|
||||
*_icon = @"tbtv_account_17x17.gif";
|
||||
else if ([_object isKindOfClass:NSClassFromString(@"SOGoUserFolder")])
|
||||
*_icon = @"tbtv_inbox_17x17.gif";
|
||||
else {
|
||||
// TODO: use drafts icon for other SOGo folders
|
||||
*_icon = @"tbtv_drafts_17x17.gif";
|
||||
}
|
||||
|
||||
NSLog (@"title: '%@', ftype: '%@', class: '%@', icon: '%@'",
|
||||
*_t,
|
||||
ftype, NSStringFromClass([_object class]), *_icon);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
- (UIxMailTreeBlock *)treeNavigationBlockForLeafNode:(id)_o atDepth:(int)_d {
|
||||
- (UIxMailTreeBlock *) treeNavigationBlockForLeafNode: (id) _o
|
||||
atDepth: (int) _d
|
||||
{
|
||||
UIxMailTreeBlock *md;
|
||||
NSString *n, *i;
|
||||
NSString *n, *i, *ft;
|
||||
id blocks;
|
||||
|
||||
/*
|
||||
|
@ -283,13 +299,15 @@ static BOOL debugBlocks = NO;
|
|||
? UIxMailTreeHasChildrenMarker
|
||||
: nil;
|
||||
|
||||
[self getTitle:&n andIcon:&i forObject:_o];
|
||||
[self getTitle: &n folderType: &ft andIcon: &i forObject:_o];
|
||||
|
||||
md = [UIxMailTreeBlock blockWithName:nil
|
||||
title:n iconName:i
|
||||
link:[self treeNavigationLinkForObject:_o atDepth:_d]
|
||||
isPathNode:NO isActiveNode:NO
|
||||
childBlocks:blocks];
|
||||
md = [UIxMailTreeBlock blockWithName: nil
|
||||
title: n
|
||||
iconName: i
|
||||
link: [self treeNavigationLinkForObject:_o atDepth:_d]
|
||||
isPathNode:NO
|
||||
isActiveNode:NO
|
||||
childBlocks: blocks];
|
||||
return md;
|
||||
}
|
||||
|
||||
|
@ -301,7 +319,7 @@ static BOOL debugBlocks = NO;
|
|||
UIxMailTreeBlock *md;
|
||||
NSMutableArray *blocks;
|
||||
NSArray *folders;
|
||||
NSString *title, *icon;
|
||||
NSString *title, *icon, *ft;
|
||||
unsigned i, count;
|
||||
|
||||
if (debugBlocks) {
|
||||
|
@ -317,7 +335,7 @@ static BOOL debugBlocks = NO;
|
|||
for (i = 0; i < count; i++) {
|
||||
id block;
|
||||
|
||||
block = [self treeNavigationBlockForLeafNode:[folders objectAtIndex:i]
|
||||
block = [self treeNavigationBlockForLeafNode: [folders objectAtIndex:i]
|
||||
atDepth:0];
|
||||
if ([block isNotNull]) [blocks addObject:block];
|
||||
}
|
||||
|
@ -326,18 +344,63 @@ static BOOL debugBlocks = NO;
|
|||
|
||||
/* build block */
|
||||
|
||||
[self getTitle:&title andIcon:&icon forObject:_object];
|
||||
[self getTitle:&title folderType: &ft andIcon:&icon forObject:_object];
|
||||
|
||||
md = [UIxMailTreeBlock blockWithName:[_object nameInContainer]
|
||||
title:title iconName:icon
|
||||
link:[@"../" stringByAppendingString:
|
||||
md = [UIxMailTreeBlock blockWithName: [_object nameInContainer]
|
||||
title: title
|
||||
iconName: icon
|
||||
link: [@"../" stringByAppendingString:
|
||||
[_object nameInContainer]]
|
||||
isPathNode:YES isActiveNode:YES
|
||||
childBlocks:blocks];
|
||||
isPathNode: YES
|
||||
isActiveNode: YES
|
||||
childBlocks: blocks];
|
||||
return md;
|
||||
}
|
||||
|
||||
- (UIxMailTreeBlock *)treeNavigationBlockForActiveNode:(id)_object {
|
||||
- (UIxMailTreeBlock *) fullTreeNavigationBlockForNode: (id)_object
|
||||
{
|
||||
UIxMailTreeBlock *md;
|
||||
NSMutableArray *blocks;
|
||||
NSArray *folders;
|
||||
NSString *title, *icon, *ft;
|
||||
unsigned i, count;
|
||||
|
||||
if (debugBlocks)
|
||||
[self logWithFormat:@"block for root node 0x%08X<%@>",
|
||||
_object, NSStringFromClass([_object class])];
|
||||
|
||||
folders = [self fetchSubfoldersOfObject: _object];
|
||||
count = [folders count];
|
||||
blocks = [NSMutableArray arrayWithCapacity: count];
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
id block;
|
||||
|
||||
block = [self fullTreeNavigationBlockForNode: [folders objectAtIndex:i]];
|
||||
if ([block isNotNull]) [blocks addObject:block];
|
||||
}
|
||||
|
||||
if (![blocks count])
|
||||
blocks = nil;
|
||||
|
||||
[self getTitle: &title folderType: &ft andIcon: &icon forObject: _object];
|
||||
// NSLog (@"*********** title = '%@'/icon = '%@'", title, icon);
|
||||
|
||||
md = [UIxMailTreeBlock blockWithName: [_object nameInContainer]
|
||||
title: title
|
||||
iconName: icon
|
||||
link: [@"../" stringByAppendingString:
|
||||
[_object nameInContainer]]
|
||||
isPathNode: YES
|
||||
isActiveNode: YES
|
||||
childBlocks: blocks];
|
||||
[md setFolderType: ft];
|
||||
|
||||
return md;
|
||||
}
|
||||
|
||||
- (UIxMailTreeBlock *) treeNavigationBlockForActiveNode: (id) _object
|
||||
{
|
||||
/*
|
||||
This generates the block for the clientObject (the object which has the
|
||||
focus)
|
||||
|
@ -345,7 +408,7 @@ static BOOL debugBlocks = NO;
|
|||
UIxMailTreeBlock *md;
|
||||
NSMutableArray *blocks;
|
||||
NSArray *folders;
|
||||
NSString *title, *icon;
|
||||
NSString *title, *icon, *ft;
|
||||
unsigned i, count;
|
||||
|
||||
// TODO: maybe we can join the two implementations, this might not be
|
||||
|
@ -367,26 +430,29 @@ static BOOL debugBlocks = NO;
|
|||
for (i = 0; i < count; i++) {
|
||||
UIxMailTreeBlock *block;
|
||||
|
||||
block = [self treeNavigationBlockForLeafNode:[folders objectAtIndex:i]
|
||||
atDepth:0];
|
||||
block = [self treeNavigationBlockForLeafNode: [folders objectAtIndex:i]
|
||||
atDepth: 0];
|
||||
if ([block isNotNull]) [blocks addObject:block];
|
||||
}
|
||||
if ([blocks count] == 0) blocks = nil;
|
||||
|
||||
/* build block */
|
||||
|
||||
[self getTitle:&title andIcon:&icon forObject:_object];
|
||||
md = [UIxMailTreeBlock blockWithName:[_object nameInContainer]
|
||||
title:title iconName:icon
|
||||
link:@"."
|
||||
isPathNode:YES isActiveNode:YES
|
||||
childBlocks:blocks];
|
||||
[self getTitle:&title folderType: &ft andIcon:&icon forObject:_object];
|
||||
md = [UIxMailTreeBlock blockWithName: [_object nameInContainer]
|
||||
title: title
|
||||
iconName: icon
|
||||
link: @"."
|
||||
isPathNode: YES
|
||||
isActiveNode: YES
|
||||
childBlocks: blocks];
|
||||
return md;
|
||||
}
|
||||
|
||||
- (UIxMailTreeBlock *)treeNavigationBlockForObject:(id)_object
|
||||
withActiveChildBlock:(UIxMailTreeBlock *)_activeChildBlock
|
||||
depth:(int)_depth
|
||||
- (UIxMailTreeBlock *)
|
||||
treeNavigationBlockForObject: (id) _object
|
||||
withActiveChildBlock: (UIxMailTreeBlock *) _activeChildBlock
|
||||
depth: (int) _depth
|
||||
{
|
||||
/*
|
||||
Note: 'activeChildBlock' here doesn't mean that the block is the selected
|
||||
|
@ -397,7 +463,7 @@ static BOOL debugBlocks = NO;
|
|||
NSMutableArray *blocks;
|
||||
NSString *activeName;
|
||||
NSArray *folders;
|
||||
NSString *title, *icon;
|
||||
NSString *title, *icon, *ft;
|
||||
unsigned i, count;
|
||||
|
||||
activeName = [_activeChildBlock valueForKey:@"name"];
|
||||
|
@ -411,11 +477,11 @@ static BOOL debugBlocks = NO;
|
|||
UIxMailTreeBlock *block;
|
||||
id folder;
|
||||
|
||||
NSLog(@"activeName: %@", activeName);
|
||||
folder = [folders objectAtIndex:i];
|
||||
block = [activeName isEqualToString:[folder nameInContainer]]
|
||||
? _activeChildBlock
|
||||
: [self treeNavigationBlockForLeafNode:folder atDepth:_depth];
|
||||
: [self treeNavigationBlockForLeafNode: folder
|
||||
atDepth:_depth];
|
||||
|
||||
if ([block isNotNull]) [blocks addObject:block];
|
||||
}
|
||||
|
@ -428,12 +494,14 @@ static BOOL debugBlocks = NO;
|
|||
|
||||
/* build block */
|
||||
|
||||
[self getTitle:&title andIcon:&icon forObject:_object];
|
||||
resultBlock = [UIxMailTreeBlock blockWithName:[_object nameInContainer]
|
||||
title:title iconName:icon
|
||||
[self getTitle:&title folderType: &ft andIcon:&icon forObject:_object];
|
||||
resultBlock
|
||||
= [UIxMailTreeBlock blockWithName: [_object nameInContainer]
|
||||
title: title
|
||||
iconName: icon
|
||||
link:
|
||||
[self treeNavigationLinkForObject:_object
|
||||
atDepth:(_depth + 1)]
|
||||
[self treeNavigationLinkForObject: _object
|
||||
atDepth: (_depth + 1)]
|
||||
isPathNode:YES isActiveNode:NO
|
||||
childBlocks:blocks];
|
||||
|
||||
|
@ -478,7 +546,7 @@ static BOOL debugBlocks = NO;
|
|||
if (debugBlocks) [self logWithFormat:@"ACTIVE parent block ..."];
|
||||
block = [self treeNavigationBlockForObject:[_object container]
|
||||
withActiveChildBlock:block
|
||||
depth:1];
|
||||
depth: 1];
|
||||
if (debugBlocks) [self logWithFormat:@"done: %@", block];
|
||||
return block;
|
||||
}
|
||||
|
@ -501,6 +569,78 @@ static BOOL debugBlocks = NO;
|
|||
return self->rootNodes;
|
||||
}
|
||||
|
||||
- (int) addNodes: (NSArray *) nodes
|
||||
atSerial: (int) startSerial
|
||||
forParent: (int) parent
|
||||
withRootName: (NSString *) rootName
|
||||
toArray: (NSMutableArray *) array
|
||||
{
|
||||
unsigned int count, max, currentSerial;
|
||||
UIxMailTreeBlock *curNode;
|
||||
NSArray *children;
|
||||
NSString *fullName;
|
||||
|
||||
max = [nodes count];
|
||||
currentSerial = startSerial;
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
curNode = [nodes objectAtIndex: count];
|
||||
fullName = [rootName stringByAppendingFormat: @"/%@", [curNode name]];
|
||||
[curNode setName: fullName];
|
||||
[curNode setSerial: currentSerial];
|
||||
[curNode setParent: parent];
|
||||
[array addObject: curNode];
|
||||
if ([curNode hasChildren])
|
||||
currentSerial = [self addNodes: [curNode children]
|
||||
atSerial: currentSerial + 1
|
||||
forParent: currentSerial
|
||||
withRootName: fullName
|
||||
toArray: array];
|
||||
else
|
||||
currentSerial++;
|
||||
}
|
||||
|
||||
return currentSerial;
|
||||
}
|
||||
|
||||
- (NSArray *) flattenedNodes
|
||||
{
|
||||
NSMutableArray *flattenedBlocks = nil;
|
||||
NSString *userKey;
|
||||
UIxMailTreeBlock *rootNode; // , *curNode;
|
||||
id mailAccounts;
|
||||
// unsigned int count, max;
|
||||
|
||||
userKey = [[self user] login];
|
||||
flattenedBlocks = [flattenedNodes objectForKey: userKey];
|
||||
if (!flattenedBlocks)
|
||||
{
|
||||
flattenedBlocks = [NSMutableArray new];
|
||||
|
||||
if (![[self clientObject] isKindOfClass: NSClassFromString(@"SOGoMailAccounts")])
|
||||
mailAccounts = [[self clientObject] mailAccountsFolder];
|
||||
else
|
||||
mailAccounts = [self clientObject];
|
||||
|
||||
rootNode = [self fullTreeNavigationBlockForNode: mailAccounts];
|
||||
[self addNodes: [rootNode children]
|
||||
atSerial: 1
|
||||
forParent: 0
|
||||
withRootName: @""
|
||||
toArray: flattenedBlocks];
|
||||
|
||||
[flattenedNodes setObject: flattenedBlocks forKey: userKey];
|
||||
// max = [flattenedBlocks count];
|
||||
// for (count = 0; count < max; count++)
|
||||
// {
|
||||
// curNode = [flattenedBlocks objectAtIndex: count];
|
||||
// NSLog (@"%d: %@/%@", count, [curNode title], [curNode iconName]);
|
||||
// }
|
||||
}
|
||||
|
||||
return flattenedBlocks;
|
||||
}
|
||||
|
||||
/* notifications */
|
||||
|
||||
- (void)sleep {
|
||||
|
|
|
@ -41,6 +41,9 @@ extern id UIxMailTreeHasChildrenMarker;
|
|||
NSString *link;
|
||||
NSArray *blocks;
|
||||
NSString *iconName;
|
||||
NSString *folderType;
|
||||
int serial;
|
||||
int parent;
|
||||
struct {
|
||||
int isPath:1;
|
||||
int isActive:1;
|
||||
|
@ -48,19 +51,48 @@ extern id UIxMailTreeHasChildrenMarker;
|
|||
} flags;
|
||||
}
|
||||
|
||||
+ (id)blockWithName:(NSString *)_n title:(NSString *)_t iconName:(NSString *)_i
|
||||
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive
|
||||
childBlocks:(NSArray *)_blocks;
|
||||
+ (id) blockWithName: (NSString *)_n
|
||||
title: (NSString *)_t
|
||||
iconName: (NSString *)_i
|
||||
link: (NSString *)_link
|
||||
isPathNode: (BOOL)_isPath
|
||||
isActiveNode: (BOOL)_isActive
|
||||
childBlocks: (NSArray *)_blocks;
|
||||
|
||||
- (id)initWithName:(NSString *)_n title:(NSString *)_t iconName:(NSString *)_i
|
||||
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive
|
||||
childBlocks:(NSArray *)_blocks;
|
||||
- (id)initWithName: (NSString *)_n
|
||||
title: (NSString *)_t
|
||||
iconName: (NSString *)_i
|
||||
link: (NSString *)_link
|
||||
isPathNode: (BOOL)_isPath
|
||||
isActiveNode: (BOOL)_isActive
|
||||
childBlocks: (NSArray *)_blocks;
|
||||
|
||||
/* accessors */
|
||||
|
||||
- (BOOL)hasChildren;
|
||||
- (BOOL)areChildrenLoaded;
|
||||
- (NSArray *)children;
|
||||
- (BOOL) hasChildren;
|
||||
- (BOOL) areChildrenLoaded;
|
||||
- (NSArray *) children;
|
||||
|
||||
- (void) setName: (NSString *) newName;
|
||||
- (NSString *) name;
|
||||
|
||||
- (void) setSerial: (int) newSerial;
|
||||
- (int) serial;
|
||||
|
||||
- (void) setParent: (int) newParent;
|
||||
- (int) parent;
|
||||
|
||||
- (void) setFolderType: (NSString *) newFolderType;
|
||||
- (NSString *) folderType;
|
||||
|
||||
- (NSString *) serialAsString;
|
||||
- (NSString *) parentAsString;
|
||||
|
||||
- (NSString *) title;
|
||||
- (NSString *) link;
|
||||
- (NSString *) iconName;
|
||||
|
||||
- (NSString *) folderMenuId;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -19,40 +19,51 @@
|
|||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "UIxMailTreeBlock.h"
|
||||
#include "common.h"
|
||||
#import "UIxMailTreeBlock.h"
|
||||
#import "common.h"
|
||||
|
||||
@implementation UIxMailTreeBlock
|
||||
|
||||
id UIxMailTreeHasChildrenMarker = nil;
|
||||
|
||||
+ (void)initialize {
|
||||
+ (void) initialize
|
||||
{
|
||||
// TODO: needs to be an array because the WETreeView requires a
|
||||
// children array
|
||||
UIxMailTreeHasChildrenMarker =
|
||||
[[NSArray alloc] initWithObjects:@"FAKE", nil];
|
||||
}
|
||||
|
||||
+ (id)blockWithName:(NSString *)_name title:(NSString *)_title
|
||||
iconName:(NSString *)_icon
|
||||
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive
|
||||
childBlocks:(NSArray *)_blocks
|
||||
+ (id) blockWithName: (NSString *) _name
|
||||
title: (NSString *) _title
|
||||
iconName: (NSString *) _icon
|
||||
link: (NSString *) _link
|
||||
isPathNode: (BOOL) _isPath
|
||||
isActiveNode: (BOOL) _isActive
|
||||
childBlocks: (NSArray *) _blocks
|
||||
{
|
||||
UIxMailTreeBlock *block;
|
||||
|
||||
block = [[self alloc] initWithName:_name title:_title iconName:_icon
|
||||
block = [[self alloc] initWithName:_name
|
||||
title:_title
|
||||
iconName:_icon
|
||||
link:_link
|
||||
isPathNode:_isPath isActiveNode:_isActive
|
||||
isPathNode:_isPath
|
||||
isActiveNode:_isActive
|
||||
childBlocks:_blocks];
|
||||
return [block autorelease];
|
||||
}
|
||||
|
||||
- (id)initWithName:(NSString *)_name title:(NSString *)_title
|
||||
iconName:(NSString *)_icon
|
||||
link:(NSString *)_link isPathNode:(BOOL)_isPath isActiveNode:(BOOL)_isActive
|
||||
childBlocks:(NSArray *)_blocks
|
||||
- (id) initWithName: (NSString *) _name
|
||||
title: (NSString *) _title
|
||||
iconName: (NSString *) _icon
|
||||
link: (NSString *) _link
|
||||
isPathNode: (BOOL) _isPath
|
||||
isActiveNode: (BOOL) _isActive
|
||||
childBlocks: (NSArray *) _blocks
|
||||
{
|
||||
if ((self = [self init])) {
|
||||
if ((self = [self init]))
|
||||
{
|
||||
self->name = [_name copy];
|
||||
self->title = [_title copy];
|
||||
self->iconName = [_icon copy];
|
||||
|
@ -65,7 +76,8 @@ id UIxMailTreeHasChildrenMarker = nil;
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
- (void) dealloc
|
||||
{
|
||||
[self->iconName release];
|
||||
[self->blocks release];
|
||||
[self->name release];
|
||||
|
@ -76,30 +88,49 @@ id UIxMailTreeHasChildrenMarker = nil;
|
|||
|
||||
/* accessors */
|
||||
|
||||
- (NSString *)name {
|
||||
- (NSString *) name
|
||||
{
|
||||
return self->name;
|
||||
}
|
||||
- (NSString *)title {
|
||||
|
||||
- (void) setName: (NSString *) newName
|
||||
{
|
||||
if (name)
|
||||
[name release];
|
||||
name = [newName copy];
|
||||
if (name)
|
||||
[name retain];
|
||||
}
|
||||
|
||||
- (NSString *) title
|
||||
{
|
||||
return self->title;
|
||||
}
|
||||
- (NSString *)link {
|
||||
|
||||
- (NSString *) link
|
||||
{
|
||||
return self->link;
|
||||
}
|
||||
- (NSString *)iconName {
|
||||
|
||||
- (NSString *) iconName
|
||||
{
|
||||
return self->iconName;
|
||||
}
|
||||
|
||||
- (BOOL)hasChildren {
|
||||
- (BOOL) hasChildren
|
||||
{
|
||||
if (self->blocks == UIxMailTreeHasChildrenMarker)
|
||||
return YES;
|
||||
return [self->blocks count] > 0 ? YES : NO;
|
||||
}
|
||||
|
||||
- (BOOL)areChildrenLoaded {
|
||||
- (BOOL) areChildrenLoaded
|
||||
{
|
||||
return self->blocks != UIxMailTreeHasChildrenMarker ? YES : NO;
|
||||
}
|
||||
|
||||
- (NSArray *)children {
|
||||
- (NSArray *) children
|
||||
{
|
||||
if (self->blocks == UIxMailTreeHasChildrenMarker)
|
||||
// TODO: print a warning
|
||||
return self->blocks;
|
||||
|
@ -107,16 +138,20 @@ id UIxMailTreeHasChildrenMarker = nil;
|
|||
return self->blocks;
|
||||
}
|
||||
|
||||
- (BOOL)isPathNode {
|
||||
- (BOOL) isPathNode
|
||||
{
|
||||
return self->flags.isPath ? YES : NO;
|
||||
}
|
||||
- (BOOL)isActiveNode {
|
||||
|
||||
- (BOOL) isActiveNode
|
||||
{
|
||||
return self->flags.isActive ? YES : NO;
|
||||
}
|
||||
|
||||
/* description */
|
||||
|
||||
- (void)appendAttributesToDescription:(NSMutableString *)_ms {
|
||||
- (void) appendAttributesToDescription: (NSMutableString *) _ms
|
||||
{
|
||||
if (self->name != nil) [_ms appendFormat:@" name='%@'", self->name];
|
||||
if (self->title != nil) [_ms appendFormat:@" title='%@'", self->title];
|
||||
|
||||
|
@ -129,7 +164,8 @@ id UIxMailTreeHasChildrenMarker = nil;
|
|||
[_ms appendFormat:@" children=%@", self->blocks];
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
- (NSString *) description
|
||||
{
|
||||
NSMutableString *ms;
|
||||
|
||||
ms = [NSMutableString stringWithCapacity:64];
|
||||
|
@ -139,4 +175,49 @@ id UIxMailTreeHasChildrenMarker = nil;
|
|||
return ms;
|
||||
}
|
||||
|
||||
- (void) setSerial: (int) newSerial
|
||||
{
|
||||
serial = newSerial;
|
||||
}
|
||||
|
||||
- (int) serial
|
||||
{
|
||||
return serial;
|
||||
}
|
||||
|
||||
- (NSString *) serialAsString
|
||||
{
|
||||
return [NSString stringWithFormat: @"%d", serial];
|
||||
}
|
||||
|
||||
- (void) setParent: (int) newParent
|
||||
{
|
||||
parent = newParent;
|
||||
}
|
||||
|
||||
- (int) parent
|
||||
{
|
||||
return parent;
|
||||
}
|
||||
|
||||
- (void) setFolderType: (NSString *) newFolderType
|
||||
{
|
||||
folderType = newFolderType;
|
||||
}
|
||||
|
||||
- (NSString *) folderType
|
||||
{
|
||||
return folderType;
|
||||
}
|
||||
|
||||
- (NSString *) parentAsString
|
||||
{
|
||||
return [NSString stringWithFormat: @"%d", parent];
|
||||
}
|
||||
|
||||
- (NSString *) folderMenuId
|
||||
{
|
||||
return [NSString stringWithFormat: @"__wox_submenu_%d-%d", parent, serial];
|
||||
}
|
||||
|
||||
@end /* UIxMailTreeBlock */
|
||||
|
|
|
@ -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 */
|
|
@ -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
|
|
@ -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 */
|
||||
}
|
|
@ -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 */
|
|
@ -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
|
|
@ -81,7 +81,7 @@
|
|||
slots = {
|
||||
toolbar = {
|
||||
protectedBy = "View";
|
||||
value = "SOGoMailFolder.toolbar";
|
||||
value = "SOGoMailObject.toolbar";
|
||||
};
|
||||
};
|
||||
methods = {
|
||||
|
@ -89,6 +89,10 @@
|
|||
protectedBy = "View";
|
||||
pageName = "UIxMailListView";
|
||||
};
|
||||
ajax = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailAjaxRequest";
|
||||
};
|
||||
index = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailListView";
|
||||
|
@ -97,7 +101,6 @@
|
|||
protectedBy = "View";
|
||||
pageName = "UIxMailListView";
|
||||
};
|
||||
|
||||
markMessageUnread = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailListView";
|
||||
|
@ -148,7 +151,7 @@
|
|||
slots = {
|
||||
toolbar = {
|
||||
protectedBy = "View";
|
||||
value = "SOGoTrashFolder.toolbar";
|
||||
value = "SOGoMailObject.toolbar";
|
||||
};
|
||||
};
|
||||
methods = {
|
||||
|
@ -170,28 +173,28 @@
|
|||
methods = {
|
||||
view = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailView";
|
||||
pageName = "UIxMailViewContainer";
|
||||
};
|
||||
|
||||
getMail = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailView";
|
||||
pageName = "UIxMailViewContainer";
|
||||
actionName = "getMail";
|
||||
};
|
||||
|
||||
delete = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailView";
|
||||
pageName = "UIxMailViewContainer";
|
||||
actionName = "delete";
|
||||
};
|
||||
trash = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailView";
|
||||
pageName = "UIxMailViewContainer";
|
||||
actionName = "trash";
|
||||
};
|
||||
junk = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailView";
|
||||
pageName = "UIxMailViewContainer";
|
||||
actionName = "junk";
|
||||
};
|
||||
edit = {
|
||||
|
@ -225,13 +228,7 @@
|
|||
slots = {
|
||||
toolbar = {
|
||||
protectedBy = "View";
|
||||
value = ( /* the toolbar groups */
|
||||
( /* first group */
|
||||
{ link = "getMail";
|
||||
image = "tb-mail-getmail-flat-24x24.png";
|
||||
cssClass = "tbicon_getmail"; label = "Get Mail"; },
|
||||
)
|
||||
);
|
||||
value = "SOGoMailObject.toolbar";
|
||||
};
|
||||
};
|
||||
methods = {
|
||||
|
@ -250,7 +247,7 @@
|
|||
slots = {
|
||||
toolbar = {
|
||||
protectedBy = "View";
|
||||
value = "SOGoMailAccount.toolbar";
|
||||
value = "SOGoMailObject.toolbar";
|
||||
};
|
||||
};
|
||||
methods = {
|
||||
|
|
|
@ -66,6 +66,8 @@
|
|||
- (NSString *)dateStringForDate:(NSCalendarDate *)_date;
|
||||
- (NSCalendarDate *)dateForDateString:(NSString *)_dateString;
|
||||
|
||||
- (BOOL) hideFrame;
|
||||
|
||||
/* SoUser */
|
||||
- (SoUser *)user;
|
||||
- (NSString *)shortUserNameForDisplay;
|
||||
|
@ -84,6 +86,10 @@
|
|||
/* locale */
|
||||
- (NSDictionary *)locale;
|
||||
|
||||
/* cached resource filenames */
|
||||
- (WOResourceManager *) pageResourceManager;
|
||||
- (NSString *) urlForResourceFilename: (NSString *) filename;
|
||||
|
||||
/* Debugging */
|
||||
- (BOOL)isUIxDebugEnabled;
|
||||
|
||||
|
|
|
@ -19,10 +19,12 @@
|
|||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "UIxComponent.h"
|
||||
#include "SOGoJSStringFormatter.h"
|
||||
#include "common.h"
|
||||
#include <NGObjWeb/SoHTTPAuthenticator.h>
|
||||
#import "UIxComponent.h"
|
||||
#import "SOGoJSStringFormatter.h"
|
||||
#import "NSString+URL.h"
|
||||
#import "common.h"
|
||||
#import <NGObjWeb/SoHTTPAuthenticator.h>
|
||||
#import <NGObjWeb/WOResourceManager.h>
|
||||
|
||||
@interface UIxComponent (PrivateAPI)
|
||||
- (void)_parseQueryString:(NSString *)_s;
|
||||
|
@ -244,7 +246,8 @@ static BOOL uixDebugEnabled = NO;
|
|||
return [uri substringFromIndex:(r.location + 1)];
|
||||
}
|
||||
|
||||
- (NSString *)userFolderPath {
|
||||
- (NSString *) _urlForTraversalObject: (int) traversal
|
||||
{
|
||||
WOContext *ctx;
|
||||
NSArray *traversalObjects;
|
||||
NSString *url;
|
||||
|
@ -252,13 +255,34 @@ static BOOL uixDebugEnabled = NO;
|
|||
|
||||
ctx = [self context];
|
||||
traversalObjects = [ctx objectTraversalStack];
|
||||
url = [[traversalObjects objectAtIndex:0]
|
||||
url = [[traversalObjects objectAtIndex: traversal]
|
||||
baseURLInContext:ctx];
|
||||
path = [[NSURL URLWithString:url] path];
|
||||
path = [path stringByAppendingPathComponent:[[ctx activeUser] login]];
|
||||
// path = [path stringByAppendingPathComponent:[[ctx activeUser] login]];
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
- (NSString *) userFolderPath
|
||||
{
|
||||
return [self _urlForTraversalObject: 1];
|
||||
}
|
||||
|
||||
- (NSString *) applicationPath
|
||||
{
|
||||
return [self _urlForTraversalObject: 2];
|
||||
}
|
||||
|
||||
- (NSString *) resourcesPath
|
||||
{
|
||||
WOResourceManager *rm;
|
||||
|
||||
if ((rm = [self resourceManager]) == nil)
|
||||
rm = [[WOApplication application] resourceManager];
|
||||
|
||||
return [rm webServerResourcesPath];
|
||||
}
|
||||
|
||||
- (NSString *)ownPath {
|
||||
NSString *uri;
|
||||
NSRange r;
|
||||
|
@ -325,6 +349,10 @@ static BOOL uixDebugEnabled = NO;
|
|||
calendarFormat:@"%Y%m%d"];
|
||||
}
|
||||
|
||||
- (BOOL) hideFrame
|
||||
{
|
||||
return ([[self queryParameterForKey: @"noframe"] boolValue]);
|
||||
}
|
||||
|
||||
/* SoUser */
|
||||
|
||||
|
@ -410,9 +438,6 @@ static BOOL uixDebugEnabled = NO;
|
|||
label = [rm stringForKey:lKey inTableNamed:lTable withDefaultValue:lVal
|
||||
languages:languages];
|
||||
|
||||
NSLog (@"string '%s' = '%s' (default: '%s')",
|
||||
[lKey cString], [label cString], [lVal cString]);
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
|
@ -455,6 +480,50 @@ static BOOL uixDebugEnabled = NO;
|
|||
return [[self context] valueForKey:@"locale"];
|
||||
}
|
||||
|
||||
- (WOResourceManager *) pageResourceManager
|
||||
{
|
||||
WOResourceManager *rm;
|
||||
|
||||
if ((rm = [[[self context] page] resourceManager]) == nil)
|
||||
rm = [[WOApplication application] resourceManager];
|
||||
|
||||
return rm;
|
||||
}
|
||||
|
||||
- (NSString *) urlForResourceFilename: (NSString *) filename
|
||||
{
|
||||
static NSMutableDictionary *pageToURL = nil;
|
||||
NSString *url;
|
||||
WOComponent *page;
|
||||
WOResourceManager *rm;
|
||||
NSBundle *pageBundle;
|
||||
|
||||
if (!pageToURL)
|
||||
pageToURL = [[NSMutableDictionary alloc] initWithCapacity: 32];
|
||||
|
||||
url = [pageToURL objectForKey: filename];
|
||||
if (!url)
|
||||
{
|
||||
rm = [self pageResourceManager];
|
||||
page = [[self context] page];
|
||||
pageBundle = [NSBundle bundleForClass: [page class]];
|
||||
url = [rm urlForResourceNamed: filename
|
||||
inFramework: [pageBundle bundlePath]
|
||||
languages: nil
|
||||
request: [[self context] request]];
|
||||
if (!url)
|
||||
url = @"";
|
||||
else
|
||||
if ([url hasPrefix: @"http"])
|
||||
url = [url hostlessURL];
|
||||
[pageToURL setObject: url forKey: filename];
|
||||
}
|
||||
|
||||
// NSLog (@"url for '%@': '%@'", filename, url);
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
/* debugging */
|
||||
|
||||
- (BOOL)isUIxDebugEnabled {
|
||||
|
|
|
@ -1080,8 +1080,4 @@
|
|||
return [self redirectToLocation:[self _completeURIForMethod:@"../view"]];
|
||||
}
|
||||
|
||||
- (BOOL) isPopup {
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end /* UIxAppointmentEditor */
|
||||
|
|
|
@ -6,18 +6,18 @@
|
|||
xmlns:uix="OGo:uix"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label"
|
||||
className="UIxMailMainFrame"
|
||||
title="panelTitle"
|
||||
className="UIxMailAccountViewContainer"
|
||||
title="title"
|
||||
>
|
||||
<div class="mailAccount">
|
||||
<div style="padding: 1em;" oncontextmenu="return false;">
|
||||
<h2>
|
||||
SOGo Mail -
|
||||
SOGo Mail - <var:string value="objectTitle" />
|
||||
|
||||
<var:if condition="clientObject.isSharedAccount">
|
||||
<var:string label:value="Shared Account: " />
|
||||
</var:if>
|
||||
|
||||
<!-- <div class="titlediv">
|
||||
<!-- <div class="titlediv">
|
||||
<var:if condition="clientObject.isSharedAccount">
|
||||
<var:string label:value="Share: " />
|
||||
</var:if>
|
||||
|
@ -26,9 +26,7 @@
|
|||
</var:if>
|
||||
<var:string value="objectTitle"/>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<var:string value="objectTitle"/>
|
||||
-->
|
||||
</h2>
|
||||
<var:if condition="clientObject.isSharedAccount">
|
||||
<div>
|
||||
|
@ -39,7 +37,7 @@
|
|||
|
||||
<h3>Email</h3>
|
||||
<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 />
|
||||
</p>
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -7,22 +7,24 @@
|
|||
xmlns:label="OGo:label"
|
||||
xmlns:rsrc="OGo:url"
|
||||
className="UIxMailMainFrame"
|
||||
title="panelTitle"
|
||||
title="name"
|
||||
>
|
||||
<div class="titlediv">
|
||||
<var:string value="clientObject.davDisplayName" />
|
||||
<div id="mailboxContent" style="visibility: hidden;">
|
||||
</div>
|
||||
|
||||
<div class="embedwhite_out">
|
||||
<div class="embedwhite_in" style="height: 300px">
|
||||
<div style="padding: 8px;">
|
||||
<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>
|
||||
<!--
|
||||
<h3>SOGo Mail - Available Accounts</h3>
|
||||
|
||||
<a rsrc:href="tbird_073_accountview.png">screenshot</a>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</var:component>
|
||||
</var:component>
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
<?xml version='1.0' standalone='yes'?>
|
||||
<var:component xmlns="http://www.w3.org/1999/xhtml"
|
||||
<var:component
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:uix="OGo:uix"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label"
|
||||
className="UIxMailPanelFrame"
|
||||
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_internetmarker">
|
||||
|
@ -16,11 +17,11 @@
|
|||
label:value="This mail is being sent from an unsecure network!" />
|
||||
</div>
|
||||
</var:if>
|
||||
<table border="0" width="100%" id="compose_table">
|
||||
<table id="compose_table">
|
||||
<tr>
|
||||
<td id="compose_leftside" var:style="initialLeftsideStyle">
|
||||
<div id="compose_fromline">
|
||||
<table border="0" width="100%">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="compose_label" width="20%">
|
||||
<var:string label:value="From" />:
|
||||
|
@ -44,7 +45,7 @@
|
|||
</div>
|
||||
<!-- moved below to selection to make it look better -->
|
||||
<div id="compose_subject">
|
||||
<table border="0" width="100%">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="compose_label" width="20%">
|
||||
<var:string label:value="Subject" />:
|
||||
|
@ -85,4 +86,4 @@
|
|||
|
||||
<!-- img rsrc:src="tbird_073_compose.png" alt="screenshot" / -->
|
||||
</div>
|
||||
</var:component>
|
||||
</var:component>
|
||||
|
|
|
@ -4,42 +4,40 @@
|
|||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
>
|
||||
|
||||
<div class="menu" id="searchMenu">
|
||||
<ul id="searchOptions">
|
||||
<li id="subject"
|
||||
onmousedown="return false;"
|
||||
onclick="setSearchCriteria(event);"><var:string label:value="Subject"/></li>
|
||||
onmouseup="setSearchCriteria(event);"><var:string label:value="Subject"/></li>
|
||||
<li id="sender"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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>
|
||||
</div>
|
||||
|
||||
<var:if condition="hideFrame" const:negate="YES">
|
||||
<span class="searchBox" style="float: right">
|
||||
<div id="filterPanel">
|
||||
<var:if condition="hideFrame" const:negate="YES"
|
||||
><span class="searchBox" style="float: right">
|
||||
<input id="searchCriteria" name="criteria" type="hidden" var:value="searchCriteria" />
|
||||
<input id="searchValue" onmousedown="onSearchMouseDown(event);" onclick="popupSearchMenu(event, 'searchMenu');" autocomplete="off" name="search" type="text" var:value="searchText" onchange="onSearchChange();" onblur="onSearchBlur();" onfocus="onSearchFocus(event);" />
|
||||
</span>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
initCriteria();
|
||||
document.pageform.search.focus();
|
||||
</script>
|
||||
</var:if>
|
||||
|
||||
<var:string label:value="View" />:
|
||||
<var:popup list="filters"
|
||||
|
@ -47,13 +45,6 @@
|
|||
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>
|
||||
</div>
|
||||
</container>
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -6,172 +6,68 @@
|
|||
xmlns:uix="OGo:uix"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label"
|
||||
className="UIxMailMainFrame"
|
||||
title="panelTitle"
|
||||
hideFrame="hideFrame"
|
||||
className="UIxMailListViewContainer"
|
||||
title="name"
|
||||
>
|
||||
<var:component className="UIxMailFilterPanel" qualifier="qualifier" />
|
||||
<var:string value="patate" />
|
||||
|
||||
<div class="menu" id="messageListMenu">
|
||||
<ul id="sourceList">
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
var:onclick="clickedMsgJS"><var:string label:value="Open Message In New Window"/></li>
|
||||
<li class="separator"></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Reply to Sender Only"/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Reply to All"/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Forward"/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Edit As New..."/></li>
|
||||
<li class="separator"></li>
|
||||
<li
|
||||
class="submenu"
|
||||
submenu="mailboxes-menu"
|
||||
onmouseover="dropDownSubmenu(event);"
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Move To"/></li>
|
||||
<li
|
||||
class="submenu"
|
||||
submenu="mailboxes-menu"
|
||||
onmouseover="dropDownSubmenu(event);"
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Copy To"/></li>
|
||||
<li
|
||||
class="submenu"
|
||||
submenu="label-menu"
|
||||
onmouseover="dropDownSubmenu(event);"
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Label"/></li>
|
||||
<li
|
||||
class="submenu"
|
||||
submenu="mark-menu"
|
||||
onmouseover="dropDownSubmenu(event);"
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Mark"/></li>
|
||||
<li class="separator"></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Save As..."/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Print Preview"/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Print..."/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onclick=""><var:string label:value="Delete Message"/></li>
|
||||
</ul>
|
||||
|
||||
<div class="menu" id="mailboxes-menu">
|
||||
<ul id="">
|
||||
<li onmousedown="return false;">really</li>
|
||||
<li onmousedown="return false;">is</li>
|
||||
<li onmousedown="return false;">a</li>
|
||||
<li onmousedown="return false;">dumb dummy!</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="menu" id="label-menu">
|
||||
<ul id="">
|
||||
<li onmousedown="return false;"><var:string label:value="None" /></li>
|
||||
<li class="separator"></li>
|
||||
<li onmousedown="return false;"><var:string label:value="Important" /></li>
|
||||
<li onmousedown="return false;"><var:string label:value="Work" /></li>
|
||||
<li onmousedown="return false;"><var:string label:value="Personal" /></li>
|
||||
<li onmousedown="return false;"><var:string label:value="To Do" /></li>
|
||||
<li onmousedown="return false;"><var:string label:value="Later" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="menu" id="mark-menu">
|
||||
<ul id="">
|
||||
<li onmousedown="return false;"><var:string label:value="As Read" /></li>
|
||||
<li onmousedown="return false;"><var:string label:value="Thread As Read" /></li>
|
||||
<li onmousedown="return false;"><var:string label:value="As Read By Date..." /></li>
|
||||
<li onmousedown="return false;"><var:string label:value="All Read" /></li>
|
||||
<li class="separator"></li>
|
||||
<li onmousedown="return false;"><var:string label:value="Flag" /></li>
|
||||
<li class="separator"></li>
|
||||
<li onmousedown="return false;"><var:string label:value="As Junk" /></li>
|
||||
<li onmousedown="return false;"><var:string label:value="As Not Junk" /></li>
|
||||
<li onmousedown="return false;"><var:string label:value="Run Junk Mail Controls" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mailboxContent" oncontextmenu="return false;">
|
||||
<var:component className="UIxMailFilterPanel" qualifier="qualifier"
|
||||
hideFrame="hideFrame" />
|
||||
|
||||
<table multiselect="yes" id="messageList" oncontextmenu="return false;">
|
||||
<table multiselect="yes" id="messageList"
|
||||
onselectionchange="onMessageSelectionChange();">
|
||||
<thead>
|
||||
<tr class="tableview">
|
||||
<td class="tbtv_headercell" width="17">
|
||||
<var:entity const:name="nbsp" />
|
||||
</td>
|
||||
<td class="tbtv_headercell" width="17">
|
||||
<img rsrc:src="title_attachment_14x14.png" width="14" height="14" />
|
||||
</td>
|
||||
<td class="tbtv_headercell" width="50%">
|
||||
<var:component className="UIxMailSortableTableHeader"
|
||||
<tr class="tableview"
|
||||
><td class="tbtv_headercell"
|
||||
><var:entity const:name="nbsp"
|
||||
/></td
|
||||
><td class="tbtv_headercell">
|
||||
<img rsrc:src="title_attachment_14x14.png" width="14"
|
||||
height="14"
|
||||
/></td
|
||||
><td class="tbtv_headercell tbtv_subject_headercell"
|
||||
><var:component className="UIxMailSortableTableHeader"
|
||||
label:label="Subject"
|
||||
const:sortKey="subject"
|
||||
const:href="view"
|
||||
var:queryDictionary="context.request.formValues"
|
||||
/>
|
||||
</td>
|
||||
<td class="tbtv_headercell">
|
||||
<var:if condition="showToAddress" const:negate="YES">
|
||||
<var:component className="UIxMailSortableTableHeader"
|
||||
/></td
|
||||
><td class="tbtv_headercell"
|
||||
><var:if condition="showToAddress" const:negate="YES"
|
||||
><var:component className="UIxMailSortableTableHeader"
|
||||
label:label="From"
|
||||
const:sortKey="from"
|
||||
const:href="view"
|
||||
var:queryDictionary="context.request.formValues"
|
||||
/>
|
||||
</var:if>
|
||||
<var:if condition="showToAddress">
|
||||
<var:component className="UIxMailSortableTableHeader"
|
||||
/></var:if
|
||||
><var:if condition="showToAddress"
|
||||
><var:component className="UIxMailSortableTableHeader"
|
||||
label:label="To"
|
||||
const:sortKey="to"
|
||||
const:href="view"
|
||||
var:queryDictionary="context.request.formValues"
|
||||
/>
|
||||
</var:if>
|
||||
</td>
|
||||
<td class="tbtv_headercell" width="17">
|
||||
<img rsrc:src="title_read_14x14.png" width="14" height="14" />
|
||||
</td>
|
||||
<td class="tbtv_headercell">
|
||||
<var:component className="UIxMailSortableTableHeader"
|
||||
/></var:if
|
||||
></td
|
||||
><td class="tbtv_headercell"
|
||||
><img rsrc:src="title_read_14x14.png" width="14" height="14"
|
||||
/></td
|
||||
><td class="tbtv_headercell"
|
||||
><var:component className="UIxMailSortableTableHeader"
|
||||
label:label="Date"
|
||||
const:sortKey="date"
|
||||
const:href="view"
|
||||
var:queryDictionary="context.request.formValues"
|
||||
const:isDefault="YES"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="tableview">
|
||||
<td colspan="6" class="tbtv_navcell" align="right">
|
||||
<var:if condition="showsAllMessages">
|
||||
<var:string value="sortedUIDs.count" />
|
||||
<var:string label:value="messages" />
|
||||
</var:if>
|
||||
|
||||
<var:if condition="showsAllMessages" const:negate="YES">
|
||||
<var:if condition="hasPrevious">
|
||||
<a href="view"
|
||||
_idx="1"
|
||||
var:queryDictionary="queryParameters"
|
||||
><var:string label:value="first"/></a> |
|
||||
<a href="view"
|
||||
var:_idx="prevFirstMessageNumber"
|
||||
var:queryDictionary="queryParameters"
|
||||
/></td
|
||||
></tr>
|
||||
<var:if condition="showsAllMessages" const:negate="YES"
|
||||
><tr class="tableview"
|
||||
><td colspan="6" class="tbtv_navcell" align="right"
|
||||
><var:if condition="hasPrevious">
|
||||
<a href="#"
|
||||
onclick="openMailboxAtIndex(this);"
|
||||
idx="1"><var:string label:value="first"/></a> |
|
||||
<a href="#"
|
||||
onclick="openMailboxAtIndex(this);"
|
||||
var:idx="prevFirstMessageNumber"
|
||||
><var:string label:value="previous"/></a> |
|
||||
</var:if>
|
||||
|
||||
|
@ -182,106 +78,102 @@
|
|||
<var:string value="sortedUIDs.count" />
|
||||
|
||||
<var:if condition="hasNext">
|
||||
| <a href="view"
|
||||
var:_idx="nextFirstMessageNumber"
|
||||
var:queryDictionary="queryParameters"
|
||||
| <a href="#"
|
||||
onclick="openMailboxAtIndex(this);"
|
||||
var:idx="nextFirstMessageNumber"
|
||||
><var:string label:value="next" /></a>
|
||||
</var:if>
|
||||
</var:if>
|
||||
</td>
|
||||
</tr>
|
||||
</td
|
||||
></tr
|
||||
></var:if>
|
||||
</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>
|
||||
<tbody>
|
||||
<var:foreach list="messages" item="message"
|
||||
><tr class="tableview" var:id="msgRowID"
|
||||
onclick="return onRowClick(event);"
|
||||
oncontextmenu="onMenuClick(event, 'messageListMenu'); onRowClick(event); return false;"
|
||||
><td onmousedown="return false;"
|
||||
></td
|
||||
><td onmousedown="return false;"
|
||||
><var:if condition="hasMessageAttachment"
|
||||
><img rsrc:src="title_attachment_14x14.png"
|
||||
/></var:if
|
||||
></td
|
||||
|
||||
<td
|
||||
><td
|
||||
onmousedown="return false;"
|
||||
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>
|
||||
var:id="msgDivID"
|
||||
><var:string value="message.envelope.subject"
|
||||
formatter="context.mailSubjectFormatter"
|
||||
/></td
|
||||
|
||||
<td var:class="messageCellStyleClass">
|
||||
<var:if condition="isMessageRead">
|
||||
<img rsrc:src="icon_read.gif"
|
||||
><td
|
||||
onmousedown="return false;"
|
||||
var:class="messageCellStyleClass"
|
||||
var:ondblclick="clickedMsgJS"
|
||||
><var:if condition="showToAddress" const:negate="YES"
|
||||
><var:string value="message.envelope.from"
|
||||
formatter="context.mailEnvelopeAddressFormatter"
|
||||
/></var:if
|
||||
><var:if condition="showToAddress"
|
||||
><var:string value="message.envelope.to"
|
||||
formatter="context.mailEnvelopeAddressFormatter"
|
||||
/></var:if
|
||||
></td
|
||||
|
||||
><td onmousedown="return false;"
|
||||
var:class="messageCellStyleClass"
|
||||
><var:if condition="isMessageRead"
|
||||
><img rsrc:src="icon_read.gif"
|
||||
class="mailerReadIcon"
|
||||
var:onclick="markUnreadJS"
|
||||
label:title="Mark Unread"
|
||||
var:id="msgIconReadImgID" />
|
||||
</var:if>
|
||||
<var:if condition="isMessageRead" const:negate="YES">
|
||||
<img rsrc:src="icon_unread.gif"
|
||||
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>
|
||||
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>
|
||||
><td onmousedown="return false;"
|
||||
var:class="messageCellStyleClass"
|
||||
var:ondblclick="clickedMsgJS"
|
||||
><span class="mailer_datefield"
|
||||
><var:string value="message.envelope.date"
|
||||
formatter="context.mailDateFormatter"
|
||||
/></span
|
||||
><entity name="nbsp"
|
||||
/></td
|
||||
></tr>
|
||||
</var:foreach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
registerDraggableMessageNodes();
|
||||
</script>
|
||||
<!--
|
||||
<tr class="tableview">
|
||||
<td colspan="6" class="tbtv_actcell">
|
||||
<!-- TODO: fix used tree, treeNavigationNodes is the _wrong_ choice
|
||||
<! 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
|
||||
>
|
||||
<! 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>
|
||||
|
|
|
@ -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>
|
|
@ -1,82 +1,319 @@
|
|||
<?xml version="1.0" standalone="yes"?>
|
||||
<container xmlns="http://www.w3.org/1999/xhtml"
|
||||
<var:component xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:uix="OGo:uix"
|
||||
xmlns:label="OGo:label"
|
||||
className="UIxPageFrame"
|
||||
title="title"
|
||||
popup="isPopup"
|
||||
>
|
||||
<var:if condition="hideFrame" const:negate="YES">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label"
|
||||
>
|
||||
<head>
|
||||
<title>
|
||||
<var:string value="title"/>
|
||||
</title>
|
||||
|
||||
<meta name="templatename" content="UIXMailMainFrame.wox"/>
|
||||
<meta name="description" content="SOGo Web Interface"/>
|
||||
<meta name="author" content="SKYRIX Software AG"/>
|
||||
<meta name="robots" content="stop"/>
|
||||
|
||||
<script rsrc:src="generic.js"> <!-- space required --></script>
|
||||
<script rsrc:src="mailer.js" > <!-- space required --></script>
|
||||
|
||||
<var:if condition="hasProductSpecificJavaScript">
|
||||
<script var:src="productJavaScriptURL"> <!-- space required --></script>
|
||||
</var:if>
|
||||
<var:if condition="hasPageSpecificJavaScript">
|
||||
<script var:src="pageJavaScriptURL"> <!-- space required --></script>
|
||||
</var:if>
|
||||
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="uix.css"/>
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="mailer.css"/>
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="mailer-toolbar.css"/>
|
||||
|
||||
<link href="mailto:info@skyrix.com" rev="made"/>
|
||||
</head>
|
||||
|
||||
<body oncontextmenu="return false;">
|
||||
<!--
|
||||
Note: the 'href' is required, otherwise an element-id will get created
|
||||
-->
|
||||
<var:if condition="showLinkBanner">
|
||||
<div class="linkbanner">
|
||||
<!-- span style="float: left" -->
|
||||
<a var:href="relativeHomePath"
|
||||
><var:string label:value="Home" /></a> |
|
||||
<a var:href="relativeCalendarPath"
|
||||
><var:string label:value="Calendar" /></a> |
|
||||
<a var:href="relativeContactsPath"
|
||||
><var:string label:value="Addressbook" /></a> |
|
||||
<a var:href="relativeMailPath"
|
||||
><var:string label:value="Mail" /></a> |
|
||||
<a var:href="logoffPath"
|
||||
><var:string label:value="Logoff" /></a> |
|
||||
<a href="http://to.be.done/"
|
||||
><var:string label:value="Right Administration" /></a>
|
||||
<div class="menu" id="accountIconMenu">
|
||||
<ul id="sourceList">
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Subscribe..." /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Get Messages for Account" /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="New Folder..." /></li>
|
||||
<li class="separator"></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Search Messages..." /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Properties..." /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</var:if>
|
||||
|
||||
<var:component className="UIxToolbar" />
|
||||
<div class="menu" id="inboxIconMenu">
|
||||
<ul id="sourceList">
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Open in New Mail Window" /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Copy Folder Location" /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Subscribe..." /></li>
|
||||
<li class="separator"></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Mark Folder Read..." /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="New Folder..." /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Compact This Folder" /></li>
|
||||
<li class="separator"></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Search Messages..." /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Properties..." /></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<form name="pageform" var:href="pageFormURL" _wosid="0">
|
||||
<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>
|
||||
|
||||
<div class="folderTree" id="mailerFolderTree">
|
||||
<var:if condition="hideFolderTree">
|
||||
<var:component-content/>
|
||||
</var:if>
|
||||
<div class="menu" id="mailboxIconMenu">
|
||||
<ul id="sourceList">
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Open in New Mail Window" /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Copy Folder Location" /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Subscribe..." /></li>
|
||||
<li class="separator"></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Mark Folder Read..." /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="New Subfolder..." /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Rename Folder..." /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Compact This Folder" /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Delete Folder" /></li>
|
||||
<li class="separator"></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Search Messages..." /></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="return false;"><var:string label:value="Properties..." /></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="menu" id="addressMenu">
|
||||
<ul id="sourceList">
|
||||
<li id="add_to_addressbook"
|
||||
onmousedown="return false;"
|
||||
onmouseup="newContactFromEmail(this);"><var:string label:value="Add to Address Book..."/></li>
|
||||
<li id="compose_mailto"
|
||||
onmousedown="return false;"
|
||||
onmouseup="newEmailTo(this);"><var:string label:value="Compose Mail To"/></li>
|
||||
<li id="create_filter"
|
||||
onmousedown="return false;"
|
||||
onmouseup="onMenuEntryClick(this, event);"><var:string label:value="Create Filter From Message..."/></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="menu" id="messageListMenu">
|
||||
<ul id="sourceList">
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="onMenuOpenMessage(event);"><var:string label:value="Open Message In New Window"/></li>
|
||||
<li class="separator"></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="onMenuReplyToSender(event);"><var:string label:value="Reply to Sender Only"/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="onMenuReplyToAll(event);"><var:string label:value="Reply to All"/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="onMenuForwardMessage(event);"><var:string label:value="Forward"/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="onMenuEditMessageAsNew(event);"><var:string label:value="Edit As New..."/></li>
|
||||
<li class="separator"></li>
|
||||
<li
|
||||
class="submenu"
|
||||
mailboxaction="move"
|
||||
submenu="mailboxes-menu"
|
||||
onmouseover="dropDownSubmenu(event);"
|
||||
onmousedown="return false;"><var:string label:value="Move To"/></li>
|
||||
<li
|
||||
class="submenu"
|
||||
mailboxaction="copy"
|
||||
submenu="mailboxes-menu"
|
||||
onmouseover="dropDownSubmenu(event);"
|
||||
onmousedown="return false;"><var:string label:value="Copy To"/></li>
|
||||
<li
|
||||
class="submenu"
|
||||
submenu="label-menu"
|
||||
onmouseover="dropDownSubmenu(event);"
|
||||
onmousedown="return false;"><var:string label:value="Label"/></li>
|
||||
<li
|
||||
class="submenu"
|
||||
submenu="mark-menu"
|
||||
onmouseover="dropDownSubmenu(event);"
|
||||
onmousedown="return false;"><var:string label:value="Mark"/></li>
|
||||
<li class="separator"></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="onMenuSaveMessageAs(event);"><var:string label:value="Save As..."/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="onMenuPreviewPrintMessage(event);"><var:string label:value="Print Preview"/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="onMenuPrintMessage(event);"><var:string label:value="Print..."/></li>
|
||||
<li
|
||||
onmousedown="return false;"
|
||||
onmouseup="onMenuDeleteMessage(event);"><var:string label:value="Delete Message"/></li>
|
||||
</ul>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<var:component
|
||||
className="UIxMailFolderMenu"
|
||||
const:menuId="mailboxes-menu"
|
||||
const:parentMenu="0"
|
||||
rootClassName="treeRootClassName"
|
||||
const:treeFolderAction="view"
|
||||
/>
|
||||
|
||||
<div class="menu" id="mark-menu">
|
||||
<ul id="">
|
||||
<li onmousedown="return false;"
|
||||
onmouseup="onMenuMarkMessage(event, 'read');"><var:string label:value="As Read" /></li>
|
||||
<li onmousedown="return false;"
|
||||
onmouseup="onMenuMarkMessage(event, 'threadread');"><var:string label:value="Thread As Read" /></li>
|
||||
<li onmousedown="return false;"
|
||||
onmouseup="onMenuMarkMessage(event, 'readbydate);"><var:string label:value="As Read By Date..." /></li>
|
||||
<li onmousedown="return false;"
|
||||
onmouseup="onMenuMarkMessage(event, 'allread);"><var:string label:value="All Read" /></li>
|
||||
<li class="separator"></li>
|
||||
<li onmousedown="return false;"
|
||||
onmouseup="onMenuMarkMessage(event, 'flag);"><var:string label:value="Flag" /></li>
|
||||
<li class="separator"></li>
|
||||
<li onmousedown="return false;"
|
||||
onmouseup="onMenuMarkMessage(event, 'junk);"><var:string label:value="As Junk" /></li>
|
||||
<li onmousedown="return false;"
|
||||
onmouseup="onMenuMarkMessage(event, 'notjunk);"><var:string label:value="As Not Junk" /></li>
|
||||
<li onmousedown="return false;"
|
||||
onmouseup="onMenuMarkMessage(event, 'runjunkmailcontrols);"><var:string label:value="Run Junk Mail Controls" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form name="pageform" var:href="pageFormURL" _wosid="0" onsubmit="checkSearchValue(event);">
|
||||
<var:if condition="isPopup" const:negate="YES">
|
||||
<var:if condition="hideFolderTree" const:negate="YES">
|
||||
<div class="folderTree" id="mailerFolderTree">
|
||||
<div class="titlediv"><var:string label:value="Folders" /></div>
|
||||
<var:component className="UIxMailTree"
|
||||
rootClassName="treeRootClassName"
|
||||
const:treeFolderAction="view"
|
||||
/>
|
||||
</var:if>
|
||||
</div>
|
||||
|
||||
<div id="dragHandle"
|
||||
|
@ -86,18 +323,22 @@
|
|||
leftblock="mailerFolderTree"
|
||||
rightblock="mailerPageContent">
|
||||
</div>
|
||||
</var:if>
|
||||
|
||||
<div class="mailPageContent" id="mailerPageContent">
|
||||
<div id="mailerPageContent">
|
||||
<var:component-content/>
|
||||
</div>
|
||||
</var:if>
|
||||
|
||||
<var:if condition="isPopup">
|
||||
<var:component-content/>
|
||||
</var:if>
|
||||
</form>
|
||||
|
||||
<var:string value="errorAlertJavaScript" const:escapeHTML="NO" />
|
||||
</body>
|
||||
</html>
|
||||
</var:if>
|
||||
|
||||
<var:if condition="hideFrame">
|
||||
<var:component-content/>
|
||||
</var:if>
|
||||
</container>
|
||||
</var:component>
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
</script>
|
||||
<script language="JavaScript" rsrc:src="UIxMailToSelection.js"> <!-- Space! --></script>
|
||||
|
||||
<table id="addr_table" style="width: 100%;">
|
||||
<table id="addr_table">
|
||||
<var:foreach list="addressLists" item="addressList">
|
||||
<var:foreach list="addressList" item="address">
|
||||
<tr var:id="currentRowId">
|
||||
<td width="20%">
|
||||
<td>
|
||||
<var:popup name="currentPopUpId"
|
||||
list="headers"
|
||||
item="item"
|
||||
|
@ -25,7 +25,7 @@
|
|||
const:style="width: 100%;"
|
||||
/>
|
||||
</td>
|
||||
<td width="80%">
|
||||
<td>
|
||||
<input var:id="currentAddressId"
|
||||
var:name="currentAddressId"
|
||||
type="text"
|
||||
|
@ -40,13 +40,13 @@
|
|||
</var:foreach>
|
||||
</var:foreach>
|
||||
<tr id="row_last">
|
||||
<td width="20%">
|
||||
<td>
|
||||
<!-- todo: use stylesheet? -->
|
||||
<select style="width: 100%;" disabled="1">
|
||||
<option value="to" ><var:string label:value="to" />:</option>
|
||||
</select>
|
||||
</td>
|
||||
<td width="80%">
|
||||
<td>
|
||||
<!-- todo: use stylesheet? -->
|
||||
<input onfocus="fancyAddRow(true,'');" type="text"
|
||||
style="width: 100%;" />
|
||||
|
|
|
@ -1,11 +1,42 @@
|
|||
<?xml version="1.0" standalone="yes"?>
|
||||
<div class="folderTreeContent"
|
||||
<div id="folderTreeContent"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label">
|
||||
<!-- TODO: extend treeview to use CSS -->
|
||||
|
||||
<script type="text/javascript" rsrc:src="dtree.js"> <!-- space --></script>
|
||||
<script type="text/javascript">
|
||||
d = new dTree('d');
|
||||
d.config.folderLlinks = true;
|
||||
d.config.hideRoot = true;
|
||||
|
||||
d.icon.root = '<var:string rsrc:value="tbtv_account_17x17.gif" />';
|
||||
d.icon.folder = '<var:string rsrc:value="tbtv_leaf_corner_17x17.gif" />';
|
||||
d.icon.folderOpen = '<var:string rsrc:value="tbtv_leaf_corner_17x17.gif" />';
|
||||
d.icon.node = '<var:string rsrc:value="tbtv_leaf_corner_17x17.gif" />';
|
||||
d.icon.line = '<var:string rsrc:value="tbtv_line_17x17.gif" />';
|
||||
d.icon.join = '<var:string rsrc:value="tbtv_junction_17x17.gif" />';
|
||||
d.icon.joinBottom = '<var:string rsrc:value="tbtv_corner_17x17.gif" />';
|
||||
d.icon.plus = '<var:string rsrc:value="tbtv_plus_17x17.gif" />';
|
||||
d.icon.plusBottom = '<var:string rsrc:value="tbtv_corner_plus_17x17.gif" />';
|
||||
d.icon.minus = '<var:string rsrc:value="tbtv_minus_17x17.gif" />';
|
||||
d.icon.minusBottom = '<var:string rsrc:value="tbtv_corner_minus_17x17.gif" />';
|
||||
d.icon.nlPlus = '<var:string rsrc:value="tbtv_corner_plus_17x17.gif" />';
|
||||
d.icon.nlMinus = '<var:string rsrc:value="tbtv_corner_minus_17x17.gif" />';
|
||||
d.icon.empty = '<var:string rsrc:value="empty.gif" />';
|
||||
|
||||
d.add(0, -1, '');
|
||||
<var:foreach list="flattenedNodes" item="item"
|
||||
><var:component className="UIxMailTreeBlockJS"
|
||||
const:treeObjectName="d"
|
||||
var:item="item"
|
||||
/></var:foreach>
|
||||
document.write(d);
|
||||
</script>
|
||||
<noscript>
|
||||
<var:treeview
|
||||
list="rootNodes" item="item" sublist="item.children"
|
||||
zoom="item.isPathNode"
|
||||
|
@ -21,19 +52,21 @@
|
|||
const:cornerMinusIcon = "tbtv_corner_minus_17x17.gif"
|
||||
const:spaceIcon = "tbtv_space_17x17.gif"
|
||||
>
|
||||
<var:tree-data const:isTreeElement="YES" const:treeLink=""
|
||||
<var:tree-data const:isTreeElement="YES"
|
||||
var:icon="item.iconName"
|
||||
var:cornerIcon="item.iconName">
|
||||
<a var:href="item.link">
|
||||
<span class="treecell">
|
||||
<var:if condition="item.isActiveNode">
|
||||
<b><var:string value="item.title" /></b>
|
||||
</var:if>
|
||||
<var:if condition="item.isActiveNode" const:negate="YES">
|
||||
<var:string value="item.title" />
|
||||
</var:if>
|
||||
</span>
|
||||
</a>
|
||||
</var:tree-data>
|
||||
var: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>
|
||||
|
|
|
@ -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>
|
|
@ -1,39 +1,13 @@
|
|||
<?xml version='1.0' standalone='yes'?>
|
||||
<var:component
|
||||
<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="UIxMailPanelFrame"
|
||||
title="panelTitle"
|
||||
>
|
||||
|
||||
<div class="menu" id="addressMenu">
|
||||
<ul id="sourceList">
|
||||
<li id="add_to_addressbook"
|
||||
onmousedown="return false;"
|
||||
onclick="newContactFromEmail(this);"><var:string label:value="Add to Address Book..."/></li>
|
||||
<li id="compose_mailto"
|
||||
onmousedown="return false;"
|
||||
onclick="newEmailTo(this);"><var:string label:value="Compose Mail To"/></li>
|
||||
<li id="create_filter"
|
||||
onmousedown="return false;"
|
||||
onclick="onMenuEntryClick(this, event);"><var:string label:value="Create Filter From Message..."/></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- TODO: refactor address rendering into an own component(/element) -->
|
||||
|
||||
<!-- TODO: can we create own clientObject's for Kolab entities? Probably
|
||||
not (since we would always need to fetch the header during
|
||||
lookup). It would work for 'annotated' folders though.
|
||||
TODO: for Kolab we need a completely different viewer with a different
|
||||
toolbar etc. And for Kolab we would need a different list viewer
|
||||
as well ...
|
||||
-->
|
||||
<var:if condition="clientObject.isKolabObject" const:negate="1">
|
||||
>
|
||||
<var:if condition="clientObject.isKolabObject" const:negate="YES">
|
||||
<!--
|
||||
Note: We cannot make this section static (like the toolbar) because the CC
|
||||
list has a dynamic height (would require some tricky JavaScript).
|
||||
|
@ -113,7 +87,7 @@
|
|||
<var:if-qualifier
|
||||
const:condition="organization hasPrefix: 'http://'"
|
||||
object="clientObject.mailHeaders"
|
||||
const:negate="1">
|
||||
const:negate="YES">
|
||||
<var:string value="clientObject.mailHeaders.organization" />
|
||||
</var:if-qualifier>
|
||||
</td>
|
||||
|
@ -174,15 +148,9 @@
|
|||
</table>
|
||||
</var:if><!-- !Kolab -->
|
||||
|
||||
<div class="mailer_mailcontent">
|
||||
<div class="mailer_mailcontent"
|
||||
oncontextmenu="onMenuClick(event, 'messageContentMenu');">
|
||||
<var:component value="contentViewerComponent"
|
||||
bodyInfo="clientObject.bodyStructure" />
|
||||
</div>
|
||||
|
||||
<script language="JavaScript">
|
||||
if (window.opener) {
|
||||
markMailReadInWindow(window.opener,
|
||||
'<var:string value="clientObject.nameInContainer"/>');
|
||||
}
|
||||
</script>
|
||||
</var:component>
|
||||
</container>
|
||||
|
|
|
@ -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>
|
|
@ -1,35 +1,62 @@
|
|||
<?xml version="1.0" standalone="yes"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
<container
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label"
|
||||
>
|
||||
xmlns:label="OGo:label">
|
||||
<var:if condition="hideFrame" const:negate="YES">
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<var:string value="title"/>
|
||||
</title>
|
||||
<meta name="hideFrame" var:content="hideFrame" />
|
||||
<meta name="description" content="SOGo Web Interface"/>
|
||||
<meta name="author" content="SKYRIX Software AG"/>
|
||||
<meta name="robots" content="stop"/>
|
||||
<meta name="test" var:content="patate"/>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"/>
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="uix.css"/>
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="calendar.css"/>
|
||||
<link href="mailto:hh@skyrix.com" rev="made"/>
|
||||
|
||||
<script rsrc:src="generic.js"> <!-- space required --></script>
|
||||
<var:if condition="hasProductSpecificJavaScript">
|
||||
<script var:src="productJavaScriptURL"> <!-- space required --></script>
|
||||
</var:if>
|
||||
<var:if condition="hasPageSpecificJavaScript">
|
||||
<script var:src="pageJavaScriptURL"> <!-- space required --></script>
|
||||
</var:if>
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="generic.css" />
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="dtree.css" />
|
||||
<var:if condition="hasProductSpecificCSS"
|
||||
><link type="text/css" rel="stylesheet" var:href="productCSSURL"
|
||||
/></var:if>
|
||||
<var:if condition="hasPageSpecificCSS"
|
||||
><link type="text/css" rel="stylesheet" var:href="pageCSSURL"
|
||||
/></var:if>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<var:if condition="isPopup" const:negate="YES">
|
||||
<div class="linkbanner">
|
||||
<body oncontextmenu="return false;">
|
||||
<script type="text/javascript">
|
||||
var UserFolderURL = '<var:string value="userFolderPath" />';
|
||||
var ApplicationBaseURL = '<var:string value="applicationPath" />';
|
||||
var ResourcesURL = '/SOGo.woa/WebServerResources'
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" rsrc:src="prototype.js"> <!-- space required --></script>
|
||||
<script type="text/javascript" rsrc:src="yul/yahoo/yahoo-min.js"> <!-- space required --></script>
|
||||
<script type="text/javascript" rsrc:src="yul/dom/dom-min.js"> <!-- space required --></script>
|
||||
<script type="text/javascript" rsrc:src="yul/event/event-min.js"> <!-- space required --></script>
|
||||
<script type="text/javascript" rsrc:src="yul/dragdrop/dragdrop-min.js"> <!-- space required --></script>
|
||||
|
||||
<script type="text/javascript" rsrc:src="generic.js"> <!-- space required --></script>
|
||||
<var:if condition="hasProductSpecificJavaScript"
|
||||
><script type="text/javascript" var:src="productJavaScriptURL"> <!-- space required --></script>
|
||||
</var:if>
|
||||
<var:if condition="hasPageSpecificJavaScript"
|
||||
><script type="text/javascript" var:src="pageJavaScriptURL"> <!-- space required --></script>
|
||||
</var:if>
|
||||
|
||||
<div id="logConsole">
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
initLogConsole();
|
||||
</script>
|
||||
|
||||
<var:if condition="isPopup" const:negate="YES"
|
||||
><div class="linkbanner">
|
||||
<a var:href="relativeHomePath"
|
||||
><var:string label:value="Home" /></a> |
|
||||
<a var:href="relativeCalendarPath"
|
||||
|
@ -41,44 +68,20 @@
|
|||
<a var:href="logoffPath"
|
||||
><var:string label:value="Logoff" /></a> |
|
||||
<a href="http://to.be.done/"
|
||||
><var:string label:value="Right Administration" /></a>
|
||||
><var:string label:value="Right Administration" /></a> |
|
||||
<a href="#" onclick="toggleLogConsole();"
|
||||
><var:string label:value="Log Console" /></a>
|
||||
</div>
|
||||
</var:if>
|
||||
</var:if
|
||||
|
||||
<var:component className="UIxToolbar" />
|
||||
><var:component className="UIxToolbar"
|
||||
/>
|
||||
|
||||
<div class="pageContent">
|
||||
|
||||
<!-- <tr> -->
|
||||
<!-- <td colspan="2"> -->
|
||||
<!-- TODO: replace the line with a CSS straight line -->
|
||||
<!-- <table cellpadding="0" cellspacing="0" border="0" width="100%"> -->
|
||||
<!-- <tr> -->
|
||||
<!-- <td class="linecolor"><img rsrc:src="line_left.gif"/></td> -->
|
||||
<!-- <td class="linecolor" width="98%"> -->
|
||||
<!-- <img rsrc:src="line_stretch.gif"/> -->
|
||||
<!-- </td> -->
|
||||
<!-- <td class="linecolor"><img rsrc:src="line_right.gif"/></td> -->
|
||||
<!-- </tr> -->
|
||||
<!-- <tr> -->
|
||||
<!-- <td valign="top" colspan="2"> -->
|
||||
<!-- <var:component className="UIxAppNavView" /> -->
|
||||
<!-- </td> -->
|
||||
<!-- <td valign="top" align="right" class="button_submit_env"> -->
|
||||
<!-- <a var:href="helpURL" -->
|
||||
<!-- class="button_submit" -->
|
||||
<!-- label:string="Help" -->
|
||||
<!-- var:target="helpWindowTarget" -->
|
||||
<!-- /> -->
|
||||
<!-- </td> -->
|
||||
<!-- </tr> -->
|
||||
<!-- </table> -->
|
||||
<!-- </td> -->
|
||||
<!-- </tr> -->
|
||||
<var:component-content/>
|
||||
</div>
|
||||
<var:component-content
|
||||
/></div>
|
||||
<var:if condition="isUIxDebugEnabled">
|
||||
<table border="0" style="font-size: 9pt;">
|
||||
<table border="0" style="font-size: 9pt; visibility: hidden;">
|
||||
<tr>
|
||||
<td valign="top">clientObject:</td>
|
||||
<td valign="top"><var:string value="clientObject" /></td>
|
||||
|
@ -152,11 +155,11 @@
|
|||
</table>
|
||||
</var:if>
|
||||
</body>
|
||||
</html>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: xml
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:nil
|
||||
End:
|
||||
-->
|
||||
</html>
|
||||
</var:if>
|
||||
|
||||
<var:if condition="hideFrame">
|
||||
<var:component-content />
|
||||
</var:if>
|
||||
</container>
|
||||
|
||||
|
|
|
@ -1,39 +1,51 @@
|
|||
<?xml version="1.0" standalone="yes"?>
|
||||
<var:if condition="hasButtons"
|
||||
<var:if condition="hasButtons"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label"
|
||||
xmlns:so="http://www.skyrix.com/od/so-lookup">
|
||||
<div class="toolbar">
|
||||
<var:foreach list="toolbarConfig" item="toolbarGroup">
|
||||
<var:foreach list="toolbarGroup" item="buttonInfo">
|
||||
<var:if condition="isButtonEnabled">
|
||||
|
||||
<a class="toolbarButton"
|
||||
<div id="toolbar" class="toolbar">
|
||||
<var:foreach list="toolbarConfig" item="toolbarGroup"
|
||||
><var:foreach list="toolbarGroup" item="buttonInfo"
|
||||
><var:if condition="isButtonEnabled"
|
||||
><a class="toolbarButton"
|
||||
var:href="buttonInfo.link"
|
||||
var:target="buttonInfo.target"
|
||||
var:onclick="buttonInfo.onclick"
|
||||
var:alt="buttonInfo.tooltip"
|
||||
var:title="buttonInfo.tooltip">
|
||||
<span class="toolbarButton">
|
||||
<img class="buttonImage"
|
||||
var:title="buttonInfo.tooltip"
|
||||
><span class="toolbarButton"
|
||||
><img class="buttonImage"
|
||||
var:src="buttonImage"
|
||||
var:alt="buttonInfo.image" /><br />
|
||||
<span class="buttonLabel"><var:string
|
||||
value="buttonLabel" /></span>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
var:alt="buttonInfo.image"
|
||||
/><br
|
||||
/><span class="buttonLabel"
|
||||
><var:string
|
||||
value="buttonLabel"
|
||||
/></span
|
||||
></span
|
||||
></a>
|
||||
</var:if>
|
||||
<var:if condition="isButtonEnabled"
|
||||
const:negate="YES"
|
||||
><span class="disabledToolbarButton"
|
||||
><img class="buttonImage"
|
||||
var:src="buttonImage"
|
||||
var:alt="buttonInfo.image"
|
||||
/><br
|
||||
/><span class="buttonLabel"
|
||||
><var:string
|
||||
value="buttonLabel"
|
||||
/></span
|
||||
></span>
|
||||
</var:if>
|
||||
</var:foreach>
|
||||
|
||||
<var:if condition="isLastGroup" const:negate="YES">
|
||||
<span class="toolbarSeparator">
|
||||
<var:entity const:name="nbsp" />
|
||||
</span>
|
||||
</var:if>
|
||||
<var:if condition="isLastGroup" const:negate="YES"
|
||||
><span class="toolbarSeparator"
|
||||
><var:entity const:name="nbsp"
|
||||
/></span
|
||||
></var:if>
|
||||
</var:foreach>
|
||||
</div>
|
||||
</var:if>
|
||||
</var:if>
|
||||
|
|
|
@ -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...");
|
||||
}
|
|
@ -51,7 +51,6 @@ function popupSearchMenu(event, menuId)
|
|||
|
||||
if (event.button == 0
|
||||
&& relX < 24) {
|
||||
log('popup');
|
||||
event.cancelBubble = true;
|
||||
event.returnValue = false;
|
||||
|
||||
|
@ -85,27 +84,33 @@ function setSearchCriteria(event)
|
|||
searchField = document.getElementById('searchValue');
|
||||
searchCriteria = document.getElementById('searchCriteria');
|
||||
|
||||
node = event.target;
|
||||
var node = event.target;
|
||||
searchField.setAttribute("ghost-phrase", node.innerHTML);
|
||||
searchCriteria = node.getAttribute('id');
|
||||
}
|
||||
|
||||
function checkSearchValue(event)
|
||||
{
|
||||
var form = event.target;
|
||||
var searchField = document.getElementById('searchValue');
|
||||
var ghostPhrase = searchField.getAttribute('ghost-phrase');
|
||||
|
||||
if (searchField.value == ghostPhrase)
|
||||
searchField.value = "";
|
||||
}
|
||||
|
||||
function onSearchChange()
|
||||
{
|
||||
log('onSearchChange');
|
||||
}
|
||||
|
||||
function onSearchMouseDown(event)
|
||||
{
|
||||
log('onSearchMouseDown');
|
||||
|
||||
searchField = document.getElementById('searchValue');
|
||||
superNode = searchField.parentNode.parentNode.parentNode;
|
||||
relX = (event.pageX - superNode.offsetLeft - searchField.offsetLeft);
|
||||
relY = (event.pageY - superNode.offsetTop - searchField.offsetTop);
|
||||
|
||||
if (relY < 24) {
|
||||
log('menu');
|
||||
event.cancelBubble = true;
|
||||
event.returnValue = false;
|
||||
}
|
||||
|
@ -113,7 +118,6 @@ function onSearchMouseDown(event)
|
|||
|
||||
function onSearchFocus(event)
|
||||
{
|
||||
log('onSearchFocus');
|
||||
searchField = document.getElementById('searchValue');
|
||||
ghostPhrase = searchField.getAttribute("ghost-phrase");
|
||||
if (searchField.value == ghostPhrase) {
|
||||
|
@ -128,7 +132,6 @@ function onSearchFocus(event)
|
|||
|
||||
function onSearchBlur()
|
||||
{
|
||||
log('onSearchBlur');
|
||||
var searchField = document.getElementById('searchValue');
|
||||
var ghostPhrase = searchField.getAttribute("ghost-phrase");
|
||||
|
||||
|
@ -159,7 +162,45 @@ function initCriteria()
|
|||
searchField.setAttribute('ghost-phrase', firstOption.innerHTML);
|
||||
searchField.setAttribute("modified", "");
|
||||
searchField.style.color = "#aaa";
|
||||
|
||||
log(searchField.value);
|
||||
}
|
||||
}
|
||||
|
||||
function deleteSelectedMails()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* message menu entries */
|
||||
function onMenuOpenMessage(event)
|
||||
{
|
||||
var node = getParentMenu(event.target).menuTarget.parentNode;
|
||||
var msgId = node.getAttribute('id').substr(4);
|
||||
|
||||
openMessageWindow(null, msgId, msgId + "/view");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function onMenuReplyToSender(event)
|
||||
{
|
||||
openMessageWindowsForSelection(null, 'reply');
|
||||
}
|
||||
|
||||
function onMenuReplyToAll(event)
|
||||
{
|
||||
openMessageWindowsForSelection(null, 'replyall');
|
||||
|
||||
}
|
||||
|
||||
function onMenuForwardMessage(event)
|
||||
{
|
||||
openMessageWindowsForSelection(null, 'forward');
|
||||
|
||||
}
|
||||
|
||||
function onMenuDeleteMessage(event)
|
||||
{
|
||||
uixDeleteSelectedMessages(null);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 62 B |
|
@ -24,16 +24,76 @@
|
|||
|
||||
/* generic stuff */
|
||||
|
||||
logWindow = window.open('', 'logWindow');
|
||||
logWindow.document.write('<html><head><title>JavaScript log</title></head>'
|
||||
+ '<body style="font-family: monospace;'
|
||||
+ 'font-size: 10pt; overflow: scroll;">'
|
||||
+ '<div class="log" id="logArea"'
|
||||
+ ' onclick="this.innerHTML=\'\';"></div></body>'
|
||||
+ '</html>');
|
||||
logWindow.resizeTo(640,480);
|
||||
logArea = logWindow.document.getElementById('logArea');
|
||||
logArea.innerHTML = '';
|
||||
var logConsole;
|
||||
|
||||
// logArea = null;
|
||||
var allDocumentElements = null;
|
||||
|
||||
/* a W3C compliant document.all */
|
||||
function getAllScopeElements(scope)
|
||||
{
|
||||
var elements = new Array();
|
||||
|
||||
for (var i = 0; i < scope.childNodes.length; i++)
|
||||
if (typeof(scope.childNodes[i]) == "object"
|
||||
&& scope.childNodes[i].tagName
|
||||
&& scope.childNodes[i].tagName != '')
|
||||
{
|
||||
elements.push(scope.childNodes[i]);
|
||||
var childElements = getAllElements(scope.childNodes[i]);
|
||||
if (childElements.length > 0)
|
||||
elements.push(childElements);
|
||||
}
|
||||
|
||||
return elements;
|
||||
}
|
||||
|
||||
function getAllElements(scope)
|
||||
{
|
||||
var elements;
|
||||
|
||||
if (scope == null)
|
||||
scope = document;
|
||||
|
||||
if (scope == document
|
||||
&& allDocumentElements != null)
|
||||
elements = allDocumentElements;
|
||||
else
|
||||
{
|
||||
elements = getAllScopeElements(scope);
|
||||
if (scope == document)
|
||||
allDocumentElements = elements;
|
||||
}
|
||||
|
||||
return elements;
|
||||
}
|
||||
|
||||
/* from
|
||||
http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/ */
|
||||
function getElementsByClassName(_tag, _class, _scope) {
|
||||
var regexp, classes, elements, element, returnElements;
|
||||
|
||||
_scope = _scope || document;
|
||||
|
||||
elements = (!_tag || _tag == "*"
|
||||
? getAllElements(null)
|
||||
: _scope.getElementsByTagName(_tag));
|
||||
returnElements = [];
|
||||
|
||||
classes = _class.split(/\s+/);
|
||||
regexp = new RegExp("(^|\s+)("+ classes.join("|") +")(\s+|$)","i");
|
||||
|
||||
if (_class) {
|
||||
for(var i = 0; element = elements[i]; i++) {
|
||||
if (regexp.test(element.className)) {
|
||||
returnElements.push(element);
|
||||
}
|
||||
}
|
||||
return returnElements;
|
||||
} else {
|
||||
return elements;
|
||||
}
|
||||
}
|
||||
|
||||
function ml_stripActionInURL(url) {
|
||||
if (url[url.length - 1] != '/') {
|
||||
|
@ -204,37 +264,45 @@ function triggerOpenerCallback() {
|
|||
}
|
||||
}
|
||||
|
||||
/* selection mechanism */
|
||||
function addClassName(node, className) {
|
||||
var classStr = '' + node.getAttribute("class");
|
||||
|
||||
function selectNode(node) {
|
||||
var classStr = '' + node.getAttribute('class');
|
||||
|
||||
position = classStr.indexOf('_selected', 0);
|
||||
position = classStr.indexOf(className, 0);
|
||||
if (position < 0) {
|
||||
classStr = classStr + ' _selected';
|
||||
classStr = classStr + ' ' + className;
|
||||
node.setAttribute('class', classStr);
|
||||
}
|
||||
}
|
||||
|
||||
function deselectNode(node) {
|
||||
function removeClassName(node, className) {
|
||||
var classStr = '' + node.getAttribute('class');
|
||||
|
||||
position = classStr.indexOf('_selected', 0);
|
||||
position = classStr.indexOf(className, 0);
|
||||
while (position > -1) {
|
||||
classStr1 = classStr.substring(0, position);
|
||||
classStr2 = classStr.substring(position + 10, classStr.length);
|
||||
classStr = classStr1 + classStr2;
|
||||
position = classStr.indexOf('_selected', 0);
|
||||
position = classStr.indexOf(className, 0);
|
||||
}
|
||||
|
||||
node.setAttribute('class', classStr);
|
||||
}
|
||||
|
||||
/* selection mechanism */
|
||||
|
||||
function selectNode(node) {
|
||||
addClassName(node, '_selected');
|
||||
}
|
||||
|
||||
function deselectNode(node) {
|
||||
removeClassName(node, '_selected');
|
||||
}
|
||||
|
||||
function deselectAll(parent) {
|
||||
for (var i = 0; i < parent.childNodes.length; i++) {
|
||||
var node = parent.childNodes.item(i);
|
||||
if (node.nodeType == 1) {
|
||||
deselectNode(node);
|
||||
removeClassName(node, '_selected');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -258,18 +326,17 @@ function getSelectedNodes(parentNode) {
|
|||
for (var i = 0; i < parentNode.childNodes.length; i++) {
|
||||
node = parentNode.childNodes.item(i);
|
||||
if (node.nodeType == 1
|
||||
&& isNodeSelected(node)) {
|
||||
selArray.push(i);
|
||||
}
|
||||
&& isNodeSelected(node))
|
||||
selArray.push(node);
|
||||
}
|
||||
|
||||
return selArray.join('|');
|
||||
return selArray;
|
||||
}
|
||||
|
||||
function onRowClick(event) {
|
||||
var node = event.target;
|
||||
// var text = document.getElementById('list');
|
||||
// text.innerHTML = '';
|
||||
if (node.tagName == 'TD')
|
||||
node = node.parentNode;
|
||||
|
||||
var startSelection = getSelectedNodes(node.parentNode);
|
||||
if (event.shiftKey == 1
|
||||
|
@ -285,7 +352,10 @@ function onRowClick(event) {
|
|||
selectNode(node);
|
||||
}
|
||||
if (startSelection != getSelectedNodes(node.parentNode)) {
|
||||
var code = '' + node.parentNode.getAttribute('onselectionchange');
|
||||
var parentNode = node.parentNode;
|
||||
if (parentNode.tagName == 'TBODY')
|
||||
parentNode = parentNode.parentNode;
|
||||
var code = '' + parentNode.getAttribute('onselectionchange');
|
||||
if (code.length > 0) {
|
||||
node.eval(code);
|
||||
}
|
||||
|
@ -296,8 +366,6 @@ function onRowClick(event) {
|
|||
|
||||
var bodyOnClick = "";
|
||||
// var acceptClick = false;
|
||||
var menuClickNode = null;
|
||||
var currentSubmenu = null;
|
||||
|
||||
function onMenuClick(event, menuId)
|
||||
{
|
||||
|
@ -306,8 +374,10 @@ function onMenuClick(event, menuId)
|
|||
event.cancelBubble = true;
|
||||
event.returnValue = false;
|
||||
|
||||
if (document.currentPopupMenu)
|
||||
hideMenu(event, document.currentPopupMenu);
|
||||
|
||||
var popup = document.getElementById(menuId);
|
||||
hideMenu(popup);
|
||||
|
||||
var menuTop = event.pageY;
|
||||
var menuLeft = event.pageX;
|
||||
|
@ -321,65 +391,121 @@ function onMenuClick(event, menuId)
|
|||
if (leftDiff < 0)
|
||||
menuLeft -= popup.offsetWidth;
|
||||
|
||||
popup.style.top = menuTop + "px";
|
||||
popup.style.left = menuLeft + "px";
|
||||
popup.style.visibility = "visible";
|
||||
menuClickNode = node;
|
||||
popup.style.top = menuTop + "px;";
|
||||
popup.style.left = menuLeft + "px;";
|
||||
popup.style.visibility = "visible;";
|
||||
setupMenuTarget(popup, node);
|
||||
|
||||
bodyOnClick = "" + document.body.getAttribute("onclick");
|
||||
document.body.setAttribute("onclick", "onBodyClick('" + menuId + "');");
|
||||
}
|
||||
|
||||
function onBodyClick(menuId)
|
||||
{
|
||||
// if (!acceptClick)
|
||||
// acceptClick = true;
|
||||
// else
|
||||
// {
|
||||
popup = document.getElementById(menuId);
|
||||
hideMenu(popup);
|
||||
document.body.setAttribute("onclick", bodyOnClick);
|
||||
menuClickNode = null;
|
||||
// }
|
||||
document.body.setAttribute("onclick", "onBodyClick(event);");
|
||||
document.currentPopupMenu = popup;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function hideMenu(menuNode)
|
||||
function setupMenuTarget(menu, target)
|
||||
{
|
||||
menu.menuTarget = target;
|
||||
var menus = getElementsByClassName("*", "menu", menu);
|
||||
for (var i = 0; i < menus.length; i++) {
|
||||
menus[i].menuTarget = target;
|
||||
}
|
||||
}
|
||||
|
||||
function getParentMenu(node)
|
||||
{
|
||||
var currentNode, menuNode;
|
||||
|
||||
menuNode = null;
|
||||
currentNode = node;
|
||||
var menure = new RegExp("(^|\s+)menu(\s+|$)", "i");
|
||||
|
||||
while (menuNode == null
|
||||
&& currentNode)
|
||||
if (menure.test(currentNode.className))
|
||||
menuNode = currentNode;
|
||||
else
|
||||
currentNode = currentNode.parentNode;
|
||||
|
||||
return menuNode;
|
||||
}
|
||||
|
||||
function onBodyClick(event)
|
||||
{
|
||||
document.currentPopupMenu.menuTarget = null;
|
||||
hideMenu(event, document.currentPopupMenu);
|
||||
document.body.setAttribute("onclick", bodyOnClick);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function hideMenu(event, menuNode)
|
||||
{
|
||||
var onHide;
|
||||
|
||||
// log('hiding menu "' + menuNode.getAttribute('id') + '"');
|
||||
if (menuNode.submenu)
|
||||
{
|
||||
hideMenu(menuNode.submenu);
|
||||
hideMenu(event, menuNode.submenu);
|
||||
menuNode.submenu = null;
|
||||
}
|
||||
|
||||
menuNode.style.visibility = "hidden";
|
||||
if (menuNode.parentMenuItem)
|
||||
{
|
||||
menuNode.parentMenuItem.setAttribute('class', 'submenu');
|
||||
menuNode.parentMenuItem = null;
|
||||
menuNode.parentMenu.setAttribute('onmousemove', null);
|
||||
menuNode.parentMenu.submenuItem = null;
|
||||
menuNode.parentMenu.submenu = null;
|
||||
menuNode.parentMenu = null;
|
||||
}
|
||||
|
||||
var onhideEvent = document.createEvent("Event");
|
||||
onhideEvent.initEvent("hideMenu", true, true);
|
||||
menuNode.dispatchEvent(onhideEvent);
|
||||
}
|
||||
|
||||
function onMenuEntryClick(node, event, menuId)
|
||||
function onMenuEntryClick(event, menuId)
|
||||
{
|
||||
id = node.getAttribute("id");
|
||||
window.alert("clicked " + menuClickNode.tagName);
|
||||
var node = event.target;
|
||||
|
||||
id = getParentMenu(node).menuTarget;
|
||||
// log("clicked " + id + "/" + id.tagName);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function initLogConsole() {
|
||||
logConsole = document.getElementById('logConsole');
|
||||
logConsole.innerHTML = '';
|
||||
}
|
||||
|
||||
function toggleLogConsole() {
|
||||
var visibility = '' + logConsole.style.visibility;
|
||||
if (visibility.length == 0) {
|
||||
logConsole.style.visibility = 'visible;';
|
||||
} else {
|
||||
logConsole.style.visibility = '';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function log(message) {
|
||||
if (logArea)
|
||||
logArea.innerHTML = logArea.innerHTML + message + '<br />' + "\n";
|
||||
logConsole.innerHTML += message + '<br />' + "\n";
|
||||
}
|
||||
|
||||
function dropDownSubmenu(event)
|
||||
{
|
||||
var node = event.target;
|
||||
var submenu = node.getAttribute("submenu");
|
||||
if (submenu && submenu != "") {
|
||||
if (node.parentNode.parentNode.submenu)
|
||||
hideMenu(node.parentNode.parentNode.submenu);
|
||||
|
||||
if (submenu && submenu != "")
|
||||
{
|
||||
var submenuNode = document.getElementById(submenu);
|
||||
node.parentNode.parentNode.submenu = submenuNode;
|
||||
var parentNode = getParentMenu(node);
|
||||
if (parentNode.submenu)
|
||||
hideMenu(event, parentNode.submenu);
|
||||
var menuTop = (node.parentNode.parentNode.offsetTop
|
||||
+ node.offsetTop - 1);
|
||||
|
||||
|
@ -397,9 +523,39 @@ function dropDownSubmenu(event)
|
|||
+ submenuNode.offsetWidth
|
||||
- 4);
|
||||
|
||||
submenuNode.style.top = menuTop + "px";
|
||||
submenuNode.style.left = menuLeft + "px";
|
||||
submenuNode.style.visibility = "visible";
|
||||
submenuNode.parentMenuItem = node;
|
||||
submenuNode.parentMenu = parentNode;
|
||||
parentNode.submenuItem = node;
|
||||
parentNode.submenu = submenuNode;
|
||||
parentNode.setAttribute('onmousemove', 'checkDropDown(event);');
|
||||
node.setAttribute('class', 'submenu-selected');
|
||||
submenuNode.style.top = menuTop + "px;";
|
||||
submenuNode.style.left = menuLeft + "px;";
|
||||
submenuNode.style.visibility = "visible;";
|
||||
}
|
||||
}
|
||||
|
||||
function checkDropDown(event)
|
||||
{
|
||||
var parentNode = getParentMenu(event.target);
|
||||
var submenuNode = parentNode.submenu;
|
||||
if (submenuNode)
|
||||
{
|
||||
var submenuItem = parentNode.submenuItem;
|
||||
var itemX = submenuItem.offsetLeft + parentNode.offsetLeft;
|
||||
var itemY = submenuItem.offsetTop + parentNode.offsetTop;
|
||||
|
||||
if (event.clientX >= itemX
|
||||
&& event.clientX < submenuNode.offsetLeft
|
||||
&& (event.clientY < itemY
|
||||
|| event.clientY > (itemY
|
||||
+ submenuItem.offsetHeight)))
|
||||
{
|
||||
hideMenu(event, submenuNode);
|
||||
parentNode.submenu = null;
|
||||
parentNode.submenuItem = null;
|
||||
parentNode.setAttribute('onmousemove', null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -409,26 +565,41 @@ var dragHandle;
|
|||
var dragHandleOrigX;
|
||||
var dragHandleOrigLeft;
|
||||
var dragHandleOrigRight;
|
||||
var dragHandleOrigY;
|
||||
var dragHandleOrigUpper;
|
||||
var dragHandleOrigLower;
|
||||
var dragHandleDiff;
|
||||
|
||||
function startHandleDragging(event) {
|
||||
if (event.button == 0) {
|
||||
var leftBlock = event.target.getAttribute('leftblock');
|
||||
var rightBlock = event.target.getAttribute('rightblock');
|
||||
var upperBlock = event.target.getAttribute('upperblock');
|
||||
var lowerBlock = event.target.getAttribute('lowerblock');
|
||||
|
||||
dragHandle = event.target;
|
||||
if (leftBlock && rightBlock) {
|
||||
dragHandle.dhType = 'horizontal';
|
||||
dragHandleOrigX = dragHandle.offsetLeft;
|
||||
dragHandleOrigLeft = document.getElementById(leftBlock).offsetWidth;
|
||||
dragHandleDiff = 0;
|
||||
dragHandleOrigRight = document.getElementById(rightBlock).offsetLeft;
|
||||
|
||||
document.body.setAttribute('onmouseup', 'stopHandleDragging(event);');
|
||||
document.body.setAttribute('onmousemove', 'dragHandleMove(event, "'
|
||||
+ leftBlock
|
||||
+ '", "'
|
||||
+ rightBlock
|
||||
+ '");');
|
||||
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";
|
||||
}
|
||||
|
||||
dragHandleMove(event, leftBlock, rightBlock);
|
||||
document.addEventListener('mouseup', stopHandleDragging, true);
|
||||
document.addEventListener('mousemove', dragHandleMove, true);
|
||||
|
||||
dragHandleMove(event);
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
|
||||
|
@ -436,36 +607,56 @@ function startHandleDragging(event) {
|
|||
}
|
||||
|
||||
function stopHandleDragging(event) {
|
||||
var diffX = (event.clientX - dragHandleOrigX
|
||||
if (dragHandle.dhType == 'horizontal') {
|
||||
var diffX = Math.floor(event.clientX - dragHandleOrigX
|
||||
- (dragHandle.offsetWidth / 2));
|
||||
var lBlock
|
||||
= document.getElementById(dragHandle.getAttribute('leftblock'));
|
||||
var rBlock
|
||||
= document.getElementById(dragHandle.getAttribute('rightblock'));
|
||||
|
||||
lBlock.style.width = (dragHandleOrigLeft + diffX) + 'px';
|
||||
rBlock.style.left = (dragHandleOrigRight + diffX) + 'px';
|
||||
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'));
|
||||
|
||||
document.body.setAttribute('onmousemove', '');
|
||||
document.body.setAttribute('onmouseup', '');
|
||||
lBlock.style.top = (dragHandleOrigLower + diffY
|
||||
- dragHandleDiff) + 'px;';
|
||||
uBlock.style.height = (dragHandleOrigUpper + diffY - dragHandleDiff) + 'px;';
|
||||
}
|
||||
|
||||
document.removeEventListener('mouseup', stopHandleDragging, true);
|
||||
document.removeEventListener('mousemove', dragHandleMove, true);
|
||||
document.body.setAttribute('style', '');
|
||||
event.cancelBubble = true;
|
||||
|
||||
dragHandleMove(event);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function dragHandleMove(event, leftBlock, rightBlock) {
|
||||
if (typeof(dragHandle) == undefined
|
||||
|| !dragHandle)
|
||||
stopHandling(event);
|
||||
else {
|
||||
function dragHandleMove(event) {
|
||||
if (dragHandle.dhType == 'horizontal') {
|
||||
var width = dragHandle.offsetWidth;
|
||||
|
||||
var hX = event.clientX;
|
||||
if (hX > -1) {
|
||||
var newLeft = hX - (width / 2);
|
||||
var newLeft = Math.floor(hX - (width / 2));
|
||||
dragHandle.style.left = newLeft + 'px;';
|
||||
event.cancelBubble = true;
|
||||
|
||||
dragHandle.style.left = newLeft + 'px';
|
||||
return false;
|
||||
}
|
||||
} else if (dragHandle.dhType == 'vertical') {
|
||||
var height = dragHandle.offsetHeight;
|
||||
var hY = event.clientY;
|
||||
if (hY > -1) {
|
||||
var newTop = Math.floor(hY - (height / 2)) - dragHandleDiff;
|
||||
dragHandle.style.top = newTop + 'px;';
|
||||
event.cancelBubble = true;
|
||||
|
||||
return false;
|
||||
|
@ -475,6 +666,8 @@ function dragHandleMove(event, leftBlock, rightBlock) {
|
|||
|
||||
function dragHandleDoubleClick(event) {
|
||||
dragHandle = event.target;
|
||||
|
||||
if (dragHandle.dhType == 'horizontal') {
|
||||
var lBlock
|
||||
= document.getElementById(dragHandle.getAttribute('leftblock'));
|
||||
var lLeft = lBlock.offsetLeft;
|
||||
|
@ -484,9 +677,23 @@ function dragHandleDoubleClick(event) {
|
|||
= document.getElementById(dragHandle.getAttribute('rightblock'));
|
||||
var leftDiff = rBlock.offsetLeft - dragHandle.offsetLeft;
|
||||
|
||||
dragHandle.style.left = lLeft + 'px';
|
||||
dragHandle.style.left = lLeft + 'px;';
|
||||
lBlock.style.width = '0px';
|
||||
rBlock.style.left = (lLeft + leftDiff) + 'px';
|
||||
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;';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,19 +60,19 @@ function toggleMailSelect(sender) {
|
|||
row = document.getElementById(sender.name);
|
||||
row.className = sender.checked ? "tableview_selected" : "tableview";
|
||||
}
|
||||
|
||||
function collectSelectedRows() {
|
||||
var pageform = document.forms['pageform'];
|
||||
var rows = new Array();
|
||||
var messageList = document.getElementById('messageList');
|
||||
var tbody = (messageList.getElementsByTagName('tbody'))[0];
|
||||
var selectedRows = getSelectedNodes(tbody);
|
||||
|
||||
for (key in pageform) {
|
||||
if (key.indexOf("row_") != 0)
|
||||
continue;
|
||||
|
||||
if (!pageform[key].checked)
|
||||
continue;
|
||||
|
||||
rows[rows.length] = key.substring(4, key.length);
|
||||
for (var i = 0; i < selectedRows.length; i++) {
|
||||
var row = selectedRows[i];
|
||||
var rowId = row.getAttribute('id').substring(4);
|
||||
rows[rows.length] = rowId;
|
||||
}
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 80 B After Width: | Height: | Size: 61 B |
Before Width: | Height: | Size: 121 B After Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 205 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 82 B |
Before Width: | Height: | Size: 81 B After Width: | Height: | Size: 82 B |
Before Width: | Height: | Size: 602 B After Width: | Height: | Size: 595 B |
Before Width: | Height: | Size: 80 B After Width: | Height: | Size: 89 B |
Before Width: | Height: | Size: 122 B After Width: | Height: | Size: 211 B |
Before Width: | Height: | Size: 127 B After Width: | Height: | Size: 208 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.0 KiB |