Added useful information to lightningTextCalendarConverter.js

RESOLVED DUPLICATE of bug 334468

Status

--
enhancement
RESOLVED DUPLICATE of bug 334468
13 years ago
12 years ago

People

(Reporter: woodie, Unassigned)

Tracking

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060414 Red Hat/1.0.8-1.4.1 Firefox/1.0.8
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060414 Red Hat/1.0.8-1.4.1 Firefox/1.0.8

Currently only the time (not date) of an attached ICS is displayed.

- I added STATUS, LOCATION & DESCRIPTION
- Did some minimal UI/label modifications

I suppose we could use a css file for this

Reproducible: Always
(Reporter)

Comment 1

13 years ago
Created attachment 222664 [details] [diff] [review]
A diff against nightly
(Reporter)

Comment 2

13 years ago
Created attachment 222667 [details]
How the ics is formatted
(Reporter)

Comment 3

13 years ago
Created attachment 222684 [details] [diff] [review]
same ass above, but diff -u
(Reporter)

Comment 4

13 years ago
Comment on attachment 222684 [details] [diff] [review]
same ass above, but diff -u

>--- lightningTextCalendarConverter.js	2005-04-24 11:33:49.000000000 -0700
>+++ lightningTextCalendarConverter_mod.js	2006-05-19 12:55:53.000000000 -0700
>@@ -18,6 +18,12 @@
>     return form;
> }
> 
>+function tidyTime(jsDate) {
>+  var days = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
>+  return days[jsDate.getDay()] + " " + jsDate.toLocaleDateString() +
>+                          "   " + jsDate.toLocaleTimeString();
>+}
>+
> function ltnMimeConverter() { }
> 
> ltnMimeConverter.prototype = {
>@@ -39,20 +45,26 @@
>         var html = "<script src='chrome://lightning/content/text-calendar-handler.js'></script>\n";
>         html += "<center>\n";
>         html += startForm(data);
>-        html += "<table bgcolor='#CCFFFF'>\n";
>+        html += "<table bgcolor='#E4E4E4' cellspacing='4'>\n";
>         var organizer = event.organizer;
>-        var rows = [["Invitation from", "<a href='" + organizer.id + "'>" + 
>+        var location = (event.getProperty("LOCATION") != null) 
>+                      ? event.getProperty("LOCATION") : '';
>+        var rows = [["Organizer: ", "<a href='" + organizer.id + "'>" + 
>                                         organizer.commonName + "</a>"],
>-                    ["Topic:", event.title],
>-                    ["Start:", event.startDate.jsDate.toLocaleTimeString()],
>-                    ["End:", event.endDate.jsDate.toLocaleTimeString()]];
>+                    ["Subject:", event.title],
>+                    ["Location:", location],
>+                    ["Start time:", tidyTime(event.startDate.jsDate) ],
>+                    ["End time:", tidyTime(event.endDate.jsDate) ]];
>+        html += "<tr><th colspan='2' bgcolor='FFFFBF'>" +
>+                               event.status + "</th></tr>\n";
>         html += rows.map(makeTableRow).join("\n");
>-        html += "<tr><td colspan='2'>";
>-        html += makeButton("accept", "Accept meeting") + " ";
>-        html += makeButton("decline", "Decline meeting") + " ";
>-        html += "</td></tr>\n";
>+        html += "<tr><th colspan='2'>" +
>+                makeButton("accept",  "Accept") + " " +
>+                makeButton("decline", "Decline") + "</th></tr>\n";
>         html += "</table>\n</form>\n</center>";
>-
>+        if (event.getProperty("DESCRIPTION") != null ) {
>+          html += "<pre>\n" + event.getProperty("DESCRIPTION") + "</pre>\n";
>+        }
>         // dump("Generated HTML:\n\n" + html + "\n\n");
>         return html;
>     },
(Reporter)

Comment 5

13 years ago
Created attachment 222689 [details] [diff] [review]
I needed to close the pre tag, this diff is correct
Attachment #222664 - Attachment is obsolete: true
Attachment #222684 - Attachment is obsolete: true

Comment 6

13 years ago
John, is this patch ready for review or are you still working on it?  If you think it's ready, you need to request review from someone.  In this case, probably dmose@mozilla.org.
(Reporter)

Comment 7

13 years ago
I have modified it further, I'll make a new patch
John,
Since it looks as if most of your proposed additions made it into the converter in bug 334468, I'm going to dupe this bug against that one.

If you have any other changes you'd like to suggest, please open a new bug and add [cal-ui-review needed] to the whiteboard so the ui folks will be sure to see them and chime in.

Thanks

*** This bug has been marked as a duplicate of 334468 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.