From 7f686a011ad6f1ca5c07947481c90bf81cbac284 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 6 Jan 2010 22:16:24 +0000 Subject: [PATCH] Monotone-Parent: cfefc003ab42b0c862e3b48be27b49e68ef65e44 Monotone-Revision: ddaad67e61bab9ca43620739a9c6719d15165d4e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-01-06T22:16:24 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++ UI/Scheduler/UIxAppointmentEditor.m | 4 +-- UI/Templates/SchedulerUI/UIxCalMainView.wox | 2 +- UI/WebServerResources/SchedulerUI.js | 33 +++++++++++++-------- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5320fc31e..92567f74d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-01-06 Wolfgang Sourdeau + * UI/WebServerResources/SchedulerUI.js (onViewEventCallback): + simplified lookup of "P" elements by groupings them in an array. + This also fixes a bug where all the returned information would not + be displayed. Also, we make use of the "calendar" field, which was + not used before. + * UI/Scheduler/UIxAppointmentEditor.m (-newAction): new events have an ".ics" extension instead of ".vcf". diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index cae453ff7..93dbbbd64 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -491,8 +491,8 @@ [event tag], @"component", [dateFormatter formattedDate: eventDate], @"startDate", [dateFormatter formattedTime: eventDate], @"startTime", - ([event hasRecurrenceRules]? @"1": @"0"), @"isReccurent", - ([event isAllDay]? @"1": @"0"), @"isAllDay", + ([event hasRecurrenceRules] ? @"1": @"0"), @"isRecurring", + ([event isAllDay] ? @"1": @"0"), @"isAllDay", [event summary], @"summary", [event location], @"location", [event comment], @"description", diff --git a/UI/Templates/SchedulerUI/UIxCalMainView.wox b/UI/Templates/SchedulerUI/UIxCalMainView.wox index d82ca51be..0c149d000 100644 --- a/UI/Templates/SchedulerUI/UIxCalMainView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMainView.wox @@ -95,7 +95,7 @@

-

+

diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 0ad963f8c..3d2b50f70 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -339,8 +339,7 @@ function onViewEvent(event) { } function onViewEventCallback(http) { - if (http.readyState == 4 - && http.status == 200) { + if (http.readyState == 4 && http.status == 200) { if (http.responseText.length > 0) { var data = http.responseText.evalJSON(true); // $H(data).keys().each(function(key) { @@ -386,25 +385,33 @@ function onViewEventCallback(http) { // Put the event's data in the DIV div.down("h1").update(data["summary"].replace(/\r?\n/g, "
")); + + var paras = div.getElementsByTagName("p"); + if (data["calendar"].length) { + paras[0].down("SPAN", 1).update(data["calendar"]); + paras[0].show(); + } else + paras[0].hide(); + if (parseInt(data["isAllDay"]) == 0) { - div.down("P", 0).down("SPAN", 1).update(data["startTime"]); - div.down("P", 0).show(); + paras[1].down("SPAN", 1).update(data["startTime"]); + paras[1].show(); } else - div.down("P", 0).hide(); + paras[1].hide(); + if (data["location"].length) { - div.down("P", 1).down("SPAN", 1).update(data["location"]); - div.down("P", 1).show(); + paras[2].down("SPAN", 1).update(data["location"]); + paras[2].show(); } else - div.down("P", 1).hide(); + paras[2].hide(); if (data["description"].length) { - div.down("P", 2).update(data["description"].replace(/\r?\n/g, "
")); - div.down("P", 2).show(); + paras[3].update(data["description"].replace(/\r?\n/g, "
")); + paras[3].show(); } else - div.down("P", 2).hide(); + paras[3].hide(); - div.setStyle({ left: left + "px", - top: top + "px" }); + div.setStyle({ left: left + "px", top: top + "px" }); div.show(); } }