diff -u8pdNr 0.9/chrome/content/ccd-calendar-item-editing.js 1.0/chrome/content/ccd-calendar-item-editing.js
--- 0.9/chrome/content/ccd-calendar-item-editing.js	2011-11-21 20:20:44 +0000
+++ 1.0/chrome/content/ccd-calendar-item-editing.js	1970-01-01 00:00:00 +0000
@@ -1,614 +0,0 @@
-/* ***** 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
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Oracle Corporation code.
- *
- * The Initial Developer of the Original Code is Oracle Corporation
- * Portions created by the Initial Developer are Copyright (C) 2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Stuart Parmenter <stuart.parmenter@oracle.com>
- *   Robin Edrenius <robin.edrenius@gmail.com>
- *   Philipp Kewisch <mozilla@kewis.ch>
- *   Daniel Boelzle <daniel.boelzle@sun.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
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-Components.utils.import("resource://calendar/modules/calAlarmUtils.jsm");
-
-function setCustomCalendarDefaults(aItem) {
-    var prefService = Components.classes["@mozilla.org/preferences-service;1"]
-                       .getService(Components.interfaces.nsIPrefService);
-    var prefBranch = prefService.getBranch("extensions.customcalendardefaults.");
-    let type = cal.isEvent(aItem) ? "event" : "todo";
-    if (type == "event") {
-        // apply default event status
-        let ccdStatus = prefBranch.getCharPref("event.status");
-        aItem.setProperty("STATUS", ccdStatus);
-        // apply default event privacy
-        let ccdPrivacy = prefBranch.getBoolPref("event.privacy");
-        if (ccdPrivacy == true) {
-            let ccdPrivacyState = prefBranch.getCharPref("event.privacy.state");
-            aItem.setProperty("CLASS", ccdPrivacyState);
-        }
-        // apply default event priority
-        let ccdPriority = prefBranch.getCharPref("event.priority");
-        aItem.setProperty("PRIORITY", ccdPriority);
-        // apply default event showTimeAs
-        let ccdShowTimeAs = prefBranch.getBoolPref("event.showTimeAs");
-        if (ccdShowTimeAs == true) {
-            let ccdShowTimeAsState = prefBranch.getCharPref("event.showTimeAs.state");
-            aItem.setProperty("TRANSP", ccdShowTimeAsState);
-        }
-    }
-    else if (type == "todo") {
-        // apply default task status
-        let ccdStatus = prefBranch.getCharPref("task.status");
-        aItem.setProperty("STATUS", ccdStatus);
-        // apply default task privacy
-        let ccdPrivacy = prefBranch.getBoolPref("task.privacy");
-        if (ccdPrivacy == true) {
-            let ccdPrivacyState = prefBranch.getCharPref("task.privacy.state");
-            aItem.setProperty("CLASS", ccdPrivacyState);
-        }
-        // apply default task priority
-        let ccdPriority = prefBranch.getCharPref("task.priority");
-        aItem.setProperty("PRIORITY", ccdPriority);
-        // apply default task showTimeAs
-        let ccdShowTimeAs = prefBranch.getBoolPref("task.showTimeAs");
-        if (ccdShowTimeAs == true) {
-            let ccdShowTimeAsState = prefBranch.getCharPref("task.showTimeAs.state");
-            aItem.setProperty("TRANSP", ccdShowTimeAsState);
-        }
-    }
-}
-
-/**
- * Takes a job and makes sure the dispose function on it is called. If there is
- * no dispose function or the job is null, ignore it.
- *
- * @param job       The job to dispose.
- */
-function disposeJob(job) {
-    if (job && job.dispose) {
-        job.dispose();
-    }
-}
-
-/**
- * Creates an event with the calendar event dialog.
- *
- * @param calendar      (optional) The calendar to create the event in
- * @param startDate     (optional) The event's start date.
- * @param endDate       (optional) The event's end date.
- * @param summary       (optional) The event's title.
- * @param event         (optional) A template event to show in the dialog
- * @param aForceAllDay  (optional) Make sure the event shown in the dialog is an
- *                                   allday event.
- */
-function createEventWithDialog(calendar, startDate, endDate, summary, event, aForceAllday) {
-    const kDefaultTimezone = calendarDefaultTimezone();
-
-    var onNewEvent = function(item, calendar, originalItem, listener) {
-        if (item.id) {
-            // If the item already has an id, then this is the result of
-            // saving the item without closing, and then saving again.
-            doTransaction('modify', item, calendar, originalItem, listener);
-        } else {
-            // Otherwise, this is an addition
-            doTransaction('add', item, calendar, null, listener);
-        }
-    };
-
-    if (event) {
-        if (!event.isMutable) {
-            event = event.clone();
-        }
-        // If the event should be created from a template, then make sure to
-        // remove the id so that the item obtains a new id when doing the
-        // transaction
-        event.id = null;
-
-        if (aForceAllday) {
-            event.startDate.isDate = true;
-            event.endDate.isDate = true;
-            if (event.startDate.compare(event.endDate) == 0) {
-                // For a one day all day event, the end date must be 00:00:00 of
-                // the next day.
-                event.endDate.day++;
-            }
-        }
-
-        if (!event.calendar) {
-            event.calendar = calendar || getSelectedCalendar();
-        }
-    } else {
-        event = createEvent();
-
-        if (startDate) {
-            event.startDate = startDate.clone();
-            if (startDate.isDate && !aForceAllday) {
-                // This is a special case where the date is specified, but the
-                // time is not. To take care, we setup up the time to our
-                // default event start time.
-                event.startDate = getDefaultStartDate(event.startDate);
-            } else if (aForceAllday) {
-                // If the event should be forced to be allday, then don't set up
-                // any default hours and directly make it allday.
-                event.startDate.isDate = true;
-                event.startDate.timezone = floating();
-            }
-        } else {
-            // If no start date was passed, then default to the next full hour
-            // of today, but with the date of the selected day
-            var refDate = currentView().initialized && currentView().selectedDay.clone();
-            event.startDate = getDefaultStartDate(refDate);
-        }
-
-        if (endDate) {
-            event.endDate = endDate.clone();
-            if (aForceAllday) {
-                // XXX it is currently not specified, how callers that force all
-                // day should pass the end date. Right now, they should make
-                // sure that the end date is 00:00:00 of the day after.
-                event.endDate.isDate = true;
-                event.endDate.timezone = floating();
-            }
-        } else {
-            event.endDate = event.startDate.clone();
-            if (!aForceAllday) {
-                // If the event is not all day, then add the default event
-                // length.
-                event.endDate.minute += getPrefSafe("calendar.event.defaultlength", 60);
-            } else {
-                // All day events need to go to the beginning of the next day.
-                event.endDate.day++;
-            }
-        }
-
-        event.calendar = calendar || getSelectedCalendar();
-
-        if (summary) {
-            event.title = summary;
-        }
-
-        cal.alarms.setDefaultValues(event);
-        setCustomCalendarDefaults(event);
-    }
-    openEventDialog(event, calendar, "new", onNewEvent, null);
-}
-
-/**
- * Creates a task with the calendar event dialog.
- *
- * @param calendar      (optional) The calendar to create the task in
- * @param dueDate       (optional) The task's due date.
- * @param summary       (optional) The task's title.
- * @param todo          (optional) A template task to show in the dialog.
- * @param initialDate   (optional) The initial date for new task datepickers
- */
-function createTodoWithDialog(calendar, dueDate, summary, todo, initialDate) {
-    const kDefaultTimezone = calendarDefaultTimezone();
-
-    var onNewItem = function(item, calendar, originalItem, listener) {
-        if (item.id) {
-            // If the item already has an id, then this is the result of
-            // saving the item without closing, and then saving again.
-            doTransaction('modify', item, calendar, originalItem, listener);
-        } else {
-            // Otherwise, this is an addition
-            doTransaction('add', item, calendar, null, listener);
-        }
-    }
-
-    if (todo) {
-        // If the todo should be created from a template, then make sure to
-        // remove the id so that the item obtains a new id when doing the
-        // transaction
-        if (todo.id) {
-            todo = todo.clone();
-            todo.id = null;
-        }
-
-        if (!todo.calendar) {
-            todo.calendar = calendar || getSelectedCalendar();
-        }
-    } else {
-        todo = createTodo();
-        todo.calendar = calendar || getSelectedCalendar();
-
-        if (summary)
-            todo.title = summary;
-
-        if (dueDate)
-            todo.dueDate = dueDate;
-
-        if (cal.getPrefSafe("calendar.alarms.onfortodos", 0) == 1 &&
-            !todo.entryDate) {
-            // the todo must have an entry date if we want to set an alarm
-            todo.entryDate = initialDate;
-        }
-
-        cal.alarms.setDefaultValues(todo);
-        setCustomCalendarDefaults(todo);
-    }
-
-    openEventDialog(todo, calendar, "new", onNewItem, null, initialDate);
-}
-
-
-
-/**
- * Modifies the passed event in the event dialog.
- *
- * @param aItem                 The item to modify.
- * @param job                   (optional) The job object that controls this
- *                                           modification.
- * @param aPromptOccurrence     If the user should be prompted to select if the
- *                                parent item or occurrence should be modified.
- * @param initialDate           (optional) The initial date for new task datepickers
- */
-function modifyEventWithDialog(aItem, job, aPromptOccurrence, initialDate) {
-    let dlg = cal.findItemWindow(aItem);
-    if (dlg) {
-        dlg.focus();
-        disposeJob(job);
-        return;
-    }
-
-    let onModifyItem = function(item, calendar, originalItem, listener) {
-        doTransaction('modify', item, calendar, originalItem, listener);
-    };
-
-    let item = aItem;
-    let futureItem, response;
-    if (aPromptOccurrence !== false) {
-        [item, futureItem, response] = promptOccurrenceModification(aItem, true, "edit");
-    }
-
-    if (item && (response || response === undefined)) {
-        openEventDialog(item, item.calendar, "modify", onModifyItem, job, initialDate);
-    } else {
-        disposeJob(job);
-    }
-}
-
-/**
- * Opens the event dialog with the given item (task OR event)
- *
- * @param calendarItem      The item to open the dialog with
- * @param calendar          The calendar to open the dialog with.
- * @param mode              The operation the dialog should do ("new", "modify")
- * @param callback          The callback to call when the dialog has completed.
- * @param job               (optional) The job object for the modification.
- * @param initialDate       (optional) The initial date for new task datepickers
- */
-function openEventDialog(calendarItem, calendar, mode, callback, job, initialDate) {
-    let dlg = cal.findItemWindow(calendarItem);
-    if (dlg) {
-        dlg.focus();
-        disposeJob(job);
-        return;
-    }
-
-    // Set up some defaults
-    mode = mode || "new";
-    calendar = calendar || getSelectedCalendar();
-    var calendars = getCalendarManager().getCalendars({});
-    calendars = calendars.filter(isCalendarWritable);
-
-    var isItemSupported;
-    if (isToDo(calendarItem)) {
-        isItemSupported = function isTodoSupported(aCalendar) {
-            return (aCalendar.getProperty("capabilities.tasks.supported") !== false);
-        };
-    } else if (isEvent(calendarItem)) {
-        isItemSupported = function isEventSupported(aCalendar) {
-            return (aCalendar.getProperty("capabilities.events.supported") !== false);
-        };
-    }
-
-    // Filter out calendars that don't support the given calendar item
-    calendars = calendars.filter(isItemSupported);
-
-    if (mode == "new" && calendars.length < 1 &&
-        (!isCalendarWritable(calendar) || !isItemSupported(calendar))) {
-        // There are no writable calendars or no calendar supports the given
-        // item. Don't show the dialog.
-        disposeJob(job);
-        return;
-    } else if (mode == "new" &&
-               (!isCalendarWritable(calendar) || !isItemSupported(calendar))) {
-        // Pick the first calendar that supports the item and is writable
-        calendar = calendars[0];
-        if (calendarItem) {
-            // XXX The dialog currently uses the items calendar as a first
-            // choice. Since we are shortly before a release to keep regression
-            // risk low, explicitly set the item's calendar here.
-            calendarItem.calendar = calendars[0];
-        }
-    }
-
-    // Setup the window arguments
-    var args = new Object();
-    args.calendarEvent = calendarItem;
-    args.calendar = calendar;
-    args.mode = mode;
-    args.onOk = callback;
-    args.job = job;
-    args.initialStartDateValue = (initialDate || getDefaultStartDate());
-
-    // this will be called if file->new has been selected from within the dialog
-    args.onNewEvent = function(calendar) {
-        createEventWithDialog(calendar, null, null);
-    };
-    args.onNewTodo = function(calendar) {
-        createTodoWithDialog(calendar);
-    };
-
-    // the dialog will reset this to auto when it is done loading.
-    window.setCursor("wait");
-
-    // ask the provide if this item is an invitation. if this is the case
-    // we'll open the summary dialog since the user is not allowed to change
-    // the details of the item.
-    var isInvitation = false;
-    if (calInstanceOf(calendar, Components.interfaces.calISchedulingSupport)) {
-        isInvitation = calendar.isInvitation(calendarItem);
-    }
-
-    // open the dialog modeless
-    var url = "chrome://calendar/content/calendar-event-dialog.xul";
-    if ((mode != "new" && isInvitation) || !isCalendarWritable(calendar)) {
-        url = "chrome://calendar/content/calendar-summary-dialog.xul";
-    }
-    openDialog(url, "_blank", "chrome,titlebar,resizable", args);
-}
-
-/**
- * Prompts the user how the passed item should be modified. If the item is an
- * exception or already a parent item, the item is returned without prompting.
- * If "all occurrences" is specified, the parent item is returned. If "this
- * occurrence only" is specified, then aItem is returned. If "this and following
- * occurrences" is selected, aItem's parentItem is modified so that the
- * recurrence rules end (UNTIL) just before the given occurrence. If
- * aNeedsFuture is specified, a new item is made from the part that was stripped
- * off the passed item.
- *
- * EXDATEs and RDATEs that do not fit into the items recurrence are removed. If
- * the modified item or the future item only consist of a single occurrence,
- * they are changed to be single items.
- *
- * @param aItem                         The item to check.
- * @param aNeedsFuture                  If true, the future item is parsed.
- *                                        This parameter can for example be
- *                                        false if a deletion is being made.
- * @param aAction                       Either "edit" or "delete". Sets up
- *                                          the labels in the occurrence prompt
- * @return [modifiedItem, futureItem, promptResponse]
- *                                      If "this and all following" was chosen,
- *                                        an array containing the item *until*
- *                                        the given occurrence (modifiedItem),
- *                                        and the item *after* the given
- *                                        occurrence (futureItem).
- *
- *                                        If any other option was chosen,
- *                                        futureItem is null  and the
- *                                        modifiedItem is either the parent item
- *                                        or the passed occurrence, or null if
- *                                        the dialog was canceled.
- *
- *                                        The promptResponse parameter gives the
- *                                        response of the dialog as a constant.
- */
-function promptOccurrenceModification(aItem, aNeedsFuture, aAction) {
-    const CANCEL = 0;
-    const MODIFY_OCCURRENCE = 1;
-    const MODIFY_FOLLOWING = 2;
-    const MODIFY_PARENT = 3;
-
-    var futureItem = false;
-    var pastItem;
-    var type = CANCEL;
-
-    // Check if this actually is an instance of a recurring event
-    if (aItem == aItem.parentItem) {
-        type = MODIFY_PARENT;
-    } else if (aItem.parentItem.recurrenceInfo.getExceptionFor(aItem.recurrenceId)) {
-        // If the user wants to edit an occurrence which is already an exception
-        // always edit this single item.
-        // XXX  Why? I think its ok to ask also for exceptions.
-        type = MODIFY_OCCURRENCE;
-    } else {
-        // Prompt the user. Setting modal blocks the dialog until it is closed. We
-        // use rv to pass our return value.
-        var rv = { value: CANCEL, item: aItem, action: aAction};
-        window.openDialog("chrome://calendar/content/calendar-occurrence-prompt.xul",
-                          "PromptOccurrenceModification",
-                          "centerscreen,chrome,modal,titlebar",
-                          rv);
-        type = rv.value;
-    }
-
-    switch (type) {
-        case MODIFY_PARENT:
-            pastItem = aItem.parentItem;
-            break;
-        case MODIFY_FOLLOWING:
-            // TODO tbd in a different bug
-            throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-            break;
-        case MODIFY_OCCURRENCE:
-            pastItem = aItem;
-            break;
-        case CANCEL:
-            // Since we have not set past or futureItem, the return below will
-            // take care.
-            break;
-    }
-
-    return [pastItem, futureItem, type];
-}
-
-// Undo/Redo code
-
-/**
- * Helper to return the transaction manager service.
- *
- * @return      The calITransactionManager service.
- */
-function getTransactionMgr() {
-    return Components.classes["@mozilla.org/calendar/transactionmanager;1"]
-                     .getService(Components.interfaces.calITransactionManager);
-}
-
-
-/**
- * Create and commit a transaction with the given arguments to the transaction
- * manager. Also updates the undo/redo menu.
- *
- * @see                 calITransactionManager
- * @param aAction       The action to do.
- * @param aItem         The new item to add/modify/delete
- * @param aCalendar     The calendar to do the transaction on
- * @param aOldItem      (optional) some actions require an old item
- * @param aListener     (optional) the listener to call when complete.
- */
-function doTransaction(aAction, aItem, aCalendar, aOldItem, aListener) {
-    // This is usually a user-initiated transaction, so make sure the calendar
-    // this transaction is happening on is visible.
-    ensureCalendarVisible(aCalendar);
-
-    // Now use the transaction manager to execute the action
-    getTransactionMgr().createAndCommitTxn(aAction,
-                                           aItem,
-                                           aCalendar,
-                                           aOldItem,
-                                           aListener ? aListener : null);
-    updateUndoRedoMenu();
-}
-
-/**
- * Undo the last operation done through the transaction manager.
- */
-function undo() {
-    if (canUndo()) {
-        getTransactionMgr().undo();
-        updateUndoRedoMenu();
-    }
-}
-
-/**
- * Redo the last undone operation in the transaction manager.
- */
-function redo() {
-    if (canRedo()) {
-        getTransactionMgr().redo();
-        updateUndoRedoMenu();
-    }
-}
-
-/**
- * Start a batch transaction on the transaction manager. Can be called multiple
- * times, which nests transactions.
- */
-function startBatchTransaction() {
-    getTransactionMgr().beginBatch();
-}
-
-/**
- * End a previously started batch transaction. NOTE: be sure to call this in a
- * try-catch-finally-block in case you have code that could fail between
- * startBatchTransaction and this call.
- */
-function endBatchTransaction() {
-    getTransactionMgr().endBatch();
-    updateUndoRedoMenu();
-}
-
-/**
- * Checks if the last operation can be undone (or if there is a last operation
- * at all).
- */
-function canUndo() {
-    return getTransactionMgr().canUndo();
-}
-
-/**
- * Checks if the last undone operation can be redone.
- */
-function canRedo() {
-    return getTransactionMgr().canRedo();
-}
-
-/**
- * Update the undo and redo commands.
- */
-function updateUndoRedoMenu() {
-    goUpdateCommand("cmd_undo");
-    goUpdateCommand("cmd_redo");
-}
-
-function setContextPartstat(value, scope, items) {
-    startBatchTransaction();
-    try {
-        for each (let oldItem in items) {
-            if (scope == "all-occurrences") {
-                oldItem = oldItem.parentItem;
-            }
-            let attendee = null;
-            if (cal.isInvitation(oldItem)) {
-                // Check for the invited attendee first, this is more important
-                attendee = cal.getInvitedAttendee(oldItem);
-            } else if (oldItem.organizer && oldItem.getAttendees({}).length) {
-                // Now check the organizer. This should be done last.
-                let calOrgId = oldItem.calendar.getProperty("organizerId");
-                if (calOrgId == oldItem.organizer.id) {
-                    attendee = oldItem.organizer;
-                }
-            }
-
-            if (attendee) {
-                let newItem = oldItem.clone();
-                let newAttendee = attendee.clone();
-
-                newAttendee.participationStatus = value;
-                if (newAttendee.isOrganizer) {
-                    newItem.organizer = newAttendee;
-                } else {
-                    newItem.removeAttendee(attendee);
-                    newItem.addAttendee(newAttendee);
-                }
-
-                doTransaction('modify', newItem, newItem.calendar, oldItem, null);
-            }
-        }
-    } catch (e) {
-        cal.ERROR("Error setting partstat: " + e);
-    } finally {
-        endBatchTransaction();
-    }
-}
diff -u8pdNr 0.9/chrome/content/ccd-calendar-task-editing.js 1.0/chrome/content/ccd-calendar-task-editing.js
--- 0.9/chrome/content/ccd-calendar-task-editing.js	2011-11-21 20:24:22 +0000
+++ 1.0/chrome/content/ccd-calendar-task-editing.js	1970-01-01 00:00:00 +0000
@@ -1,309 +0,0 @@
-/* ***** 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
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Sun Microsystems code.
- *
- * The Initial Developer of the Original Code is Sun Microsystems.
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Michael Buettner <michael.buettner@sun.com>
- *   Philipp Kewisch <mozilla@kewis.ch>
- *
- * 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
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-Components.utils.import("resource://calendar/modules/calAlarmUtils.jsm");
-
-function setCustomCalendarDefaults(item) {
-    var prefService = Components.classes["@mozilla.org/preferences-service;1"]
-                       .getService(Components.interfaces.nsIPrefService);
-    var prefBranch = prefService.getBranch("extensions.customcalendardefaults.");
-    // apply default task status
-    let ccdStatus = prefBranch.getCharPref("task.status");
-    item.setProperty("STATUS", ccdStatus);
-    // apply default task privacy
-    let ccdPrivacy = prefBranch.getBoolPref("task.privacy");
-    if (ccdPrivacy == true) {
-        let ccdPrivacyState = prefBranch.getCharPref("task.privacy.state");
-        item.setProperty("CLASS", ccdPrivacyState);
-    }
-    // apply default task priority
-    let ccdPriority = prefBranch.getCharPref("task.priority");
-    item.setProperty("PRIORITY", ccdPriority);
-    // apply default task showTimeAs
-    let ccdShowTimeAs = prefBranch.getBoolPref("task.showTimeAs");
-    if (ccdShowTimeAs == true) {
-        let ccdShowTimeAsState = prefBranch.getCharPref("task.showTimeAs.state");
-        aItem.setProperty("TRANSP", ccdShowTimeAsState);
-    }
-}
-
-/**
- * Used by the "quick add" feature for tasks, for example in the task view or
- * the uniinder-todo.
- *
- * NOTE: many of the following methods are called without taskEdit being the
- * |this| object.
- */
-
-var taskEdit = {
-    /**
-     * Get the currently observed calendar.
-     */
-    mObservedCalendar: null,
-    get observedCalendar() {
-        return this.mObservedCalendar;
-    },
-
-    /**
-     * Set the currently observed calendar, removing listeners to any old
-     * calendar set and adding listeners to the new one.
-     */
-    set observedCalendar(v) {
-        if (this.mObservedCalendar) {
-            this.mObservedCalendar.removeObserver(this.calendarObserver);
-        }
-
-        this.mObservedCalendar = v;
-
-        if (this.mObservedCalendar) {
-            this.mObservedCalendar.addObserver(this.calendarObserver);
-        }
-        return this.mObservedCalendar;
-    },
-
-    /**
-     * Helper function to set readonly and aria-disabled states and the value
-     * for a given target.
-     *
-     * @param aTarget   The ID or XUL node to set the value
-     * @param aDisable  A boolean if the target should be disabled.
-     * @param aValue    The value that should be set on the target.
-     */
-    setupTaskField: function tE_setupTaskField(aTarget, aDisable, aValue) {
-        aTarget.value = aValue;
-        setElementValue(aTarget, aDisable && "true", "readonly");
-        setElementValue(aTarget, aDisable && "true", "aria-disabled");
-    },
-
-    /**
-     * Handler function to call when the quick-add textbox gains focus.
-     *
-     * @param aEvent    The DOM focus event
-     */
-    onFocus: function tE_onFocus(aEvent) {
-        var edit = aEvent.target;
-        if (edit.localName == "input") {
-            // For some reason, we only recieve an onfocus event for the textbox
-            // when debugging with venkman.
-            edit = edit.parentNode.parentNode;
-        }
-
-        var calendar = getSelectedCalendar();
-        edit.showsInstructions = true;
-
-        if (calendar.getProperty("capabilities.tasks.supported") === false) {
-            taskEdit.setupTaskField(edit,
-                                    true,
-                                    calGetString("calendar", "taskEditInstructionsCapability"));
-        } else if (!isCalendarWritable(calendar)) {
-            taskEdit.setupTaskField(edit,
-                                    true,
-                                    calGetString("calendar", "taskEditInstructionsReadonly"));
-        } else {
-            edit.showsInstructions = false;
-            taskEdit.setupTaskField(edit, false, edit.savedValue || "");
-        }
-    },
-
-    /**
-     * Handler function to call when the quick-add textbox loses focus.
-     *
-     * @param aEvent    The DOM blur event
-     */
-    onBlur: function tE_onBlur(aEvent) {
-        var edit = aEvent.target;
-        if (edit.localName == "input") {
-            // For some reason, we only recieve the blur event for the input
-            // element. There are no targets that point to the textbox. Go up
-            // the parent chain until we reach the textbox.
-            edit = edit.parentNode.parentNode;
-        }
-
-        var calendar = getSelectedCalendar();
-
-        if (calendar.getProperty("capabilities.tasks.supported") === false){
-            taskEdit.setupTaskField(edit,
-                                    true,
-                                    calGetString("calendar", "taskEditInstructionsCapability"));
-        } else if (!isCalendarWritable(calendar)) {
-            taskEdit.setupTaskField(edit,
-                                    true,
-                                    calGetString("calendar", "taskEditInstructionsReadonly"));
-        } else {
-            if (!edit.showsInstructions) {
-                edit.savedValue = edit.value || "";
-            }
-            taskEdit.setupTaskField(edit,
-                                    false,
-                                    calGetString("calendar", "taskEditInstructions"));
-        }
-        edit.showsInstructions = true;
-    },
-
-    /**
-     * Handler function to call on keypress for the quick-add textbox.
-     *
-     * @param aEvent    The DOM keypress event
-     */
-    onKeyPress: function tE_onKeyPress(aEvent) {
-        if (aEvent.keyCode == Components.interfaces.nsIDOMKeyEvent.DOM_VK_RETURN) {
-            var edit = aEvent.target;
-            if (edit.value && edit.value.length > 0) {
-                var item = createTodo();
-                item.calendar = getSelectedCalendar();
-                item.title = edit.value;
-                edit.value = "";
-                cal.alarms.setDefaultValues(item);
-                setCustomCalendarDefaults(item);
-                doTransaction('add', item, item.calendar, null, null);
-            }
-        }
-    },
-
-    /**
-     * Window load function to set up all quick-add textboxes. The texbox must
-     * have the class "task-edit-field".
-     */
-    onLoad: function tE_onLoad(aEvent) {
-        window.removeEventListener("load", taskEdit.onLoad, false);
-        // TODO use getElementsByClassName
-        var taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
-        for (var i = 0; i < taskEditFields.length; i++) {
-            taskEdit.onBlur({ target: taskEditFields[i] });
-        }
-
-        getCompositeCalendar().addObserver(taskEdit.compositeObserver);
-        taskEdit.observedCalendar = getSelectedCalendar();
-    },
-
-    /**
-     * Window load function to clean up all quick-add fields.
-     */
-    onUnload: function tE_onUnload() {
-        getCompositeCalendar().removeObserver(taskEdit.compositeObserver);
-        taskEdit.observedCalendar = null;
-    },
-
-    /**
-     * Observer to watch for readonly, disabled and capability changes of the
-     * observed calendar.
-     *
-     * @see calIObserver
-     */
-    calendarObserver: {
-        QueryInterface: function tE_calObs_QueryInterface(aIID) {
-            return doQueryInterface(this, null, aIID,
-                                    [Components.interfaces.calIObserver]);
-        },
-
-        // calIObserver:
-        onStartBatch: function() {},
-        onEndBatch: function() {},
-        onLoad: function(aCalendar) {},
-        onAddItem: function(aItem) {},
-        onModifyItem: function(aNewItem, aOldItem) {},
-        onDeleteItem: function(aDeletedItem) {},
-        onError: function(aCalendar, aErrNo, aMessage) {},
-
-        onPropertyChanged: function tE_calObs_onPropertyChanged(aCalendar,
-                                                         aName,
-                                                         aValue,
-                                                         aOldValue) {
-            if (aCalendar.id != getSelectedCalendar().id) {
-                // Optimization: if the given calendar isn't the default calendar,
-                // then we don't need to change any readonly/disabled states.
-                return;
-            }
-            switch (aName) {
-                case "readOnly":
-                case "disabled":
-                    var taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
-                    for (var i = 0; i < taskEditFields.length; i++) {
-                        taskEdit.onBlur({ target: taskEditFields[i] });
-                    }
-            }
-        },
-
-        onPropertyDeleting: function tE_calObs_onPropertyDeleting(aCalendar,
-                                                           aName) {
-            // Since the old value is not used directly in onPropertyChanged,
-            // but should not be the same as the value, set it to a different
-            // value.
-            this.onPropertyChanged(aCalendar, aName, null, null);
-        }
-    },
-
-    /**
-     * Observer to watch for changes to the selected calendar.
-     *
-     * XXX I think we don't need to implement calIObserver here.
-     *
-     * @see calICompositeObserver
-     */
-    compositeObserver: {
-        QueryInterface: function tE_compObs_QueryInterface(aIID) {
-            return doQueryInterface(this, null, aIID,
-                                    [Components.interfaces.calIObserver,
-                                     Components.interfaces.calICompositeObserver]);
-        },
-
-        // calIObserver:
-        onStartBatch: function() {},
-        onEndBatch: function() {},
-        onLoad: function(aCalendar) {},
-        onAddItem: function(aItem) {},
-        onModifyItem: function(aNewItem, aOldItem) {},
-        onDeleteItem: function(aDeletedItem) {},
-        onError: function(aCalendar, aErrNo, aMessage) {},
-        onPropertyChanged: function(aCalendar, aName, aValue, aOldValue) {},
-        onPropertyDeleting: function(aCalendar, aName) {},
-
-        // calICompositeObserver:
-        onCalendarAdded: function onCalendarAdded(aCalendar) {},
-        onCalendarRemoved: function onCalendarRemoved(aCalendar) {},
-        onDefaultCalendarChanged: function tE_compObs_onDefaultCalendarChanged(aNewDefault) {
-            var taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
-            for (var i = 0; i < taskEditFields.length; i++) {
-                taskEdit.onBlur({ target: taskEditFields[i] });
-            }
-            taskEdit.observedCalendar = aNewDefault;
-        }
-    }
-};
-
-window.addEventListener("load", taskEdit.onLoad, false);
-window.addEventListener("unload", taskEdit.onUnload, false);
diff -u8pdNr 0.9/chrome/content/ccd-calendar-views.js 1.0/chrome/content/ccd-calendar-views.js
--- 0.9/chrome/content/ccd-calendar-views.js	2011-11-21 20:25:10 +0000
+++ 1.0/chrome/content/ccd-calendar-views.js	1970-01-01 00:00:00 +0000
@@ -1,866 +0,0 @@
-/* ***** 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
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Calendar views code
- *
- * The Initial Developer of the Original Code is
- *   the Mozilla Calendar Squad
- * Portions created by the Initial Developer are Copyright (C) 2006
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Vladimir Vukicevic <vladimir.vukicevic@oracle.com>
- *   Joey Minta <jminta@gmail.com>
- *   Michael Buettner <michael.buettner@sun.com>
- *   gekacheka@yahoo.com
- *   Matthew Willis <lilmatt@mozilla.com>
- *   Philipp Kewisch <mozilla@kewis.ch>
- *   Martin Schroeder <mschroeder@mozilla.x-home.org>
- *   Berend Cornelius <berend.cornelius@sun.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
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-Components.utils.import("resource://calendar/modules/calUtils.jsm");
-Components.utils.import("resource://calendar/modules/calAlarmUtils.jsm");
-
-function setCustomCalendarDefaults(item) {
-    var prefService = Components.classes["@mozilla.org/preferences-service;1"]
-                       .getService(Components.interfaces.nsIPrefService);
-    var prefBranch = prefService.getBranch("extensions.customcalendardefaults.");
-    // apply default event status
-    let ccdStatus = prefBranch.getCharPref("event.status");
-    item.setProperty("STATUS", ccdStatus);
-    // apply default event privacy
-    let ccdPrivacy = prefBranch.getBoolPref("event.privacy");
-    if (ccdPrivacy == true) {
-        let ccdPrivacyState = prefBranch.getCharPref("event.privacy.state");
-        item.setProperty("CLASS", ccdPrivacyState);
-    }
-    // apply default event priority
-    let ccdPriority = prefBranch.getCharPref("event.priority");
-    item.setProperty("PRIORITY", ccdPriority);
-    // apply default event showTimeAs
-    let ccdShowTimeAs = prefBranch.getBoolPref("event.showTimeAs");
-    if (ccdShowTimeAs == true) {
-        let ccdShowTimeAsState = prefBranch.getCharPref("event.showTimeAs.state");
-        aItem.setProperty("TRANSP", ccdShowTimeAsState);
-    }
-}
-
-/**
- * Controller for the views
- * @see calIcalendarViewController
- */
-var calendarViewController = {
-    QueryInterface: function(aIID) {
-        if (!aIID.equals(Components.interfaces.calICalendarViewController) &&
-            !aIID.equals(Components.interfaces.nsISupports)) {
-            throw Components.results.NS_ERROR_NO_INTERFACE;
-        }
-
-        return this;
-    },
-
-    /**
-     * Creates a new event
-     * @see calICalendarViewController
-     */
-    createNewEvent: function (aCalendar, aStartTime, aEndTime, aForceAllday) {
-        aCalendar = aCalendar || getSelectedCalendar();
-
-
-        // if we're given both times, skip the dialog
-        if (aStartTime && aEndTime && !aStartTime.isDate && !aEndTime.isDate) {
-            let item = cal.createEvent();
-            item.startDate = aStartTime;
-            item.endDate = aEndTime;
-            item.title = calGetString("calendar", "newEvent");
-            item.calendar = aCalendar;
-            cal.alarms.setDefaultValues(item);
-            setCustomCalendarDefaults(item);
-            doTransaction('add', item, aCalendar, null, null);
-        } else {
-            createEventWithDialog(aCalendar, aStartTime, null, null, null, aForceAllday);
-        }
-    },
-
-    pendingJobs: [],
-
-    /**
-     * In order to initiate a modification for the occurrence passed as argument
-     * we create an object that records the necessary details and store it in an
-     * internal array ('pendingJobs'). this way we're in a position to terminate
-     * any pending modification if need should be.
-     *
-     * @param aOccurrence       The occurrence to create the pending
-     *                            modification for.
-     */
-    createPendingModification: function (aOccurrence) {
-        // finalize a (possibly) pending modification. this will notify
-        // an open dialog to save any outstanding modifications.
-        aOccurrence = this.finalizePendingModification(aOccurrence);
-
-        // XXX TODO logic to ask for which occurrence to modify is currently in
-        // modifyEventWithDialog, since the type of transactions done depend on
-        // this. This in turn makes the aOccurrence here be potentially wrong, I
-        // haven't seen it used anywhere though.
-        var pendingModification = {
-            controller: this,
-            item: aOccurrence,
-            finalize: null,
-            dispose: function() {
-                var array = this.controller.pendingJobs;
-                for (var i=0; i<array.length; i++) {
-                    if (array[i] == this) {
-                        array.splice(i,1);
-                        break;
-                    }
-                }
-            }
-        }
-
-        this.pendingJobs.push(pendingModification);
-
-        modifyEventWithDialog(aOccurrence, pendingModification, true);
-    },
-
-    /**
-     * Iterate the list of pending modifications and see if the occurrence
-     * passed as argument is currently about to be modified (event dialog is
-     * open with the item in question). If this should be the case we call
-     * finalize() in order to bring the dialog down and avoid dataloss.
-     *
-     * @param aOccurrence       The occurrence to finalize the modification for.
-     */
-    finalizePendingModification: function (aOccurrence) {
-
-      for each (var job in this.pendingJobs) {
-          var item = job.item;
-          var parent = item.parent;
-          if ((item.hashId == aOccurrence.hashId) ||
-              (item.parentItem.hashId == aOccurrence.hashId) ||
-              (item.hashId == aOccurrence.parentItem.hashId)) {
-              // terminate() will most probably create a modified item instance.
-              aOccurrence = job.finalize();
-              break;
-        }
-      }
-
-      return aOccurrence;
-    },
-
-    /**
-     * Modifies the given occurrence
-     * @see calICalendarViewController
-     */
-    modifyOccurrence: function (aOccurrence, aNewStartTime, aNewEndTime, aNewTitle) {
-        let dlg = cal.findItemWindow(aOccurrence);
-        if (dlg) {
-            dlg.focus();
-            return;
-        }
-
-        aOccurrence = this.finalizePendingModification(aOccurrence);
-
-        // if modifying this item directly (e.g. just dragged to new time),
-        // then do so; otherwise pop up the dialog
-        if (aNewStartTime || aNewEndTime || aNewTitle) {
-            let instance = aOccurrence.clone();
-
-            if (aNewTitle) {
-                instance.title = aNewTitle;
-            }
-
-            // When we made the executive decision (in bug 352862) that
-            // dragging an occurrence of a recurring event would _only_ act
-            // upon _that_ occurrence, we removed a bunch of code from this
-            // function. If we ever revert that decision, check CVS history
-            // here to get that code back.
-
-            if (aNewStartTime || aNewEndTime) {
-                // Yay for variable names that make this next line look silly
-                if (isEvent(instance)) {
-                    if (aNewStartTime && instance.startDate) {
-                        instance.startDate = aNewStartTime;
-                    }
-                    if (aNewEndTime && instance.endDate) {
-                        instance.endDate = aNewEndTime;
-                    }
-                } else {
-                    if (aNewStartTime && instance.entryDate) {
-                        instance.entryDate = aNewStartTime;
-                    }
-                    if (aNewEndTime && instance.dueDate) {
-                        instance.dueDate = aNewEndTime;
-                    }
-                }
-            }
-
-            doTransaction('modify', instance, instance.calendar, aOccurrence, null);
-        } else {
-            this.createPendingModification(aOccurrence);
-        }
-    },
-
-    /**
-     * Deletes the given occurrences
-     * @see calICalendarViewController
-     */
-    deleteOccurrences: function (aCount,
-                                 aOccurrences,
-                                 aUseParentItems,
-                                 aDoNotConfirm) {
-        startBatchTransaction();
-        var recurringItems = {};
-
-        function getSavedItem(aItemToDelete) {
-            // Get the parent item, saving it in our recurringItems object for
-            // later use.
-            var hashVal = aItemToDelete.parentItem.hashId;
-            if (!recurringItems[hashVal]) {
-                recurringItems[hashVal] = {
-                    oldItem: aItemToDelete.parentItem,
-                    newItem: aItemToDelete.parentItem.clone()
-                };
-            }
-            return recurringItems[hashVal];
-        }
-
-        // Make sure we are modifying a copy of aOccurrences, otherwise we will
-        // run into race conditions when the view's doDeleteItem removes the
-        // array elements while we are iterating through them. While we are at
-        // it, filter out any items that have readonly calendars, so that
-        // checking for one total item below also works out if all but one item
-        // are readonly.
-        var occurrences = aOccurrences.filter(function(item) { return isCalendarWritable(item.calendar); });
-
-        for each (var itemToDelete in occurrences) {
-            if (aUseParentItems) {
-                // Usually happens when ctrl-click is used. In that case we
-                // don't need to ask the user if he wants to delete an
-                // occurrence or not.
-                itemToDelete = itemToDelete.parentItem;
-            } else if (!aDoNotConfirm && occurrences.length == 1) {
-                // Only give the user the selection if only one occurrence is
-                // selected. Otherwise he will get a dialog for each occurrence
-                // he deletes.
-                var [itemToDelete, hasFutureItem, response] = promptOccurrenceModification(itemToDelete, false, "delete");
-                if (!response) {
-                    // The user canceled the dialog, bail out
-                    break;
-                }
-            }
-
-            // Now some dirty work: Make sure more than one occurrence can be
-            // deleted by saving the recurring items and removing occurrences as
-            // they come in. If this is not an occurrence, we can go ahead and
-            // delete the whole item.
-            itemToDelete = this.finalizePendingModification(itemToDelete);
-            if (itemToDelete.parentItem.hashId != itemToDelete.hashId) {
-                var savedItem = getSavedItem(itemToDelete);
-                savedItem.newItem.recurrenceInfo
-                         .removeOccurrenceAt(itemToDelete.recurrenceId);
-                // Dont start the transaction yet. Do so later, in case the
-                // parent item gets modified more than once.
-            } else {
-                doTransaction('delete', itemToDelete, itemToDelete.calendar, null, null);
-            }
-        }
-
-        // Now handle recurring events. This makes sure that all occurrences
-        // that have been passed are deleted.
-        for each (var ritem in recurringItems) {
-            doTransaction('modify',
-                          ritem.newItem,
-                          ritem.newItem.calendar,
-                          ritem.oldItem,
-                          null);
-        }
-        endBatchTransaction();
-    }
-};
-
-/**
- * This function provides a neutral way to switch between views.
- *
- * @param aType     The type of view to select.
- * @param aShow     If true, the calendar view is forced to be shown, i.e.
- *                    bringing the view to the front if the application is
- *                    showing other elements (Lightning).
- */
-function switchCalendarView(aType, aShow) {
-    if (cal.isSunbird()) {
-        sbSwitchToView(aType);
-    } else {
-        ltnSwitchCalendarView(aType, aShow);
-    }
-}
-
-/**
- * This function does the common steps to switch between views. Should be called
- * from app-specific view switching functions
- *
- * @param aViewType     The type of view to select.
- */
-function switchToView(aViewType) {
-    var viewDeck = getViewDeck();
-    var selectedDay;
-    var currentSelection = [];
-
-    // Set up the view commands
-    var views = viewDeck.childNodes;
-    for (var i = 0; i < views.length; i++) {
-        var view = views[i];
-        var commandId = "calendar_" + view.id + "_command";
-        var command = document.getElementById(commandId);
-        if (view.id == aViewType + "-view") {
-            command.setAttribute("checked", "true");
-        } else {
-            command.removeAttribute("checked");
-        }
-    }
-
-    /**
-     * Sets up a node to use view specific attributes. If there is no view
-     * specific attribute, then <attr>-all is used instead.
-     *
-     * @param id        The id of the node to set up.
-     * @param attr      The view specific attribute to modify.
-     */
-    function setupViewNode(id, attr) {
-        let node = document.getElementById(id);
-        if (node.hasAttribute(attr + "-" + aViewType)) {
-            node.setAttribute(attr, node.getAttribute(attr + "-" + aViewType));
-        } else {
-            node.setAttribute(attr, node.getAttribute(attr + "-all"));
-        }
-    }
-
-    // Set up the labels and accesskeys for the context menu
-    ["calendar-view-context-menu-next",
-     "calendar-view-context-menu-previous",
-     "calendar-go-menu-next",
-     "calendar-go-menu-previous"].forEach(function(x) {
-            setupViewNode(x, "label");
-            setupViewNode(x, "accesskey")
-     });
-
-    // Set up the labels for the view navigation
-    ["previous-view-button",
-     "today-view-button",
-     "next-view-button"].forEach(function(x) setupViewNode(x, "tooltiptext"));
-
-    try {
-        selectedDay = viewDeck.selectedPanel.selectedDay;
-        currentSelection = viewDeck.selectedPanel.getSelectedItems({});
-    } catch (ex) {
-        // This dies if no view has even been chosen this session, but that's
-        // ok because we'll just use now() below.
-    }
-
-    if (!selectedDay) {
-        selectedDay = now();
-    }
-
-    // Anyone wanting to plug in a view needs to follow this naming scheme
-    let view = document.getElementById(aViewType + "-view");
-    viewDeck.selectedPanel = view;
-
-    // Select the corresponding tab
-    let viewTabs = document.getElementById("view-tabs");
-    viewTabs.selectedIndex = getViewDeck().selectedIndex;
-
-    let compositeCal = getCompositeCalendar();
-    if (view.displayCalendar != compositeCal) {
-        view.displayCalendar = compositeCal;
-        view.timezone = calendarDefaultTimezone();
-        view.controller = calendarViewController;
-    }
-
-    view.goToDay(selectedDay);
-    view.setSelectedItems(currentSelection.length, currentSelection);
-
-    onCalendarViewResize();
-}
-
-/**
- * Returns the calendar view deck XUL element.
- *
- * @return      The view-deck element.
- */
-function getViewDeck() {
-    return document.getElementById("view-deck");
-}
-
-/**
- * Returns the currently selected calendar view.
- *
- * @return      The selected calendar view
- */
-function currentView() {
-    return getViewDeck().selectedPanel;
-}
-
-/**
- * Returns the selected day in the current view.
- *
- * @return      The selected day
- */
-function getSelectedDay() {
-    return currentView().selectedDay;
-}
-
-var gMidnightTimer;
-
-/**
- * Creates a timer that will fire after midnight.  Pass in a function as
- * aRefreshCallback that should be called at that time.
- *
- * XXX This function is not very usable, since there is only one midnight timer.
- * Better would be a function that uses the observer service to notify at
- * midnight.
- *
- * @param aRefreshCallback      A callback to be called at midnight.
- */
-function scheduleMidnightUpdate(aRefreshCallback) {
-    var jsNow = new Date();
-    var tomorrow = new Date(jsNow.getFullYear(), jsNow.getMonth(), jsNow.getDate() + 1);
-    var msUntilTomorrow = tomorrow.getTime() - jsNow.getTime();
-
-    // Is an nsITimer/callback extreme overkill here? Yes, but it's necessary to
-    // workaround bug 291386.  If we don't, we stand a decent chance of getting
-    // stuck in an infinite loop.
-    var udCallback = {
-        notify: function(timer) {
-            aRefreshCallback();
-        }
-    };
-
-    if (!gMidnightTimer) {
-        // Observer for wake after sleep/hibernate/standby to create new timers and refresh UI
-        var wakeObserver = {
-           observe: function(aSubject, aTopic, aData) {
-               if (aTopic == "wake_notification") {
-                   // postpone refresh for another couple of seconds to get netwerk ready:
-                   if (this.mTimer) {
-                       this.mTimer.cancel();
-                   } else {
-                       this.mTimer = Components.classes["@mozilla.org/timer;1"]
-                                               .createInstance(Components.interfaces.nsITimer);
-                   }
-                   this.mTimer.initWithCallback(udCallback, 10 * 1000,
-                                                Components.interfaces.nsITimer.TYPE_ONE_SHOT);
-               }
-           }
-        };
-
-        // Add observer
-        var observerService = Components.classes["@mozilla.org/observer-service;1"]
-                                        .getService(Components.interfaces.nsIObserverService);
-        observerService.addObserver(wakeObserver, "wake_notification", false);
-
-        // Remove observer on unload
-        window.addEventListener("unload",
-                                function() {
-                                    observerService.removeObserver(wakeObserver, "wake_notification");
-                                }, false);
-        gMidnightTimer = Components.classes["@mozilla.org/timer;1"]
-                                   .createInstance(Components.interfaces.nsITimer);
-    } else {
-        gMidnightTimer.cancel();
-    }
-    gMidnightTimer.initWithCallback(udCallback, msUntilTomorrow, gMidnightTimer.TYPE_ONE_SHOT);
-}
-
-/**
- * Retuns a cached copy of the view stylesheet.
- *
- * @return      The view stylesheet object.
- */
-function getViewStyleSheet() {
-  if (!getViewStyleSheet.sheet) {
-      const cssUri = "chrome://calendar/content/calendar-view-bindings.css";
-      for each (let sheet in document.styleSheets) {
-          if (sheet.href == cssUri) {
-              getViewStyleSheet.sheet = sheet;
-              break;
-          }
-      }
-  }
-  return getViewStyleSheet.sheet;
-}
-
-/**
- * Updates the view stylesheet to contain rules that give all boxes with class
- * .calendar-color-box and an attribute calendar-id="<id of the calendar>" the
- * background color of the specified calendar.
- *
- * @param aCalendar     The calendar to update the stylesheet for.
- */
-function updateStyleSheetForViews(aCalendar) {
-    if (!updateStyleSheetForViews.ruleCache) {
-        updateStyleSheetForViews.ruleCache = {};
-    }
-    let ruleCache = updateStyleSheetForViews.ruleCache;
-
-    if (!(aCalendar.id in ruleCache)) {
-        // We haven't create a rule for this calendar yet, do so now.
-        let sheet = getViewStyleSheet();
-        let ruleString = '.calendar-color-box[calendar-id="' + aCalendar.id + '"] {} ';
-        let ruleIndex = sheet.insertRule(ruleString, sheet.cssRules.length);
-
-        ruleCache[aCalendar.id] = sheet.cssRules[ruleIndex];
-    }
-
-    let color = aCalendar.getProperty("color") || "#A8C2E1";
-    ruleCache[aCalendar.id].style.backgroundColor = color;
-    ruleCache[aCalendar.id].style.color = cal.getContrastingTextColor(color);
-}
-
-/**
- * Category preferences observer. Used to update the stylesheets for category
- * colors.
- *
- * Note we need to keep the categoryPrefBranch variable outside of
- * initCategories since branch observers only live as long as the branch object
- * is alive, and out of categoryManagement to avoid cyclic references.
- */
-var categoryPrefBranch;
-var categoryManagement = {
-    QueryInterface: function cM_QueryInterface(aIID) {
-        return cal.doQueryInterface(this,
-                                    categoryManagement.__proto__,
-                                    aIID,
-                                    [Components.interfaces.nsIObserver]);
-    },
-
-    initCategories: function cM_initCategories() {
-      let prefService = Components.classes["@mozilla.org/preferences-service;1"]
-                                  .getService(Components.interfaces.nsIPrefService);
-      categoryPrefBranch = prefService.getBranch("calendar.category.color.")
-                                      .QueryInterface(Components.interfaces.nsIPrefBranch2);
-      let categories = categoryPrefBranch.getChildList("");
-
-      // Fix illegally formatted category prefs.
-      for (let i in categories) {
-          let category = categories[i];
-          if (category.search(/[^_0-9a-z-]/) != -1) {
-              let categoryFix = formatStringForCSSRule(category);
-              if (!categoryPrefBranch.prefHasUserValue(categoryFix)) {
-                  let color = categoryPrefBranch.getCharPref(category);
-                  categoryPrefBranch.setCharPref(categoryFix, color);
-                  categoryPrefBranch.clearUserPref(category); // not usable
-                  categories[i] = categoryFix;  // replace illegal name
-              } else {
-                  categories.splice(i, 1); // remove illegal name
-              }
-          }
-      }
-
-      // Add color information to the stylesheets.
-      categories.forEach(categoryManagement.updateStyleSheetForCategory,
-                         categoryManagement);
-      categoryPrefBranch.addObserver("", categoryManagement, false);
-    },
-
-    cleanupCategories: function cM_cleanupCategories() {
-      let prefService = Components.classes["@mozilla.org/preferences-service;1"]
-                                  .getService(Components.interfaces.nsIPrefService);
-      categoryPrefBranch = prefService.getBranch("calendar.category.color.")
-                                      .QueryInterface(Components.interfaces.nsIPrefBranch2);
-      categoryPrefBranch.removeObserver("", categoryManagement);
-    },
-
-    observe: function cM_observe(aSubject, aTopic, aPrefName) {
-        this.updateStyleSheetForCategory(aPrefName);
-        // TODO Currently, the only way to find out if categories are removed is
-        // to initially grab the calendar.categories.names preference and then
-        // observe changes to it. it would be better if we had hooks for this,
-        // so we could delete the rule from our style cache and also remove its
-        // color preference.
-    },
-
-    categoryStyleCache: {},
-
-    updateStyleSheetForCategory: function cM_updateStyleSheetForCategory(aCatName) {
-        if (!(aCatName in this.categoryStyleCache)) {
-            // We haven't created a rule for this category yet, do so now.
-            let sheet = getViewStyleSheet();
-            let ruleString = '.category-color-box[categories~="' + aCatName + '"] {} ';
-            let ruleIndex = sheet.insertRule(ruleString, sheet.cssRules.length);
-
-            this.categoryStyleCache[aCatName] = sheet.cssRules[ruleIndex];
-        }
-
-        let color = cal.getPrefSafe("calendar.category.color." + aCatName) || "";
-        this.categoryStyleCache[aCatName].style.backgroundColor = color;
-    }
-};
-
-/**
- * Handler function to set the selected day in the minimonth to the currently
- * selected day in the current view.
- *
- * @param event     The "dayselect" event emitted from the views.
- *
- */
-function observeViewDaySelect(event) {
-    var date = event.detail;
-    var jsDate = new Date(date.year, date.month, date.day);
-
-    // for the month and multiweek view find the main month,
-    // which is the month with the most visible days in the view;
-    // note, that the main date is the first day of the main month
-    var jsMainDate;
-    if (!event.originalTarget.supportsDisjointDates) {
-        var mainDate = null;
-        var maxVisibleDays = 0;
-        var startDay = currentView().startDay;
-        var endDay = currentView().endDay;
-        var firstMonth = startDay.startOfMonth;
-        var lastMonth = endDay.startOfMonth;
-        for (var month = firstMonth.clone(); month.compare(lastMonth) <= 0; month.month += 1) {
-            var visibleDays = 0;
-            if (month.compare(firstMonth) == 0) {
-                visibleDays = startDay.endOfMonth.day - startDay.day + 1;
-            } else if (month.compare(lastMonth) == 0) {
-                visibleDays = endDay.day;
-            } else {
-                visibleDays = month.endOfMonth.day;
-            }
-            if (visibleDays > maxVisibleDays) {
-                mainDate = month.clone();
-                maxVisibleDays = visibleDays;
-            }
-        }
-        jsMainDate = new Date(mainDate.year, mainDate.month, mainDate.day);
-    }
-
-    getMinimonth().selectDate(jsDate, jsMainDate);
-    currentView().focus();
-}
-
-/**
- * Provides a neutral way to get the minimonth, regardless of whether we're in
- * Sunbird or Lightning.
- *
- * @return          The XUL minimonth element.
- */
-function getMinimonth() {
-    return document.getElementById("calMinimonth");
-}
-
-/**
- * Update the view orientation based on the checked state of the command
- */
-function toggleOrientation() {
-    var cmd = document.getElementById("calendar_toggle_orientation_command");
-    var newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
-    cmd.setAttribute("checked", newValue);
-
-    var deck = getViewDeck();
-    for each (var view in deck.childNodes) {
-        view.rotated = (newValue == "true");
-    }
-
-    // orientation refreshes automatically
-}
-
-/**
- * Toggle the workdays only checkbox and refresh the current view
- *
- * XXX We shouldn't need to refresh the view just to toggle the workdays. This
- * should happen automatically.
- */
-function toggleWorkdaysOnly() {
-    var cmd = document.getElementById("calendar_toggle_workdays_only_command");
-    var newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
-    cmd.setAttribute("checked", newValue);
-
-    var deck = getViewDeck();
-    for each (var view in deck.childNodes) {
-        view.workdaysOnly = (newValue == "true");
-    }
-
-    // Refresh the current view
-    currentView().goToDay(currentView().selectedDay);
-}
-
-/**
- * Toggle the tasks in view checkbox and refresh the current view
- */
-function toggleTasksInView() {
-    var cmd = document.getElementById("calendar_toggle_tasks_in_view_command");
-    var newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
-    cmd.setAttribute("checked", newValue);
-
-    var deck = getViewDeck();
-    for each (var view in deck.childNodes) {
-        view.tasksInView = (newValue == "true");
-    }
-
-    // Refresh the current view
-    currentView().goToDay(currentView().selectedDay);
-}
-
-/**
- * Toggle the show completed in view checkbox and refresh the current view
- */
-function toggleShowCompletedInView() {
-    var cmd = document.getElementById("calendar_toggle_show_completed_in_view_command");
-    var newValue = (cmd.getAttribute("checked") == "true" ? "false" : "true");
-    cmd.setAttribute("checked", newValue);
-
-    var deck = getViewDeck();
-    for each (var view in deck.childNodes) {
-        view.showCompleted = (newValue == "true");
-    }
-
-    // Refresh the current view
-    currentView().goToDay(currentView().selectedDay);
-}
-
-/**
- * Provides a neutral way to go to the current day in the views and minimonth.
- *
- * @param aDate     The date to go.
- */
-function goToDate(aDate) {
-    getMinimonth().value = aDate.jsDate;
-    currentView().goToDay(aDate);
-}
-
-/**
- * Returns the calendar view that was selected before restart, or the current
- * calendar view if it has already been set in this session
- *
- * @return          The last calendar view.
- */
-function getLastCalendarView() {
-    var deck = getViewDeck();
-    if (deck.selectedIndex > -1) {
-        var viewNode = deck.childNodes[deck.selectedIndex];
-        return viewNode.id.replace(/-view/, "");
-    }
-
-    // No deck item was selected beforehand, default to week view.
-    return "week";
-}
-
-/**
- * Deletes items currently selected in the view and clears selection.
- */
-function deleteSelectedEvents() {
-    var selectedItems = currentView().getSelectedItems({});
-    calendarViewController.deleteOccurrences(selectedItems.length,
-                                             selectedItems,
-                                             false,
-                                             false);
-    // clear selection
-    currentView().setSelectedItems(0, [], true);
-}
-
-/**
- * Edit the items currently selected in the view with the event dialog.
- */
-function editSelectedEvents() {
-    var selectedItems = currentView().getSelectedItems({});
-    if (selectedItems && selectedItems.length >= 1) {
-        modifyEventWithDialog(selectedItems[0], null, true);
-    }
-}
-
-/**
- * Select all events from all calendars. Use with care.
- */
-function selectAllEvents() {
-    var items = [];
-    var listener = {
-        onOperationComplete: function selectAll_ooc(aCalendar, aStatus,
-                                                    aOperationType, aId,
-                                                    aDetail) {
-            currentView().setSelectedItems(items.length, items, false);
-        },
-        onGetResult: function selectAll_ogr(aCalendar, aStatus, aItemType,
-                                            aDetail, aCount, aItems) {
-            for each (var item in aItems) {
-                items.push(item);
-            }
-        }
-    };
-
-    var composite = getCompositeCalendar();
-    var filter = composite.ITEM_FILTER_CLASS_OCCURRENCES;
-
-    if (currentView().tasksInView) {
-        filter |= composite.ITEM_FILTER_TYPE_ALL;
-    } else {
-        filter |= composite.ITEM_FILTER_TYPE_EVENT;
-    }
-    if (currentView().showCompleted) {
-        filter |= composite.ITEM_FILTER_COMPLETED_ALL;
-    } else {
-        filter |= composite.ITEM_FILTER_COMPLETED_NO;
-    }
-
-    // Need to move one day out to get all events
-    var end = currentView().endDay.clone();
-    end.day += 1;
-
-    composite.getItems(filter, 0, currentView().startDay, end, listener);
-}
-
-let cal = cal || {};
-cal.navigationBar = {
-    setDateRange: function setDateRange(aStartDate, aEndDate) {
-        let docTitle = "";
-        if (aStartDate) {
-            let intervalLabel = document.getElementById("intervalDescription");
-            let firstWeekNo = getWeekInfoService().getWeekTitle(aStartDate);
-            let secondWeekNo = firstWeekNo;
-            let weekLabel = document.getElementById("calendarWeek");
-            if (aStartDate.nativeTime == aEndDate.nativeTime) {
-                intervalLabel.value = getDateFormatter().formatDate(aStartDate);
-            } else {
-                intervalLabel.value = currentView().getRangeDescription();
-                secondWeekNo = getWeekInfoService().getWeekTitle(aEndDate);
-            }
-            if (secondWeekNo == firstWeekNo) {
-                weekLabel.value = calGetString("calendar", "singleShortCalendarWeek", [firstWeekNo]);
-                weekLabel.tooltipText = calGetString("calendar", "singleLongCalendarWeek", [firstWeekNo]);
-            } else {
-                weekLabel.value = calGetString("calendar", "severalShortCalendarWeeks", [firstWeekNo, secondWeekNo]);
-                weekLabel.tooltipText = calGetString("calendar", "severalLongCalendarWeeks", [firstWeekNo, secondWeekNo]);
-            }
-            docTitle = intervalLabel.value;
-        }
-        if (document.getElementById("modeBroadcaster").getAttribute("mode") == "calendar") {
-            document.title = (docTitle ? docTitle + " - " : "") +
-                calGetString("brand", "brandFullName", null, "branding");
-        }
-        let viewTabs = document.getElementById("view-tabs");
-        viewTabs.selectedIndex = getViewDeck().selectedIndex;
-    }
-};
diff -u8pdNr 0.9/chrome/content/ccd-overlay.xul 1.0/chrome/content/ccd-overlay.xul
--- 0.9/chrome/content/ccd-overlay.xul	1970-01-01 00:00:00 +0000
+++ 1.0/chrome/content/ccd-overlay.xul	2012-01-22 22:19:49 +0000
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<!-- ***** 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
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Custom Calendar Defaults code.
+   -
+   - The Initial Developer of the Original Code is
+   -   Robert Brand <mozrob@googlemail.com>.
+   - Portions created by the Initial Developer are Copyright (C) 2012
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -
+   - 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
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+
+<overlay id="customcalendardefaults-overlay"
+         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+  <script type="application/javascript"
+          src="chrome://customcalendardefaults/content/customcalendardefaults.js"/>
+
+</overlay>
diff -u8pdNr 0.9/chrome/content/ccd-prefs.js 1.0/chrome/content/ccd-prefs.js
--- 0.9/chrome/content/ccd-prefs.js	2011-11-21 22:11:49 +0000
+++ 1.0/chrome/content/ccd-prefs.js	2012-01-22 19:06:54 +0000
@@ -9,17 +9,17 @@
  * Software distributed under the License is distributed on an "AS IS" basis,
  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  * for the specific language governing rights and limitations under the
  * License.
  *
  * The Original Code is Custom Calendar Defaults.
  *
  * The Initial Developer of the Original Code is
