Monotone-Parent: bdc770e039bce1273bf76acc5e48dd7006974831

Monotone-Revision: 0c72d1fc3fd84d0415e106b3b511f86237676bdb

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-02-01T18:44:58
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2008-02-01 18:44:58 +00:00
parent 480dc6ff86
commit 3c292c566f
7 changed files with 98 additions and 1 deletions
+7
View File
@@ -30,6 +30,13 @@
NSUserDefaults *ud;
NSMutableDictionary *moduleSettings;
}
- (WOResponse *) getDragHandlesStateAction;
- (WOResponse *) getFoldersStateAction;
- (WOResponse *) saveDragHandlesStateAction;
- (WOResponse *) saveFoldersStateAction;
@end
#endif /* UIXMAILMAINFRAME_H */
+27
View File
@@ -163,6 +163,16 @@
return [self redirectToLocation: newLocation];
}
- (WOResponse *) getDragHandlesStateAction
{
NSString *dragHandles;
[self _setupContext];
dragHandles = [moduleSettings objectForKey: @"DragHandles"];
return [self responseWithStatus: 200 andString: dragHandles];
}
- (WOResponse *) getFoldersStateAction
{
NSString *expandedFolders;
@@ -173,6 +183,23 @@
return [self responseWithStatus: 200 andString: expandedFolders];
}
- (WOResponse *) saveDragHandlesStateAction
{
WORequest *request;
NSString *dragHandles;
[self _setupContext];
request = [context request];
dragHandles = [request formValueForKey: @"dragHandles"];
[moduleSettings setObject: dragHandles
forKey: @"DragHandles"];
[ud synchronize];
return [self responseWithStatus: 204];
}
- (WOResponse *) saveFoldersStateAction
{
WORequest *request;
+10
View File
@@ -330,11 +330,21 @@
pageName = "UIxMailMainFrame";
actionName = "compose";
};
dragHandlesState = {
protectedBy = "View";
pageName = "UIxMailMainFrame";
actionName = "getDragHandlesState";
};
foldersState = {
protectedBy = "View";
pageName = "UIxMailMainFrame";
actionName = "getFoldersState";
};
saveDragHandlesState = {
protectedBy = "View";
pageName = "UIxMailMainFrame";
actionName = "saveDragHandlesState";
};
saveFoldersState = {
protectedBy = "View";
pageName = "UIxMailMainFrame";
+4
View File
@@ -763,6 +763,10 @@ function folderRenameCallback(http) {
}
}
function saveDragHandlesState() {
// Call from SOGoDragHandles.js
}
function onMenuSharing(event) {
if ($(this).hasClassName("disabled"))
return;
+44 -1
View File
@@ -1253,6 +1253,7 @@ function initMailer(event) {
// initDnd();
initMailboxTree();
initMessageCheckTimer();
getDragHandlesState();
}
// Default sort options
@@ -1486,6 +1487,28 @@ function buildMailboxes(accountName, encoded) {
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 right and top offsets.
var data = http.responseText.evalJSON(true);
$("leftPanel").setStyle({ width: data[0] });
$("rightPanel").setStyle({ left: data[0] });
$("verticalDragHandle").setStyle({ left: data[0] });
$("mailboxContent").setStyle({ height: data[1] });
$("messageContent").setStyle({ top: data[1] });
$("rightDragHandle").setStyle({ top: data[1] });
}
}
}
function getFoldersState() {
if (mailAccounts.length > 0) {
var urlstr = ApplicationBaseURL + "foldersState";
@@ -1496,7 +1519,7 @@ function getFoldersState() {
function getFoldersStateCallback(http) {
if (http.status == 200) {
if (http.responseText.length > 0) {
// The response text is a JSOn representation
// The response text is a JSON array
// of the folders that were left opened.
var data = http.responseText.evalJSON(true);
for (var i = 1; i < mailboxTree.aNodes.length; i++) {
@@ -1509,6 +1532,26 @@ function getFoldersStateCallback(http) {
}
}
function saveDragHandlesState() {
// Call from SOGoDragHandles.js
var leftBlock = $("leftPanel");
var upperBlock = $("mailboxContent");
if (leftBlock && upperBlock) {
var dragHandlesState = new Array(leftBlock.getStyle("width"),
upperBlock.getStyle("height"));
var urlstr = ApplicationBaseURL + "saveDragHandlesState" + "?dragHandles=" + dragHandlesState.toJSON();
triggerAjaxRequest(urlstr, saveDragHandlesStateCallback);
}
}
function saveDragHandlesStateCallback(http) {
if (http.readyState == 4
&& isHttpStatus204(http.status)) {
log ("drag handles state saved");
}
}
function saveFoldersState() {
if (mailAccounts.length > 0) {
var foldersState = mailboxTree.getFoldersState();
+2
View File
@@ -88,6 +88,8 @@ var SOGoDragHandlesInterface = {
document.body.setAttribute('style', '');
Event.stop(event);
saveDragHandlesState();
},
move: function (event) {
if (!this.dhType)
+4
View File
@@ -1722,6 +1722,10 @@ function deletePersonalCalendarCallback(http) {
log ("ajax problem 5: " + http.status);
}
function saveDragHandlesState() {
// Call from SOGoDragHandles.js
}
function configureLists() {
var list = $("tasksList");
list.multiselect = true;