updating eventDialog to use the new calendar APIs

revamp of the event dialog by mattwillis@gmail.com
bug 272732 r=shaver
This commit is contained in:
pavlov%pavlov.net 2004-12-02 17:41:13 +00:00
parent edf0052253
commit 84dee1b4db
7 changed files with 1188 additions and 1010 deletions

View File

@ -165,6 +165,7 @@ interface calIItemBase : nsISupports
readonly attribute nsISimpleEnumerator propertyEnumerator;
nsIVariant getProperty(in AString name);
void setProperty(in AString name, in nsIVariant value);
// will not throw an error if you delete a property that doesn't exist
void deleteProperty(in AString name);
// The array returned here is not live; it will not reflect calls to

View File

@ -148,7 +148,11 @@ calItemBase.prototype = {
get propertyEnumerator() { return this.mProperties.enumerator; },
getProperty: function (aName) {
try {
return this.mProperties.getProperty(aName);
} catch (e) {
return null;
}
},
setProperty: function (aName, aValue) {
if (this.mImmutable)
@ -158,7 +162,10 @@ calItemBase.prototype = {
deleteProperty: function (aName) {
if (this.mImmutable)
throw Components.results.NS_ERROR_FAILURE;
try {
this.mProperties.deleteProperty(aName);
} catch (e) {
}
},
getAttendees: function (countObj) {

View File

@ -102,3 +102,65 @@ function launchBrowser( UrlToGoTo )
//window.open(UrlToGoTo, "_blank", "chrome,menubar,toolbar,resizable,dialog=no");
//window.open( UrlToGoTo, "calendar-opened-window" );
}
function goToggleToolbar( id, elementID )
{
var toolbar = document.getElementById(id);
var element = document.getElementById(elementID);
if (toolbar) {
var isHidden = toolbar.hidden;
toolbar.hidden = !isHidden;
document.persist(id, 'hidden');
if (element) {
element.setAttribute("checked", isHidden ? "true" : "false");
document.persist(elementID, 'checked');
}
}
}
function openExtensions(aOpenMode)
{
const EMTYPE = "Extension:Manager";
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var needToOpen = true;
var windowType = EMTYPE + "-" + aOpenMode;
var windows = wm.getEnumerator(windowType);
while (windows.hasMoreElements()) {
var theEM = windows.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal);
if (theEM.document.documentElement.getAttribute("windowtype") == windowType) {
theEM.focus();
needToOpen = false;
break;
}
}
if (needToOpen) {
const EMURL = "chrome://mozapps/content/extensions/extensions.xul?type=" + aOpenMode;
const EMFEATURES = "chrome,dialog=no,resizable";
window.openDialog(EMURL, "", EMFEATURES);
}
}
function showElement( elementId )
{
try {
dump("showElement: showing "+elementId+"\n");
document.getElementById( elementId ).removeAttribute( "hidden" );
}
catch (e) {
dump("showElement: Couldn't remove hidden attribute from "+elementId+"\n");
}
}
function hideElement( elementId )
{
try {
dump("hideElement: hiding "+elementId+"\n");
document.getElementById( elementId ).setAttribute( "hidden", "true" );
}
catch (e) {
dump("hideElement: Couldn't set hidden attribute on "+elementId+"\n");
}
}

View File

@ -1,4 +1,5 @@
/* ***** BEGIN LICENSE BLOCK *****
/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -69,6 +70,8 @@
* G L O B A L V A R I A B L E S
*/
var gCalendar = null;
//the next line needs XX-DATE-XY but last X instead of Y
var gDateMade = "2002052213-cal"
@ -168,14 +171,10 @@ var categoryPrefObserver =
function calendarInit()
{
// get the calendar event data source
gEventSource = new CalendarEventDataSource();
// XXX remove this eventually
gICalLib = new Object();
// get the Ical Library
gICalLib = gEventSource.getICalLib();
// this suspends feedbacks to observers until all is settled
gICalLib.batchMode = true;
gCalendar = createCalendar();
// set up the CalendarWindow instance
@ -198,6 +197,11 @@ function calendarInit()
checkForMailNews();
//updateColors();
}
function updateColors()
{
// Change made by CofC for Calendar Coloring
// initialize calendar color style rules in the calendar's styleSheet
@ -657,6 +661,13 @@ function multiweekToDoBoxDoubleClickEvent( todoBox, event )
}
function jsDateToDateTime(date)
{
newDate = createDateTime();
newDate.nativeTime = date;
return newDate;
}
/**
* Called when the new event button is clicked
*/
@ -664,6 +675,7 @@ var gNewDateVariable = null;
function newEventCommand( event )
{
/*
var startDate;
if( gNewDateVariable != null )
@ -675,13 +687,11 @@ function newEventCommand( event )
var Minutes = Math.ceil( startDate.getMinutes() / 5 ) * 5 ;
startDate = new Date( startDate.getFullYear(),
startDate.getMonth(),
startDate.getDate(),
startDate.getHours(),
Minutes,
0);
newEvent( startDate );
date = jsDateToDateTime(startDate);
date.minute = Minutes;
*/
date = null;
newEvent( date );
}
@ -697,29 +707,34 @@ function newToDoCommand()
function createEvent ()
{
var iCalEventComponent = Components.classes["@mozilla.org/icalevent;1"].createInstance();
var iCalEvent = iCalEventComponent.QueryInterface(Components.interfaces.oeIICalEvent);
return iCalEvent;
return Components.classes["@mozilla.org/calendar/event;1"].createInstance(Components.interfaces.calIEvent);
}
function createToDo ()
{
var iCalToDoComponent = Components.classes["@mozilla.org/icaltodo;1"].createInstance();
var iCalToDo = iCalToDoComponent.QueryInterface(Components.interfaces.oeIICalTodo);
return iCalToDo;
return Components.classes["@mozilla.org/calendar/todo;1"].createInstance(Components.interfaces.calITodo);
}
function createDateTime()
{
return Components.classes["@mozilla.org/calendar/datetime;1"].createInstance(Components.interfaces.calIDateTime);
}
function createCalendar()
{
return Components.classes["@mozilla.org/calendar/calendar;1?type=memory"].getService(Components.interfaces.calICalendar);
}
function isEvent ( aObject )
{
return (aObject instanceof Components.interfaces.oeIICalEvent) && !(aObject instanceof Components.interfaces.oeIICalTodo);
return aObject instanceof Components.interfaces.calIEvent;
}
function isToDo ( aObject )
{
return aObject instanceof Components.interfaces.oeIICalTodo;
return aObject instanceof Components.interfaces.calITodo;
}
@ -770,26 +785,28 @@ function newEvent( startDate, endDate, allDay )
// create a new event to be edited and added
var calendarEvent = createEvent();
if( !startDate )
/*
if (!startDate) {
startDate = gCalendarWindow.currentView.getNewEventDate();
}
calendarEvent.startDate.jsDate = startDate;
calendarEvent.start.setTime( startDate );
if (!endDate)
{
var MinutesToAddOn = getIntPref(gCalendarWindow.calendarPreferences.calendarPref, "event.defaultlength", gCalendarBundle.getString("defaultEventLength" ) );
var endDateTime = startDate.getTime() + ( 1000 * 60 * MinutesToAddOn );
var endDateTime = startDate.clone();
endDateTime.minute += MinutesToAddOn; // XXX this could overflow
endDateTime.normalize();
}
calendarEvent.end.setTime( endDateTime );
}
else
{
calendarEvent.end.setTime( endDate.getTime() );
}
calendarEvent.endDate.jsDate = endDate
*/
if (allDay)
calendarEvent.allDay = true;
calendarEvent.isAllDay = true;
var server = getSelectedCalendarPathOrNull();
@ -806,15 +823,11 @@ function newToDo ( startDate, dueDate )
var calendarToDo = createToDo();
// created todo has no start or due date unless user wants one
if (! startDate )
calendarToDo.start.clear();
else
calendarToDo.start.setTime( startDate );
if (startDate)
calendarToDo.start.jsDate = startDate;
if (! dueDate )
calendarToDo.due.clear();
else
calendarToDo.due.setTime( dueDate );
if (dueDate)
calendarToDo.dueDate.jsDate = dueDate;
var server = getSelectedCalendarPathOrNull();
@ -879,7 +892,7 @@ function addEventDialogResponse( calendarEvent, Server )
function addToDoDialogResponse( calendarToDo, Server )
{
saveItem( calendarToDo, Server, "addTodo" );
addEventDialogResponse(calendarToDo, Server);
}
@ -931,7 +944,7 @@ function modifyEventDialogResponse( calendarEvent, Server, originalEvent )
function modifyToDoDialogResponse( calendarToDo, Server, originalToDo )
{
saveItem( calendarToDo, Server, "modifyTodo", originalToDo );
modifyEventDialogResponse(calendarToDo, Server, originalToDo);
}
@ -999,6 +1012,18 @@ function editEventCommand()
//used to check if there were external changes for shared calendar
function saveItem( calendarEvent, Server, functionToRun, originalEvent )
{
if (functionToRun == 'addEvent')
gCalendar.addItem(calendarEvent, null);
else if (functionToRun == 'modifyEvent')
gCalendar.modifyItem(calendarEvent, null);
/*
var calendarServer = gCalendarWindow.calendarManager.getCalendarByName( Server );
var path = calendarServer.getAttribute("http://home.netscape.com/NC-rdf#path");
var shared = (calendarServer.getAttribute("http://home.netscape.com/NC-rdf#shared" ) == "true");
@ -1059,6 +1084,8 @@ function saveItem( calendarEvent, Server, functionToRun, originalEvent )
eval( "gICalLib."+functionToRun+"( calendarEvent, Server )" );
gCalendarWindow.clearSelectedEvent( calendarEvent );
}
*/
}

View File

@ -47,7 +47,6 @@
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/calendar.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/content/datetimepickers/minimonth.css" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/communicator.css" type="text/css"?>
<!-- Overlays -->
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
@ -199,7 +198,6 @@
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://calendar/content/jslib/jslib.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/utilityOverlay.js"/>
<!-- NEEDED FOR DRAG AND DROP SUPPORT -->
<script type="application/x-javascript" src="chrome://calendar/content/dragDrop.js"/>

View File

@ -1,4 +1,5 @@
/* ***** BEGIN LICENSE BLOCK *****
/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -47,7 +48,7 @@
* Garth Smedley
* REQUIRED INCLUDES
* <script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
*
* <script type="application/x-javascript" src="chrome://calendar/content/applicationUtil.js"/>
* NOTES
* Code for the calendar's new/edit event dialog.
*
@ -79,11 +80,10 @@
* W I N D O W V A R I A B L E S
*/
var debugenabled=false;
var debugenabled=true;
var gEvent; // event being edited
var gOnOkFunction; // function to be called when user clicks OK
var gOriginalEvent; //Event before edits
var gDuration = -1; // used to preserve duration when changing event start.
@ -114,35 +114,34 @@ var gEndDate = new Date( );
function loadCalendarEventDialog()
{
// Get arguments, see description at top of file
var args = window.arguments[0];
gOnOkFunction = args.onOk;
// XXX I want to get rid of the use of gEvent
gEvent = args.calendarEvent;
event = args.calendarEvent;
// mode is "new or "edit" - show proper header
var titleDataItem = null;
if ("new" == args.mode)
{
titleDataItem = document.getElementById( "data-event-title-new" );
}
else
{
titleDataItem = document.getElementById( "data-event-title-edit" );
gOriginalEvent = gEvent.clone();
title = document.getElementById("data-event-title-new").getAttribute("value");
else {
title = document.getElementById("data-event-title-edit").getAttribute("value");
}
var titleString = titleDataItem.getAttribute( "value" );
document.getElementById("calendar-new-eventwindow").setAttribute("title", titleString);
document.getElementById("calendar-new-component-window").setAttribute("title", title);
// fill in fields from the event
gStartDate.setTime( gEvent.start.getTime() );
gStartDate = event.startDate.jsDate;
document.getElementById("start-datetime").value = gStartDate;
gEndDate.setTime( gEvent.end.getTime() );
gEndDate = event.endDate.jsDate;
var displayEndDate = new Date(gEndDate);
if( gEvent.allDay ) {
if (event.isAllDay) {
//displayEndDate == icalEndDate - 1, in the case of allday events
displayEndDate.setDate(displayEndDate.getDate() - 1);
}
@ -150,16 +149,15 @@ function loadCalendarEventDialog()
gDuration = gEndDate.getTime() - gStartDate.getTime(); //in ms
if ( gEvent.recurForever )
{
gEvent.recurEnd.setTime( gEndDate );
/*
if (event.recurForever) {
event.recurEnd.setTime(gEndDate);
}
//do the stuff for exceptions
var ArrayOfExceptions = gEvent.getExceptions();
var ArrayOfExceptions = event.getExceptions();
while( ArrayOfExceptions.hasMoreElements() )
{
while( ArrayOfExceptions.hasMoreElements() ) {
var ExceptionTime = ArrayOfExceptions.getNext().QueryInterface(Components.interfaces.nsISupportsPRTime).data;
var ExceptionDate = new Date( ExceptionTime );
@ -168,62 +166,67 @@ function loadCalendarEventDialog()
}
//file attachments;
for( var i = 0; i < gEvent.attachmentsArray.Count(); i++ )
{
var thisAttachment = gEvent.attachmentsArray.QueryElementAt( i, Components.interfaces.nsIMsgAttachment );
for( var i = 0; i < event.attachmentsArray.Count(); i++ ) {
var thisAttachment = event.attachmentsArray.QueryElementAt( i, Components.interfaces.nsIMsgAttachment );
addAttachment( thisAttachment );
}
*/
document.getElementById("exceptions-date-picker").value = gStartDate;
setFieldValue( "title-field", gEvent.title );
setFieldValue( "description-field", gEvent.description );
setFieldValue( "location-field", gEvent.location );
setFieldValue( "uri-field", gEvent.url );
dump("event: "+event+"\n");
setFieldValue("title-field", event.title );
setFieldValue("description-field", event.getProperty("description"));
setFieldValue("location-field", event.getProperty("location"));
setFieldValue("uri-field", event.getProperty("url"));
switch( gEvent.status )
{
case gEvent.ICAL_STATUS_TENTATIVE:
setFieldValue( "status-field", "ICAL_STATUS_TENTATIVE" );
switch(event.status) {
case event.CAL_ITEM_STATUS_TENTATIVE:
setFieldValue("event-status-field", "ICAL_STATUS_TENTATIVE");
break;
case gEvent.ICAL_STATUS_CONFIRMED:
setFieldValue( "status-field", "ICAL_STATUS_CONFIRMED" );
case event.CAL_ITEM_STATUS_CONFIRMED:
setFieldValue("event-status-field", "ICAL_STATUS_CONFIRMED");
break;
case gEvent.ICAL_STATUS_CANCELLED:
setFieldValue( "status-field", "ICAL_STATUS_CANCELLED" );
case event.CAL_ITEM_STATUS_CANCELLED:
setFieldValue("event-status-field", "ICAL_STATUS_CANCELLED");
break;
}
setFieldValue( "all-day-event-checkbox", gEvent.allDay, "checked" );
setFieldValue( "private-checkbox", gEvent.privateEvent, "checked" );
setFieldValue("all-day-event-checkbox", event.isAllDay, "checked");
setFieldValue("private-checkbox", event.isPrivate, "checked");
setFieldValue( "alarm-checkbox", gEvent.alarm, "checked" );
setFieldValue( "alarm-length-field", gEvent.alarmLength );
setFieldValue( "alarm-length-units", gEvent.alarmUnits );
setFieldValue( "alarm-trigger-relation", gEvent.getParameter( "ICAL_RELATED_PARAMETER" ) );
if ( gEvent.alarmEmailAddress && gEvent.alarmEmailAddress != "" )
{
setFieldValue( "alarm-email-checkbox", true, "checked" );
setFieldValue( "alarm-email-field", gEvent.alarmEmailAddress );
if (!event.hasAlarm) {
// If the event has no alarm
setFieldValue("alarm-type", "none");
}
else {
setFieldValue("alarm-length-field", event.getProperty("alarmLength"));
setFieldValue("alarm-length-units", event.getProperty("alarmUnits"));
setFieldValue("alarm-trigger-relation", event.getProperty("ICAL_RELATED_PARAMETER"));
// If the event has an alarm email address, assume email alarm type
var alarmEmailAddress = event.getProperty("alarmEmailAddress");
if (alarmEmailAddress && alarmEmailAddress != "") {
setFieldValue("alarm-type", "email");
setFieldValue("alarm-email-field", alarmEmailAddress);
}
else {
setFieldValue("alarm-type", "popup");
/* XXX lilmatt: finish this by selection between popup and
popupAndSound by checking pref "calendar.alarms.playsound" */
}
else
{
setFieldValue( "alarm-email-checkbox", false, "checked" );
setFieldValue( "alarm-email-field", true, "disabled" );
}
if ( gEvent.inviteEmailAddress != undefined && gEvent.inviteEmailAddress != "" )
{
var inviteEmailAddress = event.getProperty("inviteEmailAddress");
if (inviteEmailAddress != undefined && inviteEmailAddress != "") {
setFieldValue("invite-checkbox", true, "checked");
setFieldValue( "invite-email-field", gEvent.inviteEmailAddress );
setFieldValue("invite-email-field", inviteEmailAddress);
}
else
{
else {
setFieldValue("invite-checkbox", false, "checked");
}
/* XXX
setFieldValue("repeat-checkbox", gEvent.recur, "checked");
if( gEvent.recurInterval < 1 )
gEvent.recurInterval = 1;
@ -245,18 +248,22 @@ function loadCalendarEventDialog()
setFieldValue( "repeat-numberoftimes-radio", (gEvent.recurCount != 0), "selected" );
setFieldValue( "repeat-numberoftimes-textbox", Math.max(gEvent.recurCount, 1));
*/
/* Categories stuff */
// Load categories
/*
var categoriesString = opener.GetUnicharPref(opener.gCalendarWindow.calendarPreferences.calendarPref, "categories.names", getDefaultCategories());
var categoriesList = categoriesString.split( "," );
// insert the category already in the task so it doesn't get lost
if( gEvent.categories )
{
if( categoriesString.indexOf( gEvent.categories ) == -1 )
categoriesList[categoriesList.length] = gEvent.categories;
var categories = event.getProperty("categories");
if (categories) {
if (categoriesString.indexOf(categories) == -1)
categoriesList[categoriesList.length] = categories;
}
categoriesList.sort();
@ -273,54 +280,52 @@ function loadCalendarEventDialog()
document.getElementById( "categories-field" ).selectedIndex = -1;
setFieldValue( "categories-field", gEvent.categories );
/* Server stuff */
// Server stuff
document.getElementById( "server-menulist-menupopup" ).database.AddDataSource( opener.gCalendarWindow.calendarManager.rdf.getDatasource() );
document.getElementById( "server-menulist-menupopup" ).builder.rebuild();
if( args.mode == "new" )
{
if( "server" in args )
{
if (args.mode == "new") {
if ("server" in args) {
setFieldValue( "server-field", args.server );
}
else
{
else {
document.getElementById( "server-field" ).selectedIndex = 1;
}
}
else
{
} else {
if (gEvent.parent)
setFieldValue( "server-field", gEvent.parent.server );
else
{
document.getElementById( "server-field" ).selectedIndex = 1;
}
//for now you can't edit which file the event is in.
setFieldValue( "server-field", "true", "disabled" );
setFieldValue( "server-field-label", "true", "disabled" );
}
*/
// update enabling and disabling
updateRepeatItemEnabled();
updateStartEndItemEnabled();
updateAlarmItemEnabled();
updateInviteItemEnabled();
updateAddExceptionButton();
//updateAlarmEmailItemEnabled();
/*
** set the advanced weekly repeating stuff
*/
//set the advanced weekly repeating stuff
setAdvancedWeekRepeat();
/*
setFieldValue("advanced-repeat-dayofmonth", (gEvent.recurWeekNumber == 0 || gEvent.recurWeekNumber == undefined), "selected");
setFieldValue("advanced-repeat-dayofweek", (gEvent.recurWeekNumber > 0 && gEvent.recurWeekNumber != 5), "selected");
setFieldValue("advanced-repeat-dayofweek-last", (gEvent.recurWeekNumber == 5), "selected");
*/
// hide/show fields and widgets for item type
processComponentType();
// hide/show fields and widgets for alarm type
processAlarmType();
// start focus on title
var firstFocus = document.getElementById("title-field");
@ -340,100 +345,76 @@ function loadCalendarEventDialog()
function onOKCommand()
{
event = gEvent;
// if this event isn't mutable, we need to clone it like a sheep
var originalEvent = event;
if (!event.isMutable)
event = originalEvent.clone();
// get values from the form and put them into the event
// calIEvent properties
//event.startDate.jsDate = gStartDate;
//event.endDate.jsDate = gEndDate;
event.isAllDay = getFieldValue( "all-day-event-checkbox", "checked" );
gEvent.title = getFieldValue( "title-field" );
gEvent.description = getFieldValue( "description-field" );
gEvent.location = getFieldValue( "location-field" );
gEvent.start.setTime( gStartDate.getTime() );
gEvent.end.setTime( gEndDate.getTime() );
if( getFieldValue( "status-field" ) != "" )
gEvent.status = eval( "gEvent."+getFieldValue( "status-field" ) );
gEvent.allDay = getFieldValue( "all-day-event-checkbox", "checked" );
gEvent.url = getFieldValue( "uri-field" );
gEvent.privateEvent = getFieldValue( "private-checkbox", "checked" );
if( getFieldValue( "invite-checkbox", "checked" ) )
{
gEvent.inviteEmailAddress = getFieldValue( "invite-email-field", "value" );
}
else
{
gEvent.inviteEmailAddress = "";
}
gEvent.alarm = getFieldValue( "alarm-checkbox", "checked" );
gEvent.alarmLength = getFieldValue( "alarm-length-field" );
gEvent.alarmUnits = getFieldValue( "alarm-length-units", "value" );
gEvent.setParameter( "ICAL_RELATED_PARAMETER", getFieldValue( "alarm-trigger-relation", "value" ) );
if ( getFieldValue( "alarm-email-checkbox", "checked" ) )
{
gEvent.alarmEmailAddress = getFieldValue( "alarm-email-field", "value" );
}
else
{
gEvent.alarmEmailAddress = "";
// calIItemBase properties
event.title = getFieldValue( "title-field" );
event.isPrivate = getFieldValue( "private-checkbox", "checked" );
if (getFieldValue( "alarm-type" ) != "" && getFieldValue( "alarm-type" ) != "none")
event.hasAlarm == 1
if (event.hasAlarm) {
alarmLength = getFieldValue( "alarm-length-field" );
alarmUnits = getFieldValue( "alarm-length-units", "value" );
//event.alarmTime = ...
}
gEvent.categories = getFieldValue( "categories-field", "value" );
event.recurrenceInfo = null;
gEvent.recur = getFieldValue( "repeat-checkbox", "checked" );
gEvent.recurUnits = getFieldValue( "repeat-length-units", "value" );
gEvent.recurForever = getFieldValue( "repeat-forever-radio", "selected" );
gEvent.recurInterval = getFieldValue( "repeat-length-field" );
gEvent.recurCount = (getFieldValue("repeat-numberoftimes-radio", "selected")
if (getFieldValue("repeat-checkbox", "checked")) {
recurrenceInfo = createRecurrenceInfo();
recurUnits = getFieldValue("repeat-length-units", "value");
recurForever = getFieldValue("repeat-forever-radio", "selected");
recurInterval = getFieldValue("repeat-length-field");
recurCount = (getFieldValue("repeat-numberoftimes-radio", "selected")
? Math.max(1, getFieldValue("repeat-numberoftimes-textbox"))
: 0); // 0 means not selected.
if( gEvent.recurInterval == 0 )
gEvent.recur = false;
if ( gEvent.recur && getFieldValue( "repeat-until-radio", "selected" ))
{
var recurEndDate = document.getElementById( "repeat-end-date-picker" ).value;
gEvent.recurEnd.setTime( recurEndDate );
gEvent.recurEnd.hour = gEvent.start.hour;
gEvent.recurEnd.minute = gEvent.start.minute;
//recurrenceInfo.recurType = ...
//recurrenceInfo.recurEnd = ...
}
// other properties
event.setProperty('categories', getFieldValue("categories-field", "value"));
event.setProperty('description', getFieldValue("description-field"));
event.setProperty('location', getFieldValue("location-field"));
event.setProperty('url', getFieldValue("uri-field"));
event.setProperty("ICAL_RELATED_PARAMETER", getFieldValue("alarm-trigger-relation", "value"));
if (getFieldValue("alarm-type") == "email" )
event.setProperty('alarmEmailAddress', getFieldValue("alarm-email-field", "value"));
else
{
gEvent.recurEnd.clear();
}
event.deleteProperty('alarmEmailAddress');
if( gEvent.recur == true )
{
if( gEvent.recurUnits == "weeks" )
{
/*
** advanced weekly repeating, choosing the days to repeat
if( getFieldValue( "status-field" ) != "" )
gEvent.status = eval( "gEvent."+getFieldValue( "status-field" ) );
*/
gEvent.recurWeekdays = getAdvancedWeekRepeat();
}
else if( gEvent.recurUnits == "months" )
{
/*
** advanced month repeating, either every day or every date
*/
if( getFieldValue( "advanced-repeat-dayofweek", "selected" ) == true )
{
gEvent.recurWeekNumber = getWeekNumberOfMonth();
}
else if( getFieldValue( "advanced-repeat-dayofweek-last", "selected" ) == true )
{
gEvent.recurWeekNumber = 5;
}
if (getFieldValue("invite-checkbox", "checked"))
event.setProperty('inviteEmailAddress', getFieldValue("invite-email-field", "value"));
else
gEvent.recurWeekNumber = 0;
event.deleteProperty('inviteEmailAddress');
}
}
/* EXCEPTIONS */
/*
gEvent.removeAllExceptions();
var listbox = document.getElementById( "exception-dates-listbox" );
@ -447,41 +428,36 @@ function onOKCommand()
gEvent.addException( dateObj );
}
*/
/* File attachments */
//loop over the items in the listbox
gEvent.removeAttachments();
//event.attachments.clear();
var attachmentListbox = document.getElementById( "attachmentBucket" );
for( i = 0; i < attachmentListbox.childNodes.length; i++ )
{
Attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance( Components.interfaces.nsIMsgAttachment );
Attachment.url = attachmentListbox.childNodes[i].getAttribute( "label" );
gEvent.addAttachment( Attachment );
for (i = 0; i < attachmentListbox.childNodes.length; i++) {
attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance(Components.interfaces.nsIMsgAttachment);
attachment.url = attachmentListbox.childNodes[i].getAttribute("label");
// XXX
//event.attachments.appendElement(attachment);
}
// Attach any specified contacts to the event
if( gEventCardArray )
{
if (gEventCardArray) {
try {
// Remove any existing contacts
gEvent.removeContacts();
//event.contacts.clear();
// Add specified contacts
for (var cardId in gEventCardArray)
{
if( gEventCardArray[ cardId ] )
{
gEvent.addContact( gEventCardArray[ cardId ] );
}
if (gEventCardArray[cardId]) {
// XXX
//event.contacts.appendElement(gEventCardArray[cardId]);
}
}
catch (e)
{
}
}
@ -490,7 +466,8 @@ function onOKCommand()
// :TODO: REALLY only do this if the alarm or start settings change.?
//if the end time is later than the start time... alert the user using text from the dtd.
// call caller's on OK function
gOnOkFunction( gEvent, Server, gOriginalEvent );
gOnOkFunction(event, Server, originalEvent);
// tell standard dialog stuff to close the dialog
return true;
@ -577,25 +554,25 @@ function checkSetRecur()
function setRecurError(state)
{
document.getElementById("repeat-time-warning" ).setAttribute( "collapsed", !state);
document.getElementById("repeat-time-warning" ).setAttribute( "hidden", !state);
}
function setDateError(state)
{
document.getElementById( "end-date-warning" ).setAttribute( "collapsed", !state );
document.getElementById( "end-date-warning" ).setAttribute( "hidden", !state );
}
function setTimeError(state)
{
document.getElementById( "end-time-warning" ).setAttribute( "collapsed", !state );
document.getElementById( "end-time-warning" ).setAttribute( "hidden", !state );
}
function setOkButton(state)
{
if (state == false)
document.getElementById( "calendar-new-eventwindow" ).getButton( "accept" ).setAttribute( "disabled", true );
document.getElementById( "calendar-new-component-window" ).getButton( "accept" ).setAttribute( "disabled", true );
else
document.getElementById( "calendar-new-eventwindow" ).getButton( "accept" ).removeAttribute( "disabled" );
document.getElementById( "calendar-new-component-window" ).getButton( "accept" ).removeAttribute( "disabled" );
}
function updateOKButton()
@ -698,89 +675,9 @@ function commandAllDay()
updateOKButton();
}
/**
* Called when the alarm checkbox is clicked.
*/
function commandAlarm()
{
updateAlarmItemEnabled();
}
/**
* Enable/Disable Alarm items
*/
function updateAlarmItemEnabled()
{
var alarmCheckBox = "alarm-checkbox";
var alarmField = "alarm-length-field";
var alarmMenu = "alarm-length-units";
var alarmTrigger = "alarm-trigger-relation";
var alarmEmailCheckbox = "alarm-email-checkbox";
var alarmEmailField = "alarm-email-field";
// if( getFieldValue(alarmCheckBox, "checked" ) || getFieldValue( alarmEmailCheckbox, "checked" ) )
if( getFieldValue(alarmCheckBox, "checked" ) )
{
// call remove attribute beacuse some widget code checks for the presense of a
// disabled attribute, not the value.
setFieldValue( alarmField, false, "disabled" );
setFieldValue( alarmMenu, false, "disabled" );
setFieldValue( alarmTrigger, false, "disabled" );
setFieldValue( alarmEmailField, false, "disabled" );
setFieldValue( alarmEmailCheckbox, false, "disabled" );
}
else
{
setFieldValue( alarmField, true, "disabled" );
setFieldValue( alarmMenu, true, "disabled" );
setFieldValue( alarmTrigger, true, "disabled" );
setFieldValue( alarmEmailField, true, "disabled" );
setFieldValue( alarmEmailCheckbox, true, "disabled" );
}
}
/**
* Called when the alarm checkbox is clicked.
*/
function commandAlarmEmail()
{
updateAlarmEmailItemEnabled();
}
/**
* Enable/Disable Alarm items
*/
function updateAlarmEmailItemEnabled()
{
var alarmCheckBox = "alarm-email-checkbox";
var alarmEmailField = "alarm-email-field";
if( getFieldValue( alarmCheckBox, "checked" ) )
{
// call remove attribute beacuse some widget code checks for the presense of a
// disabled attribute, not the value.
setFieldValue( alarmEmailField, false, "disabled" );
}
else
{
setFieldValue( alarmEmailField, true, "disabled" );
}
}
/**
* Called when the alarm checkbox is clicked.
* Called when the invite checkbox is clicked.
*/
function commandInvite()
@ -883,7 +780,8 @@ function updateMenuPlural( lengthFieldId, menuId )
var newLabelNumber;
if( Number( length ) > 1 )
// XXX This assumes that "0 days, minutes, etc." is plural in other languages.
if( ( Number( length ) == 0 ) || ( Number( length ) > 1 ) )
{
newLabelNumber = "labelplural"
}
@ -997,7 +895,6 @@ function updateRepeatUnitExtensions( )
}
/**
* Enable/Disable Start/End items
*/
@ -1015,8 +912,6 @@ function updateStartEndItemEnabled()
}
/**
* Handle key down in repeat field
*/
@ -1414,22 +1309,29 @@ function setFieldValue( elementId, newValue, propertyName )
{
var undefined;
if( newValue !== undefined )
{
if( newValue !== undefined ) {
var field = document.getElementById( elementId );
if( newValue === false )
{
if( newValue === false ) {
try {
field.removeAttribute( propertyName );
}
else
{
if( propertyName )
{
catch (e) {
dump("setFieldValue: field.removeAttribute couldn't remove "+propertyName+
" from "+elementId+" e: "+e+"\n");
}
}
else {
if( propertyName ) {
try {
field.setAttribute( propertyName, newValue );
}
else
{
catch (e) {
dump("setFieldValue: field.setAttribute couldn't set "+propertyName+
" from "+elementId+" to "+newValue+" e: "+e+"\n");
}
}
else {
field.value = newValue;
}
}
@ -1518,7 +1420,6 @@ function setDateFieldValue( elementId, newDate )
function setTimeFieldValue( elementId, newDate )
{
// set the value to a formatted time string
var field = document.getElementById( elementId );
field.value = formatTime( newDate );
@ -1557,3 +1458,85 @@ function debug( text )
if( debugenabled )
dump( "\n"+ text + "\n");
}
// XXX lilmatt's new crap for the new XUL
function processAlarmType()
{
var alarmMenu = document.getElementById("alarm-type");
if( alarmMenu.selectedItem ) {
dump("processAlarmType: "+alarmMenu.selectedItem.value+"\n");
switch( alarmMenu.selectedItem.value )
{
case "none":
hideElement("alarm-length-field");
hideElement("alarm-length-units");
hideElement("alarm-box-email");
break;
case "popup":
showElement("alarm-length-field");
showElement("alarm-length-units");
hideElement("alarm-box-email");
break;
case "popupAndSound":
showElement("alarm-length-field");
showElement("alarm-length-units");
hideElement("alarm-box-email");
break;
case "email":
showElement("alarm-length-field");
showElement("alarm-length-units");
showElement("alarm-box-email");
break;
}
// Make the window big enough for all the fields and widgets
window.sizeToContent();
}
else
dump("processAlarmType: no alarmMenu.selectedItem!\n");
}
function processComponentType()
{
var componentMenu = document.getElementById("component-type");
if( componentMenu.selectedItem) {
dump("processComponentType: "+componentMenu.selectedItem.value+"\n");
var args = window.arguments[0];
switch( componentMenu.selectedItem.value )
{
case "ICAL_COMPONENT_EVENT":
// Hide and show the appropriate fields and widgets
hideElement("task-status-label");
hideElement("cancelled-checkbox");
showElement("event-status-label");
showElement("event-status-field");
showElement("all-day-event-checkbox");
// Set menubar title correctly - New vs. Edit
if( "new" == args.mode )
titleDataItem = document.getElementById( "data-event-title-new" );
else
titleDataItem = document.getElementById( "data-event-title-edit" );
document.getElementById("calendar-new-component-window").setAttribute("title", titleDataItem.getAttribute( "value" ));
break;
case "ICAL_COMPONENT_TODO":
// Hide and show the appropriate fields and widgets
hideElement("event-status-label");
hideElement("event-status-field");
hideElement("all-day-event-checkbox");
showElement("task-status-label");
showElement("cancelled-checkbox");
// Set menubar title correctly - New vs. Edit
if( "new" == args.mode )
titleDataItem = document.getElementById( "data-event-title-new" );
else
titleDataItem = document.getElementById( "data-event-title-edit" );
document.getElementById("calendar-new-component-window").setAttribute("title", titleDataItem.getAttribute( "value" ));
break;
//case "ICAL_COMPONENT_JOURNAL":
}
// Make the window big enough for all the fields and widgets
window.sizeToContent();
}
else
dump("processComponentType: no componentMenu.selectedItem!\n");
}

View File

@ -25,6 +25,7 @@
- Chris Charabaruk <ccharabaruk@meldstar.com>
- ArentJan Banck <ajbanck@planet.nl>
- Mostafa Hosseini <mostafah@oeone.com>
- Matthew Willis <mattwillis@gmail.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
@ -60,13 +61,14 @@
<dialog
id="calendar-new-eventwindow"
title="Calendar Event"
id="calendar-new-component-window"
title="Calendar Component"
onload="loadCalendarEventDialog()"
buttons="accept,cancel"
ondialogaccept="return onOKCommand();"
ondialogcancel="return true;"
persist="screenX screenY"
minwidth="490"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#">
@ -74,9 +76,6 @@
<stringbundle id="bundle_calendar" src="chrome://calendar/locale/calendar.properties"/>
</stringbundleset>
<!-- Javascript DTD To Variable -->
<script type="application/x-javascript" src="chrome://communicator/content/utilityOverlay.js"/>
<script type="application/x-javascript">
var DTD_noEmailMessage = "&ab-selectAddressesDialogNoEmailMessage.label;";
var DTD_toPrefix = "&ab-selectAddressesDialogPrefixTo.label;";
@ -108,6 +107,8 @@
<dataset>
<data id="data-event-title-new" value="&event.title.new;" />
<data id="data-event-title-edit" value="&event.title.edit;" />
<data id="data-event-title-new" value="&todo.title.new;" />
<data id="data-event-title-edit" value="&todo.title.edit;" />
<data id="onthe-text" value="&onthe-text;" />
<data id="last-text" value="&last-text;" />
<data id="ofthemonth-text" value="&ofthemonth-text;" />
@ -118,135 +119,229 @@
<tabbox>
<tabs>
<tab label="&newevent.newevent.tab.label;"/>
<!-- XXX label="&newevent.newevent.tab.label;" -->
<tab label="General"/>
<tab label="&newevent.recurrence.tab.label;"/>
<tab label="&newevent.contacts.tab.label;" hidden="true"/>
<tab label="&newevent.files.tab.label;" hidden="true"/>
<!-- XXX label="&newevent.contacts.tab.label;" -->
<tab label="Attendees"/>
<!-- XXX label="&newevent.files.tab.label;" -->
<tab label="Attachments"/>
<tab label="Advanced"/>
</tabs>
<tabpanels>
<tabpanel>
<vbox flex="1">
<hbox flex="1">
<groupbox flex="1">
<caption label="General Settings"/>
<grid>
<columns>
<column />
<column flex="1"/>
</columns>
<rows>
<row align="center">
<!-- Item Type -->
<hbox pack="end">
<label for="component-type" value="Item Type"/>
</hbox>
<hbox>
<menulist id="component-type" crop="none" oncommand="processComponentType()">
<menupopup id="component-menulist-menupopup">
<menuitem label="Event" value="ICAL_COMPONENT_EVENT"/>
<menuitem label="Task" value="ICAL_COMPONENT_TODO"/>
<menuitem label="Journal" value="ICAL_COMPONENT_JOURNAL"
disabled="true"/>
</menupopup>
</menulist>
<spacer width="10px"/>
<!-- Calendar Server &newevent.server.label; -->
<hbox align="center" flex="1">
<label id="server-field-label" value="Calendar"/>
<menulist id="server-field">
<menupopup id="server-menulist-menupopup" datasources="rdf:null"
ref="urn:calendarcontainer">
<template>
<rule>
<menuitem uri="rdf:*"
value="rdf:http://home.netscape.com/NC-rdf#path"
label="rdf:http://home.netscape.com/NC-rdf#name"/>
</rule>
</template>
</menupopup>
</menulist>
</hbox>
</hbox>
</row>
<!-- Title -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<hbox pack="end">
<label for="title-field" value="&newevent.title.label;"/>
</hbox>
<textbox id="title-field"/>
</row>
<!-- Location -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<hbox pack="end">
<label for="location-field" value="&newevent.location.label;"/>
</hbox>
<textbox id="location-field"/>
</row>
<!-- Start Date -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newevent.startdate.label;"/>
</hbox>
<datetimepicker id="start-datetime" value=""
onchange="onDateTimePick( this );"/>
</row>
<!-- End Date -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newevent.enddate.label;"/>
</hbox>
<datetimepicker id="end-datetime" value=""
onchange="onDateTimePick( this );"/>
</row>
<!-- End Time Warning -->
<row align="center">
<spacer />
<label id="end-time-warning"
class="warning-text-class"
value="&newevent.endtime.warning;"
collapsed="true"/>
</row>
<!-- End Date Warning -->
<row align="center">
<spacer />
<label id="end-date-warning"
class="warning-text-class"
value="&newevent.enddate.warning;"
collapsed="true"/>
</row>
<!-- All Day -->
<row align="center">
<spacer />
<checkbox id="all-day-event-checkbox"
label="&newevent.alldayevent.label;"
oncommand="commandAllDay()"
persist="checked"/>
</row>
<!-- Description -->
<row flex="1" align="start">
<hbox class="field-label-box-class" pack="end">
<label for="description-field" value="&newevent.description.label;"/>
</hbox>
<textbox id="description-field"
multiline="true"
rows="3"
cols="30" />
</row>
<!-- URI/URL -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label for="uri-field" value="&newevent.uri.label;"/>
<!-- Status -->
<hbox pack="end">
<label id="event-status-label" for="event-status-menulist-menupopup"
value="&newevent.status.label;" hidden="true"/>
<label id="task-status-label" for="cancelled-checkbox"
value="&newtodo.status.label;" hidden="true"/>
</hbox>
<hbox>
<textbox id="uri-field"
#ifndef MOZ_SUNBIRD
type="autocomplete"
searchSessions="history"
#endif
flex="1"/>
<button label="&newevent.uri.visit.label;"
oncommand="loadURL()"/>
<menulist id="event-status-field" label="&newevent.status.label;"
hidden="true">
<menupopup id="event-status-menulist-menupopup">
<menuitem label="None"/>
<menuitem label="&newevent.status.tentative.label;"
value="ICAL_STATUS_TENTATIVE"/>
<menuitem label="&newevent.status.confirmed.label;"
value="ICAL_STATUS_CONFIRMED"/>
<menuitem label="&newevent.status.cancelled.label;"
value="ICAL_STATUS_CANCELLED"/>
</menupopup>
</menulist>
<checkbox id="cancelled-checkbox" label="&newtodo.cancelled.label;"
checked="false" hidden="true"/>
<spacer width="10px"/>
<!-- Categories -->
<hbox align="center">
<label for="categories-menulist-menupopup" value="&newtodo.categories.label;"/>
<menulist id="categories-field" label="&newevent.category.label;">
<menupopup id="categories-menulist-menupopup">
<menuitem label="&priority.level.none;" value="0"/>
</menupopup>
</menulist>
</hbox>
</hbox>
</row>
<!-- Private -->
</rows>
</grid>
<hbox>
<separator class="thin"/>
</hbox>
</groupbox>
</hbox>
<hbox flex="1">
<!-- Schedule -->
<groupbox flex="1">
<caption label="Schedule"/>
<hbox>
<checkbox id="all-day-event-checkbox" label="&newevent.alldayevent.label;"
oncommand="commandAllDay()" persist="checked" hidden="true"/>
</hbox>
<separator class="thin"/>
<hbox>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<hbox pack="end" align="center">
<label class="field-label-box-class" value="From"/>
</hbox>
<hbox flex="1">
<datetimepicker id="start-datetime" value="" onchange="onDateTimePick( this );"/>
<spacer flex="1"/>
</hbox>
</row>
<row>
<hbox pack="end" align="center">
<label value="To"/>
</hbox>
<hbox flex="1">
<datetimepicker id="end-datetime" value="" onchange="onDateTimePick( this );"/>
<spacer flex="1"/>
</hbox>
</row>
<!-- Invalid end date/time warnings -->
<row align="center">
<spacer />
<checkbox id="private-checkbox"
checked="false"
label="&newevent.private.label;"/>
<label id="end-time-warning" class="warning-text-class"
value="&newevent.endtime.warning;" hidden="true"/>
</row>
<row align="center">
<spacer />
<label id="end-date-warning" class="warning-text-class"
value="&newevent.enddate.warning;" hidden="true"/>
</row>
<!-- Alarm -->
<!-- Invalid due date/time warnings -->
<row align="center">
<spacer />
<label id="due-time-warning" class="warning-text-class"
value="&newtodo.duetime.warning;" hidden="true"/>
</row>
<row align="center">
<spacer />
<label id="due-date-warning" class="warning-text-class"
value="&newtodo.duedate.warning;" hidden="true"/>
</row>
</rows>
</grid>
</hbox>
<hbox>
<separator class="thin"/>
</hbox>
</groupbox>
</hbox>
<!-- Alarm -->
<hbox flex="1">
<groupbox flex="1">
<caption label="Alarm"/>
<hbox>
<vbox>
<menulist id="alarm-type" crop="none" oncommand="processAlarmType()">
<menupopup>
<menuitem label="None" value="none"/>
<menuitem label="Popup" value="popup"/>
<menuitem label="Popup &amp; Play Sound" value="popupAndSound"
disabled="true"/>
<menuitem label="Send Email" value="email"/>
</menupopup>
</menulist>
</vbox>
<vbox>
<textbox id="alarm-length-field" size="5" maxlength="3" oninput="alarmLengthKeyDown( this )"/>
</vbox>
<vbox>
<hbox id="alarm-box" align="center">
<checkbox id="alarm-checkbox"
class="proper-align"
label="&newevent.alarm.label;"
checked="false"
oncommand="commandAlarm()"/>
<textbox id="alarm-length-field" oninput="alarmLengthKeyDown( this )"/>
<menulist id="alarm-length-units" crop="none" labelnumber="labelplural">
<menupopup>
<menuitem label="minutes before this begins"
labelplural="minutes before this begins"
labelsingular="minute before this begins"
value="minutes"/>
<menuitem label="hours before this begins"
labelplural="hours before this begins"
labelsingular="hour before this begins"
value="hours" />
<menuitem label="days before this begins"
labelplural="days before this begins"
labelsingular="day before this begins"
value="days"/>
<menuitem label="minutes before this ends"
labelplural="minutes before this ends"
labelsingular="minute before this ends"
value="minutes"/>
<menuitem label="hours before this ends"
labelplural="hours before this ends"
labelsingular="hour before this ends"
value="hours" />
<menuitem label="days before this ends"
labelplural="days before this ends"
labelsingular="day before this ends"
value="days"/>
<!-- XXX original code for fixing localization
<menuitem label="&alarm.units.minutes;"
labelplural="&alarm.units.minutes;"
labelsingular="&alarm.units.minutes.singular;"
@ -259,90 +354,46 @@
labelplural="&alarm.units.days;"
labelsingular="&alarm.units.days.singular;"
value="days"/>
</menupopup>
</menulist>
<menulist id="alarm-trigger-relation" crop="none">
<menupopup>
<menuitem label="&newevent.beforealarm.label;"
value="ICAL_RELATED_START"/>
<menuitem label="&newevent.beforealarmends.label;"
value="ICAL_RELATED_END"/>
-->
</menupopup>
</menulist>
</vbox>
</hbox>
<hbox id="alarm-box-email" align="center">
<spacer width="15"/>
<checkbox id="alarm-email-checkbox"
label="&newevent.email.label;"
checked="false"
oncommand="commandAlarmEmail()"/>
<!-- XXX &newevent.email.label; -->
<label class="field-label-box-class" for="alarm-email-field" value="Send email to:"/>
<!-- XXX oncommand="commandAlarmEmail()"/> -->
<textbox id="alarm-email-field"
#ifndef MOZ_SUNBIRD
type="autocomplete"
searchSessions="addrbook"
#endif
size="39"
value="" />
size="40"
value=""
hidden="false"/>
</hbox>
<hbox>
<textbox id="alarm-trigger-relation" hidden="true"/>
</hbox>
<hbox>
<separator class="thin"/>
</hbox>
</groupbox>
</hbox>
<hbox flex="10"/> <!-- Creates white space at bottom of dialog -->
</vbox>
</row>
<!-- Status -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newevent.status.longlabel;"/>
</hbox>
<menulist id="status-field" label="&newevent.status.label;">
<menupopup id="status-menulist-menupopup">
<menuitem label="&newevent.status.tentative.label;"
value="ICAL_STATUS_TENTATIVE"/>
<menuitem label="&newevent.status.confirmed.label;"
value="ICAL_STATUS_CONFIRMED"/>
<menuitem label="&newevent.status.cancelled.label;"
value="ICAL_STATUS_CANCELLED"/>
</menupopup>
</menulist>
</row>
<!-- Categories -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.categories.label;"/>
</hbox>
<menulist id="categories-field" label="&newevent.category.label;">
<menupopup id="categories-menulist-menupopup">
<menuitem label="&priority.level.none;" value="0"/>
</menupopup>
</menulist>
</row>
<!-- Calendar Server -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label id="server-field-label" value="&newevent.server.label;"/>
</hbox>
<menulist id="server-field">
<menupopup id="server-menulist-menupopup"
datasources="rdf:null"
ref="urn:calendarcontainer">
<template>
<rule>
<menuitem uri="rdf:*"
value="rdf:http://home.netscape.com/NC-rdf#path"
label="rdf:http://home.netscape.com/NC-rdf#name"/>
</rule>
</template>
</menupopup>
</menulist>
</row>
</rows>
</grid>
</tabpanel>
<!-- Repeat -->
<tabpanel>
<vbox>
<vbox flex="1">
<hbox flex="1">
<groupbox flex="1">
<caption label="Recurrence"/>
<hbox id="repeat-box" align="center">
<checkbox id="repeat-checkbox"
class="proper-align"
@ -354,7 +405,6 @@
disable-controller="repeat"
value=""
oninput="repeatLengthKeyDown( this )"/>
<menulist crop="none"
oncommand="repeatUnitCommand( this )"
labelnumber="labelplural"
@ -384,7 +434,6 @@
</menupopup>
</menulist>
</hbox>
<hbox id="repeat-extenstions-week"
disabled="true"
disable-controller="repeat"
@ -433,7 +482,6 @@
value="6"
checked="false" />
</hbox>
<hbox id="repeat-extenstions-month"
disabled="true"
collapsed="true"
@ -455,9 +503,7 @@
</radiogroup>
</vbox>
</hbox>
<spacer height="10" />
<hbox align="center">
<spacer class="repeat-left-spacer" />
<radiogroup id="repeat-until-group"
@ -488,13 +534,14 @@
<label id="repeat-time-warning"
class="warning-text-class"
value="&newevent.recurend.warning;"
collapsed="true"/>
hidden="true"/>
</radiogroup>
</hbox>
<hbox align="center">
</groupbox>
</hbox>
<hbox flex="1">
<spacer class="repeat-left-spacer" />
<groupbox>
<groupbox flex="1">
<caption label="&newevent.exceptions.caption;"/>
<grid>
<columns>
@ -532,7 +579,7 @@
</tabpanel><!-- /Repeat -->
<!-- Contacts panel -->
<tabpanel orient="vertical" hidden="true">
<tabpanel orient="vertical">
<!-- Invite -->
<vbox collapsed="true">
<hbox id="invite-box" align="center">
@ -551,7 +598,7 @@
<label value="&ab-selectAddressesDialogLookIn.label;" />
<!-- Address book chooser -->
<menulist id="addressBookList" oncommand="onChooseAddressBookEventDialog( this );">
<!-- <menulist id="addressBookList" oncommand="onChooseAddressBookEventDialog( this );">
<menupopup id="addressBookList-menupopup"
ref="moz-abdirectory://"
datasources="rdf:addressdirectory">
@ -563,7 +610,7 @@
</rule>
</template>
</menupopup>
</menulist>
</menulist>-->
</hbox>
<hbox flex="1">
@ -655,6 +702,59 @@
<spacer flex="1"/>
</vbox>
</tabpanel>
<!-- "Advanced" tab -->
<tabpanel>
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<!-- URI/URL -->
<row align="center" flex="1">
<hbox class="field-label-box-class" pack="end">
<label for="uri-field" value="&newevent.uri.label;"/>
</hbox>
<hbox>
<textbox id="uri-field"
#ifndef MOZ_SUNBIRD
type="autocomplete"
searchSessions="history"
#endif
flex="1"/>
<button label="&newevent.uri.visit.label;"
oncommand="loadURL()"/>
</hbox>
</row>
<!-- Private -->
<row align="center" flex="1">
<spacer />
<checkbox id="private-checkbox"
checked="false"
label="&newevent.private.label;"/>
</row>
<!-- Description -->
<row flex="1" align="start">
<hbox class="field-label-box-class" pack="end">
<label for="description-field" value="&newevent.description.label;"/>
</hbox>
<textbox id="description-field"
multiline="true"
rows="3"
cols="30"
flex="1" />
</row>
</rows>
</grid>
</tabpanel>
</tabpanels>
</tabbox>
</dialog>