- * Robert Brand <mozrob@googlemail.com>.
+ *   Robert Brand <mozrob@googlemail.com>.
  * Portions created by the Initial Developer are Copyright (C) 2011
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  *
  * 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
  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
diff -u8pdNr 0.9/chrome/content/customcalendardefaults.js 1.0/chrome/content/customcalendardefaults.js
--- 0.9/chrome/content/customcalendardefaults.js	1970-01-01 00:00:00 +0000
+++ 1.0/chrome/content/customcalendardefaults.js	2012-02-05 22:02:05 +0000
@@ -0,0 +1,773 @@
+/* ***** 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
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Custom Calendar Defaults.
+ *
+ * The Initial Developer of the Original Code is
+ *   Robert Brand <mozrob@googlemail.com>.
+ * Portions created by the Initial Developer are Copyright (C) 2012
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * 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
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*******************************
+* Get custom default settings  *
+*******************************/
+
+function setCustomCalendarDefaults(aItem) {
+    var prefService = Components.classes["@mozilla.org/preferences-service;1"]
+                       .getService(Components.interfaces.nsIPrefService);
+    var prefBranch = prefService.getBranch("extensions.customcalendardefaults.");
+    let type = cal.isEvent(aItem) ? "event" : "todo";
+    if (type == "event") {
+        // apply default event status
+        let ccdStatus = prefBranch.getCharPref("event.status");
+        aItem.setProperty("STATUS", ccdStatus);
+        // apply default event privacy
+        let ccdPrivacy = prefBranch.getBoolPref("event.privacy");
+        if (ccdPrivacy == true) {
+            let ccdPrivacyState = prefBranch.getCharPref("event.privacy.state");
+            aItem.setProperty("CLASS", ccdPrivacyState);
+        }
+        // apply default event priority
+        let ccdPriority = prefBranch.getCharPref("event.priority");
+        aItem.setProperty("PRIORITY", ccdPriority);
+        // apply default event showTimeAs
+        let ccdShowTimeAs = prefBranch.getBoolPref("event.showTimeAs");
+        if (ccdShowTimeAs == true) {
+            let ccdShowTimeAsState = prefBranch.getCharPref("event.showTimeAs.state");
+            aItem.setProperty("TRANSP", ccdShowTimeAsState);
+        }
+    }
+    else if (type == "todo") {
+        // apply default task status
+        let ccdStatus = prefBranch.getCharPref("task.status");
+        aItem.setProperty("STATUS", ccdStatus);
+        // apply default task privacy
+        let ccdPrivacy = prefBranch.getBoolPref("task.privacy");
+        if (ccdPrivacy == true) {
+            let ccdPrivacyState = prefBranch.getCharPref("task.privacy.state");
+            aItem.setProperty("CLASS", ccdPrivacyState);
+        }
+        // apply default task priority
+        let ccdPriority = prefBranch.getCharPref("task.priority");
+        aItem.setProperty("PRIORITY", ccdPriority);
+        // apply default task showTimeAs
+        let ccdShowTimeAs = prefBranch.getBoolPref("task.showTimeAs");
+        if (ccdShowTimeAs == true) {
+            let ccdShowTimeAsState = prefBranch.getCharPref("task.showTimeAs.state");
+            aItem.setProperty("TRANSP", ccdShowTimeAsState);
+        }
+    }
+}
+
+function setCustomCalendarDefaultsTaskQuickadd(item) {
+    var prefService = Components.classes["@mozilla.org/preferences-service;1"]
+                       .getService(Components.interfaces.nsIPrefService);
+    var prefBranch = prefService.getBranch("extensions.customcalendardefaults.");
+    // apply default task status
+    let ccdStatus = prefBranch.getCharPref("task.status");
+    item.setProperty("STATUS", ccdStatus);
+    // apply default task privacy
+    let ccdPrivacy = prefBranch.getBoolPref("task.privacy");
+    if (ccdPrivacy == true) {
+        let ccdPrivacyState = prefBranch.getCharPref("task.privacy.state");
+        item.setProperty("CLASS", ccdPrivacyState);
+    }
+    // apply default task priority
+    let ccdPriority = prefBranch.getCharPref("task.priority");
+    item.setProperty("PRIORITY", ccdPriority);
+    // apply default task showTimeAs
+    let ccdShowTimeAs = prefBranch.getBoolPref("task.showTimeAs");
+    if (ccdShowTimeAs == true) {
+        let ccdShowTimeAsState = prefBranch.getCharPref("task.showTimeAs.state");
+        item.setProperty("TRANSP", ccdShowTimeAsState);
+    }
+}
+
+function setCustomCalendarDefaultsEventDrag(item) {
+    var prefService = Components.classes["@mozilla.org/preferences-service;1"]
+                       .getService(Components.interfaces.nsIPrefService);
+    var prefBranch = prefService.getBranch("extensions.customcalendardefaults.");
+    // apply default event status
+    let ccdStatus = prefBranch.getCharPref("event.status");
+    item.setProperty("STATUS", ccdStatus);
+    // apply default event privacy
+    let ccdPrivacy = prefBranch.getBoolPref("event.privacy");
+    if (ccdPrivacy == true) {
+        let ccdPrivacyState = prefBranch.getCharPref("event.privacy.state");
+        item.setProperty("CLASS", ccdPrivacyState);
+    }
+    // apply default event priority
+    let ccdPriority = prefBranch.getCharPref("event.priority");
+    item.setProperty("PRIORITY", ccdPriority);
+    // apply default event showTimeAs
+    let ccdShowTimeAs = prefBranch.getBoolPref("event.showTimeAs");
+    if (ccdShowTimeAs == true) {
+        let ccdShowTimeAsState = prefBranch.getCharPref("event.showTimeAs.state");
+        item.setProperty("TRANSP", ccdShowTimeAsState);
+    }
+}
+
+/*******************************
+* Modified Lightning functions *
+*******************************/
+
+/**
+* calendar-item-editing.js: function createEventWithDialog
+*/
+function ccdCreateEventWithDialog(calendar, startDate, endDate, summary, event, aForceAllday) {
+    const kDefaultTimezone = calendarDefaultTimezone();
+
+    var onNewEvent = function(item, calendar, originalItem, listener) {
+        if (item.id) {
+            // If the item already has an id, then this is the result of
+            // saving the item without closing, and then saving again.
+            doTransaction('modify', item, calendar, originalItem, listener);
+        } else {
+            // Otherwise, this is an addition
+            doTransaction('add', item, calendar, null, listener);
+        }
+    };
+
+    if (event) {
+        if (!event.isMutable) {
+            event = event.clone();
+        }
+        // If the event should be created from a template, then make sure to
+        // remove the id so that the item obtains a new id when doing the
+        // transaction
+        event.id = null;
+
+        if (aForceAllday) {
+            event.startDate.isDate = true;
+            event.endDate.isDate = true;
+            if (event.startDate.compare(event.endDate) == 0) {
+                // For a one day all day event, the end date must be 00:00:00 of
+                // the next day.
+                event.endDate.day++;
+            }
+        }
+
+        if (!event.calendar) {
+            event.calendar = calendar || getSelectedCalendar();
+        }
+    } else {
+        event = createEvent();
+
+        if (startDate) {
+            event.startDate = startDate.clone();
+            if (startDate.isDate && !aForceAllday) {
+                // This is a special case where the date is specified, but the
+                // time is not. To take care, we setup up the time to our
+                // default event start time.
+                event.startDate = getDefaultStartDate(event.startDate);
+            } else if (aForceAllday) {
+                // If the event should be forced to be allday, then don't set up
+                // any default hours and directly make it allday.
+                event.startDate.isDate = true;
+                event.startDate.timezone = floating();
+            }
+        } else {
+            // If no start date was passed, then default to the next full hour
+            // of today, but with the date of the selected day
+            var refDate = currentView().initialized && currentView().selectedDay.clone();
+            event.startDate = getDefaultStartDate(refDate);
+        }
+
+        if (endDate) {
+            event.endDate = endDate.clone();
+            if (aForceAllday) {
+                // XXX it is currently not specified, how callers that force all
+                // day should pass the end date. Right now, they should make
+                // sure that the end date is 00:00:00 of the day after.
+                event.endDate.isDate = true;
+                event.endDate.timezone = floating();
+            }
+        } else {
+            event.endDate = event.startDate.clone();
+            if (!aForceAllday) {
+                // If the event is not all day, then add the default event
+                // length.
+                event.endDate.minute += getPrefSafe("calendar.event.defaultlength", 60);
+            } else {
+                // All day events need to go to the beginning of the next day.
+                event.endDate.day++;
+            }
+        }
+
+        event.calendar = calendar || getSelectedCalendar();
+
+        if (summary) {
+            event.title = summary;
+        }
+
+        cal.alarms.setDefaultValues(event);
+		setCustomCalendarDefaults(event);
+    }
+    openEventDialog(event, calendar, "new", onNewEvent, null);
+}
+
+/**
+* calendar-item-editing.js: function createTodoWithDialog
+*/
+function ccdCreateTodoWithDialog(calendar, dueDate, summary, todo, initialDate) {
+    const kDefaultTimezone = calendarDefaultTimezone();
+
+    var onNewItem = function(item, calendar, originalItem, listener) {
+        if (item.id) {
+            // If the item already has an id, then this is the result of
+            // saving the item without closing, and then saving again.
+            doTransaction('modify', item, calendar, originalItem, listener);
+        } else {
+            // Otherwise, this is an addition
+            doTransaction('add', item, calendar, null, listener);
+        }
+    }
+
+    if (todo) {
+        // If the todo should be created from a template, then make sure to
+        // remove the id so that the item obtains a new id when doing the
+        // transaction
+        if (todo.id) {
+            todo = todo.clone();
+            todo.id = null;
+        }
+
+        if (!todo.calendar) {
+            todo.calendar = calendar || getSelectedCalendar();
+        }
+    } else {
+        todo = createTodo();
+        todo.calendar = calendar || getSelectedCalendar();
+
+        if (summary)
+            todo.title = summary;
+
+        if (dueDate)
+            todo.dueDate = dueDate;
+
+        if (cal.getPrefSafe("calendar.alarms.onfortodos", 0) == 1 &&
+            !todo.entryDate) {
+            // the todo must have an entry date if we want to set an alarm
+            todo.entryDate = initialDate;
+        }
+
+        cal.alarms.setDefaultValues(todo);
+		setCustomCalendarDefaults(todo);
+    }
+
+    openEventDialog(todo, calendar, "new", onNewItem, null, initialDate);
+}
+
+/**
+* calendar-task-editing.js: var taskEdit
+*/
+var ccdTaskEdit = {
+    /**
+     * Get the currently observed calendar.
+     */
+    mObservedCalendar: null,
+    get observedCalendar() {
+        return this.mObservedCalendar;
+    },
+
+    /**
+     * Set the currently observed calendar, removing listeners to any old
+     * calendar set and adding listeners to the new one.
+     */
+    set observedCalendar(v) {
+        if (this.mObservedCalendar) {
+            this.mObservedCalendar.removeObserver(this.calendarObserver);
+        }
+
+        this.mObservedCalendar = v;
+
+        if (this.mObservedCalendar) {
+            this.mObservedCalendar.addObserver(this.calendarObserver);
+        }
+        return this.mObservedCalendar;
+    },
+
+    /**
+     * Helper function to set readonly and aria-disabled states and the value
+     * for a given target.
+     *
+     * @param aTarget   The ID or XUL node to set the value
+     * @param aDisable  A boolean if the target should be disabled.
+     * @param aValue    The value that should be set on the target.
+     */
+    setupTaskField: function tE_setupTaskField(aTarget, aDisable, aValue) {
+        aTarget.value = aValue;
+        setElementValue(aTarget, aDisable && "true", "readonly");
+        setElementValue(aTarget, aDisable && "true", "aria-disabled");
+    },
+
+    /**
+     * Handler function to call when the quick-add textbox gains focus.
+     *
+     * @param aEvent    The DOM focus event
+     */
+    onFocus: function tE_onFocus(aEvent) {
+        var edit = aEvent.target;
+        if (edit.localName == "input") {
+            // For some reason, we only recieve an onfocus event for the textbox
+            // when debugging with venkman.
+            edit = edit.parentNode.parentNode;
+        }
+
+        var calendar = getSelectedCalendar();
+        edit.showsInstructions = true;
+
+        if (calendar.getProperty("capabilities.tasks.supported") === false) {
+            taskEdit.setupTaskField(edit,
+                                    true,
+                                    calGetString("calendar", "taskEditInstructionsCapability"));
+        } else if (!isCalendarWritable(calendar)) {
+            taskEdit.setupTaskField(edit,
+                                    true,
+                                    calGetString("calendar", "taskEditInstructionsReadonly"));
+        } else {
+            edit.showsInstructions = false;
+            taskEdit.setupTaskField(edit, false, edit.savedValue || "");
+        }
+    },
+
+    /**
+     * Handler function to call when the quick-add textbox loses focus.
+     *
+     * @param aEvent    The DOM blur event
+     */
+    onBlur: function tE_onBlur(aEvent) {
+        var edit = aEvent.target;
+        if (edit.localName == "input") {
+            // For some reason, we only recieve the blur event for the input
+            // element. There are no targets that point to the textbox. Go up
+            // the parent chain until we reach the textbox.
+            edit = edit.parentNode.parentNode;
+        }
+
+        var calendar = getSelectedCalendar();
+
+        if (calendar.getProperty("capabilities.tasks.supported") === false){
+            taskEdit.setupTaskField(edit,
+                                    true,
+                                    calGetString("calendar", "taskEditInstructionsCapability"));
+        } else if (!isCalendarWritable(calendar)) {
+            taskEdit.setupTaskField(edit,
+                                    true,
+                                    calGetString("calendar", "taskEditInstructionsReadonly"));
+        } else {
+            if (!edit.showsInstructions) {
+                edit.savedValue = edit.value || "";
+            }
+            taskEdit.setupTaskField(edit,
+                                    false,
+                                    calGetString("calendar", "taskEditInstructions"));
+        }
+        edit.showsInstructions = true;
+    },
+
+    /**
+     * Handler function to call on keypress for the quick-add textbox.
+     *
+     * @param aEvent    The DOM keypress event
+     */
+    onKeyPress: function tE_onKeyPress(aEvent) {
+        if (aEvent.keyCode == Components.interfaces.nsIDOMKeyEvent.DOM_VK_RETURN) {
+            var edit = aEvent.target;
+            if (edit.value && edit.value.length > 0) {
+                var item = createTodo();
+                item.calendar = getSelectedCalendar();
+                item.title = edit.value;
+                edit.value = "";
+                cal.alarms.setDefaultValues(item);
+				setCustomCalendarDefaultsTaskQuickadd(item);
+                doTransaction('add', item, item.calendar, null, null);
+            }
+        }
+    },
+
+    /**
+     * Window load function to set up all quick-add textboxes. The texbox must
+     * have the class "task-edit-field".
+     */
+    onLoad: function tE_onLoad(aEvent) {
+        window.removeEventListener("load", taskEdit.onLoad, false);
+        // TODO use getElementsByClassName
+        var taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
+        for (var i = 0; i < taskEditFields.length; i++) {
+            taskEdit.onBlur({ target: taskEditFields[i] });
+        }
+
+        getCompositeCalendar().addObserver(taskEdit.compositeObserver);
+        taskEdit.observedCalendar = getSelectedCalendar();
+    },
+
+    /**
+     * Window load function to clean up all quick-add fields.
+     */
+    onUnload: function tE_onUnload() {
+        getCompositeCalendar().removeObserver(taskEdit.compositeObserver);
+        taskEdit.observedCalendar = null;
+    },
+
+    /**
+     * Observer to watch for readonly, disabled and capability changes of the
+     * observed calendar.
+     *
+     * @see calIObserver
+     */
+    calendarObserver: {
+        QueryInterface: function tE_calObs_QueryInterface(aIID) {
+            return doQueryInterface(this, null, aIID,
+                                    [Components.interfaces.calIObserver]);
+        },
+
+        // calIObserver:
+        onStartBatch: function() {},
+        onEndBatch: function() {},
+        onLoad: function(aCalendar) {},
+        onAddItem: function(aItem) {},
+        onModifyItem: function(aNewItem, aOldItem) {},
+        onDeleteItem: function(aDeletedItem) {},
+        onError: function(aCalendar, aErrNo, aMessage) {},
+
+        onPropertyChanged: function tE_calObs_onPropertyChanged(aCalendar,
+                                                         aName,
+                                                         aValue,
+                                                         aOldValue) {
+            if (aCalendar.id != getSelectedCalendar().id) {
+                // Optimization: if the given calendar isn't the default calendar,
+                // then we don't need to change any readonly/disabled states.
+                return;
+            }
+            switch (aName) {
+                case "readOnly":
+                case "disabled":
+                    var taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
+                    for (var i = 0; i < taskEditFields.length; i++) {
+                        taskEdit.onBlur({ target: taskEditFields[i] });
+                    }
+            }
+        },
+
+        onPropertyDeleting: function tE_calObs_onPropertyDeleting(aCalendar,
+                                                           aName) {
+            // Since the old value is not used directly in onPropertyChanged,
+            // but should not be the same as the value, set it to a different
+            // value.
+            this.onPropertyChanged(aCalendar, aName, null, null);
+        }
+    },
+
+    /**
+     * Observer to watch for changes to the selected calendar.
+     *
+     * XXX I think we don't need to implement calIObserver here.
+     *
+     * @see calICompositeObserver
+     */
+    compositeObserver: {
+        QueryInterface: function tE_compObs_QueryInterface(aIID) {
+            return doQueryInterface(this, null, aIID,
+                                    [Components.interfaces.calIObserver,
+                                     Components.interfaces.calICompositeObserver]);
+        },
+
+        // calIObserver:
+        onStartBatch: function() {},
+        onEndBatch: function() {},
+        onLoad: function(aCalendar) {},
+        onAddItem: function(aItem) {},
+        onModifyItem: function(aNewItem, aOldItem) {},
+        onDeleteItem: function(aDeletedItem) {},
+        onError: function(aCalendar, aErrNo, aMessage) {},
+        onPropertyChanged: function(aCalendar, aName, aValue, aOldValue) {},
+        onPropertyDeleting: function(aCalendar, aName) {},
+
+        // calICompositeObserver:
+        onCalendarAdded: function onCalendarAdded(aCalendar) {},
+        onCalendarRemoved: function onCalendarRemoved(aCalendar) {},
+        onDefaultCalendarChanged: function tE_compObs_onDefaultCalendarChanged(aNewDefault) {
+            var taskEditFields = document.getElementsByAttribute("class", "task-edit-field");
+            for (var i = 0; i < taskEditFields.length; i++) {
+                taskEdit.onBlur({ target: taskEditFields[i] });
+            }
+            taskEdit.observedCalendar = aNewDefault;
+        }
+    }
+};
+
+/**
+* calendar-views.js: var calendarViewController
+*/
+var ccdCalendarViewController = {
+    QueryInterface: function(aIID) {
+        if (!aIID.equals(Components.interfaces.calICalendarViewController) &&
+            !aIID.equals(Components.interfaces.nsISupports)) {
+            throw Components.results.NS_ERROR_NO_INTERFACE;
+        }
+
+        return this;
+    },
+
+    /**
+     * Creates a new event
+     * @see calICalendarViewController
+     */
+    createNewEvent: function (aCalendar, aStartTime, aEndTime, aForceAllday) {
+        aCalendar = aCalendar || getSelectedCalendar();
+
+
+        // if we're given both times, skip the dialog
+        if (aStartTime && aEndTime && !aStartTime.isDate && !aEndTime.isDate) {
+            let item = cal.createEvent();
+            item.startDate = aStartTime;
+            item.endDate = aEndTime;
+            item.title = calGetString("calendar", "newEvent");
+            item.calendar = aCalendar;
+            cal.alarms.setDefaultValues(item);
+			setCustomCalendarDefaultsEventDrag(item);
+            doTransaction('add', item, aCalendar, null, null);
+        } else {
+            createEventWithDialog(aCalendar, aStartTime, null, null, null, aForceAllday);
+        }
+    },
+
+    pendingJobs: [],
+
+    /**
+     * In order to initiate a modification for the occurrence passed as argument
+     * we create an object that records the necessary details and store it in an
+     * internal array ('pendingJobs'). this way we're in a position to terminate
+     * any pending modification if need should be.
+     *
+     * @param aOccurrence       The occurrence to create the pending
+     *                            modification for.
+     */
+    createPendingModification: function (aOccurrence) {
+        // finalize a (possibly) pending modification. this will notify
+        // an open dialog to save any outstanding modifications.
+        aOccurrence = this.finalizePendingModification(aOccurrence);
+
+        // XXX TODO logic to ask for which occurrence to modify is currently in
+        // modifyEventWithDialog, since the type of transactions done depend on
+        // this. This in turn makes the aOccurrence here be potentially wrong, I
+        // haven't seen it used anywhere though.
+        var pendingModification = {
+            controller: this,
+            item: aOccurrence,
+            finalize: null,
+            dispose: function() {
+                var array = this.controller.pendingJobs;
+                for (var i=0; i<array.length; i++) {
+                    if (array[i] == this) {
+                        array.splice(i,1);
+                        break;
+                    }
+                }
+            }
+        }
+
+        this.pendingJobs.push(pendingModification);
+
+        modifyEventWithDialog(aOccurrence, pendingModification, true);
+    },
+
+    /**
+     * Iterate the list of pending modifications and see if the occurrence
+     * passed as argument is currently about to be modified (event dialog is
+     * open with the item in question). If this should be the case we call
+     * finalize() in order to bring the dialog down and avoid dataloss.
+     *
+     * @param aOccurrence       The occurrence to finalize the modification for.
+     */
+    finalizePendingModification: function (aOccurrence) {
+
+      for each (var job in this.pendingJobs) {
+          var item = job.item;
+          var parent = item.parent;
+          if ((item.hashId == aOccurrence.hashId) ||
+              (item.parentItem.hashId == aOccurrence.hashId) ||
+              (item.hashId == aOccurrence.parentItem.hashId)) {
+              // terminate() will most probably create a modified item instance.
+              aOccurrence = job.finalize();
+              break;
+        }
+      }
+
+      return aOccurrence;
+    },
+
+    /**
+     * Modifies the given occurrence
+     * @see calICalendarViewController
+     */
+    modifyOccurrence: function (aOccurrence, aNewStartTime, aNewEndTime, aNewTitle) {
+        let dlg = cal.findItemWindow(aOccurrence);
+        if (dlg) {
+            dlg.focus();
+            return;
+        }
+
+        aOccurrence = this.finalizePendingModification(aOccurrence);
+
+        // if modifying this item directly (e.g. just dragged to new time),
+        // then do so; otherwise pop up the dialog
+        if (aNewStartTime || aNewEndTime || aNewTitle) {
+            let instance = aOccurrence.clone();
+
+            if (aNewTitle) {
+                instance.title = aNewTitle;
+            }
+
+            // When we made the executive decision (in bug 352862) that
+            // dragging an occurrence of a recurring event would _only_ act
+            // upon _that_ occurrence, we removed a bunch of code from this
+            // function. If we ever revert that decision, check CVS history
+            // here to get that code back.
+
+            if (aNewStartTime || aNewEndTime) {
+                // Yay for variable names that make this next line look silly
+                if (isEvent(instance)) {
+                    if (aNewStartTime && instance.startDate) {
+                        instance.startDate = aNewStartTime;
+                    }
+                    if (aNewEndTime && instance.endDate) {
+                        instance.endDate = aNewEndTime;
+                    }
+                } else {
+                    if (aNewStartTime && instance.entryDate) {
+                        instance.entryDate = aNewStartTime;
+                    }
+                    if (aNewEndTime && instance.dueDate) {
+                        instance.dueDate = aNewEndTime;
+                    }
+                }
+            }
+
+            doTransaction('modify', instance, instance.calendar, aOccurrence, null);
+        } else {
+            this.createPendingModification(aOccurrence);
+        }
+    },
+
+    /**
+     * Deletes the given occurrences
+     * @see calICalendarViewController
+     */
+    deleteOccurrences: function (aCount,
+                                 aOccurrences,
+                                 aUseParentItems,
+                                 aDoNotConfirm) {
+        startBatchTransaction();
+        var recurringItems = {};
+
+        function getSavedItem(aItemToDelete) {
+            // Get the parent item, saving it in our recurringItems object for
+            // later use.
+            var hashVal = aItemToDelete.parentItem.hashId;
+            if (!recurringItems[hashVal]) {
+                recurringItems[hashVal] = {
+                    oldItem: aItemToDelete.parentItem,
+                    newItem: aItemToDelete.parentItem.clone()
+                };
+            }
+            return recurringItems[hashVal];
+        }
+
+        // Make sure we are modifying a copy of aOccurrences, otherwise we will
+        // run into race conditions when the view's doDeleteItem removes the
+        // array elements while we are iterating through them. While we are at
+        // it, filter out any items that have readonly calendars, so that
+        // checking for one total item below also works out if all but one item
+        // are readonly.
+        var occurrences = aOccurrences.filter(function(item) { return isCalendarWritable(item.calendar); });
+
+        for each (var itemToDelete in occurrences) {
+            if (aUseParentItems) {
+                // Usually happens when ctrl-click is used. In that case we
+                // don't need to ask the user if he wants to delete an
+                // occurrence or not.
+                itemToDelete = itemToDelete.parentItem;
+            } else if (!aDoNotConfirm && occurrences.length == 1) {
+                // Only give the user the selection if only one occurrence is
+                // selected. Otherwise he will get a dialog for each occurrence
+                // he deletes.
+                var [itemToDelete, hasFutureItem, response] = promptOccurrenceModification(itemToDelete, false, "delete");
+                if (!response) {
+                    // The user canceled the dialog, bail out
+                    break;
+                }
+            }
+
+            // Now some dirty work: Make sure more than one occurrence can be
+            // deleted by saving the recurring items and removing occurrences as
+            // they come in. If this is not an occurrence, we can go ahead and
+            // delete the whole item.
+            itemToDelete = this.finalizePendingModification(itemToDelete);
+            if (itemToDelete.parentItem.hashId != itemToDelete.hashId) {
+                var savedItem = getSavedItem(itemToDelete);
+                savedItem.newItem.recurrenceInfo
+                         .removeOccurrenceAt(itemToDelete.recurrenceId);
+                // Dont start the transaction yet. Do so later, in case the
+                // parent item gets modified more than once.
+            } else {
+                doTransaction('delete', itemToDelete, itemToDelete.calendar, null, null);
+            }
+        }
+
+        // Now handle recurring events. This makes sure that all occurrences
+        // that have been passed are deleted.
+        for each (var ritem in recurringItems) {
+            doTransaction('modify',
+                          ritem.newItem,
+                          ritem.newItem.calendar,
+                          ritem.oldItem,
+                          null);
+        }
+        endBatchTransaction();
+    }
+};
+
+/****************************************
+* Redefine Lightning functions so those *
+* of the extension are called           *
+****************************************/
+
+var ccd_createEventWithDialog = createEventWithDialog;
+createEventWithDialog = ccdCreateEventWithDialog;
+
+var ccd_createTodoWithDialog = createTodoWithDialog;
+createTodoWithDialog = ccdCreateTodoWithDialog;
+
+var ccd_taskEdit = taskEdit;
+taskEdit = ccdTaskEdit;
+
+var ccd_calendarViewController = calendarViewController;
+calendarViewController = ccdCalendarViewController;
diff -u8pdNr 0.9/chrome.manifest 1.0/chrome.manifest
--- 0.9/chrome.manifest	2011-09-16 20:24:44 +0000
+++ 1.0/chrome.manifest	2012-01-22 22:16:26 +0000
@@ -1,7 +1,4 @@
 content customcalendardefaults chrome/content/
 locale customcalendardefaults en-US chrome/locale/en-US/
 locale customcalendardefaults de chrome/locale/de/
