Contextual menu in calendar views

Monotone-Parent: 32632141d8aa98b84dfa7b115552977245bbb185
Monotone-Revision: 0434c62b8e39bcee18f796c100eaf812cef0be1a

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-07-15T18:26:08
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2009-07-15 18:26:08 +00:00
parent f3343ebe71
commit 7b1fe4fbf4
14 changed files with 160 additions and 0 deletions
+42
View File
@@ -722,6 +722,16 @@ function restoreCurrentDaySelection(div) {
}
}
function loadPreviousView(event) {
var previousArrow = $$("A.leftNavigationArrow").first();
onCalendarGotoDay(previousArrow);
}
function loadNextView(event) {
var nextArrow = $$("A.rightNavigationArrow").first();
onCalendarGotoDay(nextArrow);
}
function changeDateSelectorDisplay(day, keepCurrentDay) {
var url = ApplicationBaseURL + "dateselector";
if (day) {
@@ -1120,11 +1130,43 @@ function calendarDisplayCallback(http) {
&& http.status == 200) {
document.dayDisplayAjaxRequest = null;
div.update(http.responseText);
if (http.callbackData["view"])
currentView = http.callbackData["view"];
if (http.callbackData["day"])
currentDay = http.callbackData["day"];
// Initialize contextual menu
var menu;
var observer;
if (currentView == 'dayview') {
menu = new Array(onMenuNewEventClick,
onMenuNewTaskClick,
"-",
loadPreviousView,
loadNextView);
observer = $("daysView");
}
else if (currentView == 'weekview') {
menu = new Array(onMenuNewEventClick,
onMenuNewTaskClick,
"-",
loadPreviousView,
loadNextView);
observer = $("daysView");
}
else {
menu = new Array(onMenuNewEventClick,
onMenuNewTaskClick,
"-",
loadPreviousView,
loadNextView);
observer = $("monthDaysView");
}
initMenu($("currentViewMenu"), menu);
observer.observe("contextmenu", function(event) {
popupMenu(event, 'currentViewMenu', this); });
var contentView;
if (currentView == "monthview")
contentView = $("calendarContent");