Monotone-Parent: e791f856fa8cb6c49f52de50d8bcbfcc98922c88

Monotone-Revision: eb4be993b8aa1a70806a19e9980e936bdb9b448a

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-09-07T15:50:03
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-09-07 15:50:03 +00:00
parent 607d720676
commit 078f70c3af
2 changed files with 34 additions and 13 deletions

View File

@@ -1,5 +1,8 @@
2006-09-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/WebServerResources/SchedulerUI.js: implemented caching of
date selectors.
* UI/SOGoUI/UIxComponent.m ([UIxComponent -userFolderPath]):
return a path based on the object's context instead of the first
level in SOGo's object hierarchy...

View File

@@ -5,6 +5,8 @@ var listFilter = 'view_today';
var currentDay = '';
var currentView = 'dayview';
var cachedDateSelectors = new Array();
function newEvent(sender) {
var day = sender.getAttribute("day");
if (!day)
@@ -167,18 +169,23 @@ function gotoToday()
return false;
}
function dateSelectorCallback(http)
function setDateSelectorContent(content)
{
var div = $("dateSelectorView");
log ("dateselectorcallback: " + div);
div.innerHTML = content;
if (currentDay.length > 0)
restoreCurrentDaySelection(div);
}
function dateSelectorCallback(http)
{
if (http.readyState == 4
&& http.status == 200) {
document.dateSelectorAjaxRequest = null;
div.innerHTML = http.responseText;
if (currentDay.length > 0)
restoreCurrentDaySelection(div);
var content = http.responseText;
setDateSelectorContent(content);
cachedDateSelectors[http.callbackData] = content;
}
else
log ("ajax fuckage");
@@ -237,13 +244,22 @@ function changeDateSelectorDisplay(day, keepCurrentDay)
if (!keepCurrentDay)
currentDay = day;
if (document.dateSelectorAjaxRequest) {
document.dateSelectorAjaxRequest.aborted = true;
document.dateSelectorAjaxRequest.abort();
var month = day.substr(0, 6);
if (cachedDateSelectors[month]) {
log ("restoring cached selector for month: " + month);
setDateSelectorContent(cachedDateSelectors[month]);
}
else {
log ("loading selector for month: " + month);
if (document.dateSelectorAjaxRequest) {
document.dateSelectorAjaxRequest.aborted = true;
document.dateSelectorAjaxRequest.abort();
}
document.dateSelectorAjaxRequest
= triggerAjaxRequest(url,
dateSelectorCallback,
month);
}
document.dateSelectorAjaxRequest = triggerAjaxRequest(url,
dateSelectorCallback,
null);
}
}
@@ -514,8 +530,10 @@ function onCalendarSelectAppointment(event, node)
var aptId = node.getAttribute("aptId");
var row = $(aptId);
log ("row: " + row);
selectNode(row);
if (row) {
log ("row: " + row);
selectNode(row);
}
event.cancelBubble = false;
event.returnValue = false;