Monotone-Parent: 773965cc12e1e34ce72a11b7b25f3ff6e0dc7887

Monotone-Revision: c0da933d3e86c470a7d83491a010f1ba6edc3fcd

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-03-25T19:59:13
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle 2008-03-25 19:59:13 +00:00
parent faff3ed110
commit a62cd61e0d
26 changed files with 547 additions and 492 deletions

View file

@ -1,3 +1,23 @@
2008-03-25 Francis Lachapelle <flachapelle@inverse.ca>
* UI/Scheduler/UIxCalMainView.m ([UIxCalMainView
-verticalDragHandleStyle]): CSS style wrt to position of drag
handle saved by current user.
([UIxCalMainView -horizontalDragHandleStyle]): idem.
([UIxCalMainView -eventsListViewStyle]): idem.
* UI/Contacts/UIxContactsListViewContainer.m
([UIxContactsListViewContainer -verticalDragHandleStyle]): CSS
style wrt to position of drag handle saved by current user.
([UIxContactsListViewContainer -horizontalDragHandleStyle]): idem.
([UIxContactsListViewContainer -contactsListContentStyle]): idem.
* UI/MailerUI/UIxMailMainFrame.m ([UIxMailMainFrame
-verticalDragHandleStyle]): CSS style wrt to position of drag
handle saved by current user.
([UIxMailMainFrame -horizontalDragHandleStyle]): idem.
([UIxMailMainFrame -mailboxContentStyle]): idem.
2008-03-18 Wolfgang Sourdeau <wsourdeau@inverse.ca> 2008-03-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Appointments/SOGoAppointmentFolder.m * SoObjects/Appointments/SOGoAppointmentFolder.m

3
NEWS
View file

@ -5,6 +5,9 @@
- pressing enter in the contact edition dialog will perform the creation/update operation - pressing enter in the contact edition dialog will perform the creation/update operation
- implemented more of the CalDAV specification for compatibility with Lightning 0.8 - implemented more of the CalDAV specification for compatibility with Lightning 0.8
- added Italian translation, thanks to Marco Lertora - added Italian translation, thanks to Marco Lertora
- improved restoration of drag hanldes state
- improved contextual menu handling of Address Book module
- fixed various bugs with Safari 3.1
0.9.0-20080208 (1.0 rc5) 0.9.0-20080208 (1.0 rc5)
------------------------ ------------------------

View file

@ -108,6 +108,8 @@
"Name of the Address Book" = "Name of the Address Book"; "Name of the Address Book" = "Name of the Address Book";
"Are you sure you want to delete the selected address book?" "Are you sure you want to delete the selected address book?"
= "Are you sure you want to delete the selected address book?"; = "Are you sure you want to delete the selected address book?";
"You cannot delete the selected contact(s)"
= "You cannot delete the selected contact(s).";
"Address Book Name" = "Address Book Name"; "Address Book Name" = "Address Book Name";

View file

@ -121,7 +121,8 @@
"Name of the Address Book" = "Nom du carnet d'adresses"; "Name of the Address Book" = "Nom du carnet d'adresses";
"Are you sure you want to delete the selected address book?" "Are you sure you want to delete the selected address book?"
= "Voulez-vous vraiment supprimer le carnet d'adresses sélectionné ?"; = "Voulez-vous vraiment supprimer le carnet d'adresses sélectionné ?";
"You cannot delete the selected contact(s)"
= "Vous ne pouvez pas supprimer les contacts sélectionnés.";
"Address Book Name" = "Nom du carnet d'adresses"; "Address Book Name" = "Nom du carnet d'adresses";
"You cannot subscribe to a folder that you own!" "You cannot subscribe to a folder that you own!"

View file

@ -112,6 +112,8 @@
"Name of the Address Book" = "Adressbuch-Name"; "Name of the Address Book" = "Adressbuch-Name";
"Are you sure you want to delete the selected address book?" "Are you sure you want to delete the selected address book?"
= "Wollen Sie wirklich das ausgewählte Adressbuch löschen?"; = "Wollen Sie wirklich das ausgewählte Adressbuch löschen?";
"You cannot delete the selected contact(s)"
= "Ausgewählte Karten können nicht gelöscht werden.";
"Address Book Name" = "Adressbuch Name"; "Address Book Name" = "Adressbuch Name";

View file

@ -31,7 +31,6 @@
NSMutableDictionary *moduleSettings; NSMutableDictionary *moduleSettings;
} }
- (WOResponse *) getDragHandlesStateAction;
- (WOResponse *) saveDragHandleStateAction; - (WOResponse *) saveDragHandleStateAction;
@end @end

View file

