Monotone-Parent: 033f1a3f676dedd1b54a51a87b0d653fb22ae059

Monotone-Revision: 7d2b86578ac10360d4af5ba1d0812b383ec8c885

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-09-06T22:27:46
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2006-09-06 22:27:46 +00:00
parent b09640468a
commit 9450a40a36
2 changed files with 52 additions and 27 deletions

View file

@ -1,5 +1,8 @@
2006-09-06 Wolfgang Sourdeau <wsourdeau@inverse.ca> 2006-09-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/WebServerResources/SchedulerUI.js: implemented a mechanism to
imitate Sunbird's synchronization between the 3 visible views.
* UI/SOGoUI/UIxComponent.m ([UIxComponent -selectedDate]): make * UI/SOGoUI/UIxComponent.m ([UIxComponent -selectedDate]): make
sure the numbers in dateString are formatted so as to take 4 chars sure the numbers in dateString are formatted so as to take 4 chars
for the year and 2 for the day and the month, otherwise for the year and 2 for the day and the month, otherwise

View file

@ -3,7 +3,6 @@ var sortKey = '';
var listFilter = 'view_today'; var listFilter = 'view_today';
var currentDay = ''; var currentDay = '';
var currentCalendarDay = '';
var currentView = 'dayview'; var currentView = 'dayview';
function newEvent(sender) { function newEvent(sender) {
@ -121,7 +120,7 @@ function onContactRefresh(node)
function onDaySelect(node) function onDaySelect(node)
{ {
currentDay = node.getAttribute("day"); var day = node.getAttribute("day");
var td = node.getParentWithTagName("td"); var td = node.getParentWithTagName("td");
var table = td.getParentWithTagName("table"); var table = td.getParentWithTagName("table");
@ -134,7 +133,7 @@ function onDaySelect(node)
selectNode(td); selectNode(td);
document.selectedDate = td; document.selectedDate = td;
changeCalendarDisplay(currentDay, null); changeCalendarDisplay(day);
if (listFilter == 'view_selectedday') if (listFilter == 'view_selectedday')
refreshAppointments(); refreshAppointments();
@ -145,7 +144,7 @@ function onDateSelectorGotoMonth(node)
{ {
var day = node.getAttribute("date"); var day = node.getAttribute("date");
changeDateSelectorDisplay(day); changeDateSelectorDisplay(day, true);
return false; return false;
} }
@ -154,6 +153,7 @@ function onCalendarGotoDay(node)
{ {
var day = node.getAttribute("date"); var day = node.getAttribute("date");
changeDateSelectorDisplay(day);
changeCalendarDisplay(day); changeCalendarDisplay(day);
return false; return false;
@ -161,11 +161,8 @@ function onCalendarGotoDay(node)
function gotoToday() function gotoToday()
{ {
currentDay = ''; changeDateSelectorDisplay('');
currentCalendarDay = '';
changeCalendarDisplay(); changeCalendarDisplay();
changeDateSelectorDisplay();
return false; return false;
} }
@ -230,26 +227,24 @@ function restoreCurrentDaySelection(div)
} }
} }
function changeDateSelectorDisplay(day, event) function changeDateSelectorDisplay(day, keepCurrentDay)
{ {
var url = ApplicationBaseURL + "dateselector"; var url = ApplicationBaseURL + "dateselector";
if (day) if (day)
url += "?day=" + day; url += "?day=" + day;
// if (currentDay.length > 0) if (day != currentDay) {
// url += '&selectedDay=' + currentDay; if (!keepCurrentDay)
log ("changeDateSelectorDisplay: " + url); currentDay = day;
if (document.dateSelectorAjaxRequest) { if (document.dateSelectorAjaxRequest) {
// log ("aborting dateselector ajaxrq"); document.dateSelectorAjaxRequest.aborted = true;
document.dateSelectorAjaxRequest.aborted = true; document.dateSelectorAjaxRequest.abort();
document.dateSelectorAjaxRequest.abort(); }
document.dateSelectorAjaxRequest = triggerAjaxRequest(url,
dateSelectorCallback,
null);
} }
document.dateSelectorAjaxRequest = triggerAjaxRequest(url,
dateSelectorCallback,
null);
// log ('should go to ' + day);
} }
function changeCalendarDisplay(day, newView) function changeCalendarDisplay(day, newView)
@ -257,7 +252,7 @@ function changeCalendarDisplay(day, newView)
var url = ApplicationBaseURL + ((newView) ? newView : currentView); var url = ApplicationBaseURL + ((newView) ? newView : currentView);
if (!day) if (!day)
day = currentCalendarDay; day = currentDay;
if (day) if (day)
url += "?day=" + day; url += "?day=" + day;
@ -312,7 +307,7 @@ function calendarDisplayCallback(http)
if (http.callbackData["view"]) if (http.callbackData["view"])
currentView = http.callbackData["view"]; currentView = http.callbackData["view"];
if (http.callbackData["day"]) if (http.callbackData["day"])
currentCalendarDay = http.callbackData["day"]; currentDay = http.callbackData["day"];
} }
else else
log ("ajax fuckage"); log ("ajax fuckage");
@ -417,7 +412,10 @@ function onListFilterChange() {
function onAppointmentClick(event) function onAppointmentClick(event)
{ {
var node = event.target.getParentWithTagName("tr"); var node = event.target.getParentWithTagName("tr");
changeCalendarDisplay(node.getAttribute("day")); var day = node.getAttribute("day");
changeCalendarDisplay(day);
changeDateSelectorDisplay(day);
return onRowClick(event); return onRowClick(event);
} }
@ -487,7 +485,7 @@ function onMonthMenuItemClick(node)
var month = '' + node.getAttribute("month"); var month = '' + node.getAttribute("month");
var year = '' + $("yearLabel").innerHTML; var year = '' + $("yearLabel").innerHTML;
changeDateSelectorDisplay(year+month+"01"); changeDateSelectorDisplay(year+month+"01", true);
return false; return false;
} }
@ -497,7 +495,7 @@ function onYearMenuItemClick(node)
var month = '' + $("monthLabel").getAttribute("month");; var month = '' + $("monthLabel").getAttribute("month");;
var year = '' + node.innerHTML; var year = '' + node.innerHTML;
changeDateSelectorDisplay(year+month+"01"); changeDateSelectorDisplay(year+month+"01", true);
return false; return false;
} }
@ -508,3 +506,27 @@ function onSearchFormSubmit()
return false; return false;
} }
function onCalendarSelectAppointment(event, node)
{
var list = $("appointmentsList");
list.deselectAll();
var aptId = node.getAttribute("aptId");
var row = $(aptId);
log ("row: " + row);
selectNode(row);
event.cancelBubble = false;
event.returnValue = false;
}
function onCalendarSelectDay(event, node)
{
var day = node.getAttribute("day");
changeDateSelectorDisplay(day);
event.cancelBubble = true;
event.returnValue = false;
}