diff --git a/mozilla/calendar/base/content/calendar-dialog-utils.js b/mozilla/calendar/base/content/calendar-dialog-utils.js
index 4fece2b68e9..21ac9235b50 100644
--- a/mozilla/calendar/base/content/calendar-dialog-utils.js
+++ b/mozilla/calendar/base/content/calendar-dialog-utils.js
@@ -782,3 +782,52 @@ function commonUpdateReminder() {
updateReminderDetails();
}
+
+function updateLink() {
+ var itemUrlString = (window.calendarItem || window.item).getProperty("URL");
+ var linkCommand = document.getElementById("cmd_toggle_link");
+
+ function hideOrShow(aBool, aDisable) {
+ setElementValue("event-grid-link-row", !aBool && "true", "hidden");
+ var separator = document.getElementById("event-grid-link-separator");
+ if (separator) {
+ // The separator is not there in the summary dialog
+ setElementValue("event-grid-link-separator", !aBool && "true", "hidden");
+ }
+
+ if (linkCommand) {
+ setElementValue(linkCommand, aDisable && "true", "disabled");
+ }
+ }
+
+ if (linkCommand && linkCommand.getAttribute("checked") != "true") {
+ hideOrShow(false, false);
+ } else if (itemUrlString && itemUrlString.length) {
+ var handler, uri;
+ try {
+ uri = makeURL(itemUrlString);
+ handler = getIOService().getProtocolHandler(uri.scheme);
+ } catch (e) {
+ // No protocol handler for the given protocol, or invalid uri
+ hideOrShow(false, true);
+ return;
+ }
+
+ if (handler && handler instanceof Components.interfaces.nsIExternalProtocolHandler) {
+ // Only show if there is an external app for this scheme
+ hideOrShow(handler.externalAppExistsForScheme(uri.scheme));
+ } else {
+ // Internal protocol handler, show it
+ hideOrShow(true);
+ }
+
+
+ setTimeout(function() {
+ // HACK the url-link doesn't crop when setting the value in onLoad
+ setElementValue("url-link", itemUrlString);
+ setElementValue("url-link", itemUrlString, "href");
+ }, 0);
+ } else {
+ hideOrShow(false, true);
+ }
+}
diff --git a/mozilla/calendar/base/content/calendar-summary-dialog.js b/mozilla/calendar/base/content/calendar-summary-dialog.js
index 385d16144d9..c0e93cfd943 100644
--- a/mozilla/calendar/base/content/calendar-summary-dialog.js
+++ b/mozilla/calendar/base/content/calendar-summary-dialog.js
@@ -99,6 +99,7 @@ function onLoad() {
updateRepeatDetails();
updateAttendees();
+ updateLink();
var location = item.getProperty("LOCATION");
if (location && location.length) {
@@ -154,14 +155,6 @@ function onLoad() {
}
}
- if (item.hasProperty("URL")) {
- var url = item.getProperty("URL");
- if (url && url.length) {
- document.getElementById("item-link-box").removeAttribute("hidden");
- document.getElementById("item-link").value = url;
- }
- }
-
document.title = item.title;
// If this item is read only we remove the 'cancel' button as users
diff --git a/mozilla/calendar/base/content/calendar-summary-dialog.xul b/mozilla/calendar/base/content/calendar-summary-dialog.xul
index 67712cf7de1..cad1854c44c 100644
--- a/mozilla/calendar/base/content/calendar-summary-dialog.xul
+++ b/mozilla/calendar/base/content/calendar-summary-dialog.xul
@@ -71,6 +71,8 @@
src="chrome://calendar/content/calendar-dialog-utils.js"/>
+
@@ -261,18 +263,15 @@
-
-
+
+
-
-
-
-
-
+
+
diff --git a/mozilla/calendar/base/themes/pinstripe/calendar-event-dialog.css b/mozilla/calendar/base/themes/pinstripe/calendar-event-dialog.css
index 85a99b884fa..20f275bd7d7 100644
--- a/mozilla/calendar/base/themes/pinstripe/calendar-event-dialog.css
+++ b/mozilla/calendar/base/themes/pinstripe/calendar-event-dialog.css
@@ -56,6 +56,10 @@ listbox[disabled="true"] {
height: 1em;
}
+.default-indent {
+ -moz-margin-start: 1.5em;
+}
+
.status-icon {
margin: 0 3px;
display: none;
diff --git a/mozilla/calendar/base/themes/winstripe/calendar-event-dialog.css b/mozilla/calendar/base/themes/winstripe/calendar-event-dialog.css
index 85a99b884fa..20f275bd7d7 100644
--- a/mozilla/calendar/base/themes/winstripe/calendar-event-dialog.css
+++ b/mozilla/calendar/base/themes/winstripe/calendar-event-dialog.css
@@ -56,6 +56,10 @@ listbox[disabled="true"] {
height: 1em;
}
+.default-indent {
+ -moz-margin-start: 1.5em;
+}
+
.status-icon {
margin: 0 3px;
display: none;
diff --git a/mozilla/calendar/locales/en-US/chrome/prototypes/sun-calendar-event-dialog.dtd b/mozilla/calendar/locales/en-US/chrome/prototypes/sun-calendar-event-dialog.dtd
index d1de57892b7..6767d4944df 100644
--- a/mozilla/calendar/locales/en-US/chrome/prototypes/sun-calendar-event-dialog.dtd
+++ b/mozilla/calendar/locales/en-US/chrome/prototypes/sun-calendar-event-dialog.dtd
@@ -84,6 +84,8 @@
+
+
@@ -186,6 +188,7 @@
+
@@ -353,5 +356,6 @@
+
diff --git a/mozilla/calendar/prototypes/wcap/sun-calendar-event-dialog.js b/mozilla/calendar/prototypes/wcap/sun-calendar-event-dialog.js
index 2a64fa49259..b21eac6b455 100644
--- a/mozilla/calendar/prototypes/wcap/sun-calendar-event-dialog.js
+++ b/mozilla/calendar/prototypes/wcap/sun-calendar-event-dialog.js
@@ -290,6 +290,9 @@ function loadDialog(item) {
updateAttachment();
}
+ // URL link
+ updateLink();
+
// Description
setElementValue("item-description", item.getProperty("DESCRIPTION"));
@@ -2335,6 +2338,20 @@ function updateAttachment() {
}
}
+function toggleLink() {
+ var linkCommand = document.getElementById("cmd_toggle_link");
+ var row = document.getElementById("event-grid-link-row");
+ var separator = document.getElementById("event-grid-link-separator");
+
+ var isHidden = row.hidden;
+ row.hidden = !isHidden;
+ separator.hidden = !isHidden;
+
+ linkCommand.setAttribute("checked", isHidden ? "true" : "false");
+
+ updateLink();
+}
+
function updateAttendees() {
var attendeeRow = document.getElementById("event-grid-attendee-row");
var attendeeRow2 = document.getElementById("event-grid-attendee-row-2");
diff --git a/mozilla/calendar/prototypes/wcap/sun-calendar-event-dialog.xul b/mozilla/calendar/prototypes/wcap/sun-calendar-event-dialog.xul
index 5fc9aecdc23..f9a391db3a4 100644
--- a/mozilla/calendar/prototypes/wcap/sun-calendar-event-dialog.xul
+++ b/mozilla/calendar/prototypes/wcap/sun-calendar-event-dialog.xul
@@ -152,6 +152,9 @@
'view-toolbars-event-menuitem')"/>
+
+
+
@@ -1035,6 +1045,19 @@
onclick="attachmentLinkClicked(event);"/>
+
+
+
+
+
+
diff --git a/mozilla/calendar/providers/gdata/components/calGoogleUtils.js b/mozilla/calendar/providers/gdata/components/calGoogleUtils.js
index 493a6571f88..8946bcdbed7 100644
--- a/mozilla/calendar/providers/gdata/components/calGoogleUtils.js
+++ b/mozilla/calendar/providers/gdata/components/calGoogleUtils.js
@@ -756,7 +756,7 @@ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar, aReferenceItem) {
// id
item.id = getIdFromEntry(aXMLEntry);
- // link
+ // link (edit url)
// Since Google doesn't set the edit url to be https if the request is
// https, we need to work around this here.
var editUrl = aXMLEntry.link.(@rel == 'edit').@href.toString();
@@ -765,6 +765,13 @@ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar, aReferenceItem) {
}
item.setProperty("X-GOOGLE-EDITURL", editUrl);
+ // link (alternative representation, html)
+ var htmlUrl = aXMLEntry.link.(@rel == 'alternate').@href.toString();
+ if (aCalendar.uri.schemeIs("https")) {
+ htmlUrl = htmlUrl.replace(/^http:/, "https:");
+ }
+ item.setProperty("URL", htmlUrl);
+
// title
item.title = aXMLEntry.title.(@type == 'text');