@ -269,24 +269,6 @@
// ? contactFolder : nil); // ? contactFolder : nil);
// } // }
- (WOResponse *) getDragHandlesStateAction
{
NSArray *dragHandles;
NSString *vertical, *horizontal;
[self _setupContext];
vertical = [moduleSettings objectForKey: @"DragHandleVertical"];
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"];
dragHandles = [[NSArray alloc] initWithObjects:
vertical ? vertical : @"",
horizontal ? horizontal : @"",
nil];
return [self responseWithStatus: 200
andString: [dragHandles jsonRepresentation]];
}
- (WOResponse *) saveDragHandleStateAction - (WOResponse *) saveDragHandleStateAction
{ {
WORequest *request; WORequest *request;

View file

@ -33,6 +33,8 @@
{ {
NSString *selectorComponentClass; NSString *selectorComponentClass;
id currentFolder; id currentFolder;
NSUserDefaults *ud;
NSMutableDictionary *moduleSettings;
} }
- (void) setCurrentFolder: (id) folder; - (void) setCurrentFolder: (id) folder;
@ -43,6 +45,10 @@
- (NSString *) currentContactFolderOwner; - (NSString *) currentContactFolderOwner;
- (NSString *) currentContactFolderName; - (NSString *) currentContactFolderName;
- (NSString *) verticalDragHandleStyle;
- (NSString *) horizontalDragHandleStyle;
- (NSString *) contactsListContentStyle;
@end @end
#endif /* UIXCONTACTSLISTVIEWCONTAINERBASE_H */ #endif /* UIXCONTACTSLISTVIEWCONTAINERBASE_H */

View file

@ -37,6 +37,27 @@
@implementation UIxContactsListViewContainer @implementation UIxContactsListViewContainer
- (void) _setupContext
{
SOGoUser *activeUser;
NSString *module;
SOGoContactFolders *clientObject;
activeUser = [context activeUser];
clientObject = [[self clientObject] container];
module = [clientObject nameInContainer];
ud = [activeUser userSettings];
moduleSettings = [ud objectForKey: module];
if (!moduleSettings)
{
moduleSettings = [NSMutableDictionary new];
[moduleSettings autorelease];
}
[ud setObject: moduleSettings forKey: module];
}
- (id) init - (id) init
{ {
if ((self = [super init])) if ((self = [super init]))
@ -120,4 +141,34 @@
return [[self queryParameterForKey: @"popup"] boolValue]; return [[self queryParameterForKey: @"popup"] boolValue];
} }
- (NSString *) verticalDragHandleStyle
{
NSString *vertical;
[self _setupContext];
vertical = [moduleSettings objectForKey: @"DragHandleVertical"];
return (vertical ? [vertical stringByAppendingFormat: @"px"] : nil);
}
- (NSString *) horizontalDragHandleStyle
{
NSString *horizontal;
[self _setupContext];
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"];
return (horizontal ? [horizontal stringByAppendingFormat: @"px"] : nil);
}
- (NSString *) contactsListContentStyle
{
int height;
[self _setupContext];
height = [[moduleSettings objectForKey: @"DragHandleVertical"] intValue];
return (height ? [NSString stringWithFormat: @"%ipx", (height - 27)] : nil);
}
@end @end

View file

@ -50,11 +50,6 @@
protectedBy = "View"; protectedBy = "View";
pageName = "UIxContactsUserFolders"; pageName = "UIxContactsUserFolders";
}; };
dragHandlesState = {
protectedBy = "<public>";
pageName = "UIxContactFoldersView";
actionName = "getDragHandlesState";
};
saveDragHandleState = { saveDragHandleState = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxContactFoldersView"; pageName = "UIxContactFoldersView";

View file

@ -31,9 +31,12 @@
NSMutableDictionary *moduleSettings; NSMutableDictionary *moduleSettings;
} }
- (WOResponse *) getDragHandlesStateAction;
- (WOResponse *) getFoldersStateAction; - (WOResponse *) getFoldersStateAction;
- (NSString *) verticalDragHandleStyle;
- (NSString *) horizontalDragHandleStyle;
- (NSString *) mailboxContentStyle;
- (WOResponse *) saveDragHandleStateAction; - (WOResponse *) saveDragHandleStateAction;
- (WOResponse *) saveFoldersStateAction; - (WOResponse *) saveFoldersStateAction;

View file

