diff --git a/calendar/base/content/calendar-event-dialog.js b/calendar/base/content/calendar-event-dialog.js
index 62005d8db28..852af605a2a 100644
--- a/calendar/base/content/calendar-event-dialog.js
+++ b/calendar/base/content/calendar-event-dialog.js
@@ -911,6 +911,9 @@ function loadDetails() {
updateAlarm();
updateTaskAlarmWarnings();
+
+ updateURL();
+ return;
}
function updateToDoStatus(status, passedInCompletedDate)
@@ -975,3 +978,38 @@ function updateToDoStatus(status, passedInCompletedDate)
disableElement("completed-date-picker");
}
}
+
+function updateURL(aValue)
+{
+ var button = document.getElementById("load-url-button");
+ button.setAttribute("disabled", true)
+
+ if (!aValue) {
+ return;
+ }
+
+ // The user might have just put in 'www.foo.com', correct that here
+ if (aValue.indexOf( ":" ) == -1) {
+ aValue = "http://" + aValue;
+ }
+ try {
+ makeURL(aValue);
+ // If we made it this far, that means it's a valid url
+ button.removeAttribute("disabled");
+ } catch(ex) {}
+
+ return;
+}
+
+function loadURL()
+{
+ var url = getElementValue("item-url");
+
+ // The user might have just put in 'www.foo.com', correct that here
+ if (url.indexOf( ":" ) == -1) {
+ url = "http://" + url;
+ }
+
+ launchBrowser(url);
+ return;
+}
diff --git a/calendar/base/content/calendar-event-dialog.xul b/calendar/base/content/calendar-event-dialog.xul
index 2b61d8f04f6..c82f1a22e70 100644
--- a/calendar/base/content/calendar-event-dialog.xul
+++ b/calendar/base/content/calendar-event-dialog.xul
@@ -62,6 +62,7 @@
+