mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-23 04:15:26 +00:00
Mantis 78
Monotone-Parent: 757b3c1280d9af553772340bd7408a4ff375bda6 Monotone-Revision: 244b022b573e6f31bb6d274bcd23e14acd12414b Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-07-23T20:11:06 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1224,12 +1224,13 @@ function calendarDisplayCallback(http) {
|
||||
function assignCalendar(name) {
|
||||
if (typeof(skycalendar) != "undefined") {
|
||||
var node = $(name);
|
||||
|
||||
node.calendar = new skycalendar(node);
|
||||
node.calendar.setCalendarPage(ResourcesURL + "/skycalendar.html");
|
||||
var dateFormat = node.getAttribute("dateFormat");
|
||||
if (dateFormat)
|
||||
if (node) {
|
||||
node.calendar = new skycalendar(node);
|
||||
node.calendar.setCalendarPage(ResourcesURL + "/skycalendar.html");
|
||||
var dateFormat = node.getAttribute("dateFormat");
|
||||
if (dateFormat)
|
||||
node.calendar.setDateFormat(dateFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -309,21 +309,27 @@ function onAllDayChanged(event) {
|
||||
function initTimeWidgets(widgets) {
|
||||
this.timeWidgets = widgets;
|
||||
|
||||
widgets['start']['date'].observe("change", this.onAdjustTime, false);
|
||||
widgets['start']['hour'].observe("change", this.onAdjustTime, false);
|
||||
widgets['start']['minute'].observe("change", this.onAdjustTime, false);
|
||||
if (widgets['start']['date']) {
|
||||
widgets['start']['date'].observe("change", this.onAdjustTime, false);
|
||||
widgets['start']['hour'].observe("change", this.onAdjustTime, false);
|
||||
widgets['start']['minute'].observe("change", this.onAdjustTime, false);
|
||||
}
|
||||
|
||||
widgets['end']['date'].observe("change", this.onAdjustTime, false);
|
||||
widgets['end']['hour'].observe("change", this.onAdjustTime, false);
|
||||
widgets['end']['minute'].observe("change", this.onAdjustTime, false);
|
||||
if (widgets['end']['date']) {
|
||||
widgets['end']['date'].observe("change", this.onAdjustTime, false);
|
||||
widgets['end']['hour'].observe("change", this.onAdjustTime, false);
|
||||
widgets['end']['minute'].observe("change", this.onAdjustTime, false);
|
||||
}
|
||||
|
||||
var allDayLabel = $("allDay");
|
||||
var input = $(allDayLabel).childNodesWithTag("input")[0];
|
||||
input.observe("change", onAllDayChanged.bindAsEventListener(input));
|
||||
if (input.checked) {
|
||||
for (var type in widgets) {
|
||||
widgets[type]['hour'].disabled = true;
|
||||
widgets[type]['minute'].disabled = true;
|
||||
if (allDayLabel) {
|
||||
var input = $(allDayLabel).childNodesWithTag("input")[0];
|
||||
input.observe("change", onAllDayChanged.bindAsEventListener(input));
|
||||
if (input.checked) {
|
||||
for (var type in widgets) {
|
||||
widgets[type]['hour'].disabled = true;
|
||||
widgets[type]['minute'].disabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -333,8 +339,11 @@ function refreshAttendees() {
|
||||
var attendeesNames = $("attendeesNames").value;
|
||||
var attendeesEmails = $("attendeesEmails").value.split(",");
|
||||
var attendeesStates = $("attendeesStates").value.split(",");
|
||||
var attendeesMenu = $("attendeesMenu").down("ul");
|
||||
var attendeesHref = $("attendeesHref");
|
||||
var attendeesMenu = null;
|
||||
|
||||
if ($("attendeesMenu"))
|
||||
attendeesMenu = $("attendeesMenu").down("ul");
|
||||
|
||||
// Remove link of attendees
|
||||
for (var i = 0; i < attendeesHref.childNodes.length; i++)
|
||||
@@ -342,7 +351,7 @@ function refreshAttendees() {
|
||||
|
||||
// Remove attendees from menu
|
||||
var menuItems = $$("DIV#attendeesMenu LI.attendee");
|
||||
if (menuItems)
|
||||
if (menuItems && attendeesMenu)
|
||||
for (var i = 0; i < menuItems.length; i++)
|
||||
attendeesMenu.removeChild(menuItems[i]);
|
||||
|
||||
@@ -355,7 +364,8 @@ function refreshAttendees() {
|
||||
attendeesNames = attendeesNames.split(",");
|
||||
for (var i = 0; i < attendeesEmails.length; i++) {
|
||||
var node = document.createElement("li");
|
||||
attendeesMenu.appendChild(node);
|
||||
if (attendeesMenu)
|
||||
attendeesMenu.appendChild(node);
|
||||
$(node).writeAttribute("email", attendeesEmails[i]);
|
||||
$(node).addClassName("attendee");
|
||||
$(node).addClassName(attendeesStates[i]);
|
||||
@@ -374,7 +384,8 @@ function initializeAttendeesHref() {
|
||||
var attendeesLabel = $("attendeesLabel");
|
||||
var attendeesNames = $("attendeesNames");
|
||||
|
||||
attendeesHref.observe("click", onAttendeesHrefClick, false);
|
||||
if (!attendeesHref.hasClassName ("nomenu"))
|
||||
attendeesHref.observe("click", onAttendeesHrefClick, false);
|
||||
refreshAttendees();
|
||||
}
|
||||
|
||||
@@ -399,7 +410,8 @@ function getMenus() {
|
||||
null);
|
||||
|
||||
var attendeesMenu = $('attendeesMenu');
|
||||
attendeesMenu.prepareVisibility = onAttendeesMenuPrepareVisibility;
|
||||
if (attendeesMenu)
|
||||
attendeesMenu.prepareVisibility = onAttendeesMenuPrepareVisibility;
|
||||
|
||||
return { "attendeesMenu": AppointmentEditor.attendeesMenu };
|
||||
}
|
||||
|
||||
@@ -100,42 +100,53 @@ function initializeDocumentHref() {
|
||||
}
|
||||
|
||||
var changeUrlButton = $("changeAttachButton");
|
||||
changeUrlButton.observe("click", onPopupAttachWindow, false);
|
||||
if (changeUrlButton)
|
||||
changeUrlButton.observe("click", onPopupAttachWindow, false);
|
||||
}
|
||||
|
||||
function initializePrivacyMenu() {
|
||||
var privacy = $("privacy").value.toUpperCase();
|
||||
var privacyMenu = $("privacy-menu").childNodesWithTag("ul")[0];
|
||||
var menuEntries = $(privacyMenu).childNodesWithTag("li");
|
||||
var chosenNode;
|
||||
if (privacy == "CONFIDENTIAL")
|
||||
chosenNode = menuEntries[1];
|
||||
else if (privacy == "PRIVATE")
|
||||
chosenNode = menuEntries[2];
|
||||
else
|
||||
chosenNode = menuEntries[0];
|
||||
privacyMenu.chosenNode = chosenNode;
|
||||
$(chosenNode).addClassName("_chosen");
|
||||
if ($("privacy-menu")) {
|
||||
var privacy = $("privacy").value.toUpperCase();
|
||||
var privacyMenu = $("privacy-menu").childNodesWithTag("ul")[0];
|
||||
var menuEntries = $(privacyMenu).childNodesWithTag("li");
|
||||
var chosenNode;
|
||||
if (privacy == "CONFIDENTIAL")
|
||||
chosenNode = menuEntries[1];
|
||||
else if (privacy == "PRIVATE")
|
||||
chosenNode = menuEntries[2];
|
||||
else
|
||||
chosenNode = menuEntries[0];
|
||||
privacyMenu.chosenNode = chosenNode;
|
||||
$(chosenNode).addClassName("_chosen");
|
||||
}
|
||||
}
|
||||
|
||||
function onComponentEditorLoad(event) {
|
||||
initializeDocumentHref();
|
||||
initializePrivacyMenu();
|
||||
var list = $("calendarList");
|
||||
list.observe("change", onChangeCalendar, false);
|
||||
list.fire("mousedown");
|
||||
if (list) {
|
||||
list.observe("change", onChangeCalendar, false);
|
||||
list.fire("mousedown");
|
||||
}
|
||||
|
||||
var menuItems = $("itemPrivacyList").childNodesWithTag("li");
|
||||
for (var i = 0; i < menuItems.length; i++)
|
||||
menuItems[i].observe("mousedown",
|
||||
onMenuSetClassification.bindAsEventListener(menuItems[i]),
|
||||
false);
|
||||
if ($("itemPrivacyList")) {
|
||||
var menuItems = $("itemPrivacyList").childNodesWithTag("li");
|
||||
for (var i = 0; i < menuItems.length; i++)
|
||||
menuItems[i].observe("mousedown",
|
||||
onMenuSetClassification.bindAsEventListener(menuItems[i]),
|
||||
false);
|
||||
}
|
||||
|
||||
$("repeatHref").observe("click", onPopupRecurrenceWindow);
|
||||
$("repeatList").observe("change", onPopupRecurrenceWindow);
|
||||
$("reminderHref").observe("click", onPopupReminderWindow);
|
||||
$("reminderList").observe("change", onPopupReminderWindow);
|
||||
$("summary").observe("keyup", onSummaryChange);
|
||||
if ($("repeatList"))
|
||||
$("repeatList").observe("change", onPopupRecurrenceWindow);
|
||||
if ($("reminderHref"))
|
||||
$("reminderHref").observe("click", onPopupReminderWindow);
|
||||
if ($("reminderList"))
|
||||
$("reminderList").observe("change", onPopupReminderWindow);
|
||||
if ($("summary"))
|
||||
$("summary").observe("keyup", onSummaryChange);
|
||||
|
||||
Event.observe(window, "resize", onWindowResize);
|
||||
|
||||
@@ -144,12 +155,15 @@ function onComponentEditorLoad(event) {
|
||||
onSummaryChange (null);
|
||||
|
||||
var summary = $("summary");
|
||||
summary.focus();
|
||||
summary.selectText(0, summary.value.length);
|
||||
if (summary) {
|
||||
summary.focus();
|
||||
summary.selectText(0, summary.value.length);
|
||||
}
|
||||
}
|
||||
|
||||
function onSummaryChange (e) {
|
||||
document.title = $("summary").value;
|
||||
if ($("summary"))
|
||||
document.title = $("summary").value;
|
||||
}
|
||||
|
||||
function onWindowResize(event) {
|
||||
@@ -161,10 +175,15 @@ function onWindowResize(event) {
|
||||
|
||||
height = window.height() - comment.cumulativeOffset().top - offset;
|
||||
|
||||
if (document.visible())
|
||||
height -= $("changeAttachButton").getHeight();
|
||||
if (document.visible()) {
|
||||
if ($("changeAttachButton"))
|
||||
height -= $("changeAttachButton").getHeight();
|
||||
else
|
||||
height -= $("documentHref").getHeight();
|
||||
}
|
||||
|
||||
area.setStyle({ height: (height - offset*2) + "px" });
|
||||
if (area)
|
||||
area.setStyle({ height: (height - offset*2) + "px" });
|
||||
comment.setStyle({ height: (height - offset) + "px" });
|
||||
|
||||
return true;
|
||||
@@ -176,7 +195,7 @@ function onPopupRecurrenceWindow(event) {
|
||||
|
||||
var repeatHref = $("repeatHref");
|
||||
|
||||
if ($("repeatList").value == 7) {
|
||||
if ($("repeatList") && $("repeatList").value == 7) {
|
||||
repeatHref.show();
|
||||
if (event)
|
||||
window.open(ApplicationBaseURL + "editRecurrence", null,
|
||||
@@ -194,13 +213,13 @@ function onPopupReminderWindow(event) {
|
||||
|
||||
var reminderHref = $("reminderHref");
|
||||
|
||||
if ($("reminderList").value == 15) {
|
||||
if ($("reminderList") && $("reminderList").value == 15) {
|
||||
reminderHref.show();
|
||||
if (event)
|
||||
window.open(ApplicationBaseURL + "editReminder", null,
|
||||
"width=250,height=150");
|
||||
}
|
||||
else
|
||||
else if (reminderHref)
|
||||
reminderHref.hide();
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user