-
-override chrome://calendar/content/calendar-item-editing.js chrome://customcalendardefaults/content/ccd-calendar-item-editing.js
-override chrome://calendar/content/calendar-views.js chrome://customcalendardefaults/content/ccd-calendar-views.js
-override chrome://calendar/content/calendar-task-editing.js chrome://customcalendardefaults/content/ccd-calendar-task-editing.js
+overlay chrome://calendar/content/calendar-views.xul chrome://customcalendardefaults/content/ccd-overlay.xul
diff -u8pdNr 0.9/install.rdf 1.0/install.rdf
--- 0.9/install.rdf	2011-12-23 19:45:51 +0000
+++ 1.0/install.rdf	2012-02-05 21:32:25 +0000
@@ -1,17 +1,17 @@
 <?xml version="1.0"?>
 
 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      xmlns:em="http://www.mozilla.org/2004/em-rdf#">
 
   <Description about="urn:mozilla:install-manifest">
     <em:name>Custom Calendar Defaults</em:name>
     <em:id>customcalendardefaults@nadelundhirn.de</em:id>
-    <em:version>0.9</em:version>
+    <em:version>1.0</em:version>
 
     <em:localized>
       <Description>
         <em:locale>de-DE</em:locale>
         <em:name>Custom Calendar Defaults</em:name>
         <em:creator>Robert Brand</em:creator>
         <em:description>Voreinstellungen für Termine und Aufgaben anpassen</em:description>
         <em:homepageURL>http://www.nadelundhirn.de/wp/tag/customcalendardefaults/</em:homepageURL>
