From: wolfgang Date: Thu, 28 Jun 2007 20:44:49 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1091 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68134ba595144d86e7f15ea1dd429f7d4a2abda3;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1091 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ChangeLog b/ChangeLog index f08a575f..24e07bf2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,53 @@ +2007-06-28 Wolfgang Sourdeau + + * UI/Common/UIxSortButton.m: removed useless class module. + + * UI/Common/UIxSortableTableHeader.m: removed useless class + module. + + * UI/Contacts/UIxContactsListView.m ([UIxContactsListView + -contactInfos]): use the "asc" url parameter instead of "desc" to + determine the ordering. + ([-sortOrdering]): removed method. + ([UIxContactsListView -init]): removed the "searchText" ivar. + (general): the template no longer use the UIxSortableTableHeader + components. + + * UI/MailerUI/UIxMailListView.m ([UIxMailListView + -defaultSortKey]): default sort following the messages arrival + instead of their date. + ([-isSortedDescending]): removed method. + ([-imap4SortOrdering]): use the "asc" url parameter instead of + "desc" to determine the ordering. + (general): the template no longer use the UIxSortableTableHeader + components. + +2007-06-27 Wolfgang Sourdeau + + * UI/MailerUI/UIxMailListView.m ([UIxMailListView -sleep]): + removed method. + ([-setQualifier:_msg], [-qualifier]): removed methods. + ([UIxMailListView -defaultAction]): added code to handle the + search criteria and value passed as url parameters. Also, we now + handle the same search criterias as Thunderbird/Icedove. + +2007-06-22 Wolfgang Sourdeau + + * UI/PreferencesUI/UIxJSONPreferences.m ([UIxJSONPreferences + -jsonDefaultsAction]): bug fix: returns a WOResponse instance with + the string instead of the string itself. + ([UIxJSONPreferences -jsonSettingsAction]): same as above. + + * SoObjects/SOGo/SOGoUser.m ([SOGoUser +initialize]): new module + bool var "acceptAnyUser" that is set when the AuthenticationMethod + user default is nil. + ([SOGoUser -initWithLogin:newLoginroles:newRoles]): + unconditionnally returns an instance whenever acceptAnyUser is set. + +2007-06-21 Wolfgang Sourdeau + + * Main/sogod.m (main): prevent SOGo from running as root. + 2007-06-19 Wolfgang Sourdeau * SoObjects/SOGo/SOGoUser.m ([SOGoUser diff --git a/SoObjects/Appointments/product.plist b/SoObjects/Appointments/product.plist index 1fb47e4d..d70b2faa 100644 --- a/SoObjects/Appointments/product.plist +++ b/SoObjects/Appointments/product.plist @@ -11,7 +11,7 @@ SOGoAppointmentFolder = { superclass = "SOGoFolder"; defaultRoles = { - "FreeBusyLookup" = ( "Owner", "FreeBusy", "AuthorizedSubscriber" ); +/* "FreeBusyLookup" = ( "Owner", "FreeBusy", "AuthorizedSubscriber" ); */ "ViewWholePublicRecords" = ( "Owner", "PublicResponder", "PublicModifier", "PublicViewer" ); "ViewDAndTOfPublicRecords" = ( "Owner", "PublicDAndTViewer" ); "ModifyPublicRecords" = ( "Owner", "PublicModifier" ); @@ -29,7 +29,7 @@ }; }; SOGoGroupAppointmentFolder = { - superclass = "SOGoAppointmentFolder"; + superclass = "SOGoAppointmentFolder"; }; SOGoCalendarComponent = { superclass = "SOGoContentObject"; @@ -42,14 +42,18 @@ }; }; SOGoAppointmentObject = { - superclass = "SOGoCalendarComponent"; + superclass = "SOGoCalendarComponent"; }; SOGoTaskObject = { superclass = "SOGoCalendarComponent"; }; SOGoFreeBusyObject = { - superclass = "SOGoContentObject"; - protectedBy = ""; + superclass = "SOGoContentObject"; + protectedBy = "Access Contents Information"; + defaultRoles = { + "Access Contents Information" = ( "Owner", "Authenticated" ); + "WebDAV Access" = ( "Owner", "Authenticated" ); + }; }; }; } diff --git a/UI/Common/English.lproj/Localizable.strings b/UI/Common/English.lproj/Localizable.strings index 4ac925e1..bb9c1bf5 100644 --- a/UI/Common/English.lproj/Localizable.strings +++ b/UI/Common/English.lproj/Localizable.strings @@ -9,6 +9,7 @@ "Calendar" = "Calendar"; "Address Book" = "Address Book"; "Mail" = "Mail"; +"Preferences" = "Preferences"; "Logoff" = "Logoff"; "Right Administration" = "Right Administration"; "Log Console (dev.)" = "Log Console (dev.)"; diff --git a/UI/Common/French.lproj/Localizable.strings b/UI/Common/French.lproj/Localizable.strings index c18c4068..5264f182 100644 --- a/UI/Common/French.lproj/Localizable.strings +++ b/UI/Common/French.lproj/Localizable.strings @@ -7,6 +7,7 @@ "Calendar" = "Agenda"; "Address Book" = "Carnet d'adresses"; "Mail" = "Courrier"; +"Preferences" = "Préférences"; "Logoff" = "Quitter"; "Right Administration" = "Partage"; "Log Console (dev.)" = "Journal (dév.)"; diff --git a/UI/Common/GNUmakefile b/UI/Common/GNUmakefile index 9adbb6dc..cd4320a2 100644 --- a/UI/Common/GNUmakefile +++ b/UI/Common/GNUmakefile @@ -12,7 +12,6 @@ CommonUI_OBJC_FILES += \ CommonUIProduct.m \ UIxPageFrame.m \ UIxPrintPageFrame.m \ - UIxSortButton.m \ UIxAppNavView.m \ \ UIxAclEditor.m \ @@ -23,8 +22,6 @@ CommonUI_OBJC_FILES += \ UIxTabItem.m \ UIxUserRightsEditor.m \ \ - UIxSortableTableHeader.m \ - \ UIxToolbar.m CommonUI_RESOURCE_FILES += \ diff --git a/UI/Common/UIxSortButton.m b/UI/Common/UIxSortButton.m deleted file mode 100644 index fb4d3351..00000000 --- a/UI/Common/UIxSortButton.m +++ /dev/null @@ -1,29 +0,0 @@ -/* - 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. -*/ - -#include - -@interface UIxSortButton : WOComponent -@end - -@implementation UIxSortButton -@end /* UIxSortButton */ - diff --git a/UI/Common/UIxSortableTableHeader.m b/UI/Common/UIxSortableTableHeader.m deleted file mode 100644 index 66862523..00000000 --- a/UI/Common/UIxSortableTableHeader.m +++ /dev/null @@ -1,130 +0,0 @@ -/* - 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. -*/ - -#include - -/* - UIxSortableTableHeader - - TODO: document. - - Note: needs to inherit from SoComponent so that resource lookup properly - works! -*/ - -@interface UIxSortableTableHeader : SoComponent -{ - NSString *label; - NSString *sortKey; - NSString *href; - NSDictionary *queryDictionary; - BOOL isDefault; -} - -@end - -#include "common.h" - -@implementation UIxSortableTableHeader - -- (void)dealloc { - [self->label release]; - [self->sortKey release]; - [self->href release]; - [self->queryDictionary release]; - [super dealloc]; -} - -/* Accessors */ - -- (void)setLabel:(NSString *)_label { - ASSIGNCOPY(self->label, _label); -} -- (NSString *)label { - return self->label; -} - -- (void)setSortKey:(NSString *)_sortKey { - ASSIGNCOPY(self->sortKey, _sortKey); -} - -- (NSString *)sortKey { - return self->sortKey; -} - -- (void)setHref:(NSString *)_href { - ASSIGNCOPY(self->href, _href); -} -- (NSString *)href { - return self->href; -} - -- (void)setQueryDictionary:(NSDictionary *)_queryDictionary { - ASSIGN(self->queryDictionary, _queryDictionary); -} -- (NSDictionary *)queryDictionary { - return self->queryDictionary; -} - -- (id)singleQueryValueForKey:(NSString *)_key { - id so; - - so = [self->queryDictionary objectForKey:_key]; - if (![so isNotNull]) return nil; - - if (![so isKindOfClass:[NSArray class]]) - return so; - - return ([so count] > 0) ? [so objectAtIndex:0] : nil; -} - -- (void)setIsDefault:(BOOL)_isDefault { - self->isDefault = _isDefault; -} -- (BOOL)isDefault { - return self->isDefault; -} - -/* derived accessors */ - -- (BOOL) isSelected -{ - NSString *so; - - so = [self singleQueryValueForKey:@"sort"]; - - return ((so) - ? [so isEqualToString:self->sortKey] - : isDefault); -} - -- (BOOL)isSortedDescending -{ - NSString *desc; - - desc = [[[self context] request] formValueForKey:@"desc"]; - - return ((desc) - ? [desc boolValue] - : YES); -} - -@end /* UIxSortableTableHeader */ diff --git a/UI/Contacts/UIxContactsListView.h b/UI/Contacts/UIxContactsListView.h index 92b4a72e..ed952fff 100644 --- a/UI/Contacts/UIxContactsListView.h +++ b/UI/Contacts/UIxContactsListView.h @@ -31,7 +31,6 @@ @interface UIxContactsListView : UIxComponent { - NSString *searchText; NSDictionary *currentContact; NSString *selectorComponentClass; } diff --git a/UI/Contacts/UIxContactsListView.m b/UI/Contacts/UIxContactsListView.m index 64c8fd90..a68239d2 100644 --- a/UI/Contacts/UIxContactsListView.m +++ b/UI/Contacts/UIxContactsListView.m @@ -42,13 +42,6 @@ return self; } -- (void) dealloc -{ - if (searchText) - [searchText release]; - [super dealloc]; -} - /* accessors */ - (void) setCurrentContact: (NSDictionary *) _contact @@ -61,19 +54,6 @@ return currentContact; } -- (void) setSearchText: (NSString *) _txt -{ - ASSIGNCOPY (searchText, _txt); -} - -- (id) searchText -{ - if (!searchText) - [self setSearchText: [self queryParameterForKey:@"search"]]; - - return searchText; -} - - (id ) mailerContactsAction { selectorComponentClass = @"UIxContactsMailerSelection"; @@ -126,45 +106,33 @@ NSString *s; s = [self queryParameterForKey: @"sort"]; - if ([s length] == 0) + if (![s length]) s = [self defaultSortKey]; return s; } -- (NSComparisonResult) sortOrdering -{ - return ([[self queryParameterForKey:@"desc"] boolValue] - ? NSOrderedDescending - : NSOrderedAscending); -} - - (NSArray *) contactInfos { id folder; + NSString *ascending, *searchText, *valueText; + NSComparisonResult ordering; folder = [self clientObject]; - return [folder lookupContactsWithFilter: [self searchText] - sortBy: [self sortKey] - ordering: [self sortOrdering]]; -} + ascending = [self queryParameterForKey: @"asc"]; + ordering = ((![ascending length] || [ascending boolValue]) + ? NSOrderedAscending : NSOrderedDescending); -/* notifications */ + searchText = [self queryParameterForKey: @"search"]; + if ([searchText length] > 0) + valueText = [self queryParameterForKey: @"value"]; + else + valueText = nil; -- (void) sleep -{ - if (searchText) - { - [searchText release]; - searchText = nil; - } - currentContact = nil; -// [allRecords release]; -// allRecords = nil; -// [filteredRecords release]; -// filteredRecords = nil; - [super sleep]; + return [folder lookupContactsWithFilter: valueText + sortBy: [self sortKey] + ordering: ordering]; } /* actions */ diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index 16c3021c..26912cf6 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -81,7 +81,11 @@ /* MailListView */ -"Subject or Sender contains" = "Subject or Sender contains"; +"Sender" = "Sender"; +"Subject or Sender" = "Subject or Sender"; +"To or Cc" = "To or Cc"; +"Entire Message" = "Entire Message"; + "Date" = "Date"; "View" = "View"; "All" = "All"; diff --git a/UI/MailerUI/French.lproj/Localizable.strings b/UI/MailerUI/French.lproj/Localizable.strings index 252b1eb2..c9fe7dfa 100644 --- a/UI/MailerUI/French.lproj/Localizable.strings +++ b/UI/MailerUI/French.lproj/Localizable.strings @@ -83,7 +83,11 @@ "View:" = "Voir :"; -"Subject or Sender contains" = "Sujet ou Expéditeur contient "; +"Sender" = "Expéditeur"; +"Subject or Sender" = "Sujet ou expéditeur"; +"To or Cc" = "Pour ou Copie à"; +"Entire Message" = "Message Complet"; + "Date" = "Date"; "All" = "Tous"; "Unread" = "Non lus"; diff --git a/UI/MailerUI/UIxMailFilterPanel.m b/UI/MailerUI/UIxMailFilterPanel.m index bb81e965..a28dd800 100644 --- a/UI/MailerUI/UIxMailFilterPanel.m +++ b/UI/MailerUI/UIxMailFilterPanel.m @@ -34,16 +34,16 @@ @implementation UIxMailFilterPanel -static NSArray *filters = nil; -static NSDictionary *filterToQualifier = nil; +static NSArray *filters = nil; +// static NSDictionary *filterToQualifier = nil; + (void)initialize { // TODO: also available: answered, draft [custom: NotJunk and Junk] // Note: we currently cannot use: "flags != 'deleted'" static NSString *quals[] = { - @"all", nil, - @"read", @"flags = 'seen' AND NOT (flags = 'deleted')", - @"unread", @"flags = 'unseen' AND NOT (flags = 'deleted')", + @"all", nil, + @"read", @"flags = 'seen' AND NOT (flags = 'deleted')", + @"unread", @"flags = 'unseen' AND NOT (flags = 'deleted')", @"deleted", @"flags = 'deleted'", @"flagged", @"flags = 'flagged'", nil, nil @@ -63,7 +63,7 @@ static NSDictionary *filterToQualifier = nil; } } - filterToQualifier = [md copy]; +// filterToQualifier = [md copy]; filters = [ma copy]; [md release]; md = nil; [ma release]; ma = nil; @@ -80,106 +80,110 @@ static NSDictionary *filterToQualifier = nil; return self; } -- (void)dealloc { - [self->searchCriteria release]; - [self->searchText release]; +- (void) dealloc +{ + [searchCriteria release]; + [searchText release]; [super dealloc]; } /* accessors */ -- (void)setSearchText: (NSString *)_txt +- (void) setSearchText: (NSString *) _txt { - ASSIGNCOPY(self->searchText, _txt); + ASSIGN (searchText, _txt); } -- (void)setSearchCriteria: (NSString *)_txt +- (void) setSearchCriteria: (NSString *) _txt { - ASSIGNCOPY(self->searchText, _txt); + ASSIGN (searchText, _txt); } -- (NSString *)searchText +- (NSString *) searchText { - if (self->searchText == nil) + if (!searchText) { - self->searchText = - [[[[self context] request] formValueForKey:@"search"] copy]; + searchText = [[context request] formValueForKey: @"value"]; + [searchText retain]; } - return self->searchText; + + return searchText; } -- (NSString *)searchCriteria +- (NSString *) searchCriteria { - if (self->searchCriteria == nil) + if (!searchCriteria) { - self->searchCriteria = - [[[[self context] request] formValueForKey:@"criteria"] copy]; + searchCriteria = [[context request] formValueForKey: @"criteria"]; + [searchCriteria retain]; } - return self->searchCriteria; + + return searchCriteria; } /* filters */ -- (NSArray *)filters +- (NSArray *) filters { return filters; } /* qualifiers */ -- (EOQualifier *) searchTextQualifier -{ - EOQualifier *q; - NSString *s; +// - (EOQualifier *) searchTextQualifier +// { +// EOQualifier *q; +// NSString *s; - s = [self searchText]; - if ([s length] == 0) - return nil; +// s = [self searchText]; +// if ([s length] == 0) +// return nil; - q = [EOQualifier qualifierWithQualifierFormat: - @"(subject doesContain: %@) OR " - @"(from doesContain: %@)", - s, s]; - return q; -} - -- (NSString *)filterLabel -{ -#if 1 - return [[[self context] page] labelForKey:[self valueForKey:@"filter"]]; -#else - return [self valueForKey:@"filter"]; -#endif -} - -- (NSString *)selectedFilter -{ - return [[[self context] request] formValueForKey:@"filterpopup"]; -} - -- (EOQualifier *)filterQualifier -{ - NSString *selectedFilter; +// q = [EOQualifier qualifierWithQualifierFormat: +// @"(subject doesContain: %@) OR " +// @"(from doesContain: %@)", +// s, s]; +// return q; +// } + +// - (NSString *) filterLabel +// { +// #if 1 +// return [[context page] labelForKey:[self valueForKey:@"filter"]]; +// #else +// return [self valueForKey:@"filter"]; +// #endif +// } + +// - (NSString *) selectedFilter +// { +// return [[context request] formValueForKey: @"filterpopup"]; +// } + +// - (EOQualifier *) filterQualifier +// { +// NSString *selectedFilter; - selectedFilter = [self selectedFilter]; +// selectedFilter = [self selectedFilter]; - return [selectedFilter length] > 0 - ? [filterToQualifier objectForKey:selectedFilter] : nil; -} - -- (EOQualifier *) qualifier -{ - EOQualifier *sq, *fq; - NSArray *qa; +// return [selectedFilter length] > 0 +// ? [filterToQualifier objectForKey:selectedFilter] : nil; +// } + +// - (EOQualifier *) qualifier +// { +// EOQualifier *sq, *fq; +// NSArray *qa; - sq = [self searchTextQualifier]; - fq = [self filterQualifier]; +// sq = [self searchTextQualifier]; +// fq = [self filterQualifier]; - if (fq == nil) return sq; - if (sq == nil) return fq; +// if (fq == nil) return sq; +// if (sq == nil) return fq; - qa = [NSArray arrayWithObjects:fq, sq, nil]; - return [[[EOAndQualifier alloc] initWithQualifierArray:qa] autorelease]; -} +// qa = [NSArray arrayWithObjects:fq, sq, nil]; + +// return [[[EOAndQualifier alloc] initWithQualifierArray:qa] autorelease]; +// } @end /* UIxMailFilterPanel */ diff --git a/UI/MailerUI/UIxMailListView.h b/UI/MailerUI/UIxMailListView.h index 7d7fd458..fddbfea8 100644 --- a/UI/MailerUI/UIxMailListView.h +++ b/UI/MailerUI/UIxMailListView.h @@ -38,11 +38,9 @@ NSTimeZone *userTimeZone; } -- (NSString *)defaultSortKey; -- (NSString *)imap4SortKey; -- (NSString *)imap4SortOrdering; - -- (BOOL)isSortedDescending; +- (NSString *) defaultSortKey; +- (NSString *) imap4SortKey; +- (NSString *) imap4SortOrdering; @end diff --git a/UI/MailerUI/UIxMailListView.m b/UI/MailerUI/UIxMailListView.m index f0a2ff93..b63b740c 100644 --- a/UI/MailerUI/UIxMailListView.m +++ b/UI/MailerUI/UIxMailListView.m @@ -36,6 +36,8 @@ #import #import +#import + #import #import #import @@ -48,38 +50,42 @@ static int attachmentFlagSize = 8096; @implementation UIxMailListView +- (id) init +{ + SOGoUser *user; + + if ((self = [super init])) + { + qualifier = nil; + user = [context activeUser]; + ASSIGN (dateFormatter, [user dateFormatterInContext: context]); + ASSIGN (userTimeZone, [user timeZone]); + } + + return self; +} + - (void) dealloc { - [self->qualifier release]; - [self->sortedUIDs release]; - [self->messages release]; - [self->message release]; + [qualifier release]; + [sortedUIDs release]; + [messages release]; + [message release]; [dateFormatter release]; [userTimeZone release]; [super dealloc]; } -/* notifications */ - -- (void) sleep -{ - [self->qualifier release]; self->qualifier = nil; - [self->sortedUIDs release]; self->sortedUIDs = nil; - [self->messages release]; self->messages = nil; - [self->message release]; self->message = nil; - [super sleep]; -} - /* accessors */ -- (void)setMessage:(id)_msg +- (void) setMessage: (id) _msg { - ASSIGN(self->message, _msg); + ASSIGN(message, _msg); } - (id) message { - return self->message; + return message; } - (NSString *) messageDate @@ -92,16 +98,6 @@ static int attachmentFlagSize = 8096; return [dateFormatter formattedDateAndTime: messageDate]; } -- (void) setQualifier: (EOQualifier *) _msg -{ - ASSIGN(self->qualifier, _msg); -} - -- (EOQualifier *) qualifier -{ - return self->qualifier; -} - - (BOOL) showToAddress { NSString *ftype; @@ -179,7 +175,7 @@ static int attachmentFlagSize = 8096; /* Note: see SOGoMailManager.m for allowed IMAP4 keys */ static NSArray *keys = nil; if (keys == nil) { - keys = [[NSArray alloc] initWithObjects: + keys = [[NSArray alloc] initWithObjects: @"UID", @"FLAGS", @"ENVELOPE", @"RFC822.SIZE", nil]; } return keys; @@ -187,39 +183,29 @@ static int attachmentFlagSize = 8096; - (NSString *) defaultSortKey { - return @"DATE"; + return @"ARRIVAL"; } - (NSString *) imap4SortKey { NSString *sort; - sort = [[[self context] request] formValueForKey:@"sort"]; + sort = [[context request] formValueForKey: @"sort"]; - if ([sort length] == 0) + if (![sort length]) sort = [self defaultSortKey]; return [sort uppercaseString]; } -- (BOOL) isSortedDescending -{ - NSString *desc; - - desc = [[[self context] request] formValueForKey:@"desc"]; - - return ((desc) - ? [desc boolValue] - : YES); -} - - (NSString *) imap4SortOrdering { - NSString *sort; + NSString *sort, *ascending; sort = [self imap4SortKey]; - if ([self isSortedDescending]) + ascending = [[context request] formValueForKey: @"asc"]; + if (![ascending boolValue]) sort = [@"REVERSE " stringByAppendingString: sort]; return sort; @@ -227,27 +213,27 @@ static int attachmentFlagSize = 8096; - (NSRange) fetchRange { - if (self->firstMessageNumber == 0) + if (firstMessageNumber == 0) return NSMakeRange(0, messagesPerPage); - return NSMakeRange(self->firstMessageNumber - 1, messagesPerPage); + return NSMakeRange(firstMessageNumber - 1, messagesPerPage); } - (NSArray *) sortedUIDs { if (!sortedUIDs) { - sortedUIDs - = [[self clientObject] fetchUIDsMatchingQualifier: [self qualifier] - sortOrdering: [self imap4SortOrdering]]; + sortedUIDs + = [[self clientObject] fetchUIDsMatchingQualifier: qualifier + sortOrdering: [self imap4SortOrdering]]; [sortedUIDs retain]; } - return self->sortedUIDs; + return sortedUIDs; } - (unsigned int) totalMessageCount { - return [self->sortedUIDs count]; + return [sortedUIDs count]; } - (BOOL) showsAllMessages @@ -330,16 +316,9 @@ static int attachmentFlagSize = 8096; NSArray *msgs; NSRange r; unsigned len; - SOGoUser *user; - if (self->messages != nil) - return self->messages; - - user = [context activeUser]; - if (!dateFormatter) - dateFormatter = [user dateFormatterInContext: context]; - if (!userTimeZone) - ASSIGN (userTimeZone, [user timeZone]); + if (messages != nil) + return messages; r = [self fetchBlock]; uids = [self sortedUIDs]; @@ -347,9 +326,10 @@ static int attachmentFlagSize = 8096; /* only need to restrict if we have a lot */ uids = [uids subarrayWithRange:r]; - msgs = [[self clientObject] fetchUIDs:uids parts:[self fetchKeys]]; - self->messages = [[msgs valueForKey:@"fetch"] retain]; - return self->messages; + msgs = [[self clientObject] fetchUIDs: uids parts: [self fetchKeys]]; + messages = [[msgs valueForKey: @"fetch"] retain]; + + return messages; } /* URL processing */ @@ -432,25 +412,26 @@ static int attachmentFlagSize = 8096; { NSString *uid; - if ((uid = [[[self context] request] formValueForKey:@"uid"]) == nil) + if ((uid = [[context request] formValueForKey: @"uid"]) == nil) return nil; - return [[self clientObject] lookupName:uid inContext:[self context] - acquire:NO]; + return [[self clientObject] lookupName: uid + inContext: context + acquire: NO]; } /* actions */ - (BOOL) isJavaScriptRequest { - return [[[[self context] request] formValueForKey:@"jsonly"] boolValue]; + return [[[context request] formValueForKey:@"jsonly"] boolValue]; } - (id) javaScriptOK { WOResponse *r; - r = [[self context] response]; + r = [context response]; [r setStatus:200 /* OK */]; return r; } @@ -473,17 +454,57 @@ static int attachmentFlagSize = 8096; return firstMessage; } +- (void) _setQualifierForCriteria: (NSString *) criteria + andValue: (NSString *) value +{ + [qualifier release]; + + if ([criteria isEqualToString: @"subject"]) + qualifier = [EOQualifier qualifierWithQualifierFormat: + @"(subject doesContain: %@)", + value]; + else if ([criteria isEqualToString: @"sender"]) + qualifier = [EOQualifier qualifierWithQualifierFormat: + @"(from doesContain: %@)", + value]; + else if ([criteria isEqualToString: @"subject_or_sender"]) + qualifier = [EOQualifier qualifierWithQualifierFormat: + @"(subject doesContain: %@) OR " + @"(from doesContain: %@)", + value, value]; + else if ([criteria isEqualToString: @"to_or_cc"]) + qualifier = [EOQualifier qualifierWithQualifierFormat: + @"(to doesContain: %@) OR " + @"(cc doesContain: %@)", + value, value]; + else if ([criteria isEqualToString: @"entire_message"]) + qualifier = [EOQualifier qualifierWithQualifierFormat: + @"(message doesContain: %@)", + value]; + else + qualifier = nil; + + [qualifier retain]; +} + - (id) defaultAction { WORequest *request; - NSString *specificMessage; + NSString *specificMessage, *searchCriteria, *searchValue; - request = [[self context] request]; + request = [context request]; [[self clientObject] flushMailCaches]; specificMessage = [request formValueForKey: @"pageforuid"]; - self->firstMessageNumber + searchCriteria = [request formValueForKey: @"search"]; + searchValue = [request formValueForKey: @"value"]; + if ([searchCriteria length] > 0 + && [searchValue length] > 0) + [self _setQualifierForCriteria: searchCriteria + andValue: searchValue]; + + firstMessageNumber = ((specificMessage) ? [self firstMessageOfPageFor: [specificMessage intValue]] : [[request formValueForKey:@"idx"] intValue]); @@ -550,19 +571,24 @@ static int attachmentFlagSize = 8096; { // TODO: we might want to flush the caches? NSException *error; - id client; - - if ((client = [self clientObject]) == nil) { - return [NSException exceptionWithHTTPStatus:404 /* Not Found */ - reason:@"did not find mail folder"]; - } - - if ((error = [[self clientObject] expunge]) != nil) - return error; + id clientObject; + + clientObject = [self clientObject]; + if (clientObject) + { + error = [clientObject expunge]; + if (!error) + { + if ([clientObject respondsToSelector: @selector(flushMailCaches)]) + [clientObject flushMailCaches]; + return [self redirectToLocation:@"view"]; + } + } + else + error = [NSException exceptionWithHTTPStatus:404 /* Not Found */ + reason: @"did not find mail folder"]; - if ([client respondsToSelector:@selector(flushMailCaches)]) - [client flushMailCaches]; - return [self redirectToLocation:@"view"]; + return error; } @end diff --git a/UI/MailerUI/common.h b/UI/MailerUI/common.h index 9e98639c..ca5c2267 100644 --- a/UI/MailerUI/common.h +++ b/UI/MailerUI/common.h @@ -19,6 +19,7 @@ 02111-1307, USA. */ +#warning importing common is baaaad #import #if LIB_FOUNDATION_LIBRARY diff --git a/UI/MainUI/product.plist b/UI/MainUI/product.plist index ed1eaaed..c751208b 100644 --- a/UI/MainUI/product.plist +++ b/UI/MainUI/product.plist @@ -12,7 +12,7 @@ superclass = "SoComponent"; protectedBy = "View"; defaultRoles = { - "View" = ( "Authenticated", "FreeBusy" ); + "View" = ( "Authenticated" ); }; }; SOGoObject = { diff --git a/UI/PreferencesUI/UIxJSONPreferences.m b/UI/PreferencesUI/UIxJSONPreferences.m index 96f1d35f..0b18a97b 100644 --- a/UI/PreferencesUI/UIxJSONPreferences.m +++ b/UI/PreferencesUI/UIxJSONPreferences.m @@ -24,20 +24,34 @@ #import #import +#import +#import #import #import "UIxJSONPreferences.h" @implementation UIxJSONPreferences +- (WOResponse *) _makeResponse: (NSString *) jsonText +{ + WOResponse *response; + + response = [context response]; + [response setHeader: @"text/plain; charset=utf-8" + forKey: @"content-type"]; + [response appendContentString: jsonText]; + + return response; +} + - (WOResponse *) jsonDefaultsAction { NSUserDefaults *defaults; defaults = [[context activeUser] userDefaults]; - return [defaults jsonRepresentation]; + return [self _makeResponse: [defaults jsonRepresentation]]; } - (WOResponse *) jsonSettingsAction @@ -46,7 +60,7 @@ settings = [[context activeUser] userSettings]; - return [settings jsonRepresentation]; + return [self _makeResponse: [settings jsonRepresentation]]; } @end diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 9332a7e5..e0b7f2ca 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -129,9 +129,8 @@ static BOOL uixDebugEnabled = NO; - (void) dealloc { - [self->queryParameters release]; - if (_selectedDate) - [_selectedDate release]; + [queryParameters release]; + [_selectedDate release]; [super dealloc]; } @@ -161,7 +160,7 @@ static BOOL uixDebugEnabled = NO; value = [[part substringFromIndex:(r.location + r.length)] stringByUnescapingURL]; } - [self->queryParameters setObject:value forKey:key]; + [queryParameters setObject:value forKey:key]; part = [e nextObject]; } } @@ -195,10 +194,10 @@ static BOOL uixDebugEnabled = NO; NSRange r; NSString *qs; - if (self->queryParameters) - return self->queryParameters; + if (queryParameters) + return queryParameters; - self->queryParameters = [[NSMutableDictionary alloc] initWithCapacity:8]; + queryParameters = [[NSMutableDictionary alloc] initWithCapacity:8]; req = [[self context] request]; uri = [req uri]; @@ -212,7 +211,7 @@ static BOOL uixDebugEnabled = NO; /* add form values */ [self addKeepAliveFormValuesToQueryParameters]; - return self->queryParameters; + return queryParameters; } - (NSDictionary *) queryParameters diff --git a/UI/Scheduler/French.lproj/Localizable.strings b/UI/Scheduler/French.lproj/Localizable.strings index 5da57be7..0ce5f40d 100644 --- a/UI/Scheduler/French.lproj/Localizable.strings +++ b/UI/Scheduler/French.lproj/Localizable.strings @@ -212,7 +212,7 @@ "Search appointments" = "Recherche de rendez-vous"; "Search in Anais" = "Recherche par Anaïs"; -"All day Event" = "Toute la journée"; +"All day Event" = "Événement sur la journéee"; "check for conflicts" = "Vérifier les conflits"; "Browse URL" = "Visiter l'URL"; diff --git a/UI/Templates/ContactsUI/UIxContactsListView.wox b/UI/Templates/ContactsUI/UIxContactsListView.wox index 49349d8c..7d4836e5 100644 --- a/UI/Templates/ContactsUI/UIxContactsListView.wox +++ b/UI/Templates/ContactsUI/UIxContactsListView.wox @@ -13,32 +13,18 @@ - - - - - - - - - - - - - - - - + - - - - - + + + + diff --git a/UI/Templates/MailerUI/UIxMailFilterPanel.wox b/UI/Templates/MailerUI/UIxMailFilterPanel.wox index 71e4be51..5d15e65d 100644 --- a/UI/Templates/MailerUI/UIxMailFilterPanel.wox +++ b/UI/Templates/MailerUI/UIxMailFilterPanel.wox @@ -7,27 +7,16 @@ > - +
@@ -38,11 +27,11 @@ menuid="searchMenu" /> - +
diff --git a/UI/Templates/MailerUI/UIxMailListView.wox b/UI/Templates/MailerUI/UIxMailListView.wox index 741252ca..b6514b3a 100644 --- a/UI/Templates/MailerUI/UIxMailListView.wox +++ b/UI/Templates/MailerUI/UIxMailListView.wox @@ -1,130 +1,108 @@ - - - -
-
- | - | - - - - - - - | - + + + + + + + - - - - - + > + +
+
+ | + | + + + + + + + | +
diff --git a/UI/Templates/MailerUI/UIxMailMainFrame.wox b/UI/Templates/MailerUI/UIxMailMainFrame.wox index 21bed1e3..343ad30d 100644 --- a/UI/Templates/MailerUI/UIxMailMainFrame.wox +++ b/UI/Templates/MailerUI/UIxMailMainFrame.wox @@ -156,10 +156,9 @@
- -
-
-
+
+
+
diff --git a/UI/WebServerResources/ContactsUI.css b/UI/WebServerResources/ContactsUI.css index e96cc3b4..f70ba607 100644 --- a/UI/WebServerResources/ContactsUI.css +++ b/UI/WebServerResources/ContactsUI.css @@ -179,8 +179,8 @@ TABLE#contactsList TD { white-space: nowrap; width: 20%; } -TABLE#contactsList TD.headerName, -TABLE#contactsList TD.headerEmail +TD#nameHeader, +TD#mailHeader { width: 30%; } TABLE#contactsList TD IMG diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index 0e3b0357..4cae52a4 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -1,7 +1,7 @@ /* JavaScript for SOGoContacts */ var cachedContacts = new Array(); -var currentContactFolder = '/personal'; +var currentContactFolder = null; var usersRightsWindowHeight = 200; var usersRightsWindowWidth = 450; @@ -30,8 +30,22 @@ function validateEditorInput(sender) { return true; } -function openContactsFolder(contactsFolder, params) { - if (contactsFolder != currentContactFolder || params) { +function openContactsFolder(contactsFolder, reload, idx) { + if (contactsFolder != currentContactFolder || reload) { + currentContactFolder = contactsFolder; + var url = URLForFolderID(currentContactFolder) + + "/view?noframe=1"; + + var searchValue = search["value"]; + if (searchValue && searchValue.length > 0) + url += ("&search=" + search["criteria"] + + "&value=" + searchValue); + var sortAttribute = sorting["attribute"]; + if (sortAttribute && sortAttribute.length > 0) + url += ("&sort=" + sorting["attribute"] + + "&asc=" + sorting["ascending"]); + + var selection; if (contactsFolder == currentContactFolder) { var contactsList = $("contactsList"); if (contactsList) @@ -40,21 +54,14 @@ function openContactsFolder(contactsFolder, params) { window.alert("no contactsList"); } else - selection = null; - - currentContactFolder = contactsFolder; - var url = URLForFolderID(currentContactFolder) + - "/view?noframe=1&sort=cn&desc=0"; - if (params) - url += '&' + params; - - var selection; - if (document.contactsListAjaxRequest) { - document.contactsListAjaxRequest.aborted = true; - document.contactsListAjaxRequest.abort(); - } - document.contactsListAjaxRequest - = triggerAjaxRequest(url, contactsListCallback, selection); + selection = null; + + if (document.contactsListAjaxRequest) { + document.contactsListAjaxRequest.aborted = true; + document.contactsListAjaxRequest.abort(); + } + document.contactsListAjaxRequest + = triggerAjaxRequest(url, contactsListCallback, selection); } } @@ -70,6 +77,15 @@ function openContactsFolderAtIndex(element) { = triggerAjaxRequest(url, contactsListCallback); } +function configureContactsListHeaders(cells) { + for (var i = 0; i < cells.length; i++) { + var currentCell = $(cells[i]); + Event.observe(currentCell, "click", + onHeaderClick.bindAsEventListener(currentCell)); + Event.observe(currentCell, "mousedown", listRowMouseDownHandler); + } +} + function contactsListCallback(http) { var div = $("contactsListContent"); @@ -77,12 +93,44 @@ function contactsListCallback(http) { && http.status == 200) { document.contactsListAjaxRequest = null; div.innerHTML = http.responseText; + + var table = $("contactsList"); + if (table) + configureContactsListHeaders(table.tBodies[0].rows[0].cells); + + if (sorting["attribute"] && sorting["attribute"].length > 0) { + var sortHeader; + if (sorting["attribute"] == "cn") + sortHeader = $("nameHeader"); + else if (sorting["attribute"] == "mail") + sortHeader = $("mailHeader"); + else if (sorting["attribute"] == "screenname") + sortHeader = $("screenNameHeader"); + else if (sorting["attribute"] == "o") + sortHeader = $("orgHeader"); + else if (sorting["attribute"] == "telephonenumber") + sortHeader = $("phoneHeader"); + else + sortHeader = null; + + if (sortHeader) { + var sortImage = createElement("img", "messageSortImage", "sortImage"); + sortHeader.insertBefore(sortImage, sortHeader.firstChild); + if (sorting["ascending"]) + sortImage.src = ResourcesURL + "/title_sortdown_12x12.png"; + else + sortImage.src = ResourcesURL + "/title_sortup_12x12.png"; + } + } + var selected = http.callbackData; if (selected) { - for (var i = 0; i < selected.length; i++) - $(selected[i]).select(); + for (var i = 0; i < selected.length; i++) { + var row = $(selected[i]); + if (row) + row.select(); + } } - configureSortableTableHeaders(); } else log ("ajax problem 1"); @@ -332,19 +380,31 @@ function newEmailTo(sender) { } function onHeaderClick(event) { - if (document.contactsListAjaxRequest) { - document.contactsListAjaxRequest.aborted = true; - document.contactsListAjaxRequest.abort(); - } - url = URLForFolderID(currentContactFolder); -// // log("url: " + url); -// var url = "" + this.href; - if (url.indexOf("noframe=", 0) == -1) - url += "&noframe=1"; - document.contactsListAjaxRequest - = triggerAjaxRequest(url, contactsListCallback); + var headerId = this.getAttribute("id"); + var newSortAttribute; + if (headerId == "nameHeader") + newSortAttribute = "cn"; + else if (headerId == "mailHeader") + newSortAttribute = "mail"; + else if (headerId == "screenNameHeader") + newSortAttribute = "screenname"; + else if (headerId == "orgHeader") + newSortAttribute = "o"; + else if (headerId == "phoneHeader") + newSortAttribute = "telephonenumber"; + + log("header: " + headerId); + + if (sorting["attribute"] == newSortAttribute) + sorting["ascending"] = !sorting["ascending"]; + else { + sorting["attribute"] = newSortAttribute; + sorting["ascending"] = true; + } + + refreshCurrentFolder(); - event.preventDefault(); + preventDefault(event); } function registerDraggableMessageNodes() { @@ -367,17 +427,17 @@ function onFolderSelectionChange() { var div = $("contactsListContent"); div.innerHTML = ""; } - else - openContactsFolder(nodes[0].getAttribute("id"), null); + else { + search = {}; + sorting = {}; + $("searchValue").value = ""; + initCriteria(); + openContactsFolder(nodes[0].getAttribute("id")); + } } -function onSearchFormSubmit() { - var searchValue = $("searchValue"); - - openContactsFolder(currentContactFolder, - "search=" + searchValue.value); - - return false; +function refreshCurrentFolder() { + openContactsFolder(currentContactFolder, true); } function onConfirmContactSelection(event) { @@ -409,7 +469,7 @@ function onConfirmContactSelection(event) { && selectorList.value != initialValues) selector.changeNotification("addition"); - event.preventDefault(); + preventDefault(event); } function onContactMailTo(node) { @@ -417,11 +477,11 @@ function onContactMailTo(node) { } function refreshContacts(contactId) { - openContactsFolder(currentContactFolder, "reload=true"); - cachedContacts[currentContactFolder + "/" + contactId] = null; - loadContact(contactId); + refreshCurrentFolder(); + cachedContacts[currentContactFolder + "/" + contactId] = null; + loadContact(contactId); - return false; + return false; } function onAddressBookNew(event) { @@ -465,7 +525,7 @@ function newUserFolderCallback(folderData) { function onAddressBookAdd(event) { openUserFolderSelector(newUserFolderCallback, "contact"); - event.preventDefault(); + preventDefault(event); } function onFolderUnsubscribeCB(folderId) { @@ -494,7 +554,7 @@ function onAddressBookRemove(event) { } } - event.preventDefault(); + preventDefault(event); } function deletePersonalAddressBook(folderId) { @@ -594,13 +654,15 @@ function configureContactFolders() { var personalFolder = $("/personal"); personalFolder.select(); + openContactsFolder("/personal"); } } function setEventsOnContactFolder(node) { - Event.observe(node, "mousedown", listRowMouseDownHandler, false); - Event.observe(node, "click", onRowClick, false); - Event.observe(node, "contextmenu", onContactFoldersContextMenu.bindAsEventListener(node), false); + Event.observe(node, "mousedown", listRowMouseDownHandler, false); + Event.observe(node, "click", onRowClick, false); + Event.observe(node, "contextmenu", + onContactFoldersContextMenu.bindAsEventListener(node), false); } function onMenuSharing(event) { @@ -625,29 +687,19 @@ function getMenus() { return menus; } -function configureSearchField() { - var searchValue = $("searchValue"); - - Event.observe(searchValue, "mousedown", onSearchMouseDown.bindAsEventListener(searchValue), false); - Event.observe(searchValue, "click", popupSearchMenu.bindAsEventListener(searchValue), false); - Event.observe(searchValue, "blur", onSearchBlur.bindAsEventListener(searchValue), false); - Event.observe(searchValue, "focus", onSearchFocus.bindAsEventListener(searchValue), false); - Event.observe(searchValue, "keydown", onSearchKeyDown.bindAsEventListener(searchValue), false); -} - function configureSelectionButtons() { var container = $("contactSelectionButtons"); if (container) { var buttons = container.childNodesWithTag("input"); for (var i = 0; i < buttons.length; i++) - Event.observe(buttons[i], "click", onConfirmContactSelection.bindAsEventListener(buttons[i]), false); + Event.observe(buttons[i], "click", + onConfirmContactSelection.bindAsEventListener(buttons[i])); } } function initContacts(event) { if (!document.body.hasClassName("popup")) { configureAbToolbar(); - configureSearchField(); } else configureSelectionButtons(); diff --git a/UI/WebServerResources/MailerUI.css b/UI/WebServerResources/MailerUI.css index 2010ef56..98d15c6b 100644 --- a/UI/WebServerResources/MailerUI.css +++ b/UI/WebServerResources/MailerUI.css @@ -470,7 +470,8 @@ TABLE#addr_table } TABLE#messageList -{ display: block; +{ cursor: default; + display: block; position: absolute; background-color: #fff; color: #000; @@ -493,21 +494,25 @@ TABLE#messageList THEAD TABLE#messageList TD { height: 1.2em; } +TD#messageFlagHeader, TABLE#messageList TD.messageFlagColumn { width: 1em; text-align: center; } +TD#subjectHeader, TABLE#messageList TD.tbtv_subject_headercell, TABLE#messageList td.mailer_unreadmailsubject, TABLE#messageList td.mailer_readmailsubject { width: 40%; min-width: 40%; } +TD#fromHeader, TABLE#messageList TD.tbtv_from_headercell, TABLE#messageList TD.messageAddressColumn { width: 35%; overflow: hidden; } +TD#dateHeader, TABLE#messageList TD.tbtv_date_headercell, TABLE#messageList TD.messageDateColumn { width: 25%; diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index a88ec830..6e30e03a 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -342,7 +342,8 @@ function moveMessages(rowIds, folder) { /* send AJAX request (synchronously) */ var messageId = currentMailbox + "/" + rowIds[i]; - url = ApplicationBaseURL + messageId + "/move?jsonly=1&tofolder=" + folder; + url = (ApplicationBaseURL + messageId + + "/move?jsonly=1&tofolder=" + folder); http = createHTTPClient(); http.open("GET", url, false /* not async */); http.send(""); @@ -384,6 +385,11 @@ function onMailboxTreeItemClick(event) { this.select(); topNode.selectedEntry = this; + search = {}; + sorting = {}; + $("searchValue").value = ""; + initCriteria(); + var datatype = this.parentNode.getAttribute("datatype"); if (datatype == "account" || datatype == "additional") { currentMailbox = mailbox; @@ -406,73 +412,60 @@ function onMailboxMenuCopy() { window.alert("unimplemented"); } -function _refreshWindowMailbox() { - openMailbox(currentMailbox, true); -} - function refreshMailbox() { var topWindow = getTopWindow(); if (topWindow) - topWindow._refreshWindowMailbox(); + topWindow.refreshCurrentFolder(); return false; } -function openMailbox(mailbox, reload) { +function openMailbox(mailbox, reload, idx) { if (mailbox != currentMailbox || reload) { currentMailbox = mailbox; - var url = ApplicationBaseURL + mailbox + "/view?noframe=1&desc=1"; - var mailboxContent = $("mailboxContent"); - var rightDragHandle = $("rightDragHandle"); + var url = ApplicationBaseURL + mailbox + "/view?noframe=1"; var messageContent = $("messageContent"); messageContent.innerHTML = ''; - if (mailbox.lastIndexOf("/") == 0) { - var url = (ApplicationBaseURL + currentMailbox + "/" - + "/view?noframe=1"); - if (document.messageAjaxRequest) { - document.messageAjaxRequest.aborted = true; - document.messageAjaxRequest.abort(); - } - document.messageAjaxRequest - = triggerAjaxRequest(url, messageCallback); - mailboxContent.innerHTML = ''; - mailboxContent.style.visibility = "hidden;"; - rightDragHandle.style.visibility = "hidden;"; - messageContent.style.top = "0px;"; - } else { - if (document.messageListAjaxRequest) { - document.messageListAjaxRequest.aborted = true; - document.messageListAjaxRequest.abort(); - } - if (currentMessages[mailbox]) { - loadMessage(currentMessages[mailbox]); - url += '&pageforuid=' + currentMessages[mailbox]; - } - document.messageListAjaxRequest - = triggerAjaxRequest(url, messageListCallback, - currentMessages[mailbox]); - if (mailboxContent.getStyle('visibility') == "hidden") { - mailboxContent.setStyle({ visibility: "visible" }); - rightDragHandle.setStyle({ visibility: "visible" }); - messageContent.setStyle({ top: (rightDragHandle.offsetTop - + rightDragHandle.offsetHeight - + 'px') }); - } + + if (currentMessages[mailbox]) { + loadMessage(currentMessages[mailbox]); + url += '&pageforuid=' + currentMessages[mailbox]; + } + + var searchValue = search["value"]; + if (searchValue && searchValue.length > 0) + url += ("&search=" + search["criteria"] + + "&value=" + searchValue); + var sortAttribute = sorting["attribute"]; + if (sortAttribute && sortAttribute.length > 0) + url += ("&sort=" + sorting["attribute"] + + "&asc=" + sorting["ascending"]); + if (idx) + url += "&idx=" + idx; + + if (document.messageListAjaxRequest) { + document.messageListAjaxRequest.aborted = true; + document.messageListAjaxRequest.abort(); } + + var mailboxContent = $("mailboxContent"); + if (mailboxContent.getStyle('visibility') == "hidden") { + mailboxContent.setStyle({ visibility: "visible" }); + var rightDragHandle = $("rightDragHandle"); + rightDragHandle.setStyle({ visibility: "visible" }); + messageContent.setStyle({ top: (rightDragHandle.offsetTop + + rightDragHandle.offsetHeight + + 'px') }); + } + + document.messageListAjaxRequest + = triggerAjaxRequest(url, messageListCallback, + currentMessages[mailbox]); } - // triggerAjaxRequest(mailbox, 'toolbar', toolbarCallback); } function openMailboxAtIndex(event) { - var idx = this.getAttribute("idx"); - var url = ApplicationBaseURL + currentMailbox + "/view?noframe=1&idx=" + idx; - - if (document.messageListAjaxRequest) { - document.messageListAjaxRequest.aborted = true; - document.messageListAjaxRequest.abort(); - } - document.messageListAjaxRequest - = triggerAjaxRequest(url, messageListCallback); + openMailbox(currentMailbox, true, this.getAttribute("idx")); preventDefault(event); } @@ -486,11 +479,31 @@ function messageListCallback(http) { div.innerHTML = http.responseText; var selected = http.callbackData; if (selected) { - var row = $('row_' + selected); - row.select(); + var row = $("row_" + selected); + if (row) + row.select(); } configureMessageListEvents(); - configureSortableTableHeaders(); + if (sorting["attribute"] && sorting["attribute"].length > 0) { + var sortHeader; + if (sorting["attribute"] == "subject") + sortHeader = $("subjectHeader"); + else if (sorting["attribute"] == "from") + sortHeader = $("fromHeader"); + else if (sorting["attribute"] == "date") + sortHeader = $("dateHeader"); + else + sortHeader = null; + + if (sortHeader) { + var sortImage = createElement("img", "messageSortImage", "sortImage"); + sortHeader.insertBefore(sortImage, sortHeader.firstChild); + if (sorting["ascending"]) + sortImage.src = ResourcesURL + "/title_sortdown_12x12.png"; + else + sortImage.src = ResourcesURL + "/title_sortup_12x12.png"; + } + } } else log("messageListCallback: problem during ajax request (readyState = " + http.readyState + ", status = " + http.status + ")"); @@ -834,24 +847,31 @@ function expandUpperTree(node) { } function onHeaderClick(event) { - if (document.messageListAjaxRequest) { - document.messageListAjaxRequest.aborted = true; - document.messageListAjaxRequest.abort(); + var headerId = this.getAttribute("id"); + var newSortAttribute; + if (headerId == "subjectHeader") + newSortAttribute = "subject"; + else if (headerId == "fromHeader") + newSortAttribute = "from"; + else if (headerId == "dateHeader") + newSortAttribute = "date"; + else + newSortAttribute = "arrival"; + + if (sorting["attribute"] == newSortAttribute) + sorting["ascending"] = !sorting["ascending"]; + else { + sorting["attribute"] = newSortAttribute; + sorting["ascending"] = true; } - var link = this.getAttribute('href'); - url = ApplicationBaseURL + currentMailbox + "/" + link; - if (!link.match(/noframe=/)) - url += "&noframe=1"; - document.messageListAjaxRequest - = triggerAjaxRequest(url, messageListCallback); + + refreshCurrentFolder(); preventDefault(event); } -function onSearchFormSubmit() { - log("search not implemented"); - - return false; +function refreshCurrentFolder() { + openMailbox(currentMailbox, true); } function pouetpouet(event) { @@ -934,11 +954,24 @@ var messageListData = function(type) { return msgIds; } +/* a model for a futur refactoring of the sortable table headers mechanism */ + +function configureMessageListHeaders(cells) { + for (var i = 0; i < cells.length; i++) { + var currentCell = $(cells[i]); + Event.observe(currentCell, "click", + onHeaderClick.bindAsEventListener(currentCell)); + Event.observe(currentCell, "mousedown", listRowMouseDownHandler); + } +} + function configureMessageListEvents() { var messageList = $("messageList"); if (messageList) { Event.observe(messageList, "mousedown", onMessageSelectionChange.bindAsEventListener(messageList)); + + configureMessageListHeaders(messageList.tHead.rows[0].cells); var cell = messageList.tHead.rows[1].cells[0]; if ($(cell).hasClassName("tbtv_navcell")) { var anchors = $(cell).childNodesWithTag("a"); @@ -955,7 +988,7 @@ function configureMessageListEvents() { rows[i].dndGhost = messageListGhost; rows[i].dndDataForType = messageListData; document.DNDManager.registerSource(rows[i]); - + for (var j = 0; j < rows[i].cells.length; j++) { var cell = rows[i].cells[j]; Event.observe(cell, "mousedown", listRowMouseDownHandler); @@ -1026,19 +1059,8 @@ function openInbox(node) { mailboxTree.o(1); } -function configureSearchField() { - var searchValue = $("searchValue"); - - Event.observe(searchValue, "mousedown", onSearchMouseDown.bindAsEventListener(searchValue)); - Event.observe(searchValue, "click", popupSearchMenu.bindAsEventListener(searchValue)); - Event.observe(searchValue, "blur", onSearchBlur.bindAsEventListener(searchValue)); - Event.observe(searchValue, "focus", onSearchFocus.bindAsEventListener(searchValue)); - Event.observe(searchValue, "keydown", onSearchKeyDown.bindAsEventListener(searchValue)); -} - function initMailer(event) { if (!document.body.hasClassName("popup")) { - configureSearchField(); configureMessageListEvents(); initDnd(); currentMailbox = "/" + accounts[0] + "/INBOX"; @@ -1319,6 +1341,9 @@ function getMenus() { null); menus["mark-menu"] = new Array(null, null, null, null, "-", null, "-", null, null, null); + menus["searchMenu"] = new Array(setSearchCriteria, setSearchCriteria, + setSearchCriteria, setSearchCriteria, + setSearchCriteria); return menus; } diff --git a/UI/WebServerResources/UIxAclEditor.js b/UI/WebServerResources/UIxAclEditor.js index 5354d999..8e39832b 100644 --- a/UI/WebServerResources/UIxAclEditor.js +++ b/UI/WebServerResources/UIxAclEditor.js @@ -53,7 +53,7 @@ function saveAcls() { function onUserAdd(event) { openUserFolderSelector(null, "user"); - event.preventDefault(); + preventDefault(event); } function removeUserCallback(http) { @@ -79,7 +79,7 @@ function onUserRemove(event) { var userId = nodes[i].getAttribute("id"); triggerAjaxRequest(baseURL + userId, removeUserCallback, nodes[i]); } - event.preventDefault(); + preventDefault(event); } function subscribeToFolder(refreshCallback, refreshCallbackData) { @@ -109,12 +109,12 @@ function openRightsForUser(button) { function openRightsForDefaultUser(event) { openRightsForUserID(defaultUserID); - event.preventDefault(); + preventDefault(event); } function onOpenUserRights(event) { openRightsForUser(); - event.preventDefault(); + preventDefault(event); } function onAclLoadHandler() { diff --git a/UI/WebServerResources/UIxAttendeesEditor.js b/UI/WebServerResources/UIxAttendeesEditor.js index ea67f8e2..1fe1004b 100644 --- a/UI/WebServerResources/UIxAttendeesEditor.js +++ b/UI/WebServerResources/UIxAttendeesEditor.js @@ -15,7 +15,7 @@ var attendeesEmails; function onContactKeydown(event) { if (event.keyCode == 9) { - event.preventDefault(); + preventDefault(event); if (this.confirmedValue) this.value = this.confirmedValue; var row = this.parentNode.parentNode.nextSibling; @@ -333,7 +333,7 @@ function initializeWindowButtons() { } function onEditorOkClick(event) { - event.preventDefault(); + preventDefault(event); attendeesNames = new Array(); attendeesEmails = new Array(); @@ -363,7 +363,7 @@ function onEditorOkClick(event) { } function onEditorCancelClick(event) { - event.preventDefault(); + preventDefault(event); window.close(); } diff --git a/UI/WebServerResources/UIxComponentEditor.js b/UI/WebServerResources/UIxComponentEditor.js index c14f0f19..47a0d619 100644 --- a/UI/WebServerResources/UIxComponentEditor.js +++ b/UI/WebServerResources/UIxComponentEditor.js @@ -43,7 +43,7 @@ function onPopupUrlWindow(event) { function onPopupDocumentWindow(event) { var documentUrl = $("url"); - event.preventDefault(); + preventDefault(event); window.open(documentUrl.value, "SOGo_Document"); return false; diff --git a/UI/WebServerResources/UIxContactsUserFolders.js b/UI/WebServerResources/UIxContactsUserFolders.js index d5b527a1..2755a613 100644 --- a/UI/WebServerResources/UIxContactsUserFolders.js +++ b/UI/WebServerResources/UIxContactsUserFolders.js @@ -78,7 +78,7 @@ function buildTree(response) { } function onFolderTreeItemClick(event) { - event.preventDefault(); + preventDefault(event); var topNode = $("d"); if (topNode.selectedEntry) diff --git a/UI/WebServerResources/events.js b/UI/WebServerResources/events.js index fdf04908..ed4db4a4 100644 --- a/UI/WebServerResources/events.js +++ b/UI/WebServerResources/events.js @@ -1,165 +1,165 @@ -// written by Dean Edwards, 2005 -// with input from Tino Zijdel, Matthias Miller, Diego Perini -// http://dean.edwards.name/weblog/2005/10/add-event/ -function addEvent(element, type, handler) { - // Modification by Tanny O'Haley, http://tanny.ica.com to add the - // DOMContentLoaded for all browsers. - if (type == "DOMContentLoaded" || type == "domload") { - addDOMLoadEvent(handler); - return; - } - - if (element.addEventListener) { - element.addEventListener(type, handler, false); - } else { - // assign each event handler a unique ID - if (!handler.$$guid) handler.$$guid = addEvent.guid++; - // create a hash table of event types for the element - if (!element.events) element.events = {}; - // create a hash table of event handlers for each element/event pair - var handlers = element.events[type]; - if (!handlers) { - handlers = element.events[type] = {}; - // store the existing event handler (if there is one) - if (element["on" + type]) { - handlers[0] = element["on" + type]; - } - } - // store the event handler in the hash table - handlers[handler.$$guid] = handler; - // assign a global event handler to do all the work - element["on" + type] = handleEvent; - } -}; -// a counter used to create unique IDs -addEvent.guid = 1; - -function removeEvent(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else { - // delete the event handler from the hash table - if (element.events && element.events[type]) { - delete element.events[type][handler.$$guid]; - } - } -}; - -function handleEvent(event) { - var returnValue = true; - // grab the event object (IE uses a global event object) - event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event); - // get a reference to the hash table of event handlers - var handlers = this.events[event.type]; - // execute each event handler - for (var i in handlers) { - this.$$handleEvent = handlers[i]; - if (this.$$handleEvent(event) === false) { - returnValue = false; - } - } - return returnValue; -}; - -function fixEvent(event) { - // add W3C standard event methods - event.preventDefault = fixEvent.preventDefault; - event.stopPropagation = fixEvent.stopPropagation; - return event; -}; -fixEvent.preventDefault = function() { - this.returnValue = false; -}; -fixEvent.stopPropagation = function() { - this.cancelBubble = true; -}; - -// End Dean Edwards addEvent. - -// Tino Zijdel - crisp@xs4all.nl This little snippet fixes the problem that the onload attribute on -// the body-element will overwrite previous attached events on the window object for the onload event. -if (!window.addEventListener) { - document.onreadystatechange = function(){ - if (window.onload && window.onload != handleEvent) { - addEvent(window, 'load', window.onload); - window.onload = handleEvent; - } - } -} - -// Here are my functions for adding the DOMContentLoaded event to browsers other -// than Mozilla. - -// Array of DOMContentLoaded event handlers. -window.onDOMLoadEvents = new Array(); -window.DOMContentLoadedInitDone = false; - -// Function that adds DOMContentLoaded listeners to the array. -function addDOMLoadEvent(listener) { - window.onDOMLoadEvents[window.onDOMLoadEvents.length]=listener; -} - -// Function to process the DOMContentLoaded events array. -function DOMContentLoadedInit() { - // quit if this function has already been called - if (window.DOMContentLoadedInitDone) return; - - // flag this function so we don't do the same thing twice - window.DOMContentLoadedInitDone = true; - - // iterates through array of registered functions - for (var i=0; i<\/script>"); - var script = document.getElementById("__ie_onload"); - script.onreadystatechange = function() { - if (this.readyState == "complete") { - DOMContentLoadedInit(); // call the onload handler - } - }; -/*@end @*/ +// written by Dean Edwards, 2005 +// with input from Tino Zijdel, Matthias Miller, Diego Perini +// http://dean.edwards.name/weblog/2005/10/add-event/ +function addEvent(element, type, handler) { + // Modification by Tanny O'Haley, http://tanny.ica.com to add the + // DOMContentLoaded for all browsers. + if (type == "DOMContentLoaded" || type == "domload") { + addDOMLoadEvent(handler); + return; + } + + if (element.addEventListener) { + element.addEventListener(type, handler, false); + } else { + // assign each event handler a unique ID + if (!handler.$$guid) handler.$$guid = addEvent.guid++; + // create a hash table of event types for the element + if (!element.events) element.events = {}; + // create a hash table of event handlers for each element/event pair + var handlers = element.events[type]; + if (!handlers) { + handlers = element.events[type] = {}; + // store the existing event handler (if there is one) + if (element["on" + type]) { + handlers[0] = element["on" + type]; + } + } + // store the event handler in the hash table + handlers[handler.$$guid] = handler; + // assign a global event handler to do all the work + element["on" + type] = handleEvent; + } +}; +// a counter used to create unique IDs +addEvent.guid = 1; + +function removeEvent(element, type, handler) { + if (element.removeEventListener) { + element.removeEventListener(type, handler, false); + } else { + // delete the event handler from the hash table + if (element.events && element.events[type]) { + delete element.events[type][handler.$$guid]; + } + } +}; + +function handleEvent(event) { + var returnValue = true; + // grab the event object (IE uses a global event object) + event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event); + // get a reference to the hash table of event handlers + var handlers = this.events[event.type]; + // execute each event handler + for (var i in handlers) { + this.$$handleEvent = handlers[i]; + if (this.$$handleEvent(event) === false) { + returnValue = false; + } + } + return returnValue; +}; + +function fixEvent(event) { + // add W3C standard event methods + event.preventDefault = fixEvent.preventDefault; + event.stopPropagation = fixEvent.stopPropagation; + return event; +}; +fixEvent.preventDefault = function() { + this.returnValue = false; +}; +fixEvent.stopPropagation = function() { + this.cancelBubble = true; +}; + +// End Dean Edwards addEvent. + +// Tino Zijdel - crisp@xs4all.nl This little snippet fixes the problem that the onload attribute on +// the body-element will overwrite previous attached events on the window object for the onload event. +if (!window.addEventListener) { + document.onreadystatechange = function(){ + if (window.onload && window.onload != handleEvent) { + addEvent(window, 'load', window.onload); + window.onload = handleEvent; + } + } +} + +// Here are my functions for adding the DOMContentLoaded event to browsers other +// than Mozilla. + +// Array of DOMContentLoaded event handlers. +window.onDOMLoadEvents = new Array(); +window.DOMContentLoadedInitDone = false; + +// Function that adds DOMContentLoaded listeners to the array. +function addDOMLoadEvent(listener) { + window.onDOMLoadEvents[window.onDOMLoadEvents.length]=listener; +} + +// Function to process the DOMContentLoaded events array. +function DOMContentLoadedInit() { + // quit if this function has already been called + if (window.DOMContentLoadedInitDone) return; + + // flag this function so we don't do the same thing twice + window.DOMContentLoadedInitDone = true; + + // iterates through array of registered functions + for (var i=0; i<\/script>"); + var script = document.getElementById("__ie_onload"); + script.onreadystatechange = function() { + if (this.readyState == "complete") { + DOMContentLoadedInit(); // call the onload handler + } + }; +/*@end @*/ diff --git a/UI/WebServerResources/generic.css b/UI/WebServerResources/generic.css index 5ea9c2e1..e1a0f2d3 100644 --- a/UI/WebServerResources/generic.css +++ b/UI/WebServerResources/generic.css @@ -390,7 +390,8 @@ td.tbtv_actcell TD.headerCell, TD.tbtv_headercell, TD.tbtv_navcell -{ background-color: #d4d0c8; +{ vertical-align: middle; + background-color: #d4d0c8; border-top: 1px solid #fff; border-left: 1px solid #fff; border-right: 2px solid #222; @@ -400,10 +401,12 @@ TD.tbtv_navcell TD.headerCell:active, TD.tbtv_headercell:active -{ background-color: #DCDAD5; - border: 1px solid #9c9a94; - -moz-border-bottom-colors: #9c9a94; - -moz-border-right-colors: #9c9a94; } +{ background-color: #dcdad5; + padding-top: 2px; + border-top: 1px solid #9c9a94; + border-left: 1px solid #9c9a94; + border-right: 2px solid #9c9a94; + border-bottom: 1px solid #9c9a94; } TD.headerCell SPAN, td.tbtv_headercell SPAN @@ -425,6 +428,7 @@ td.tbtv_headercell a:hover /* background-color: #C4C0B8; */ } +IMG.sortImage, TD.headerCell IMG.tbtv_sortcell, td.tbtv_headercell img.tbtv_sortcell { float: right; diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index 0ff9cfa8..a99e2cb3 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -29,12 +29,17 @@ var queryParameters; var activeAjaxRequests = 0; var menus = new Array(); +var search = {}; +var sorting = {}; var weekStartIsMonday = true; // logArea = null; var allDocumentElements = null; +var userDefaults = null; +var userSettings = null; + /* a W3C compliant document.all */ function getAllScopeElements(scope) { var elements = new Array(); @@ -99,6 +104,30 @@ function getElementsByClassName2(_tag, _class, _scope) { } } +function createElement(tagName, id, classes, attributes, htmlAttributes, + parentNode) { + var newElement = $(document.createElement(tagName)); + if (id) + newElement.setAttribute("id", id); + if (classes) { + if (typeof(classes) == "string") + newElement.addClassName(classes); + else + for (var i = 0; i < classes.length; i++) + newElement.addClassName(classes[i]); + } + if (attributes) + for (var i in attributes) + newElement[i] = attributes[i]; + if (htmlAttributes) + for (var i in htmlAttributes) + newElement.setAttribute(i, attributes[i]); + if (parentNode) + parentNode.appendChild(newElement); + + return $(newElement); +} + function ml_stripActionInURL(url) { if (url[url.length - 1] != '/') { var i; @@ -206,7 +235,7 @@ function createHTTPClient() { // http://developer.apple.com/internet/webcontent/xmlhttpreq.html if (typeof XMLHttpRequest != "undefined") return new XMLHttpRequest(); - + try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { } try { return new ActiveXObject("Microsoft.XMLHTTP"); } @@ -730,11 +759,9 @@ function checkDropDown(event) { /* search field */ function popupSearchMenu(event) { - var node = getTarget(event); - var menuId = this.getAttribute("menuid"); - relX = event.pageX - node.cascadeLeftOffset(); - relY = event.pageY - node.cascadeTopOffset(); + relX = event.pageX - $(this).cascadeLeftOffset(); + relY = event.pageY - $(this).cascadeTopOffset(); if (event.button == 0 && relX < 24) { @@ -744,9 +771,9 @@ function popupSearchMenu(event) { if (document.currentPopupMenu) hideMenu(event, document.currentPopupMenu); - var popup = document.getElementById(menuId); - popup.setStyle({ top: node.offsetHeight + "px", - left: (node.offsetLeft + 3) + "px", + var popup = $(menuId); + popup.setStyle({ top: this.offsetHeight + "px", + left: (this.offsetLeft + 3) + "px", visibility: "visible" }); document.currentPopupMenu = popup; @@ -759,7 +786,7 @@ function setSearchCriteria(event) { searchCriteria = $("searchCriteria"); searchValue.setAttribute("ghost-phrase", this.innerHTML); -// searchCriteria = this.getAttribute('id'); + searchCriteria.value = this.getAttribute('id'); } function checkSearchValue(event) { @@ -775,6 +802,21 @@ function onSearchChange() { log ("onSearchChange()..."); } +function configureSearchField() { + var searchValue = $("searchValue"); + + Event.observe(searchValue, "mousedown", + onSearchMouseDown.bindAsEventListener(searchValue)); + Event.observe(searchValue, "click", + popupSearchMenu.bindAsEventListener(searchValue)); + Event.observe(searchValue, "blur", + onSearchBlur.bindAsEventListener(searchValue)); + Event.observe(searchValue, "focus", + onSearchFocus.bindAsEventListener(searchValue)); + Event.observe(searchValue, "keydown", + onSearchKeyDown.bindAsEventListener(searchValue)); +} + function onSearchMouseDown(event) { var superNode = this.parentNode.parentNode.parentNode; relX = (event.pageX - superNode.offsetLeft - this.offsetLeft); @@ -821,23 +863,27 @@ function onSearchKeyDown(event) { this.timer = setTimeout("onSearchFormSubmit()", 1000); } +function onSearchFormSubmit(event) { + var searchValue = $("searchValue"); + var searchCriteria = $("searchCriteria"); + + search["criteria"] = searchCriteria.value; + search["value"] = searchValue.value; + + refreshCurrentFolder(); +} + function initCriteria() { var searchCriteria = $("searchCriteria"); var searchValue = $("searchValue"); - var firstOption; - var searchOptions = $("searchOptions"); - if (searchOptions) { - var firstOption; - $A(searchOptions.childNodes).each(function (item) { - if (item.tagName == 'LI') { - firstOption = item; - } - }); - searchCriteria.value = firstOption.getAttribute('id'); - searchValue.setAttribute('ghost-phrase', firstOption.innerHTML); + var searchOptions = $("searchOptions").childNodesWithTag("li"); + if (searchOptions.length > 0) { + var firstChild = searchOptions[0]; + searchCriteria.value = $(firstChild).getAttribute('id'); + searchValue.setAttribute('ghost-phrase', firstChild.innerHTML); if (searchValue.value == '') { - searchValue.value = firstOption.innerHTML; + searchValue.value = firstChild.innerHTML; searchValue.setAttribute("modified", ""); searchValue.setStyle({ color: "#aaa" }); } @@ -946,7 +992,7 @@ function unsubscribeFromFolder(folder, refreshCallback, refreshCallbackData) { } function listRowMouseDownHandler(event) { - preventDefault(event); + preventDefault(event); } /* tabs */ @@ -1174,36 +1220,53 @@ function indexColor(number) { return color; } +function loadPreferences() { + var url = UserFolderURL + "jsonDefaults"; + var http = createHTTPClient(); + http.open("GET", url, false); + http.send(""); + if (http.status == 200) + userDefaults = http.responseText.evalJSON(true); + + url = UserFolderURL + "jsonSettings"; + http.open("GET", url, false); + http.send(""); + if (http.status == 200) + userSettings = http.responseText.evalJSON(true); +} + function onLoadHandler(event) { - queryParameters = parseQueryParameters('' + window.location); - if (!$(document.body).hasClassName("popup")) { - initLogConsole(); - initCriteria(); - } - initMenus(); - initTabs(); - configureDragHandles(); - configureSortableTableHeaders(); - configureLinkBanner(); - var progressImage = $("progressIndicator"); - if (progressImage) - progressImage.parentNode.removeChild(progressImage); - Event.observe(document.body, "contextmenu", onBodyClickContextMenu); + loadPreferences(); + queryParameters = parseQueryParameters('' + window.location); + if (!$(document.body).hasClassName("popup")) { + initLogConsole(); + initCriteria(); + configureSearchField(); + } + initMenus(); + initTabs(); + configureDragHandles(); + configureSortableTableHeaders(); + configureLinkBanner(); + var progressImage = $("progressIndicator"); + if (progressImage) + progressImage.parentNode.removeChild(progressImage); + Event.observe(document.body, "contextmenu", onBodyClickContextMenu); } function onBodyClickContextMenu(event) { - preventDefault(event); + preventDefault(event); } function configureSortableTableHeaders() { - var headers = document.getElementsByClassName("sortableTableHeader"); - for (var i = 0; i < headers.length; i++) { - var header = headers[i]; - var anchor = $(header).childNodesWithTag("a")[0]; - if (anchor) - Event.observe(anchor, "click", - onHeaderClick.bindAsEventListener(anchor)); - } + var headers = document.getElementsByClassName("sortableTableHeader"); + for (var i = 0; i < headers.length; i++) { + var header = headers[i]; + var anchor = $(header).childNodesWithTag("a")[0]; + if (anchor) + Event.observe(anchor, "click", + onHeaderClick.bindAsEventListener(anchor)); + } } function onLinkBannerClick() { @@ -1218,7 +1281,7 @@ function onPreferencesClick(event) { w.opener = window; w.focus(); - event.preventDefault(); + preventDefault(event); } function configureLinkBanner() { @@ -1238,7 +1301,14 @@ function configureLinkBanner() { addEvent(window, 'load', onLoadHandler); +function parent$(element) { + return this.opener.document.getElementById(element); +} + /* stubs */ +function refreshCurrentFolder() { +} + function configureDragHandles() { } @@ -1248,7 +1318,3 @@ function getMenus() { function onHeaderClick(event) { window.alert("generic headerClick"); } - -function parent$(element) { - return this.opener.document.getElementById(element); -}