2007-09-14 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ * SoObjects/Appointments/SOGoAppointmentFolder.m
+ ([-deleteEntriesWithIds:ids]): moved method into SOGoFolder.
+
+ * UI/Scheduler/UIxCalMainView.m ([-batchDeleteAction]): moved
+ method into UIxFolderActions.
+
+ * SoObjects/Appointments/SOGoFreeBusyObject.m ([SOGoFreeBusyObject
+ -fetchFreeBusyInfosFrom:_startDateto:_endDate]): fetch the
+ freebusy info from the "personal" calendar.
+
+ * UI/Common/UIxParentFolderActions.m ([UIxParentFolderActions
+ -createFolderAction]): new standardized method for requesting
+ folder creations among gcs-based modules.
+
+ * UI/Common/UIxParentFolderActions.[hm]: new action class module.
+
+ * SoObjects/Appointments/SOGoAppointmentFolders.m: new class
+ module, equivalent to the SOGoParentFolder's child
+ SOGoContactFolders, but for calendars.
+
* SoObjects/SOGo/SOGoObject.m ([SOGoObject -labelForKey:key]): new
method that returns translated strings for controller bundles
(same as what UIxComponent does for view bundles).
given during an indirect bind;
- deleting a message no longer expunges its parent folder;
- implemented support for multiple calendars;
-- it is not possible to rename folders;
+- it is now possible to rename folders;
- fixed search in message content;
+- added tooltips for toolbar buttons (English and French);
+- added checkmarks in live search options popup menus;
+- initial support for resizable columns in tables;
- countless bugfixes;
0.9.0-20070824
- (NSArray *) fetchFreeBusyInfosFrom: (NSCalendarDate *) _startDate
to: (NSCalendarDate *) _endDate;
-- (void) deleteEntriesWithIds: (NSArray *) ids;
-
/* URL generation */
- (NSString *) baseURLForAptWithUID: (NSString *) _uid
component: _component];
}
-- (void) deleteEntriesWithIds: (NSArray *) ids
-{
- Class objectClass;
- unsigned int count, max;
- NSString *currentId;
- id deleteObject;
-
- max = [ids count];
- for (count = 0; count < max; count++)
- {
- currentId = [ids objectAtIndex: count];
- objectClass
- = [self objectClassForResourceNamed: currentId];
- deleteObject = [objectClass objectWithName: currentId
- inContainer: self];
- [deleteObject delete];
- [deleteObject primaryDelete];
- }
-}
-
/* URL generation */
- (NSString *) baseURLForAptWithUID: (NSString *)_uid
--- /dev/null
+/* SOGoAppointmentFolders.h - this file is part of SOGo
+ *
+ * Copyright (C) 2007 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 SOGOAPPOINTMENTFOLDERS_H
+#define SOGOAPPOINTMENTFOLDERS_H
+
+#import <SoObjects/SOGo/SOGoParentFolder.h>
+
+@interface SOGoAppointmentFolders : SOGoParentFolder
+
+@end
+
+#endif /* SOGOAPPOINTMENTFOLDERS_H */
--- /dev/null
+/* SOGoAppointmentFolders.m - this file is part of SOGo
+ *
+ * Copyright (C) 2007 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/NSString.h>
+
+#import "SOGoAppointmentFolder.h"
+
+#import "SOGoAppointmentFolders.h"
+
+@implementation SOGoAppointmentFolders
+
++ (NSString *) gcsFolderType
+{
+ return @"Appointment";
+}
+
++ (Class) subFolderClass
+{
+ return [SOGoAppointmentFolder class];
+}
+
+- (NSString *) defaultFolderName
+{
+ return @"Personal calendar";
+}
+
+@end
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoPermissions.h>
+#import "SOGoAppointmentFolder.h"
+
#import "SOGoFreeBusyObject.h"
@interface SOGoFreeBusyObject (PrivateAPI)
- (NSArray *) fetchFreeBusyInfosFrom: (NSCalendarDate *) _startDate
to: (NSCalendarDate *) _endDate
{
- id calFolder;
+ SOGoAppointmentFolder *calFolder;
// SoSecurityManager *sm;
NSArray *infos;
- calFolder = [container lookupName: @"Calendar" inContext: nil acquire: NO];
+ calFolder = [[container lookupName: @"Calendar" inContext: nil acquire: NO]
+ lookupName: @"personal" inContext: nil acquire: NO];
// sm = [SoSecurityManager sharedSecurityManager];
// if (![sm validatePermission: SOGoPerm_FreeBusyLookup
// onObject: calFolder
// inContext: context])
- infos = [calFolder fetchFreeBusyInfosFrom: _startDate
- to: _endDate];
+ infos = [calFolder fetchFreeBusyInfosFrom: _startDate
+ to: _endDate];
// else
// {
// infos = [NSArray new];
}
return allErrors;
}
-- (NSException *)deleteInUIDs:(NSArray *)_uids {
- NSEnumerator *e;
- id folder;
- NSException *allErrors = nil;
+// - (NSException *)deleteInUIDs:(NSArray *)_uids {
+// NSEnumerator *e;
+// id folder;
+// NSException *allErrors = nil;
- e = [[container lookupCalendarFoldersForUIDs: _uids inContext: context]
- objectEnumerator];
- while ((folder = [e nextObject])) {
- NSException *error;
- SOGoTaskObject *task;
+// e = [[container lookupCalendarFoldersForUIDs: _uids inContext: context]
+// objectEnumerator];
+// while ((folder = [e nextObject])) {
+// NSException *error;
+// SOGoTaskObject *task;
- task = [folder lookupName: [self nameInContainer]
- inContext: context
- acquire: NO];
- if (![task isNotNull]) {
- [self logWithFormat:@"Note: did not find '%@' in folder: %@",
- [self nameInContainer], folder];
- continue;
- }
- if ([task isKindOfClass: [NSException class]]) {
- [self logWithFormat:@"Exception: %@", [(NSException *) task reason]];
- continue;
- }
+// task = [folder lookupName: [self nameInContainer]
+// inContext: context
+// acquire: NO];
+// if (![task isNotNull]) {
+// [self logWithFormat:@"Note: did not find '%@' in folder: %@",
+// [self nameInContainer], folder];
+// continue;
+// }
+// if ([task isKindOfClass: [NSException class]]) {
+// [self logWithFormat:@"Exception: %@", [(NSException *) task reason]];
+// continue;
+// }
- if ((error = [task primaryDelete]) != nil) {
- [self logWithFormat:@"Note: failed to delete in folder: %@", folder];
- // TODO: make compound
- allErrors = error;
- }
- }
- return allErrors;
-}
+// if ((error = [task primaryDelete]) != nil) {
+// [self logWithFormat:@"Note: failed to delete in folder: %@", folder];
+// // TODO: make compound
+// allErrors = error;
+// }
+// }
+// return allErrors;
+// }
/* "iCal multifolder saves" */
- delete in removed folders
- send iMIP mail for all folders not found
*/
- iCalToDo *task;
- NSArray *removedUIDs;
- NSMutableArray *attendees;
+// iCalToDo *task;
+// NSArray *removedUIDs;
+// NSMutableArray *attendees;
- /* load existing content */
+ [self primaryDelete];
+
+ return nil;
+// /* load existing content */
- task = (iCalToDo *) [self component: NO];
+// task = (iCalToDo *) [self component: NO];
- /* compare sequence if requested */
+// /* compare sequence if requested */
- if (_v != 0) {
- // TODO
- }
+// if (_v != 0) {
+// // TODO
+// }
- removedUIDs = [self attendeeUIDsFromTask:task];
+// removedUIDs = [self attendeeUIDsFromTask:task];
- if ([self sendEMailNotifications])
- {
- /* send notification email to attendees excluding organizer */
- attendees = [NSMutableArray arrayWithArray:[task attendees]];
- [attendees removePerson:[task organizer]];
+// if ([self sendEMailNotifications])
+// {
+// /* send notification email to attendees excluding organizer */
+// attendees = [NSMutableArray arrayWithArray:[task attendees]];
+// [attendees removePerson:[task organizer]];
- /* flag task as being cancelled */
- [(iCalCalendar *) [task parent] setMethod: @"cancel"];
- [task increaseSequence];
-
- /* remove all attendees to signal complete removal */
- [task removeAllAttendees];
-
- /* send notification email */
- [self sendEMailUsingTemplateNamed: @"Deletion"
- forOldObject: nil
- andNewObject: task
- toAttendees: attendees];
- }
+// /* flag task as being cancelled */
+// [(iCalCalendar *) [task parent] setMethod: @"cancel"];
+// [task increaseSequence];
+
+// /* remove all attendees to signal complete removal */
+// [task removeAllAttendees];
+
+// /* send notification email */
+// [self sendEMailUsingTemplateNamed: @"Deletion"
+// forOldObject: nil
+// andNewObject: task
+// toAttendees: attendees];
+// }
- /* perform */
+// /* perform */
- return [self deleteInUIDs:removedUIDs];
+// return [self deleteInUIDs:removedUIDs];
}
- (NSException *)saveContentString:(NSString *)_iCalString {
/* lower level fetches */
- (BOOL) nameExistsInFolder: (NSString *) objectName;
+- (void) deleteEntriesWithIds: (NSArray *) ids;
+
- (NSArray *) fetchContentObjectNames;
- (NSDictionary *) fetchContentStringsAndNamesOfAllObjects;
#import "NSArray+Utilities.h"
#import "NSString+Utilities.h"
+#import "SOGoContentObject.h"
#import "SOGoPermissions.h"
#import "SOGoUser.h"
&& [records count] > 0);
}
+- (void) deleteEntriesWithIds: (NSArray *) ids
+{
+ unsigned int count, max;
+ NSString *currentID;
+ SOGoContentObject *deleteObject;
+
+ max = [ids count];
+ for (count = 0; count < max; count++)
+ {
+ currentID = [ids objectAtIndex: count];
+ deleteObject = [self lookupName: currentID
+ inContext: context acquire: NO];
+ [deleteObject delete];
+ }
+}
+
- (NSDictionary *) fetchContentStringsAndNamesOfAllObjects
{
NSDictionary *files;
"Sorry, the user rights can not be configured for that object." = "Sorry, the user rights can not be configured for that object.";
/* generic.js */
-"Unable to subscribe to that folder!" = "Unable to subscribe to that folder!";
-"You cannot subscribe to a folder that you own!" = "You cannot subscribe to a folder that you own!";
-"Unable to unsubscribe from that folder!" = "Unable to unsubscribe from that folder!";
-"You cannot unsubscribe from a folder that you own!" = "You cannot unsubscribe from a folder that you own!";
+"Unable to subscribe to that folder!"
+ = "Unable to subscribe to that folder!";
+"You cannot subscribe to a folder that you own!"
+ = "You cannot subscribe to a folder that you own!";
+"Unable to unsubscribe from that folder!"
+ = "Unable to unsubscribe from that folder!";
+"You cannot unsubscribe from a folder that you own!"
+ = "You cannot unsubscribe from a folder that you own!";
"Unable to rename that folder!" = "Unable to rename that folder!";
+"You have already subscribed to that folder!"
+ = "You have already subscribed to that folder!";
"Unable to unsubscribe from that folder!" = "Impossible de se désabonner de ce dossier.";
"You cannot unsubscribe from a folder that you own!" = "Impossible de vous désabonner d'un dossier qui vous appartient.";
"Unable to rename that folder!" = "Impossible de renommer ce dossier.";
+"You have already subscribed to that folder!"
+ = "Vous êtes déja abonné à ce dossier.";
"Unable to unsubscribe from that folder!" = "Unmöglich sich von diesem Ordner zu des-abonnieren.";
"You cannot unsubscribe from a folder that you own!" = "Unmöglich sich von einem Ordner zu des-abonnieren, der Ihnen selbst gehört.";
"Unable to rename that folder!" = "Unable to rename that folder!";
+"You have already subscribed to that folder!"
+ = "You have already subscribed to that folder!";
- (void) _setupContext
{
- NSString *clientClass, *mailInvitationParam;
+ NSString *folder, *mailInvitationParam;
+ NSArray *realFolderPath;
SOGoUser *activeUser;
activeUser = [context activeUser];
clientObject = [self clientObject];
owner = [clientObject ownerInContext: nil];
- clientClass = NSStringFromClass([clientObject class]);
- if ([clientClass isEqualToString: @"SOGoContactGCSFolder"])
- baseFolder = @"Contacts";
- else if ([clientClass isEqualToString: @"SOGoAppointmentFolder"])
- baseFolder = @"Calendar";
- else
- baseFolder = nil;
+ baseFolder = [[clientObject container] nameInContainer];
um = [LDAPUserManager sharedUserManager];
ud = [activeUser userSettings];
}
[ud setObject: moduleSettings forKey: baseFolder];
+ realFolderPath = [[clientObject nameInContainer]
+ componentsSeparatedByString: @"_"];
+ if ([realFolderPath count] > 1)
+ folder = [realFolderPath objectAtIndex: 1];
+ else
+ folder = [realFolderPath objectAtIndex: 0];
subscriptionPointer = [NSString stringWithFormat: @"%@:%@/%@",
- owner, baseFolder,
- [clientObject nameInContainer]];
+ owner, baseFolder, folder];
mailInvitationParam
= [[context request] formValueForKey: @"mail-invitation"];
return response;
}
+- (id) batchDeleteAction
+{
+ WOResponse *response;
+ NSString *idsParam;
+ NSArray *ids;
+
+ idsParam = [[context request] formValueForKey: @"ids"];
+ ids = [idsParam componentsSeparatedByString: @"/"];
+ if ([ids count])
+ {
+ clientObject = [self clientObject];
+ [clientObject deleteEntriesWithIds: ids];
+ response = [self responseWith204];
+ }
+ else
+ {
+ response = [self responseWithStatus: 500];
+ [response appendContentString: @"At least 1 id required."];
+ }
+
+ return response;
+}
+
@end
--- /dev/null
+/* UIxParentFolderActions.h - this file is part of SOGo
+ *
+ * Copyright (C) 2007 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 UIXPARENTFOLDERACTIONS_H
+#define UIXPARENTFOLDERACTIONS_H
+
+#import <NGObjWeb/WODirectAction.h>
+
+@interface UIxParentFolderActions : WODirectAction
+@end
+
+#endif /* UIXPARENTFOLDERACTIONS_H */
--- /dev/null
+/* UIxParentFolderActions.m - this file is part of SOGo
+ *
+ * Copyright (C) 2007 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/NSString.h>
+
+#import <NGObjWeb/NSException+HTTP.h>
+#import <NGObjWeb/WOResponse.h>
+#import <NGObjWeb/WORequest.h>
+
+#import <UI/Common/WODirectAction+SOGo.h>
+#import <SoObjects/SOGo/SOGoParentFolder.h>
+
+#import "UIxParentFolderActions.h"
+
+@implementation UIxParentFolderActions
+
+- (id <WOActionResults>) createFolderAction
+{
+ WOResponse *response;
+ NSString *name, *nameInContainer;
+
+ name = [[context request] formValueForKey: @"name"];
+ if ([name length] > 0)
+ {
+ response = (WOResponse *) [[self clientObject] newFolderWithName: name
+ nameInContainer: &nameInContainer];
+ if (!response)
+ {
+ response = [self responseWithStatus: 201];
+ [response setHeader: @"text/plain; charset=us-ascii"
+ forKey: @"content-type"];
+ [response appendContentString: nameInContainer];
+ }
+ }
+ else
+ response = [NSException exceptionWithHTTPStatus: 400
+ reason: @"The name is missing"];
+
+ return response;
+}
+
+@end
return image;
}
+- (NSString *) buttonTooltip
+{
+ NSString *key;
+
+ key = [[self buttonInfo] valueForKey: @"tooltip"];
+
+ return [self labelForKey: key];
+}
+
/* enable/disable buttons */
- (BOOL)isButtonEnabled {
actionClass = "UIxFolderActions";
actionName = "renameFolder";
};
+ batchDelete = {
+ protectedBy = "Delete Objects";
+ actionClass = "UIxFolderActions";
+ actionName = "batchDelete";
+ };
};
};
};
"invalidemailwarn" = "invalidemailwarn";
"new" = "new";
+/* Tooltips */
+
+"Create a new address book card" = "Create a new address book card";
+"Create a new list" = "Create a new list";
+"Edit the selected card" = "Edit the selected card";
+"Send a mail message" = "Send a mail message";
+"Delete selected card or address book" = "Delete selected card or address book";
+
"htmlMailFormat_UNKNOWN" = "Unknown";
"htmlMailFormat_FALSE" = "Plain Text";
"htmlMailFormat_TRUE" = "HTML";
= "This person can read the cards of this addressbook.";
"This person can erase cards from this addressbook."
= "This person can erase cards from this addressbook.";
+
+"The selected contact has no email address."
+= "The selected contact has no email address.";
"invalidemailwarn" = "Champ de l'email invalide, continuer quand même ?";
"new" = "Nouveau";
+/* Tooltips */
+
+"Create a new address book card" = "Créer une nouvelle fiche";
+"Create a new list" = "Créer une nouvelle liste de diffusion";
+"Edit the selected card" = "Modifier la fiche sélectionnée";
+"Send a mail message" = "Rédiger un courrier à la sélection";
+"Delete selected card or address book" = "Supprimer la fiche sélectionnée";
+
"htmlMailFormat_UNKNOWN" = "Inconnu";
"htmlMailFormat_FALSE" = "Texte simple (sans HTML)";
"htmlMailFormat_TRUE" = "HTML";
"This person can erase cards from this addressbook."
= "Cette personne peut effacer des fiches de ce carnet d'adresses.";
+"The selected contact has no email address."
+= "Cette personne n'a pas d'adresse courriel.";
+
= "Diese Person kann Karten dieses Adressbuches anzeigen.";
"This person can erase cards from this addressbook."
= "Diese Person kann Karten aus diesem Adressbuch löschen";
+
+"The selected contact has no email address."
+= "The selected contact has no email address.";
"Attach" = "Attach";
"Save" = "Save";
+/* Tooltips */
+
+"Send this message now" = "Send this message now";
+"Select a recipient from an Address Book" = "Select a recipient from an Address Book";
+"Include an attachment" = "Include an attachment";
+"Save this message" = "Save this message";
+"Get new messages" = "Get new messages";
+"Create a new message" = "Create a new message";
+"Go to address book" = "Go to address book";
+"Reply to the message" = "Reply to the message";
+"Reply to sender and all recipients" = "Reply to sender and all recipients";
+"Forward selected message" = "Forward selected message";
+"Delete selected message or folder" = "Delete selected message or folder";
+"Mark the selected messages as junk" = "Mark the selected messages as junk";
+"Print this message" = "Print this message";
+"Stop the current transfer" = "Stop the current transfer";
+
/* Main Frame */
"Home" = "Home";
"Attach" = "Joindre";
"Save" = "Enregistrer";
+/* Tooltips */
+
+"Send this message now" = "Envoyer le message maintenant";
+"Select a recipient from an Address Book" = "Sélectionner un destinataire du carnet d'adresses";
+"Include an attachment" = "Inclure une pièce jointe";
+"Save this message" = "Enregistrer ce message";
+"Get new messages" = "Relever les nouveaux messages";
+"Create a new message" = "Créer un nouveau message";
+"Go to address book" = "Ouvrir le carnet d'adresses";
+"Reply to the message" = "Répondre au message";
+"Reply to sender and all recipients" = "Répondre à l'expéditeur et à tous les destinataires";
+"Forward selected message" = "Transférer le message sélectionné";
+"Delete selected message or folder" = "Supprimer le message ou le dossier sélectionné";
+"Mark the selected messages as junk" = "Marquer les messages sélectionnés comme indésirables";
+"Print this message" = "Imprimer ce message";
+"Stop the current transfer" = "Arrêter le transfert courant";
+
/* Main Frame */
"Home" = "Accueil";
/* this file is in UTF-8 format! */
+/* Tooltips */
+
+"Create a new event" = "Create a new event";
+"Create a new task" = "Create a new task";
+"Edit this event or task" = "Edit this event or task";
+"Delete this event or task" = "Delete this event or task";
+"Go to today" = "Go to today";
+"Switch to day view" = "Switch to day view";
+"Switch to week view" = "Switch to week view";
+"Switch to month view" = "Switch to month view";
+
/* Day */
"Sunday" = "Sunday";
"eventDeleteConfirmation" = "Erasing this event will be permanent.\\nWould you like to continue?";
"taskDeleteConfirmation" = "Erasing this task will be permanent.\\nWould you like to continue?";
+"Are you sure you want to delete the selected calendar?"
+= "Are you sure you want to delete the selected calendar?";
+
/* Legend */
"Required participant" = "Required participant";
"Optional participant" = "Optional participant";
/* this file is in UTF-8 format! */
+/* Tooltips */
+
+"Create a new event" = "Créer un nouvel événement";
+"Create a new task" = "Créer une nouvelle tâche";
+"Edit this event or task" = "Modifier l'événement ou la tâche sélectionnée";
+"Delete this event or task" = "Supprimer l'événement ou la tâche sélectionnée";
+"Go to today" = "Aller à la journée d'aujourd'hui";
+"Switch to day view" = "Passer à la vue par jour";
+"Switch to week view" = "Passer à la vue par semaine";
+"Switch to month view" = "Passer à la vue par mois";
+
/* Day */
"Sunday" = "Dimanche";
"eventDeleteConfirmation" = "L'effacement de cet événement sera permanent.\\nVoulez-vous continuer?";
"taskDeleteConfirmation" = "L'effacement de cette tâche sera permanent.\\nVoulez-vous continuer?";
+"Are you sure you want to delete the selected calendar?"
+= "Voulez-vous vraiment supprimer l'agenda sélectionné ?";
+
/* Legend */
"Required participant" = "Participant obligatoire";
"Optional participant" = "Participant facultatif";
"eventDeleteConfirmation" = "L'effacement de cet événement sera permanent.\\nVoulez-vous continuer?";
"taskDeleteConfirmation" = "L'effacement de cette tâche sera permanent.\\nVoulez-vous continuer?";
+"Are you sure you want to delete the selected calendar?"
+= "Are you sure you want to delete the selected calendar?";
+
/* Legend */
"Required participant" = "Participant obligatoire";
"Optional participant" = "Participant facultatif";
return yearMenuItem;
}
-- (id) batchDeleteAction
-{
- NSArray *ids;
- SOGoAppointmentFolder *clientObject;
-
- ids = [[self queryParameterForKey: @"ids"] componentsSeparatedByString: @"/"];
- if (ids)
- {
- clientObject = [self clientObject];
- [clientObject deleteEntriesWithIds: ids];
- }
-
- return self;
-}
-
@end
SOGoAppointmentFolder *folder;
NSMutableDictionary *calendar;
unsigned int count, max;
- NSString *folderId, *folderName;
+ NSString *folderName;
NSNumber *isActive;
if (!calendars)
pageName = "UIxCalUserRightsEditor";
actionName = "saveUserRights";
};
+ editAttendees = {
+ protectedBy = "View";
+ pageName = "UIxAttendeesEditor";
+ };
};
};
pageName = "UIxTaskEditor";
actionName = "new";
};
- batchDelete = {
- protectedBy = "Delete Objects";
- pageName = "UIxCalMainView";
- actionName = "batchDelete";
- };
-
show = {
protectedBy = "View";
pageName = "UIxCalView";
actionName = "redirectForUIDs";
};
- batchDelete = {
- protectedBy = "Delete Objects";
- pageName = "UIxCalMainView";
- actionName = "batchDelete";
- };
- editAttendees = {
- protectedBy = "View";
- pageName = "UIxAttendeesEditor";
- };
userRights = {
protectedBy = "ReadAcls";
pageName = "UIxCalUserRightsEditor";
pageName = "UIxAppointmentEditor";
actionName = "decline";
};
- editAttendees = {
- protectedBy = "View";
- pageName = "UIxAttendeesEditor";
- };
};
};
<script type="text/javascript" rsrc:src="skycalendar.js"><!-- space --></script>
<script type="text/javascript" rsrc:src="UIxComponentEditor.js"><!-- space --></script>
+ <script type="text/javascript">
+ var activeCalendar = '<var:string value="clientObject.container.nameInContainer"/>';
+ var activeComponent = '<var:string value="clientObject.nameInContainer"/>';
+ </script>
+
<div class="menu" id="privacy-menu">
<ul id="itemPrivacyList">
<var:foreach list="privacyClasses" item="item">
</script>
<script type="text/javascript" rsrc:src="events.js"><!-- space required --></script>
<script type="text/javascript" rsrc:src="prototype.js"><!-- space required --></script>
+ <script type="text/javascript" rsrc:src="tablekit.js"><!-- space required --></script>
<script type="text/javascript" rsrc:src="JavascriptAPIExtensions.js"><!-- space required --></script>
<script type="text/javascript" rsrc:src="HTMLElement.js"><!-- space required --></script>
<script type="text/javascript" rsrc:src="HTMLInputElement.js"><!-- space required --></script>
var:href="buttonInfo.link"
var:target="buttonInfo.target"
var:onclick="buttonInfo.onclick"
- var:title="buttonInfo.tooltip"
+ var:title="buttonTooltip"
><span class="toolbarButton"
><img class="buttonImage"
var:src="buttonImage"
- var:alt="buttonInfo.tooltip"
+ var:alt="buttonTooltip"
/><var:if condition="hasMenu"
><img class="buttonMenuArrow"
rsrc:src="arrow-dwn-sharp.gif"
- var:alt="buttonInfo.tooltip"
+ var:alt="buttonTooltip"
/></var:if
><br
/><span class="buttonLabel"
><span class="disabledToolbarButton"
><img class="buttonImage"
var:src="buttonImage"
- var:alt="buttonInfo.tooltip"
+ var:alt="buttonTooltip"
/><br
/><span class="buttonLabel"
><var:string
width: 100%; }
TABLE#contactsList TD
-{ white-space: nowrap;
- width: 20%; }
+{ white-space: wrap;
+ /*width: 20%;*/ }
TD#nameHeader,
TD#mailHeader
-{ width: 30%; }
+{ /*width: 30%;*/ }
TABLE#contactsList TD IMG
{
INPUT#searchValue:focus
{ color: #000; }
+TABLE#contactsList TD.resize-handle-active
+{ cursor: e-resize; }
+
+DIV.resize-handle
+{ cursor: e-resize;
+ width: 2px;
+ border-right: 1px solid #fff;
+ position: absolute;
+ top: 0;
+ left: 0;
+ max-height: 2em; }
+
/* drag handles */
DIV#dragHandle
{
var cachedContacts = new Array();
var currentContactFolder = null;
+var savedColumnsWidth = null;
var usersRightsWindowHeight = 200;
var usersRightsWindowWidth = 450;
var currentCell = $(cells[i]);
Event.observe(currentCell, "click",
onHeaderClick.bindAsEventListener(currentCell));
- Event.observe(currentCell, "mousedown", listRowMouseDownHandler);
+ //Event.observe(currentCell, "mousedown", listRowMouseDownHandler);
}
}
if (http.readyState == 4
&& http.status == 200) {
document.contactsListAjaxRequest = null;
- div.innerHTML = http.responseText;
+ div.update(http.responseText);
var table = $("contactsList");
- if (table)
+ if (table) {
+ TableKit.Resizable.init(table);
+ if (savedColumnsWidth != null) {
+ // Restore columns width
+ table.setColumnsWidth(savedColumnsWidth);
+ }
configureContactsListHeaders(table.tBodies[0].rows[0].cells);
+ }
if (sorting["attribute"] && sorting["attribute"].length > 0) {
var sortHeader;
$(this).select();
}
-function onContactContextMenu(event, element) {
+function onContactContextMenu(event, element) { log ("onContactContextMenu");
var menu = $("contactMenu");
- //Event.observe(menu, "hideMenu", onContactContextMenuHide, false);
+
Event.observe(menu, "mousedown", onContactContextMenuHide, false);
- //document.documentElement.onclick = onContactContextMenuHide;
popupMenu(event, "contactMenu", element);
var topNode = $("contactsList");
function onMenuWriteToContact(event) {
var contactId = document.menuTarget.getAttribute('id');
+ var contactRow = $(contactId);
+ var emailCell = contactRow.down('td', 1);
+
+ if (!emailCell.firstChild) { // .nodeValue is the contact email address
+ window.alert(labels["The selected contact has no email address."].decodeEntities());
+ return false;
+ }
openMailComposeWindow(ApplicationBaseURL + currentContactFolder
+ "/" + contactId + "/write");
+
+ if (document.body.hasClassName("popup"))
+ window.close();
}
function onMenuDeleteContact(event) {
function onToolbarWriteToSelectedContacts(event) {
var contactsList = $('contactsList');
var rows = contactsList.getSelectedRowsId();
+ var rowsWithEmail = 0;
- for (var i = 0; i < rows.length; i++)
- openMailComposeWindow(ApplicationBaseURL + currentContactFolder
- + "/" + rows[i] + "/write");
+ for (var i = 0; i < rows.length; i++) {
+ var emailCell = $(rows[i]).down('td', 1);
+ if (emailCell.firstChild) { // .nodeValue is the contact email address
+ rowsWithEmail++;
+ openMailComposeWindow(ApplicationBaseURL + currentContactFolder
+ + "/" + rows[i] + "/write");
+ }
+ }
+
+ if (rowsWithEmail == 0) {
+ window.alert(labels["The selected contact has no email address."].decodeEntities());
+ }
+ else if (document.body.hasClassName("popup"))
+ window.close();
return false;
}
sorting["ascending"] = true;
}
+ savedColumnsWidth = this.up('table').getColumnsWidth();
refreshCurrentFolder();
preventDefault(event);
folder = accessToSubscribedFolder(folder);
else
folder = "/" + name;
- var li = document.createElement("li");
- $("contactFolders").appendChild(li);
- li.setAttribute("id", folder);
- li.appendChild(document.createTextNode(name));
- setEventsOnContactFolder(li);
+ if ($(folder))
+ window.alert(clabels["You have already subscribed to that folder!"]);
+ else {
+ var li = document.createElement("li");
+ $("contactFolders").appendChild(li);
+ li.setAttribute("id", folder);
+ li.appendChild(document.createTextNode(name));
+ setEventsOnContactFolder(li);
+ }
}
function newFolderCallback(http) {
node.select();
}
}
+ },
+
+ getColumnsWidth: function(element) {
+ element = $(element);
+ var widths = new Array();
+ if (element.tagName == 'TABLE') {
+ var cells = TableKit.getHeaderCells(element);
+ for (var i = 0; i < cells.length; i++) {
+ widths[i] = $(cells[i]).getWidth();
+ }
+ }
+ return widths;
+ },
+
+ setColumnsWidth: function(element, widths) {
+ element = $(element);
+ if (element.tagName == 'TABLE') {
+ for (var i = 0; i < widths.length; i++) {
+ TableKit.Resizable.resize(element, i, widths[i]);
+ }
+ }
}
+
+
}); // Element.addMethods
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
+ License along with OGo; see the file COPYING. If not, write toge the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
}
TABLE.mailer_fieldtable
-{
- top: 0px;
+{ top: 0px;
left: 0px;
padding-top: .5em;
padding-bottom: .5em;
overflow-x: hidden;
border-bottom: 1px solid #808080;
background: #d4d0c8;
-}
+ width: 100%; }
DIV.mailer_mailcontent
{
}
TABLE#messageList
-{ display: block;
- position: relative;
- width: 100%; }
+{ /*width: 100%;*/ }
TABLE#messageList TD
{ height: 1.2em; }
TABLE#messageList TD.tbtv_subject_headercell,
TABLE#messageList TD.mailer_unreadmailsubject,
TABLE#messageList TD.mailer_readmailsubject
-{ width: 40%;
+{ /*width: 40%;*/
min-width: 40%; }
TD#fromHeader,
TABLE#messageList TD.tbtv_from_headercell,
TABLE#messageList TD.messageAddressColumn
-{ width: 35%;
+{ /*width: 35%;*/
+ min-width: 35%;
overflow: hidden; }
TD#dateHeader,
TABLE#messageList TD.tbtv_date_headercell,
TABLE#messageList TD.messageDateColumn
-{ width: 25%;
+{ /*width: 25%;*/
overflow: hidden; }
TABLE#messageList TR._selected TD
text-decoration: line-through;
}
+TABLE#messageList TD.resize-handle-active
+{ cursor: e-resize; }
+
+DIV.resize-handle
+{ cursor: e-resize;
+ width: 2px;
+ border-right: 1px solid #fff;
+ position: absolute;
+ top: 0;
+ left: 0;
+ max-height: 2em; }
+
/* drag handles */
DIV#verticalDragHandle
{
deleteCachedMessage(messageId);
if (currentMessages[currentMailbox] == rowId) {
var div = $('messageContent');
- div.innerHTML = "";
+ div.update();
currentMessages[currentMailbox] = null;
}
}
deleteCachedMessage(messageId);
if (currentMessages[currentMailbox] == rowIds[i]) {
var div = $('messageContent');
- div.innerHTML = "";
+ div.update();
currentMessages[currentMailbox] = null;
}
}
currentMailboxType = this.parentNode.getAttribute("datatype");
if (currentMailboxType == "account" || currentMailboxType == "additional") {
currentMailbox = mailbox;
- $("messageContent").innerHTML = "";
+ $("messageContent").update();
var body = $("messageList").tBodies[0];
for (var i = body.rows.length; i > 0; i--)
body.deleteRow(i-1);
currentMailbox = mailbox;
var url = ApplicationBaseURL + mailbox + "/view?noframe=1";
var messageContent = $("messageContent");
- messageContent.innerHTML = '';
-
+ messageContent.update();
+
var currentMessage;
if (!idx) {
currentMessage = currentMessages[mailbox];
+ "&asc=" + sorting["ascending"]);
if (idx)
url += "&idx=" + idx;
-
if (document.messageListAjaxRequest) {
document.messageListAjaxRequest.aborted = true;
document.messageListAjaxRequest.abort();
if (http.readyState == 4
&& http.status == 200) {
- document.messageListAjaxRequest = null;
- div.innerHTML = http.responseText;
+ document.messageListAjaxRequest = null;
+ div.update(http.responseText);
+
+ TableKit.Resizable.init($('messageList'));
+
var selected = http.callbackData;
if (selected) {
var row = $("row_" + selected);
row.select();
}
configureMessageListEvents();
+
if (sorting["attribute"] && sorting["attribute"].length > 0) {
var sortHeader;
if (sorting["attribute"] == "subject")
markMailInWindow(window, idx, true);
} else {
var div = $('messageContent');
- div.innerHTML = cachedMessage['text'];
+ div.update(cachedMessage['text']);
cachedMessage['time'] = (new Date()).getTime();
document.messageAjaxRequest = null;
configureLinksInMessage();
if (http.readyState == 4
&& http.status == 200) {
document.messageAjaxRequest = null;
- div.innerHTML = http.responseText;
+ div.update(http.responseText);
configureLinksInMessage();
if (http.callbackData) {
refreshCurrentFolder();
- preventDefault(event);
+ Event.stop(event);
}
function refreshCurrentFolder() {
for (var i = 0; i < cells.length; i++) {
var currentCell = $(cells[i]);
Event.observe(currentCell, "click",
- onHeaderClick.bindAsEventListener(currentCell));
- Event.observe(currentCell, "mousedown", listRowMouseDownHandler);
+ onHeaderClick.bindAsEventListener(currentCell));
+ //Event.observe(currentCell, "mousedown", listRowMouseDownHandler);
}
}
var messageList = $("messageList");
if (messageList) {
Event.observe(messageList, "mousedown",
- onMessageSelectionChange.bindAsEventListener(messageList));
+ 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");
function initMailer(event) {
if (!document.body.hasClassName("popup")) {
- configureMessageListEvents();
initDnd();
- currentMailbox = "/" + accounts[0] + "/folderINBOX";
initMailboxTree();
}
}
}
function updateMailboxTreeInPage() {
- $("folderTreeContent").innerHTML = mailboxTree;
+ $("folderTreeContent").update(mailboxTree);
var inboxFound = false;
var tree = $("mailboxTree");
}
function deleteEventCallback(http) {
- if (http.readyState == 4
- && http.status == 200) {
- var nodes = http.callbackData;
- for (var i = 0; i < nodes.length; i++) {
- var node = $(nodes[i]);
- if (node)
- node.parentNode.removeChild(node);
- }
- if (eventsToDelete.length)
- _batchDeleteEvents();
- else {
- document.deleteEventAjaxRequest = null;
- refreshEvents();
- refreshTasks();
- changeCalendarDisplay();
+ if (http.readyState == 4) {
+ if (isHttpStatus204(http.status)) {
+ var nodes = http.callbackData;
+ for (var i = 0; i < nodes.length; i++) {
+ var node = $(nodes[i]);
+ if (node)
+ node.parentNode.removeChild(node);
+ }
+ if (eventsToDelete.length)
+ _batchDeleteEvents();
+ else {
+ document.deleteEventAjaxRequest = null;
+ refreshEvents();
+ refreshTasks();
+ changeCalendarDisplay();
+ }
}
+ else
+ log ("deleteEventCallback Ajax error");
}
- else
- log ("deleteEventCallback Ajax error");
}
function editDoubleClickedEvent(event) {
var viewEndDate = ed.asDate();
var startDate = new Date();
- startDate.setTime(eventData[4] * 1000 + (1000 * UTCOffset));
var endDate = new Date();
- endDate.setTime(eventData[5] * 1000 + (1000 * UTCOffset));
+ if (eventData[7] == 0) {
+ startDate.setTime(eventData[4] * 1000 + (1000 * UTCOffset));
+ endDate.setTime(eventData[5] * 1000 + (1000 * UTCOffset));
+ }
+ else {
+ startDate.setTime(eventData[4] * 1000);
+ endDate.setTime(eventData[5] * 1000);
+ }
+
+// log ("s: " + startDate+ "; e: " + endDate);
var days = startDate.daysUpTo(endDate);
editEvent, deleteEvent, "-",
onSelectAll, "-",
null, null);
- menus["calendarsMenu"] = new Array(null, null, "-", null, null, "-",
+ menus["calendarsMenu"] = new Array(onCalendarNew, onCalendarRemove,
+ "-", null, null, "-",
null, "-", onMenuSharing);
menus["searchMenu"] = new Array(setSearchCriteria);
// log ("append: " + folderName + "; folder: " + folder);
- var calendarList = $("calendarList");
- var lis = calendarList.childNodesWithTag("li");
- var color = indexColor(lis.length + 100);
- //log ("color: " + color);
-
- var li = document.createElement("li");
- calendarList.appendChild(li);
-
- var checkBox = document.createElement("input");
- checkBox.setAttribute("type", "checkbox");
- li.appendChild(checkBox);
-
- li.appendChild(document.createTextNode(" "));
-
- var colorBox = document.createElement("div");
- li.appendChild(colorBox);
- li.appendChild(document.createTextNode(" " + folderName));
- colorBox.appendChild(document.createTextNode("OO"));
-
- li.setAttribute("id", folder);
- Event.observe(li, "mousedown", listRowMouseDownHandler);
- Event.observe(li, "click", onRowClick);
- $(checkBox).addClassName("checkBox");
-
- Event.observe(checkBox, "click",
- updateCalendarStatus.bindAsEventListener(checkBox));
-
- $(colorBox).addClassName("colorBox");
- if (color)
- $(colorBox).setStyle({color: color,
- backgroundColor: color});
-
- var url = URLForFolderID(folder) + "/canAccessContent";
- triggerAjaxRequest(url, calendarEntryCallback, folder);
-
- if (!document.styleSheets) return;
- var theRules = new Array();
- var lastSheet = document.styleSheets[document.styleSheets.length - 1];
- if (lastSheet.insertRule) { // Mozilla
- lastSheet.insertRule('.calendarFolder' + folder.substr(1) + ' {'
- + ' background-color: '
- + color
- + ' !important; }', 0);
- }
- else { // IE
- lastSheet.addRule('.calendarFolder' + folder.substr(1),
- ' background-color: '
- + color
- + ' !important; }');
+ if ($(folder))
+ window.alert(clabels["You have already subscribed to that folder!"]);
+ else {
+ var calendarList = $("calendarList");
+ var lis = calendarList.childNodesWithTag("li");
+ var color = indexColor(lis.length + 100);
+ //log ("color: " + color);
+
+ var li = document.createElement("li");
+ calendarList.appendChild(li);
+
+ var checkBox = document.createElement("input");
+ checkBox.setAttribute("type", "checkbox");
+ li.appendChild(checkBox);
+ li.appendChild(document.createTextNode(" "));
+
+ var colorBox = document.createElement("div");
+ li.appendChild(colorBox);
+ li.appendChild(document.createTextNode(" " + folderName));
+ colorBox.appendChild(document.createTextNode("OO"));
+
+ li.setAttribute("id", folder);
+ Event.observe(li, "mousedown", listRowMouseDownHandler);
+ Event.observe(li, "click", onRowClick);
+ $(checkBox).addClassName("checkBox");
+
+ Event.observe(checkBox, "click",
+ updateCalendarStatus.bindAsEventListener(checkBox));
+
+ $(colorBox).addClassName("colorBox");
+ if (color)
+ $(colorBox).setStyle({color: color,
+ backgroundColor: color});
+
+ var url = URLForFolderID(folder) + "/canAccessContent";
+ triggerAjaxRequest(url, calendarEntryCallback, folder);
+
+ if (!document.styleSheets) return;
+ var theRules = new Array();
+ var lastSheet = document.styleSheets[document.styleSheets.length - 1];
+ if (lastSheet.insertRule) { // Mozilla
+ lastSheet.insertRule('.calendarFolder' + folder.substr(1) + ' {'
+ + ' background-color: '
+ + color
+ + ' !important; }', 0);
+ }
+ else { // IE
+ lastSheet.addRule('.calendarFolder' + folder.substr(1),
+ ' background-color: '
+ + color
+ + ' !important; }');
+ }
}
}
function onPopupAttendeesWindow(event) {
if (event)
preventDefault(event);
- window.open(ApplicationBaseURL + "editAttendees", null,
+ window.open(ApplicationBaseURL + "/editAttendees", null,
"width=803,height=573");
return false;
var menuItems = $("itemPrivacyList").childNodesWithTag("li");
for (var i = 0; i < menuItems.length; i++)
- Event.observe(menuItems[i], "mouseup",
+ Event.observe(menuItems[i], "mousedown",
onMenuSetClassification.bindAsEventListener(menuItems[i]),
false);
}
margin-left: .5em; }
TABLE
-{ display: block;
- table-layout: fixed;
+{ table-layout: fixed;
border-spacing: 0px; }
TABLE TD
-{ white-space: nowrap;
- padding-left: .25em;
+{ padding-left: .25em;
padding-right: .25em; }
a:link
{ margin-left: 5px;
margin-right: 5px;
padding: 0;
- border-bottom: 1px solid #000000; }
+ border-bottom: 1px solid #000; }
div#header img.headerlogo
{ float: right;
.menu LI.submenu:hover, .menu LI.submenu-selected
{ background-image: url('submenu-active.gif') !important; }
+/* live search popup menu */
+UL#searchOptions LI
+{ list-style-position: inside;
+ list-style-image: url("menu-nocheck.gif");
+ padding: 1px 3px;
+ margin: px; }
+
+UL#searchOptions LI._chosen
+{ list-style-image: url("menu-check.gif"); }
+
+UL#searchOptions LI._chosen:hover
+{ list-style-image: url("menu-check-hover.gif"); }
+
DIV#logConsole
{ position: absolute;
overflow: auto;
TD.headerCell SPAN,
td.tbtv_headercell SPAN
-{ float: left;
- width: 100%; }
+{ float: left; }
td.tbtv_headercell a
{ cursor: default;
margin: 0px auto;
display: block;
- color: black;
- width: 100%; }
+ color: black; }
td.tbtv_headercell a:hover
{ margin: 0px auto;
padding-right: .3em; }
TD.headerDateTime
-{ width: 30em;
- min-width: 30em; }
+{ min-width: 30em; }
TD.headerTitle
{ width: 30%; }
TD.subjectCell,
td.tbtv_subject_headercell
-{ overflow: hidden;
- width: auto; }
+{ overflow: hidden; }
/* drag handles */
DIV.dragHandle
return w;
}
-function openMailComposeWindow(url, wId) {
+function openMailComposeWindow(url, wId) { log (url);
if (!wId)
wId = "" + (new Date().getTime());
var w = window.open(url, wId,
preventDefault(event);
}
-function hideMenu(menuNode) { //log ("hideMenu");
+function hideMenu(menuNode) {
var onHide;
if (menuNode.submenu) {
if (menuNode.parentMenuItem) {
menuNode.parentMenuItem.setAttribute('class', 'submenu');
menuNode.parentMenuItem = null;
- menuNode.parentMenu.setAttribute('onmousemove', null);
+ Event.stopObserving(menuNode, 'mousemove', checkDropDown);
menuNode.parentMenu.submenuItem = null;
menuNode.parentMenu.submenu = null;
menuNode.parentMenu = null;
}
- if (document.createEvent) {
+ if (document.createEvent) { // Safari & Mozilla
var onhideEvent;
if (isSafari())
onhideEvent = document.createEvent("UIEvents");
- else // Mozilla
+ else
onhideEvent = document.createEvent("Events");
onhideEvent.initEvent("mousedown", false, true);
menuNode.dispatchEvent(onhideEvent);
var node = event.target;
id = getParentMenu(node).menuTarget;
-// log("clicked " + id + "/" + id.tagName);
return false;
}
+ parentNode.cascadeLeftOffset()))
menuLeft = - submenuNode.offsetWidth + 3;
- parentNode.setAttribute('onmousemove', 'checkDropDown(event);');
+ Event.observe(parentNode, "mousemove", checkDropDown);
node.setAttribute('class', 'submenu-selected');
submenuNode.setStyle({ top: menuTop + "px",
left: menuLeft + "px",
hideMenu(parentMenu.submenu);
parentMenu.submenu = null;
parentMenu.submenuItem = null;
- parentMenu.setAttribute('onmousemove', null);
+ Event.stopObserving(parentMenu, 'mousemove', checkDropDown);
}
}
}
searchValue.setAttribute("ghost-phrase", this.innerHTML);
searchCriteria.value = this.getAttribute('id');
+
+ if (this.parentNode.chosenNode)
+ this.parentNode.chosenNode.removeClassName("_chosen");
+ this.addClassName("_chosen");
+ this.parentNode.chosenNode = this;
}
function checkSearchValue(event) {
function configureSearchField() {
var searchValue = $("searchValue");
+ var searchOptions = $("searchOptions");
if (!searchValue) return;
onSearchFocus.bindAsEventListener(searchValue));
Event.observe(searchValue, "keydown",
onSearchKeyDown.bindAsEventListener(searchValue));
+
+ if (!searchOptions) return;
+
+ // Set the checkmark to the first option
+ var firstOption = searchOptions.down('li');
+ firstOption.addClassName("_chosen");
+ searchOptions.chosenNode = firstOption;
}
function onSearchMouseDown(event) {
function onSearchBlur(event) {
var ghostPhrase = this.getAttribute("ghost-phrase");
- //log ("search blur: '" + this.value + "'");
+
if (!this.value) {
this.setAttribute("modified", "");
this.setStyle({ color: "#aaa" });
var searchValue = $("searchValue");
var searchCriteria = $("searchCriteria");
var ghostPhrase = searchValue.getAttribute('ghost-phrase');
-
+
if (searchValue.value == ghostPhrase) return;
search["criteria"] = searchCriteria.value;