@@ -23,34 +23,34 @@
     <em:optionsURL>chrome://customcalendardefaults/content/ccd-prefs.xul</em:optionsURL>
 	<em:updateURL>http://www.nadelundhirn.de/krams/exten/customcalendardefaults/update.rdf</em:updateURL>
 	<em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC0aEUGwdymA73OVxwnZK4y6GkkP6t260QkoOOE1v+SoSC4bz8Xjqdmgb9Bs0YZNqQrB1VlvkMoAF3mnf5h/8vd2s43VverhrqXBxYehZmFiwL11f84vwPV5HsRfTwFlSgAOufY/d7/6DOoZkbhXR2/0QMxkscWtbIK0NpCZ3FCEQIDAQAB</em:updateKey>
 
     <!-- Thunderbird -->
     <em:targetApplication>
       <Description>
         <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
-        <em:minVersion>9.0a1</em:minVersion>
-        <em:maxVersion>9.*</em:maxVersion>
+        <em:minVersion>10.0a1</em:minVersion>
+        <em:maxVersion>10.*</em:maxVersion>
       </Description>
     </em:targetApplication>
     
     <!-- SeaMonkey -->
     <em:targetApplication>
       <Description>
         <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
-        <em:minVersion>2.6a1</em:minVersion>
-        <em:maxVersion>2.6.*</em:maxVersion>
+        <em:minVersion>2.7a1</em:minVersion>
+        <em:maxVersion>2.7.*</em:maxVersion>
       </Description>
     </em:targetApplication>
 
     <em:requires>
       <Description>
         <!-- Lightning (also Sunbird via extension stub) -->
         <em:id>{e2fda1a4-762b-4020-b5ad-a41df1933103}</em:id>
-        <em:minVersion>1.1</em:minVersion>
-        <em:maxVersion>1.1</em:maxVersion>
+        <em:minVersion>1.2</em:minVersion>
+        <em:maxVersion>1.2.*</em:maxVersion>
       </Description>
     </em:requires>
 
   </Description>
 
 </RDF>