@ -163,24 +163,6 @@
return [self redirectToLocation: newLocation]; return [self redirectToLocation: newLocation];
} }
- (WOResponse *) getDragHandlesStateAction
{
NSArray *dragHandles;
NSString *vertical, *horizontal;
[self _setupContext];
vertical = [moduleSettings objectForKey: @"DragHandleVertical"];
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"];
dragHandles = [[NSArray alloc] initWithObjects:
vertical ? vertical : @"",
horizontal ? horizontal : @"",
nil];
return [self responseWithStatus: 200
andString: [dragHandles jsonRepresentation]];
}
- (WOResponse *) getFoldersStateAction - (WOResponse *) getFoldersStateAction
{ {
NSString *expandedFolders; NSString *expandedFolders;
@ -191,6 +173,36 @@
return [self responseWithStatus: 200 andString: expandedFolders]; return [self responseWithStatus: 200 andString: expandedFolders];
} }
- (NSString *) verticalDragHandleStyle
{
NSString *vertical;
[self _setupContext];
vertical = [moduleSettings objectForKey: @"DragHandleVertical"];
return (vertical ? [vertical stringByAppendingFormat: @"px"] : nil);
}
- (NSString *) horizontalDragHandleStyle
{
NSString *horizontal;
[self _setupContext];
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"];
return (horizontal ? [horizontal stringByAppendingFormat: @"px"] : nil);
}
- (NSString *) mailboxContentStyle
{
NSString *height;
[self _setupContext];
height = [moduleSettings objectForKey: @"DragHandleVertical"];
return (height ? [NSString stringWithFormat: @"%ipx", ([height intValue] - 27)] : nil);
}
- (WOResponse *) saveDragHandleStateAction - (WOResponse *) saveDragHandleStateAction
{ {
WORequest *request; WORequest *request;

View file

@ -330,11 +330,6 @@
pageName = "UIxMailMainFrame"; pageName = "UIxMailMainFrame";
actionName = "compose"; actionName = "compose";
}; };
dragHandlesState = {
protectedBy = "View";
pageName = "UIxMailMainFrame";
actionName = "getDragHandlesState";
};
foldersState = { foldersState = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailMainFrame"; pageName = "UIxMailMainFrame";

View file

@ -47,7 +47,10 @@
- (void) setYearMenuItem: (NSNumber *) aYearMenuItem; - (void) setYearMenuItem: (NSNumber *) aYearMenuItem;
- (NSNumber *) yearMenuItem; - (NSNumber *) yearMenuItem;
- (WOResponse *) getDragHandlesStateAction; - (NSString *) verticalDragHandleStyle;
- (NSString *) horizontalDragHandleStyle;
- (NSString *) eventsListViewStyle;
- (WOResponse *) saveDragHandleStateAction; - (WOResponse *) saveDragHandleStateAction;
@end @end

View file

@ -124,22 +124,34 @@ static NSMutableArray *yearMenuItems = nil;
return yearMenuItem; return yearMenuItem;
} }
- (WOResponse *) getDragHandlesStateAction - (NSString *) verticalDragHandleStyle
{ {
NSArray *dragHandles; NSString *vertical;
NSString *vertical, *horizontal;
[self _setupContext]; [self _setupContext];
vertical = [moduleSettings objectForKey: @"DragHandleVertical"];
vertical = [moduleSettings objectForKey: @"DragHandleVertical"]; return (vertical ? [vertical stringByAppendingFormat: @"px"] : nil);
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"]; }
dragHandles = [[NSArray alloc] initWithObjects:
vertical != nil ? vertical : @"",
horizontal ? horizontal : @"",
nil];
return [self responseWithStatus: 200 - (NSString *) horizontalDragHandleStyle
andString: [dragHandles jsonRepresentation]]; {
NSString *horizontal;
[self _setupContext];
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"];
return (horizontal ? [horizontal stringByAppendingFormat: @"px"] : nil);
}
- (NSString *) eventsListViewStyle
{
NSString *height;
[self _setupContext];
height = [moduleSettings objectForKey: @"DragHandleVertical"];
return (height ? [NSString stringWithFormat: @"%ipx", ([height intValue] - 27)] : nil);
} }
- (WOResponse *) saveDragHandleStateAction - (WOResponse *) saveDragHandleStateAction

View file

@ -40,11 +40,6 @@
protectedBy = "View"; protectedBy = "View";
pageName = "UIxCalMainView"; pageName = "UIxCalMainView";
}; };
dragHandlesState = {
protectedBy = "<public>";
pageName = "UIxCalMainView";
actionName = "getDragHandlesState";
};
saveDragHandleState = { saveDragHandleState = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxCalMainView"; pageName = "UIxCalMainView";

View file

@ -31,12 +31,7 @@
<tr class="tableview" <tr class="tableview"
var:id="currentCName" var:id="currentCName"
var:contactname="currentContact.displayName" var:contactname="currentContact.displayName"
var:contactid="currentContact.c_uid" var:contactid="currentContact.c_uid">
onclick="return onContactRowClick(event, this);"
ondblclick="return onContactRowDblClick(event, this);"
onmousedown="return false;"
onselectstart="return false;"
oncontextmenu="return onContactContextMenu(event, this);">
<td><img rsrc:src="abcard.gif" <td><img rsrc:src="abcard.gif"
/><var:string value="currentContact.displayName" const:escapeHTML="YES" /></td> /><var:string value="currentContact.displayName" const:escapeHTML="YES" /></td>
<td><var:string value="currentContact.mail"/></td> <td><var:string value="currentContact.mail"/></td>

View file

@ -11,6 +11,22 @@
title="name" title="name"
var:popup="isPopup"> var:popup="isPopup">
<var:if condition="hideFrame" const:negate="YES"> <var:if condition="hideFrame" const:negate="YES">
<style type="text/css">
<var:if condition="horizontalDragHandleStyle">
DIV#dragHandle, DIV#rightPanel
{ left: <var:string value="horizontalDragHandleStyle" />; }
DIV#contactFoldersList
{ width: <var:string value="horizontalDragHandleStyle" />; }
</var:if><var:if condition="verticalDragHandleStyle">
DIV#rightDragHandle, DIV#contactView
{ top: <var:string value="verticalDragHandleStyle" />; }
</var:if><var:if condition="contactsListContentStyle">
DIV#contactsListContent
{ height: <var:string value="contactsListContentStyle" />; }
</var:if>
</style>
<div class="menu" id="contactFoldersMenu"> <div class="menu" id="contactFoldersMenu">
<ul> <ul>
<li><var:string label:value="Modify" /></li> <li><var:string label:value="Modify" /></li>
@ -85,8 +101,7 @@
<div class="dragHandle" id="rightDragHandle"><!-- space --></div> <div class="dragHandle" id="rightDragHandle"><!-- space --></div>
<div id="contactView" onmousedown="return false;" <div id="contactView" onmousedown="return false;"><!-- space --></div>
></div>
</div> </div>
<!-- /var:if> --> <!-- /var:if> -->

View file

@ -12,6 +12,20 @@
var textMailAccounts = '<var:string value="mailAccounts" const:escapeHTML="NO"/>'; var textMailAccounts = '<var:string value="mailAccounts" const:escapeHTML="NO"/>';
var textQuotaSupport = '<var:string value="quotaSupport" const:escapeHTML="NO"/>'; var textQuotaSupport = '<var:string value="quotaSupport" const:escapeHTML="NO"/>';
</script> </script>
<style type="text/css">
<var:if condition="horizontalDragHandleStyle">
DIV#verticalDragHandle, DIV#rightPanel
{ left: <var:string value="horizontalDragHandleStyle" />; }
DIV#leftPanel
{ width: <var:string value="horizontalDragHandleStyle" />; }
</var:if><var:if condition="verticalDragHandleStyle">
DIV#rightDragHandle, DIV#messageContent
{ top: <var:string value="verticalDragHandleStyle" />; }
</var:if><var:if condition="mailboxContentStyle">
DIV#mailboxContent
{ height: <var:string value="mailboxContentStyle" />; }
</var:if>
</style>
<div class="menu" id="accountIconMenu"> <div class="menu" id="accountIconMenu">
<ul> <ul>
<li><var:string label:value="Subscribe..." /></li> <li><var:string label:value="Subscribe..." /></li>

View file

@ -8,6 +8,20 @@
xmlns:label="OGo:label" xmlns:label="OGo:label"
className="UIxPageFrame" className="UIxPageFrame"
title="title"> title="title">
<style type="text/css">
<var:if condition="horizontalDragHandleStyle">
DIV#verticalDragHandle, DIV#rightPanel
{ left: <var:string value="horizontalDragHandleStyle" />; }
DIV#leftPanel
{ width: <var:string value="horizontalDragHandleStyle" />; }
</var:if><var:if condition="verticalDragHandleStyle">
DIV#rightDragHandle, DIV#calendarView
{ top: <var:string value="verticalDragHandleStyle" />; }
</var:if><var:if condition="eventsListViewStyle">
DIV#eventsListView
{ height: <var:string value="eventsListViewStyle" />; }
</var:if>
</style>
<div class="preload" style="visibility: hidden;"> <div class="preload" style="visibility: hidden;">
<img rsrc:src="event-gradient.png"/> <img rsrc:src="event-gradient.png"/>
</div> </div>

View file

@ -38,7 +38,7 @@ DIV#contactsListContent
top: 2.5em; top: 2.5em;
left: 0px; left: 0px;
right: 0px; right: 0px;
height: 16em; height: 15.5em;
overflow: auto; overflow: auto;
overflow-x: hidden; } overflow-x: hidden; }
@ -169,7 +169,8 @@ DIV#folderTreeContent TABLE TD
padding: 0px; } padding: 0px; }
TABLE#contactsList TABLE#contactsList
{ -khtml-user-select: none; { -moz-user-select: none;
-khtml-user-select: none;
width: 100%; } width: 100%; }
TABLE#contactsList TD, TABLE#contactsList TD,
@ -249,13 +250,11 @@ INPUT#searchValue:focus
/* drag handles */ /* drag handles */
DIV#dragHandle DIV#dragHandle
{ { cursor: e-resize;
cursor: e-resize;
top: 8em; top: 8em;
left: 15em; left: 15em;
width: 5px; width: 5px;
bottom: 0px; bottom: 0px; }
}
DIV#rightDragHandle DIV#rightDragHandle
{ {

View file

@ -26,39 +26,39 @@ function validateEditorInput(sender) {
} }
function openContactsFolder(contactsFolder, reload, idx) { function openContactsFolder(contactsFolder, reload, idx) {
if ((contactsFolder && contactsFolder != currentContactFolder) if ((contactsFolder && contactsFolder != currentContactFolder)
|| reload) { || reload) {
currentContactFolder = contactsFolder; currentContactFolder = contactsFolder;
var url = URLForFolderID(currentContactFolder) + var url = URLForFolderID(currentContactFolder) +
"/view?noframe=1"; "/view?noframe=1";
var searchValue = search["value"]; var searchValue = search["value"];
if (searchValue && searchValue.length > 0) if (searchValue && searchValue.length > 0)
url += ("&search=" + search["criteria"] url += ("&search=" + search["criteria"]
+ "&value=" + escape(searchValue.utf8encode())); + "&value=" + escape(searchValue.utf8encode()));
var sortAttribute = sorting["attribute"]; var sortAttribute = sorting["attribute"];
if (sortAttribute && sortAttribute.length > 0) if (sortAttribute && sortAttribute.length > 0)
url += ("&sort=" + sorting["attribute"] url += ("&sort=" + sorting["attribute"]
+ "&asc=" + sorting["ascending"]); + "&asc=" + sorting["ascending"]);
var selection; var selection;
if (contactsFolder == currentContactFolder) { if (contactsFolder == currentContactFolder) {
var contactsList = $("contactsList"); var contactsList = $("contactsList");
if (contactsList) if (contactsList)
selection = contactsList.getSelectedRowsId(); selection = contactsList.getSelectedRowsId();
// else // else
// window.alert("no contactsList"); // window.alert("no contactsList");
} }
else else
selection = null; selection = null;
if (document.contactsListAjaxRequest) { if (document.contactsListAjaxRequest) {
document.contactsListAjaxRequest.aborted = true; document.contactsListAjaxRequest.aborted = true;
document.contactsListAjaxRequest.abort(); document.contactsListAjaxRequest.abort();
} }
document.contactsListAjaxRequest document.contactsListAjaxRequest
= triggerAjaxRequest(url, contactsListCallback, selection); = triggerAjaxRequest(url, contactsListCallback, selection);
} }
} }
function openContactsFolderAtIndex(element) { function openContactsFolderAtIndex(element) {
@ -74,89 +74,96 @@ function openContactsFolderAtIndex(element) {
} }
function contactsListCallback(http) { function contactsListCallback(http) {
if (http.readyState == 4) { if (http.readyState == 4) {
if (http.status == 200) { if (http.status == 200) {
document.contactsListAjaxRequest = null; document.contactsListAjaxRequest = null;
var table = $("contactsList"); var table = $("contactsList");
if (table) { if (table) {
// Update table // Update table
var data = http.responseText; var data = http.responseText;
var html = data.replace(/^(.*\n)*.*(<table(.*\n)*)$/, "$2"); var html = data.replace(/^(.*\n)*.*(<table(.*\n)*)$/, "$2");
var tbody = table.tBodies[0]; var tbody = table.tBodies[0];
var tmp = document.createElement('div'); var tmp = document.createElement('div');
$(tmp).update(html); $(tmp).update(html);
table.replaceChild(tmp.firstChild.tBodies[0], tbody); table.replaceChild($(tmp).select("table tbody")[0], tbody);
var rows = table.tBodies[0].rows;
for (var i = 0; i < rows.length; i++) {
Event.observe(rows[i], "mousedown", onRowClick);
Event.observe(rows[i], "dblclick", onContactRowDblClick.bindAsEventListener(rows[i]));
Event.observe(rows[i], "selectstart", listRowMouseDownHandler);
Event.observe(rows[i], "contextmenu", onContactContextMenu.bindAsEventListener(rows[i]));
}
}
else {
// Add table (doesn't happen .. yet)
var div = $("contactsListContent");
div.update(http.responseText);
table = $("contactsList");
configureSortableTableHeaders(table);
TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true});
}
if (sorting["attribute"] && sorting["attribute"].length > 0) {
var sortHeader;
if (sorting["attribute"] == "displayName")
sortHeader = $("nameHeader");
else if (sorting["attribute"] == "mail")
sortHeader = $("mailHeader");
else if (sorting["attribute"] == "screenName")
sortHeader = $("screenNameHeader");
else if (sorting["attribute"] == "org")
sortHeader = $("orgHeader");
else if (sorting["attribute"] == "phone")
sortHeader = $("phoneHeader");
else
sortHeader = null;
if (sortHeader) {
var sortImages = $(table.tHead).select(".sortImage");
$(sortImages).each(function(item) {
item.remove();
});
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++) {
var row = $(selected[i]);
if (row)
row.selectElement();
}
}
} }
else { else {
// Add table (doesn't happen .. yet) var table = $("contactsList");
var div = $("contactsListContent"); if (table) {
div.update(http.responseText); var sortImages = $(table.tHead).select(".sortImage");
table = $("contactsList"); $(sortImages).each(function(item) {
configureSortableTableHeaders(table); item.remove();
TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true}); });
var tBody = $(table.tBodies[0]);
var length = tBody.rows.length;
for (var i = length - 1; i > -1; i--)
tBody.removeChild(tBody.rows[i]);
}
} }
}
if (sorting["attribute"] && sorting["attribute"].length > 0) { else
var sortHeader; log ("ajax problem 1: status = " + http.status);
if (sorting["attribute"] == "displayName")
sortHeader = $("nameHeader");
else if (sorting["attribute"] == "mail")
sortHeader = $("mailHeader");
else if (sorting["attribute"] == "screenName")
sortHeader = $("screenNameHeader");
else if (sorting["attribute"] == "org")
sortHeader = $("orgHeader");
else if (sorting["attribute"] == "phone")
sortHeader = $("phoneHeader");
else
sortHeader = null;
if (sortHeader) {
var sortImages = $(table.tHead).getElementsByClassName("sortImage");
$(sortImages).each(function(item) {
item.remove();
});
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++) {
var row = $(selected[i]);
if (row)
row.selectElement();
}
}
}
else {
var table = $("contactsList");
if (table) {
var sortImages = $(table.tHead).getElementsByClassName("sortImage");
$(sortImages).each(function(item) {
item.remove();
});
var tBody = $(table.tBodies[0]);
var length = tBody.rows.length;
for (var i = length - 1; i > -1; i--)
tBody.removeChild(tBody.rows[i]);
}
}
}
else
log ("ajax problem 1: status = " + http.status);
} }
function onContactFoldersContextMenu(event) { function onContactFoldersContextMenu(event) {
var menu = $("contactFoldersMenu"); var menu = $("contactFoldersMenu");
//Event.observe(menu, "hideMenu", onContactFoldersContextMenuHide, false);
Event.observe(menu, "mousedown", onContactFoldersContextMenuHide, false); Event.observe(menu, "mousedown", onContactFoldersContextMenuHide, false);
popupMenu(event, "contactFoldersMenu", this); popupMenu(event, "contactFoldersMenu", this);
@ -169,19 +176,18 @@ function onContactFoldersContextMenu(event) {
$(this).selectElement(); $(this).selectElement();
} }
function onContactContextMenu(event, element) {// log ("onContactContextMenu"); function onContactContextMenu(event) {
var menu = $("contactMenu"); var menu = $("contactMenu");
var topNode = $('contactsList');
Event.observe(menu, "mousedown", onContactContextMenuHide, false);
popupMenu(event, "contactMenu", element);
var topNode = $("contactsList");
var selectedNodes = topNode.getSelectedRows(); var selectedNodes = topNode.getSelectedRows();
topNode.menuSelectedRows = selectedNodes;
for (var i = 0; i < selectedNodes.length; i++) if (selectedNodes.length > 1) {
$(selectedNodes[i]).deselect(); // TODO: Add support for selection of multiple contacts
topNode.menuSelectedEntry = element; }
$(element).selectElement(); else {
Event.observe(menu, "hideMenu", onContactContextMenuHide);
popupMenu(event, "contactMenu", this);
}
} }
function onContactContextMenuHide(event) { function onContactContextMenuHide(event) {
@ -287,14 +293,8 @@ function moveTo(uri) {
} }
/* contact menu entries */ /* contact menu entries */
function onContactRowClick(event, node) { function onContactRowDblClick(event) {
loadContact(node.getAttribute('id')); var contactId = this.getAttribute('id');
return onRowClick(event);
}
function onContactRowDblClick(event, node) {
var contactId = node.getAttribute('id');
openContactWindow(URLForFolderID(currentContactFolder) openContactWindow(URLForFolderID(currentContactFolder)
+ "/" + contactId + "/edit", contactId); + "/" + contactId + "/edit", contactId);
@ -302,6 +302,18 @@ function onContactRowDblClick(event, node) {
return false; return false;
} }
function onContactSelectionChange(event) {
var rows = this.getSelectedRowsId();
if (rows.length == 1) {
var node = $(rows[0]);
loadContact(node.getAttribute('id'));
}
else if (rows.length > 1) {
$('contactView').update();
}
}
function onMenuEditContact(event) { function onMenuEditContact(event) {
var contactId = document.menuTarget.getAttribute('id'); var contactId = document.menuTarget.getAttribute('id');
@ -386,7 +398,6 @@ function uixDeleteSelectedContacts(sender) {
} }
var contactView = $('contactView'); var contactView = $('contactView');
contactView.update();
for (var i = 0; i < rows.length; i++) { for (var i = 0; i < rows.length; i++) {
var url, http, rowElem; var url, http, rowElem;
@ -414,7 +425,9 @@ function uixDeleteSelectedContacts(sender) {
} }
if (failCount > 0) if (failCount > 0)
alert("Could not delete the selected contacts!"); alert(labels["You cannot delete the selected contact(s)."]);
else
contactView.update();
return false; return false;
} }
@ -522,7 +535,7 @@ function onConfirmContactSelection(event) {
} }
function onContactMailTo(node) { function onContactMailTo(node) {
return openMailTo(node.innerHTML); return openMailTo(node.innerHTML);
} }
function refreshContacts(contactId) { function refreshContacts(contactId) {
@ -534,46 +547,46 @@ function refreshContacts(contactId) {
} }
function onAddressBookNew(event) { function onAddressBookNew(event) {
createFolder(window.prompt(labels["Name of the Address Book"]), createFolder(window.prompt(labels["Name of the Address Book"]),
appendAddressBook); appendAddressBook);
preventDefault(event); preventDefault(event);
} }
function appendAddressBook(name, folder) { function appendAddressBook(name, folder) {
var owner; var owner;
var result = true; var result = true;
if (folder) { if (folder) {
owner = getSubscribedFolderOwner(folder); owner = getSubscribedFolderOwner(folder);
folder = accessToSubscribedFolder(folder); folder = accessToSubscribedFolder(folder);
} }
else else
folder = "/" + name; folder = "/" + name;
if (!owner) if (!owner)
owner = UserLogin; owner = UserLogin;
if ($(folder)) if ($(folder))
result = false; result = false;
else { else {
var contactFolders = $("contactFolders"); var contactFolders = $("contactFolders");
var items = contactFolders.childNodesWithTag("li"); var items = contactFolders.childNodesWithTag("li");
var li = document.createElement("li"); var li = document.createElement("li");
// Add the calendar to the proper place // Add the calendar to the proper place
var i = getListIndexForFolder(items, owner, name); var i = getListIndexForFolder(items, owner, name);
if (i != items.length) // User is subscribed to other calendars of the same owner if (i != items.length) // User is subscribed to other calendars of the same owner
contactFolders.insertBefore(li, items[i]); contactFolders.insertBefore(li, items[i]);
else else
contactFolders.appendChild(li); contactFolders.appendChild(li);
li.setAttribute("id", folder); li.setAttribute("id", folder);
li.setAttribute("owner", owner); li.setAttribute("owner", owner);
li.appendChild(document.createTextNode(name)); li.appendChild(document.createTextNode(name));
setEventsOnContactFolder(li); setEventsOnContactFolder(li);
} }
return result; return result;
} }
function newFolderCallback(http) { function newFolderCallback(http) {
@ -714,8 +727,8 @@ function configureAbToolbar() {
function configureContactFolders() { function configureContactFolders() {
var contactFolders = $("contactFolders"); var contactFolders = $("contactFolders");
if (contactFolders) { if (contactFolders) {
Event.observe(contactFolders, "mousedown", listRowMouseDownHandler); contactFolders.observe("mousedown", listRowMouseDownHandler);
Event.observe(contactFolders, "click", onFolderSelectionChange); contactFolders.observe("click", onFolderSelectionChange);
var lis = contactFolders.childNodesWithTag("li"); var lis = contactFolders.childNodesWithTag("li");
for (var i = 0; i < lis.length; i++) for (var i = 0; i < lis.length; i++)
setEventsOnContactFolder(lis[i]); setEventsOnContactFolder(lis[i]);
@ -728,64 +741,41 @@ function configureContactFolders() {
} }
} }
function setEventsOnContactFolder(node) { function setEventsOnContactFolder(folder) {
Event.observe(node, "mousedown", listRowMouseDownHandler, false); var node = $(folder);
Event.observe(node, "click", onRowClick, false);
Event.observe(node, "contextmenu", node.observe("mousedown", listRowMouseDownHandler);
onContactFoldersContextMenu.bindAsEventListener(node), false); node.observe("click", onRowClick);
Event.observe(node, "contextmenu",
onContactFoldersContextMenu.bindAsEventListener(node));
} }
function onMenuModify(event) { function onMenuModify(event) {
var folders = $("contactFolders"); var folders = $("contactFolders");
var selected = folders.getSelectedNodes()[0]; var selected = folders.getSelectedNodes()[0];
if (UserLogin == selected.getAttribute("owner")) { if (UserLogin == selected.getAttribute("owner")) {
var currentName = selected.innerHTML; var currentName = selected.innerHTML;
var newName = window.prompt(labels["Address Book Name"], var newName = window.prompt(labels["Address Book Name"],
currentName); currentName);
if (newName && newName.length > 0 if (newName && newName.length > 0
&& newName != currentName) { && newName != currentName) {
var url = (URLForFolderID(selected.getAttribute("id")) var url = (URLForFolderID(selected.getAttribute("id"))
+ "/renameFolder?name=" + escape(newName.utf8encode())); + "/renameFolder?name=" + escape(newName.utf8encode()));
triggerAjaxRequest(url, folderRenameCallback, triggerAjaxRequest(url, folderRenameCallback,
{node: selected, name: newName}); {node: selected, name: newName});
} }
} else } else
window.alert(clabels["Unable to rename that folder!"]); window.alert(clabels["Unable to rename that folder!"]);
} }
function folderRenameCallback(http) { function folderRenameCallback(http) {
if (http.readyState == 4) { if (http.readyState == 4) {
if (isHttpStatus204(http.status)) { if (isHttpStatus204(http.status)) {
var dict = http.callbackData; var dict = http.callbackData;
dict["node"].innerHTML = dict["name"]; dict["node"].innerHTML = dict["name"];
}
}
}
function getDragHandlesState() {
var urlstr = ApplicationBaseURL + "dragHandlesState";
triggerAjaxRequest(urlstr, getDragHandlesStateCallback);
}
function getDragHandlesStateCallback(http) {
if (http.status == 200) {
if (http.responseText.length > 0) {
// The response text is a JSON array
// of the top and right offsets.
var data = http.responseText.evalJSON(true);
if (data[0].length > 0) {
$("contactsListContent").setStyle({ height: data[0] });
$("contactView").setStyle({ top: data[0] });
$("rightDragHandle").setStyle({ top: data[0] });
} }
if (data[1].length > 0) { }
$("contactFoldersList").setStyle({ width: data[1] });
$("rightPanel").setStyle({ left: data[1] });
$("dragHandle").setStyle({ left: data[1] });
}
}
}
} }
function onMenuSharing(event) { function onMenuSharing(event) {
@ -880,10 +870,10 @@ function configureSelectionButtons() {
function initContacts(event) { function initContacts(event) {
if (!document.body.hasClassName("popup")) { if (!document.body.hasClassName("popup")) {
configureAbToolbar(); configureAbToolbar();
getDragHandlesState();
} }
else else
configureSelectionButtons(); configureSelectionButtons();
configureContactFolders(); configureContactFolders();
// initDnd(); // initDnd();
@ -891,6 +881,8 @@ function initContacts(event) {
if (table) { if (table) {
// Initialize contacts table // Initialize contacts table
table.multiselect = true; table.multiselect = true;
Event.observe(table, "mousedown",
onContactSelectionChange.bindAsEventListener(table));
configureSortableTableHeaders(table); configureSortableTableHeaders(table);
TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true}); TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true});
} }

View file

@ -626,22 +626,18 @@ TABLE#messageList TR[labels~="label1"]._selected TD
/* drag handles */ /* drag handles */
DIV#verticalDragHandle DIV#verticalDragHandle
{ { cursor: e-resize;
cursor: e-resize;
top: 7.5em; top: 7.5em;
left: 15em; left: 15em;
width: 5px; width: 5px;
bottom: 0px; bottom: 0px; }
}
DIV#rightDragHandle DIV#rightDragHandle
{ { cursor: n-resize;
cursor: n-resize;
top: 18em; top: 18em;
left: 0px; left: 0px;
right: 0px; right: 0px;
height: 5px; height: 5px; }
}
@media print @media print
{ {

View file

@ -558,7 +558,7 @@ function messageListCallback(http) {
var sortHeader = $(sorting["attribute"] + "Header"); var sortHeader = $(sorting["attribute"] + "Header");
if (sortHeader) { if (sortHeader) {
var sortImages = $(table.tHead).getElementsByClassName("sortImage"); var sortImages = $(table.tHead).select(".sortImage");
$(sortImages).each(function(item) { $(sortImages).each(function(item) {
item.remove(); item.remove();
}); });
@ -1259,7 +1259,6 @@ function initMailer(event) {
// initDnd(); // initDnd();
initMailboxTree(); initMailboxTree();
initMessageCheckTimer(); initMessageCheckTimer();
getDragHandlesState();
} }
// Default sort options // Default sort options
@ -1493,31 +1492,6 @@ function buildMailboxes(accountName, encoded) {
return account; return account;
} }
function getDragHandlesState() {
var urlstr = ApplicationBaseURL + "dragHandlesState";
triggerAjaxRequest(urlstr, getDragHandlesStateCallback);
}
function getDragHandlesStateCallback(http) {
if (http.status == 200) {
if (http.responseText.length > 0) {
// The response text is a JSON array
// of the top and right offsets.
var data = http.responseText.evalJSON(true);
if (data[0].length > 0) {
$("mailboxContent").setStyle({ height: data[0] });
$("messageContent").setStyle({ top: data[0] });
$("rightDragHandle").setStyle({ top: data[0] });
}
if (data[1].length > 0) {
$("leftPanel").setStyle({ width: data[1] });
$("rightPanel").setStyle({ left: data[1] });
$("verticalDragHandle").setStyle({ left: data[1] });
}
}
}
}
function getFoldersState() { function getFoldersState() {
if (mailAccounts.length > 0) { if (mailAccounts.length > 0) {
var urlstr = ApplicationBaseURL + "foldersState"; var urlstr = ApplicationBaseURL + "foldersState";

View file

@ -62,28 +62,28 @@ var SOGoDragHandlesInterface = {
if (this.dhType == 'horizontal') { if (this.dhType == 'horizontal') {
var pointerX = Event.pointerX(event); var pointerX = Event.pointerX(event);
if (pointerX <= this.leftMargin) { if (pointerX <= this.leftMargin) {
this.rightBlock.setStyle({ left: (this.leftMargin) + 'px' }); this.rightBlock.setStyle({ left: (this.leftMargin) + 'px' });
this.leftBlock.setStyle({ width: (this.leftMargin) + 'px' }); this.leftBlock.setStyle({ width: (this.leftMargin) + 'px' });
} }
else { else {
var deltaX = Math.floor(pointerX - this.origX - (this.offsetWidth / 2)); var deltaX = Math.floor(pointerX - this.origX - (this.offsetWidth / 2));
this.rightBlock.setStyle({ left: (this.origRight + deltaX) + 'px' }); this.rightBlock.setStyle({ left: (this.origRight + deltaX) + 'px' });
this.leftBlock.setStyle({ width: (this.origLeft + deltaX) + 'px' }); this.leftBlock.setStyle({ width: (this.origLeft + deltaX) + 'px' });
} }
this.saveDragHandleState(this.dhType, this.leftBlock.getStyle("width")); this.saveDragHandleState(this.dhType, parseInt(this.leftBlock.getStyle("width")));
} }
else if (this.dhType == 'vertical') { else if (this.dhType == 'vertical') {
var pointerY = Event.pointerY(event); var pointerY = Event.pointerY(event);
if (pointerY <= this.topMargin) { if (pointerY <= this.topMargin) {
this.lowerBlock.setStyle({ top: (this.topMargin - delta) + 'px' }); this.lowerBlock.setStyle({ top: (this.topMargin - delta) + 'px' });
this.upperBlock.setStyle({ height: (this.topMargin - delta) + 'px' }); this.upperBlock.setStyle({ height: (this.topMargin - delta) + 'px' });
} }
else { else {
var deltaY = Math.floor(pointerY - this.origY - (this.offsetHeight / 2)); var deltaY = Math.floor(pointerY - this.origY - (this.offsetHeight / 2));
this.lowerBlock.setStyle({ top: (this.origLower + deltaY - delta) + 'px' }); this.lowerBlock.setStyle({ top: (this.origLower + deltaY - delta) + 'px' });
this.upperBlock.setStyle({ height: (this.origUpper + deltaY - delta) + 'px' }); this.upperBlock.setStyle({ height: (this.origUpper + deltaY - delta) + 'px' });
} }
this.saveDragHandleState(this.dhType, this.upperBlock.getStyle("height")); this.saveDragHandleState(this.dhType, parseInt(this.lowerBlock.getStyle("top")));
} }
Event.stopObserving(document.body, "mouseup", this.stopHandleDraggingBound, true); Event.stopObserving(document.body, "mouseup", this.stopHandleDraggingBound, true);
Event.stopObserving(document.body, "mousemove", this.moveBound, true); Event.stopObserving(document.body, "mousemove", this.moveBound, true);

View file

@ -385,7 +385,7 @@ function eventsListCallback(http) {
var sortHeader = $(sorting["attribute"] + "Header"); var sortHeader = $(sorting["attribute"] + "Header");
if (sortHeader) { if (sortHeader) {
var sortImages = $(table.tHead).getElementsByClassName("sortImage"); var sortImages = $(table.tHead).select(".sortImage");
$(sortImages).each(function(item) { $(sortImages).each(function(item) {
item.remove(); item.remove();
}); });
@ -696,126 +696,127 @@ function refreshCalendarEvents(scrollEvent) {
} }
function refreshCalendarEventsCallback(http) { function refreshCalendarEventsCallback(http) {
if (http.readyState == 4 if (http.readyState == 4
&& http.status == 200) { && http.status == 200) {
if (http.responseText.length > 0) {
if (http.responseText.length > 0) { var data = http.responseText.evalJSON(true);
var data = http.responseText.evalJSON(true); // log("refresh calendar events: " + data.length);
// log("refresh calendar events: " + data.length); var dateTuples = new Array();
for (var i = 0; i < data.length; i++) for (var i = 0; i < data.length; i++) {
drawCalendarEvent(data[i], drawCalendarEvent(data[i],
http.callbackData["startDate"], http.callbackData["startDate"],
http.callbackData["endDate"]); http.callbackData["endDate"]);
} }
scrollDayView(http.callbackData["scrollEvent"]); }
} scrollDayView(http.callbackData["scrollEvent"]);
else }
log("AJAX error when refreshing calendar events"); else
log("AJAX error when refreshing calendar events");
} }
function drawCalendarEvent(eventData, sd, ed) { function drawCalendarEvent(eventData, sd, ed) {
var viewStartDate = sd.asDate(); var viewStartDate = sd.asDate();
var viewEndDate = ed.asDate(); var viewEndDate = ed.asDate();
var startDate = new Date(); var startDate = new Date();
startDate.setTime(eventData[4] * 1000); startDate.setTime(eventData[4] * 1000);
var endDate = new Date(); var endDate = new Date();
endDate.setTime(eventData[5] * 1000); endDate.setTime(eventData[5] * 1000);
// log ("s: " + startDate + "; e: " + endDate); //log ("s: " + startDate + "; e: " + endDate);
var days = startDate.daysUpTo(endDate); var days = startDate.daysUpTo(endDate);
var title; var title;
if (currentView == "monthview" if (currentView == "monthview"
&& (eventData[7] == 0)) && (eventData[7] == 0))
title = startDate.getDisplayHoursString() + " " + eventData[3]; title = startDate.getDisplayHoursString() + " " + eventData[3];
else else
title = eventData[3]; title = eventData[3];
// log("title: " + title); // log("title: " + title);
// log("viewS: " + viewStartDate); // log("viewS: " + viewStartDate);
var startHour = null; var startHour = null;
var endHour = null; var endHour = null;
var siblings = new Array(); var siblings = new Array();
for (var i = 0; i < days.length; i++) for (var i = 0; i < days.length; i++)
if (days[i].earlierDate(viewStartDate) == viewStartDate if (days[i].earlierDate(viewStartDate) == viewStartDate
&& days[i].laterDate(viewEndDate) == viewEndDate) { && days[i].laterDate(viewEndDate) == viewEndDate) {
var starts; var starts;
// log("day: " + days[i]); // log("day: " + days[i]);
if (i == 0) { if (i == 0) {
var quarters = (startDate.getUTCHours() * 4 var quarters = (startDate.getUTCHours() * 4
+ Math.floor(startDate.getUTCMinutes() / 15)); + Math.floor(startDate.getUTCMinutes() / 15));
starts = quarters; starts = quarters;
startHour = startDate.getDisplayHoursString(); startHour = startDate.getDisplayHoursString();
endHour = endDate.getDisplayHoursString(); endHour = endDate.getDisplayHoursString();
}
else
starts = 0;
var ends;
var lasts;
if (i == days.length - 1) {
var quarters = (endDate.getUTCHours() * 4
+ Math.ceil(endDate.getUTCMinutes() / 15));
ends = quarters;
}
else
ends = 96;
lasts = ends - starts;
if (!lasts)
lasts = 1;
var eventDiv = newEventDIV(eventData[0], eventData[1], starts, lasts,
null, null, title);
siblings.push(eventDiv);
eventDiv.siblings = siblings;
if (eventData[9].length > 0)
eventDiv.addClassName(eventData[9]); // event owner status
var dayString = days[i].getDayString();
// log("day: " + dayString);
var parentDiv = null;
if (currentView == "monthview") {
var dayDivs = $("monthDaysView").childNodesWithTag("div");
var j = 0;
while (!parentDiv && j < dayDivs.length) {
if (dayDivs[j].getAttribute("day") == dayString)
parentDiv = dayDivs[j];
else
j++;
}
}
else {
if (eventData[7] == 0) {
var daysView = $("daysView");
var eventsDiv = $(daysView).childNodesWithTag("div")[1];
var dayDivs = $(eventsDiv).childNodesWithTag("div");
var j = 0;
while (!parentDiv && j < dayDivs.length) {
if (dayDivs[j].getAttribute("day") == dayString)
parentDiv = dayDivs[j].childNodesWithTag("div")[0];
else
j++;
}
}
else {
var header = $("calendarHeader");
var daysDiv = $(header).childNodesWithTag("div")[1];
var dayDivs = $(daysDiv).childNodesWithTag("div");
var j = 0;
while (!parentDiv && j < dayDivs.length) {
if (dayDivs[j].getAttribute("day") == dayString)
parentDiv = dayDivs[j];
else
j++;
}
}
}
if (parentDiv)
parentDiv.appendChild(eventDiv);
} }
else
starts = 0;
var ends;
var lasts;
if (i == days.length - 1) {
var quarters = (endDate.getUTCHours() * 4
+ Math.ceil(endDate.getUTCMinutes() / 15));
ends = quarters;
}
else
ends = 96;
lasts = ends - starts;
if (!lasts)
lasts = 1;
var eventDiv = newEventDIV(eventData[0], eventData[1], starts, lasts,
null, null, title);
siblings.push(eventDiv);
eventDiv.siblings = siblings;
if (eventData[9].length > 0)
eventDiv.addClassName(eventData[9]);
var dayString = days[i].getDayString();
// log("day: " + dayString);
var parentDiv = null;
if (currentView == "monthview") {
var dayDivs = $("monthDaysView").childNodesWithTag("div");
var j = 0;
while (!parentDiv && j < dayDivs.length) {
if (dayDivs[j].getAttribute("day") == dayString)
parentDiv = dayDivs[j];
else
j++;
}
}
else {
if (eventData[7] == 0) {
var daysView = $("daysView");
var eventsDiv = $(daysView).childNodesWithTag("div")[1];
var dayDivs = $(eventsDiv).childNodesWithTag("div");
var j = 0;
while (!parentDiv && j < dayDivs.length) {
if (dayDivs[j].getAttribute("day") == dayString)
parentDiv = dayDivs[j].childNodesWithTag("div")[0];
else
j++;
}
}
else {
var header = $("calendarHeader");
var daysDiv = $(header).childNodesWithTag("div")[1];
var dayDivs = $(daysDiv).childNodesWithTag("div");
var j = 0;
while (!parentDiv && j < dayDivs.length) {
if (dayDivs[j].getAttribute("day") == dayString)
parentDiv = dayDivs[j];
else
j++;
}
}
}
if (parentDiv)
parentDiv.appendChild(eventDiv);
}
} }
function eventClass(cname) { function eventClass(cname) {
@ -1723,31 +1724,6 @@ function deletePersonalCalendarCallback(http) {
log ("ajax problem 5: " + http.status); log ("ajax problem 5: " + http.status);
} }
function getDragHandlesState() {
var urlstr = ApplicationBaseURL + "dragHandlesState";
triggerAjaxRequest(urlstr, getDragHandlesStateCallback);
}
function getDragHandlesStateCallback(http) {
if (http.status == 200) {
if (http.responseText.length > 0) {
// The response text is a JSON array
// of the top and right offsets.
var data = http.responseText.evalJSON(true);
if (data[0].length > 0) {
$("eventsListView").setStyle({ height: data[0] });
$("calendarView").setStyle({ top: data[0] });
$("rightDragHandle").setStyle({ top: data[0] });
}
if (data[1].length > 0) {
$("leftPanel").setStyle({ width: data[1] });
$("rightPanel").setStyle({ left: data[1] });
$("verticalDragHandle").setStyle({ left: data[1] });
}
}
}
}
function configureLists() { function configureLists() {
var list = $("tasksList"); var list = $("tasksList");
list.multiselect = true; list.multiselect = true;
@ -1783,19 +1759,18 @@ function initDateSelectorEvents() {
} }
function initCalendars() { function initCalendars() {
sorting["attribute"] = "start"; sorting["attribute"] = "start";
sorting["ascending"] = true; sorting["ascending"] = true;
if (!document.body.hasClassName("popup")) { if (!document.body.hasClassName("popup")) {
getDragHandlesState(); initDateSelectorEvents();
initDateSelectorEvents(); initCalendarSelector();
initCalendarSelector(); configureSearchField();
configureSearchField(); configureLists();
configureLists(); var selector = $("calendarSelector");
var selector = $("calendarSelector"); if (selector)
if (selector) selector.attachMenu("calendarsMenu");
selector.attachMenu("calendarsMenu"); }
}
} }
FastInit.addOnLoad(initCalendars); FastInit.addOnLoad(initCalendars);