Bug 1231098 - attached webpage (url) not displayed in event invitation;r=philipp

This commit is contained in:
MakeMyDay 2016-06-11 12:55:36 +02:00
Родитель 0934abf084
Коммит 77e6289ea1
4 изменённых файлов: 69 добавлений и 0 удалений

Просмотреть файл

@ -46,6 +46,10 @@
<td class="description"><p id="imipHtml-description-descr"/></td>
<td class="content"><p id="imipHtml-description-content"/></td>
</tr>
<tr id="imipHtml-attachments-row" hidden="true">
<td class="description"><p id="imipHtml-attachments-descr"/></td>
<td class="content"><p id="imipHtml-attachments-content"/></td>
</tr>
<tr id="imipHtml-comment-row" hidden="true">
<td class="description"><p id="imipHtml-comment-descr"/></td>
<td class="content"><p id="imipHtml-comment-content"/></td>
@ -61,6 +65,10 @@
</table>
</td>
</tr>
<tr id="imipHtml-url-row" hidden="true">
<td class="description"><p id="imipHtml-url-descr"/></td>
<td class="content"><p id="imipHtml-url-content"/></td>
</tr>
</table>
</body>
</html>

Просмотреть файл

@ -189,6 +189,19 @@ ltn.invitation = {
.replace("*~*~*~*~*~*~*~*~*~*", "");
field("description", eventDescription, true);
// URL
field("url", aEvent.getProperty("URL"), true);
// ATTACH - we only display URI but no BINARY type attachments here
let links = new Array();
let attachments = aEvent.getAttachments({});
for (let attachment of attachments) {
if (attachment.uri) {
links.push(attachment.uri.spec);
}
}
field("attachments", links.join("<br>"), true);
// ATTENDEE and ORGANIZER fields
let attendees = aEvent.getAttendees({});
let attendeeTemplate = doc.getElementById("attendee-template");

Просмотреть файл

@ -24,8 +24,14 @@ imipHtml.location=Location:
imipHtml.when=When:
imipHtml.organizer=Organizer:
imipHtml.description=Description:
# LOCALIZATION_NOTE(imipHtml.attachments): This is a label for one or more (additional) links to
# documents or websites attached to this event.
imipHtml.attachments=Attachments:
imipHtml.comment=Comment:
imipHtml.attendees=Attendees:
# LOCALIZATION_NOTE(imipHtml.url): This is a label for a reference to an (alternate) online
# representation of the event (either directly human readable or not).
imipHtml.url=Related Link:
imipHtml.canceledOccurrences=Canceled Occurrences:
imipHtml.modifiedOccurrences=Modified Occurrences:
imipHtml.newLocation=New Location: %1$S

Просмотреть файл

@ -51,6 +51,8 @@ function getIcs() {
"TRANSP:OPAQUE",
"LOCATION:Room 1",
"DESCRIPTION:Let us get together",
"URL:http://www.example.com",
"ATTACH:http://www.example.com",
"END:VEVENT",
"END:VCALENDAR"].join("\r\n");
}
@ -157,6 +159,40 @@ add_task(function* createInvitationOverlay_test() {
node: "imipHtml-description-content",
value: "It's up to you <span xmlns=\"http://www.w3.org/1999/xhtml\" class=\"moz-smile" +
"y-s3\" title=\";-)\"><span>;-)</span></span>"}
}, {
input: {
url: "URL:http://www.example.org/event.ics\r\n"},
expected: {
node: "imipHtml-url-content",
value: "<a xmlns=\"http://www.w3.org/1999/xhtml\" class=\"moz-txt-link-freetext\" hre" +
"f=\"http://www.example.org/event.ics\">http://www.example.org/event.ics</a>"}
}, {
input: {
attach: "ATTACH:http://www.example.org\r\n"},
expected: {
node: "imipHtml-attachments-content",
value: "<a xmlns=\"http://www.w3.org/1999/xhtml\" class=\"moz-txt-link-freetext\" hre" +
"f=\"http://www.example.org/\">http://www.example.org/</a>"}
}, {
input: {
attach: "ATTACH;FMTTYPE=text/plain;ENCODING=BASE64;VALUE=BINARY:VGhlIHF1aWNrIGJyb3duI" +
"GZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZy4\r\n"},
expected: {
node: "imipHtml-attachments-content",
value: ""}
}, {
input: {
attach: "ATTACH:http://www.example.org/first/\r\n" +
"ATTACH:http://www.example.org/second\r\n" +
"ATTACH:file:///N:/folder/third.file\r\n"},
expected: {
node: "imipHtml-attachments-content",
value: "<a xmlns=\"http://www.w3.org/1999/xhtml\" class=\"moz-txt-link-freetext\" hre" +
"f=\"http://www.example.org/first/\">http://www.example.org/first/</a>&lt;br&g" +
"t;<a xmlns=\"http://www.w3.org/1999/xhtml\" class=\"moz-txt-link-freetext\" h" +
"ref=\"http://www.example.org/second\">http://www.example.org/second</a>&lt;br" +
"&gt;<a xmlns=\"http://www.w3.org/1999/xhtml\" class=\"moz-txt-link-freetext\"" +
" href=\"file:///N:/folder/third.file\">file:///N:/folder/third.file</a>"}
}, {
input: {
attendee: "ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=OPT-PARTICIPANT;CUTYPE=INDIV" +
@ -253,6 +289,12 @@ add_task(function* createInvitationOverlay_test() {
case "organizer":
item = item.replace(/ORGANIZER;[^\r]+\r\n/, test.input.organizer);
break;
case "attach":
item = item.replace(/ATTACH:[^\r]+\r\n/, test.input.attach);
break;
case "url":
item = item.replace(/URL:[^\r]+\r\n/, test.input.url);
break;
}
}
let itipItem = Components.classes["@mozilla.org/calendar/itip-item;1"]