Improvements to the component/event/task editor

Monotone-Parent: 075f98c3d837af89c8856cd35c6327138dfb5eea
Monotone-Revision: b187467dece23f6eb8bf6fef314b1cf1ca22eaec

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-08-07T16:01:14
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2009-08-07 16:01:14 +00:00
parent 83e1cf8b06
commit 41f230c6b2
6 changed files with 91 additions and 78 deletions
+12 -10
View File
@@ -461,16 +461,18 @@ function getMenus() {
}
function onAppointmentEditorLoad() {
assignCalendar('startTime_date');
assignCalendar('endTime_date');
var widgets = {'start': {'date': $("startTime_date"),
'hour': $("startTime_time_hour"),
'minute': $("startTime_time_minute")},
'end': {'date': $("endTime_date"),
'hour': $("endTime_time_hour"),
'minute': $("endTime_time_minute")}};
initTimeWidgets(widgets);
if (readOnly == false) {
assignCalendar('startTime_date');
assignCalendar('endTime_date');
var widgets = {'start': {'date': $("startTime_date"),
'hour': $("startTime_time_hour"),
'minute': $("startTime_time_minute")},
'end': {'date': $("endTime_date"),
'hour': $("endTime_time_hour"),
'minute': $("endTime_time_minute")}};
initTimeWidgets(widgets);
}
initializeAttendeesHref();
}
+19 -19
View File
@@ -22,7 +22,7 @@ SPAN.content
SPAN.content > INPUT.textField,
LABEL#commentArea textarea
{ width: 380px; }
{ max-width: 380px; }
LABEL, SPAN.checkBoxList
{ display: block;
@@ -34,12 +34,13 @@ LABEL, SPAN.checkBoxList
width: 100%; }
LABEL#commentArea textarea
{ padding-bottom: 0em;
top: 0px;
{ position: absolute;
top: 0;
width: 100%;
left: 8em;
position: absolute;
padding: 0px;
right: 1em;
margin: 0px;
margin: auto;
margin-left: 1px; }
SPAN.headerContent
@@ -51,7 +52,7 @@ SPAN.headerContent
}
LABEL.title
{
margin-top: 20px;
margin-top: 1em;
font-weight: bold;
}
LABEL.titleNoSpace
@@ -66,10 +67,13 @@ DIV#windowButtons
right: 2em; }
LABEL.calendarName
{ text-align: right;
margin-top: 10px;
margin-bottom: 10px;
width: 97%;
{ background-color: #fff;
border-bottom: 1px solid #555;
font-weight: bold;
text-align: right;
margin: 0;
padding: 10px;
width: auto;
}
DIV#attendeesMenu
@@ -81,13 +85,9 @@ DIV.fakeTextArea
border-width: 2px;
border-style: inset;
padding: 2px;
height: 100%;
white-space: pre-wrap;
}
height: 100px;
white-space: pre-wrap; }
DIV#descriptionDiv {
height: 80px;
}
SPAN.fixedHeight {
height: 60px;
}
DIV#descriptionDiv,
DIV#attendeesDiv
{ height: 120px; }
+19 -12
View File
@@ -43,8 +43,8 @@ function onPopupAttachWindow(event) {
}
attachInput.value = newAttach;
}
onWindowResize(event);
onWindowResize(event);
return false;
}
@@ -183,27 +183,31 @@ function onSummaryChange (e) {
}
function onWindowResize(event) {
var document = $("documentLabel");
var comment = $("commentArea");
if (comment) {
var area = comment.select("textarea").first();
var offset = 6;
// Resize comment area of read-write component
var document = $("documentLabel");
var area = comment.select("textarea").first();
var offset = 6;
var height;
height = window.height() - comment.cumulativeOffset().top - offset;
height = window.height() - comment.cumulativeOffset().top - offset;
if (document.visible()) {
if (document.visible()) {
// Component has an attachment
if ($("changeAttachButton"))
height -= $("changeAttachButton").getHeight();
height -= $("changeAttachButton").getHeight();
else
height -= $("documentHref").getHeight();
}
if (area)
area.setStyle({ height: (height - offset*2) + "px" });
comment.setStyle({ height: (height - offset) + "px" });
comment.setStyle({ height: (height - offset) + "px" });
}
else {
// Resize attendees area of a read-only component
$("eventView").style.height = window.height () + "px";
var height = window.height() - 120;
var tmp = $("generalDiv");
@@ -213,8 +217,11 @@ function onWindowResize(event) {
if (tmp)
height -= tmp.offsetHeight;
$("attendeesDiv").style.height = height + "px";
$("attendeesMenu").style.height = (height - 20) + "px";
tmp = $("attendeesDiv");
if (tmp) {
tmp.style.height = height + "px";
$("attendeesMenu").style.height = (height - 20) + "px";
}
}
return true;
+29 -24
View File
@@ -156,16 +156,18 @@ function addContact(tag, fullContactName, contactId, contactName, contactEmail)
}
function onTimeControlCheck(checkBox) {
var inputs = checkBox.parentNode.getElementsByTagName("input");
var selects = checkBox.parentNode.getElementsByTagName("select");
for (var i = 0; i < inputs.length; i++)
if (inputs[i] != checkBox)
inputs[i].disabled = !checkBox.checked;
for (var i = 0; i < selects.length; i++)
if (selects[i] != checkBox)
selects[i].disabled = !checkBox.checked;
if (checkBox) {
var inputs = checkBox.parentNode.getElementsByTagName("input");
var selects = checkBox.parentNode.getElementsByTagName("select");
for (var i = 0; i < inputs.length; i++)
if (inputs[i] != checkBox)
inputs[i].disabled = !checkBox.checked;
for (var i = 0; i < selects.length; i++)
if (selects[i] != checkBox)
selects[i].disabled = !checkBox.checked;
if (checkBox.id == "dueDateCB")
$("reminderList").disabled = !checkBox.checked;
$("reminderList").disabled = !checkBox.checked;
}
}
function saveEvent(sender) {
@@ -294,26 +296,29 @@ function onStatusListChange(event) {
function initializeStatusLine() {
var statusList = $("statusList");
statusList.observe("mouseup", onStatusListChange, false);
if (statusList)
statusList.observe("mouseup", onStatusListChange, false);
}
function onTaskEditorLoad() {
assignCalendar('startTime_date');
assignCalendar('dueTime_date');
assignCalendar('statusTime_date');
assignCalendar('startTime_date');
assignCalendar('dueTime_date');
assignCalendar('statusTime_date');
if (readOnly == false) {
var widgets = {'start': {'date': $("startTime_date"),
'hour': $("startTime_time_hour"),
'minute': $("startTime_time_minute")},
'due': {'date': $("dueTime_date"),
'hour': $("dueTime_time_hour"),
'minute': $("dueTime_time_minute")}};
initTimeWidgets(widgets);
}
var widgets = {'start': {'date': $("startTime_date"),
'hour': $("startTime_time_hour"),
'minute': $("startTime_time_minute")},
'due': {'date': $("dueTime_date"),
'hour': $("dueTime_time_hour"),
'minute': $("dueTime_time_minute")}};
initTimeWidgets(widgets);
// Enable or disable the reminder list
onTimeControlCheck($("dueDateCB"));
// Enable or disable the reminder list
onTimeControlCheck($("dueDateCB"));
initializeStatusLine();
initializeStatusLine();
}
document.observe("dom:loaded", onTaskEditorLoad);