Bug 1280898 - Set up eslint for calendar files - enable indent rule. r=MakeMyDay
authoreslint <eslint@bugzilla.kewis.ch>
Sat, 09 Jul 2016 12:38:40 +0200
changeset 26018 2d001923cb988f8f6a7108093f5388e9b627bc01
parent 26017 880d5e4d567c33a4424cae66ac72fc523a663efd
child 26019 25a80188c50e5a1a4b9a142f8445930bfea18b7a
push id1771
push userclokep@gmail.com
push dateMon, 14 Nov 2016 17:47:53 +0000
treeherdercomm-beta@399ae9d71595 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMakeMyDay
bugs1280898
Bug 1280898 - Set up eslint for calendar files - enable indent rule. r=MakeMyDay MozReview-Commit-ID: CNVptKunJBx
calendar/.eslintrc
calendar/base/backend/icaljs/calDateTime.js
calendar/base/content/agenda-listbox.js
calendar/base/content/agenda-listbox.xml
calendar/base/content/calendar-base-view.xml
calendar/base/content/calendar-common-sets.js
calendar/base/content/calendar-daypicker.xml
calendar/base/content/calendar-invitations-manager.js
calendar/base/content/calendar-item-bindings.xml
calendar/base/content/calendar-menus.xml
calendar/base/content/calendar-month-view.xml
calendar/base/content/calendar-multiday-view.xml
calendar/base/content/calendar-statusbar.js
calendar/base/content/calendar-task-tree.js
calendar/base/content/calendar-task-tree.xml
calendar/base/content/calendar-task-view.js
calendar/base/content/calendar-ui-utils.js
calendar/base/content/calendar-unifinder.js
calendar/base/content/calendar-view-core.xml
calendar/base/content/calendar-views.js
calendar/base/content/calendar-views.xml
calendar/base/content/dialogs/calendar-dialog-utils.js
calendar/base/content/dialogs/calendar-event-dialog-attendees.js
calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
calendar/base/content/dialogs/calendar-event-dialog-freebusy.xml
calendar/base/content/dialogs/calendar-event-dialog-recurrence-preview.xml
calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
calendar/base/content/dialogs/calendar-invitations-list.xml
calendar/base/content/dialogs/calendar-print-dialog.js
calendar/base/content/dialogs/calendar-properties-dialog.js
calendar/base/content/dialogs/calendar-summary-dialog.js
calendar/base/content/preferences/categories.js
calendar/base/content/preferences/editCategory.js
calendar/base/content/widgets/calendar-alarm-widget.xml
calendar/base/content/widgets/calendar-list-tree.xml
calendar/base/content/widgets/calendar-subscriptions-list.xml
calendar/base/content/widgets/calendar-widgets.xml
calendar/base/content/widgets/minimonth.xml
calendar/base/modules/calExtract.jsm
calendar/base/modules/calHashedArray.jsm
calendar/base/modules/calItipUtils.jsm
calendar/base/modules/calProviderUtils.jsm
calendar/base/modules/calRecurrenceUtils.jsm
calendar/base/modules/calUtils.jsm
calendar/base/src/calAlarmService.js
calendar/base/src/calApplicationUtils.js
calendar/base/src/calCalendarManager.js
calendar/base/src/calDeletedItems.js
calendar/base/src/calFilter.js
calendar/base/src/calIcsSerializer.js
calendar/base/src/calItemBase.js
calendar/base/src/calItipItem.js
calendar/base/src/calProtocolHandler.js
calendar/base/src/calTimezoneService.js
calendar/base/src/calUtils.js
calendar/import-export/calOutlookCSVImportExport.js
calendar/lightning/components/calItipProtocolHandler.js
calendar/lightning/content/html-item-editing/react-code.js
calendar/lightning/content/imip-bar.js
calendar/lightning/content/lightning-item-iframe.js
calendar/lightning/content/messenger-overlay-sidebar.js
calendar/lightning/content/suite-overlay-sidebar.js
calendar/providers/caldav/calDavCalendar.js
calendar/providers/caldav/calDavRequestHandlers.js
calendar/providers/composite/calCompositeCalendar.js
calendar/providers/gdata/content/gdata-list-tree.xml
calendar/providers/ics/calICSCalendar.js
calendar/providers/memory/calMemoryCalendar.js
calendar/providers/storage/calStorageCalendar.js
calendar/providers/storage/calStorageUpgrade.jsm
calendar/providers/wcap/calWcapCalendar.js
calendar/providers/wcap/calWcapCalendarItems.js
calendar/providers/wcap/calWcapErrors.js
calendar/providers/wcap/calWcapSession.js
calendar/resources/content/calendarCreation.js
calendar/resources/content/datetimepickers/datetimepickers.xml
calendar/resources/content/mouseoverPreviews.js
calendar/resources/content/publish.js
calendar/resources/content/publishDialog.js
calendar/test/mozmill/eventDialog/testEventDialog.js
calendar/test/mozmill/eventDialog/testEventDialogModificationPrompt.js
calendar/test/mozmill/eventDialog/testUTF8.js
calendar/test/mozmill/recurrence/testAnnualRecurrence.js
calendar/test/mozmill/recurrence/testBiweeklyRecurrence.js
calendar/test/mozmill/recurrence/testDailyRecurrence.js
calendar/test/mozmill/recurrence/testLastDayOfMonthRecurrence.js
calendar/test/mozmill/recurrence/testWeeklyNRecurrence.js
calendar/test/mozmill/recurrence/testWeeklyUntilRecurrence.js
calendar/test/mozmill/recurrence/testWeeklyWithExceptionRecurrence.js
calendar/test/mozmill/recurrenceRotated/testAnnualRecurrence.js
calendar/test/mozmill/recurrenceRotated/testBiweeklyRecurrence.js
calendar/test/mozmill/recurrenceRotated/testDailyRecurrence.js
calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
calendar/test/mozmill/shared-modules/calendar-utils.js
calendar/test/mozmill/shared-modules/timezone-utils.js
calendar/test/mozmill/testAlarmDefaultValue.js
calendar/test/mozmill/testBasicFunctionality.js
calendar/test/mozmill/testLocalICS.js
calendar/test/mozmill/testTodayPane.js
calendar/test/mozmill/timezoneTests/test1.js
calendar/test/mozmill/timezoneTests/test10.js
calendar/test/mozmill/timezoneTests/test2.js
calendar/test/mozmill/timezoneTests/test3.js
calendar/test/mozmill/timezoneTests/test4.js
calendar/test/mozmill/timezoneTests/test5.js
calendar/test/mozmill/timezoneTests/test6.js
calendar/test/mozmill/timezoneTests/test7.js
calendar/test/mozmill/timezoneTests/test8.js
calendar/test/mozmill/timezoneTests/test9.js
calendar/test/mozmill/views/testDayView.js
calendar/test/mozmill/views/testMonthView.js
calendar/test/mozmill/views/testMultiweekView.js
calendar/test/mozmill/views/testTaskView.js
calendar/test/mozmill/views/testWeekView.js
calendar/test/unit/head_consts.js
calendar/test/unit/test_alarmservice.js
calendar/test/unit/test_alarmutils.js
calendar/test/unit/test_attendee.js
calendar/test/unit/test_bug350845.js
calendar/test/unit/test_calmgr.js
calendar/test/unit/test_freebusy_service.js
calendar/test/unit/test_gdata_provider.js
calendar/test/unit/test_ics.js
calendar/test/unit/test_ics_service.js
calendar/test/unit/test_providers.js
calendar/test/unit/test_webcal.js
--- a/calendar/.eslintrc
+++ b/calendar/.eslintrc
@@ -457,13 +457,16 @@
         /* mail/calendar words */ "to", "cc",
         /* Components */ "Ci", "Cc", "Cu", "Cr",
       ]
     }],
 
     // Disallow lexical declarations in case/default clauses
     "no-case-declarations": 2,
 
+    // Enforce consistent indentation (4-space)
+    "indent": [2, 4, { "SwitchCase": 1 }],
+
     // The following rules will not be enabled currently, but are kept here for
     // easier updates in the future.
     "no-else-return": 0,
   }
 }
--- a/calendar/base/backend/icaljs/calDateTime.js
+++ b/calendar/base/backend/icaljs/calDateTime.js
@@ -122,15 +122,15 @@ calDateTime.prototype = {
     get endOfMonth() { return new calDateTime(this.innerObject.endOfMonth()); },
     get startOfYear() { return new calDateTime(this.innerObject.startOfYear()); },
     get endOfYear() { return new calDateTime(this.innerObject.endOfYear()); },
 
     get icalString() { return this.innerObject.toICALString(); },
     set icalString(val) {
         let jcalString;
         if (val.length > 10) {
-           jcalString = ICAL.design.icalendar.value["date-time"].fromICAL(val);
+            jcalString = ICAL.design.icalendar.value["date-time"].fromICAL(val);
         } else {
-           jcalString = ICAL.design.icalendar.value.date.fromICAL(val);
+            jcalString = ICAL.design.icalendar.value.date.fromICAL(val);
         }
         this.innerObject = ICAL.Time.fromString(jcalString);
     }
 };
--- a/calendar/base/content/agenda-listbox.js
+++ b/calendar/base/content/agenda-listbox.js
@@ -700,17 +700,17 @@ agendaListbox.setupCalendar = function()
  * Usually called at midnight to update the agenda pane. Also retrieves the
  * items from the calendar.
  *
  * @see #refreshCalendarQuery
  * @param newDate       The first date to show if the agenda pane doesn't show
  *                        today.
  */
 agendaListbox.refreshPeriodDates = function(newDate) {
-     this.kDefaultTimezone = calendarDefaultTimezone();
+    this.kDefaultTimezone = calendarDefaultTimezone();
     // Today: now until midnight of tonight
     let oldshowstoday = this.showstoday;
     this.showstoday = this.showsToday(newDate);
     if ((this.showstoday) && (!oldshowstoday)) {
         this.addPeriodListItem(this.tomorrow, "tomorrow-header");
         this.addPeriodListItem(this.soon, "nextweek-header");
     } else if (!this.showstoday) {
         this.removePeriodListItem(this.tomorrow);
@@ -910,17 +910,17 @@ agendaListbox.calendarObserver.onDeleteI
     this.onLocalDeleteItem(item, true);
 };
 
 agendaListbox.calendarObserver.onLocalDeleteItem = function(item, moveSelection) {
     if (!isEvent(item)) {
         return false;
     }
     let selectedItemHashId = -1;
-// get all sub items if it is a recurring item
+    // get all sub items if it is a recurring item
     let occs = this.getOccurrencesBetween(item);
     for (let i = 0; i < occs.length; i++) {
         let isSelected = this.agendaListbox.deleteItem(occs[i], moveSelection);
         if (isSelected) {
             selectedItemHashId = occs[i].hashId;
         }
     }
     return selectedItemHashId;
@@ -1028,17 +1028,17 @@ function setCurrentEvent() {
                                           .getInTimezone(agendaListbox.kDefaultTimezone)
                                           .subtractDate(anow).inSeconds;
                 if (msuntillend > 0) {
                     complistItem.setAttribute("current", "true");
                     if (msuntillend < msScheduleTime || msScheduleTime == -1) {
                         msScheduleTime = msuntillend;
                     }
                 } else {
-                     removelist.push(complistItem);
+                    removelist.push(complistItem);
                 }
             } else {
                 complistItem.removeAttribute("current");
             }
             if (msScheduleTime == -1 || msuntillstart < msScheduleTime) {
                 if (msuntillstart > 0) {
                     msScheduleTime = msuntillstart;
                 }
@@ -1049,21 +1049,21 @@ function setCurrentEvent() {
         }
     } while (!leaveloop);
 
     if (msScheduleTime > -1) {
         scheduleNextCurrentEventUpdate(setCurrentEvent, msScheduleTime * 1000);
     }
 
     if (removelist) {
-      if (removelist.length > 0) {
-          for (let i = 0; i < removelist.length; i++) {
-              removelist[i].remove();
-          }
-      }
+        if (removelist.length > 0) {
+            for (let i = 0; i < removelist.length; i++) {
+                removelist[i].remove();
+            }
+        }
     }
 }
 
 var gEventTimer;
 
 /**
  * Creates a timer that will fire after the next event is current.
  *  Pass in a function as aRefreshCallback that should be called at that time.
@@ -1083,21 +1083,21 @@ function scheduleNextCurrentEventUpdate(
         }
     };
 
     if (gEventTimer) {
         gEventTimer.cancel();
     } else {
         // Observer for wake after sleep/hibernate/standby to create new timers and refresh UI
         let wakeObserver = {
-           observe: function(aSubject, aTopic, aData) {
-               if (aTopic == "wake_notification") {
-                   aRefreshCallback();
-               }
-           }
+            observe: function(aSubject, aTopic, aData) {
+                if (aTopic == "wake_notification") {
+                    aRefreshCallback();
+                }
+            }
         };
         // Add observer
         Services.obs.addObserver(wakeObserver, "wake_notification", false);
 
         // Remove observer on unload
         window.addEventListener("unload", () => {
             Services.obs.removeObserver(wakeObserver, "wake_notification");
         }, false);
--- a/calendar/base/content/agenda-listbox.xml
+++ b/calendar/base/content/agenda-listbox.xml
@@ -1,29 +1,29 @@
 <?xml version="1.0"?>
-
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <bindings id="agenda-list-bindings"
- xmlns="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:xbl="http://www.mozilla.org/xbl">
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="agenda-base-richlist-item"
            extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
     <implementation>
       <field name="mOccurrence">null</field>;
       <property name="occurrence" readonly="true">
         <getter><![CDATA[
           return this.mOccurrence;
         ]]></getter>
       </property>
     </implementation>
+
     <handlers>
       <handler event="click" phase="capturing"><![CDATA[
         if (event.detail == 1) {
             agendaListbox.onSelect(this);
         } else if (event.button == 0) {
             // We only care about button 0 doubleclick events
             document.getElementById("agenda_edit_event_command").doCommand();
             event.stopPropagation();
@@ -42,49 +42,51 @@
     <content>
       <xul:treenode-checkbox class="agenda-checkbox" anonid="agenda-checkbox-widget"
                                                    flex="1"
                                                    xbl:inherits="selected,label,hidden,disabled"/>
     </content>
     <implementation>
       <field name="kCheckbox">null</field>;
       <constructor><![CDATA[
-          this.kCheckbox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-checkbox-widget");
+        this.kCheckbox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-checkbox-widget");
       ]]></constructor>
 
       <method name="getItem">
         <body><![CDATA[
-            return this.mItem;
+          return this.mItem;
         ]]></body>
       </method>
+
       <method name="setItem">
         <parameter name="synthetic"/>
         <parameter name="showsToday"/>
         <body><![CDATA[
-            this.mItem = synthetic;
-            let duration = synthetic.duration;
-            if (showsToday) {
-                this.kCheckbox.label = this.getAttribute("title");
-                if (this.id == "nextweek-header") {
-                    if (duration > 7) {
-                        this.kCheckbox.label += " (" + unitPluralForm(duration / 7, "weeks") + ")";
-                    } else {
-                        this.kCheckbox.label += " (" + unitPluralForm(duration, "days") + ")";
-                    }
-                }
-            } else if (synthetic.duration == 1) {
-                this.kCheckbox.label = getDateFormatter().formatDate(synthetic.start);
-            } else {
-                this.kCheckbox.label = getDateFormatter().formatInterval(synthetic.start, synthetic.end);
-            }
+          this.mItem = synthetic;
+          let duration = synthetic.duration;
+          if (showsToday) {
+              this.kCheckbox.label = this.getAttribute("title");
+              if (this.id == "nextweek-header") {
+                  if (duration > 7) {
+                      this.kCheckbox.label += " (" + unitPluralForm(duration / 7, "weeks") + ")";
+                  } else {
+                      this.kCheckbox.label += " (" + unitPluralForm(duration, "days") + ")";
+                  }
+              }
+          } else if (synthetic.duration == 1) {
+              this.kCheckbox.label = getDateFormatter().formatDate(synthetic.start);
+          } else {
+              this.kCheckbox.label = getDateFormatter().formatInterval(synthetic.start, synthetic.end);
+          }
         ]]></body>
       </method>
+
       <method name="getCheckbox">
         <body><![CDATA[
-            return this.kCheckbox;
+          return this.kCheckbox;
         ]]></body>
       </method>
     </implementation>
   </binding>
 
   <binding id="agenda-allday-richlist-item"
            extends="chrome://calendar/content/agenda-listbox.xml#agenda-base-richlist-item">
     <content tooltip="itemTooltip">
@@ -101,71 +103,74 @@
                                              flex="1"
                                              flat="true"/>
           </xul:hbox>
         </xul:vbox>
       </xul:hbox>
     </content>
     <implementation>
       <field name="mAllDayItem">null</field>;
+
       <constructor><![CDATA[
-          this.mAllDayItem = document.getAnonymousElementByAttribute(this, "anonid", "allday-item");
+        this.mAllDayItem = document.getAnonymousElementByAttribute(this, "anonid", "allday-item");
       ]]></constructor>
+
       <method name="setOccurrence">
         <parameter name="aOccurrence"/>
         <parameter name="aPeriod"/>
         <body><![CDATA[
-            this.mOccurrence = aOccurrence;
-            this.mAllDayItem.occurrence = aOccurrence;
-            let dateFormatter = cal.getDateFormatter();
-            let periodStartDate = aPeriod.start.clone();
-            periodStartDate.isDate = true;
-            let periodEndDate = aPeriod.end;
-            let startDate = this.mOccurrence[calGetStartDateProp(this.mOccurrence)]
-                                .getInTimezone(calendarDefaultTimezone());
-            let endDate = this.mOccurrence[calGetEndDateProp(this.mOccurrence)]
+          this.mOccurrence = aOccurrence;
+          this.mAllDayItem.occurrence = aOccurrence;
+          let dateFormatter = cal.getDateFormatter();
+          let periodStartDate = aPeriod.start.clone();
+          periodStartDate.isDate = true;
+          let periodEndDate = aPeriod.end;
+          let startDate = this.mOccurrence[calGetStartDateProp(this.mOccurrence)]
                               .getInTimezone(calendarDefaultTimezone());
-            let endPreviousDay = endDate.clone();
-            endPreviousDay.day--;
-            // Show items's date for long periods but also for "Upcoming"
-            // period with one day duration.
-            let showDate = aPeriod.multiday || aPeriod.duration > 1;
+          let endDate = this.mOccurrence[calGetEndDateProp(this.mOccurrence)]
+                            .getInTimezone(calendarDefaultTimezone());
+          let endPreviousDay = endDate.clone();
+          endPreviousDay.day--;
+          // Show items's date for long periods but also for "Upcoming"
+          // period with one day duration.
+          let showDate = aPeriod.multiday || aPeriod.duration > 1;
 
-            let date = "";
-            let iconType = "";
-            let allDayDateLabel = document.getAnonymousElementByAttribute(this, "anonid", "agenda-allDayEvent-date");
-            setBooleanAttribute(allDayDateLabel, "hidden", !showDate);
-            if (startDate.compare(endPreviousDay) == 0) {
-                // All day event one day duration.
-                date = dateFormatter.formatDate(startDate);
-            } else if (startDate.compare(periodStartDate) >= 0 &&
-                 startDate.compare(periodEndDate) <= 0) {
-                // All day event spanning multiple days.
-                iconType = "start";
-                date = dateFormatter.formatDate(startDate);
-            } else if (endDate.compare(periodStartDate) >= 0 &&
-                       endDate.compare(periodEndDate) <= 0) {
-                iconType = "end";
-                date = dateFormatter.formatDate(endPreviousDay);
-            } else {
-                iconType = "continue";
-                hideElement(allDayDateLabel);
-            }
+          let date = "";
+          let iconType = "";
+          let allDayDateLabel = document.getAnonymousElementByAttribute(this, "anonid", "agenda-allDayEvent-date");
+          setBooleanAttribute(allDayDateLabel, "hidden", !showDate);
+          if (startDate.compare(endPreviousDay) == 0) {
+              // All day event one day duration.
+              date = dateFormatter.formatDate(startDate);
+          } else if (startDate.compare(periodStartDate) >= 0 &&
+               startDate.compare(periodEndDate) <= 0) {
+              // All day event spanning multiple days.
+              iconType = "start";
+              date = dateFormatter.formatDate(startDate);
+          } else if (endDate.compare(periodStartDate) >= 0 &&
+                     endDate.compare(periodEndDate) <= 0) {
+              iconType = "end";
+              date = dateFormatter.formatDate(endPreviousDay);
+          } else {
+              iconType = "continue";
+              hideElement(allDayDateLabel);
+          }
 
-            let multiDayImage = document.getAnonymousElementByAttribute(this, "anonid", "agenda-multiDayEvent-image");
-            multiDayImage.setAttribute("type", iconType);
-            // class wrap causes allday items to wrap its text in today-pane
-            let addWrap = document.getAnonymousElementByAttribute(this.mAllDayItem, "anonid", "eventbox");
-            addWrap.classList.add("wrap");
-            addWrap = document.getAnonymousElementByAttribute(this.mAllDayItem, "anonid", "event-detail-box");
-            addWrap.classList.add("wrap");
-            allDayDateLabel.value = date;
+          let multiDayImage = document.getAnonymousElementByAttribute(this, "anonid", "agenda-multiDayEvent-image");
+          multiDayImage.setAttribute("type", iconType);
+          // class wrap causes allday items to wrap its text in today-pane
+          let addWrap = document.getAnonymousElementByAttribute(this.mAllDayItem, "anonid", "eventbox");
+          addWrap.classList.add("wrap");
+          addWrap = document.getAnonymousElementByAttribute(this.mAllDayItem, "anonid", "event-detail-box");
+          addWrap.classList.add("wrap");
+          allDayDateLabel.value = date;
         ]]></body>
       </method>
     </implementation>
+
     <handlers>
       <handler event="dragstart" phase="capturing"><![CDATA[
         invokeEventDragSession(this.mAllDayItem.occurrence.clone(), this);
         event.stopPropagation();
         event.preventDefault();
       ]]></handler>
     </handlers>
   </binding>
@@ -184,98 +189,101 @@
           <xul:hbox align="start">
             <xul:image anonid="agenda-multiDayEvent-image" class="agenda-multiDayEvent-image"/>
             <xul:label anonid="agenda-event-start" class="agenda-event-start" crop="end" flex="1" xbl:inherits="selected"/>
           </xul:hbox>
           <xul:label anonid="agenda-event-title" class="agenda-event-title" crop="end" xbl:inherits="selected"/>
         </xul:vbox>
       </xul:hbox>
     </content>
+
     <implementation>
       <method name="setOccurrence">
         <parameter name="aItem"/>
         <parameter name="aPeriod"/>
         <body><![CDATA[
-            this.mOccurrence = aItem;
-            this.setAttribute("status", aItem.status);
-            let dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
-                                  .getService(Components.interfaces.calIDateTimeFormatter);
+          this.mOccurrence = aItem;
+          this.setAttribute("status", aItem.status);
+          let dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
+                                .getService(Components.interfaces.calIDateTimeFormatter);
 
-            let periodStartDate = aPeriod.start.clone();
-            periodStartDate.isDate = true;
-            let periodEndDate = aPeriod.end.clone();
-            periodEndDate.day--;
-            let start = this.mOccurrence[calGetStartDateProp(this.mOccurrence)]
-                            .getInTimezone(calendarDefaultTimezone());
-            let end = this.mOccurrence[calGetEndDateProp(this.mOccurrence)]
+          let periodStartDate = aPeriod.start.clone();
+          periodStartDate.isDate = true;
+          let periodEndDate = aPeriod.end.clone();
+          periodEndDate.day--;
+          let start = this.mOccurrence[calGetStartDateProp(this.mOccurrence)]
                           .getInTimezone(calendarDefaultTimezone());
-            let startDate = start.clone();
-            startDate.isDate = true;
-            let endDate = end.clone();
-            endDate.isDate = true;
-            let endAtMidnight = (end.hour == 0 && end.minute == 0);
-            if (endAtMidnight) {
-                endDate.day--;
-            }
-            // Show items's date for long periods but also for "Upcoming"
-            // period with one day duration.
-            let longFormat = aPeriod.multiday || aPeriod.duration > 1;
+          let end = this.mOccurrence[calGetEndDateProp(this.mOccurrence)]
+                        .getInTimezone(calendarDefaultTimezone());
+          let startDate = start.clone();
+          startDate.isDate = true;
+          let endDate = end.clone();
+          endDate.isDate = true;
+          let endAtMidnight = (end.hour == 0 && end.minute == 0);
+          if (endAtMidnight) {
+              endDate.day--;
+          }
+          // Show items's date for long periods but also for "Upcoming"
+          // period with one day duration.
+          let longFormat = aPeriod.multiday || aPeriod.duration > 1;
 
-            let duration = "";
-            let iconType = "";
-            if (startDate.compare(endDate) == 0) {
-                // event that starts and ends in the same day, midnight included
-                duration = longFormat ? dateFormatter.formatDateTime(start)
-                                      : dateFormatter.formatTime(start);
-            } else if (startDate.compare(periodStartDate) >= 0 &&
-                       startDate.compare(periodEndDate) <= 0) {
-                // event spanning multiple days, start date within period
-                iconType = "start";
-                duration = longFormat ? dateFormatter.formatDateTime(start)
-                                      : dateFormatter.formatTime(start);
-            } else if (endDate.compare(periodStartDate) >= 0 &&
-                       endDate.compare(periodEndDate) <= 0) {
-                // event spanning multiple days, end date within period
-                iconType = "end";
-                if (endAtMidnight) {
-                    duration = dateFormatter.formatDate(endDate) + " ";
-                    duration = longFormat ? duration + calGetString("dateFormat", "midnight")
-                                          : calGetString("dateFormat", "midnight");
-                } else {
-                    duration = longFormat ? dateFormatter.formatDateTime(end)
-                                          : dateFormatter.formatTime(end);
-                }
-            } else {
-                iconType = "continue";
-            }
-            let multiDayImage = document.getAnonymousElementByAttribute(this, "anonid", "agenda-multiDayEvent-image");
-            multiDayImage.setAttribute("type", iconType);
-            let durationbox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-event-start");
-            durationbox.textContent = duration;
+          let duration = "";
+          let iconType = "";
+          if (startDate.compare(endDate) == 0) {
+              // event that starts and ends in the same day, midnight included
+              duration = longFormat ? dateFormatter.formatDateTime(start)
+                                    : dateFormatter.formatTime(start);
+          } else if (startDate.compare(periodStartDate) >= 0 &&
+                     startDate.compare(periodEndDate) <= 0) {
+              // event spanning multiple days, start date within period
+              iconType = "start";
+              duration = longFormat ? dateFormatter.formatDateTime(start)
+                                    : dateFormatter.formatTime(start);
+          } else if (endDate.compare(periodStartDate) >= 0 &&
+                     endDate.compare(periodEndDate) <= 0) {
+              // event spanning multiple days, end date within period
+              iconType = "end";
+              if (endAtMidnight) {
+                  duration = dateFormatter.formatDate(endDate) + " ";
+                  duration = longFormat ? duration + calGetString("dateFormat", "midnight")
+                                        : calGetString("dateFormat", "midnight");
+              } else {
+                  duration = longFormat ? dateFormatter.formatDateTime(end)
+                                        : dateFormatter.formatTime(end);
+              }
+          } else {
+              iconType = "continue";
+          }
+          let multiDayImage = document.getAnonymousElementByAttribute(this, "anonid", "agenda-multiDayEvent-image");
+          multiDayImage.setAttribute("type", iconType);
+          let durationbox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-event-start");
+          durationbox.textContent = duration;
 
-            // show items with time only (today & tomorrow) as one line.
-            if (longFormat) {
-                let titlebox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-event-title");
-                titlebox.textContent = aItem.title;
-            } else {
-                durationbox.textContent += " " + aItem.title;
-            }
-            this.refreshColor();
+          // show items with time only (today & tomorrow) as one line.
+          if (longFormat) {
+              let titlebox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-event-title");
+              titlebox.textContent = aItem.title;
+          } else {
+              durationbox.textContent += " " + aItem.title;
+          }
+          this.refreshColor();
         ]]></body>
       </method>
+
       <method name="refreshColor">
         <body><![CDATA[
-            let calcolor = (this.mOccurrence &&
-                            this.mOccurrence.calendar.getProperty("color")) ||
-                           "#a8c2e1";
+          let calcolor = (this.mOccurrence &&
+                           this.mOccurrence.calendar.getProperty("color")) ||
+                          "#a8c2e1";
 
-            let imagebox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-calendar-image");
-            imagebox.setAttribute("style", "background-color: " + calcolor + ";");
+          let imagebox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-calendar-image");
+          imagebox.setAttribute("style", "background-color: " + calcolor + ";");
         ]]></body>
       </method>
     </implementation>
+
     <handlers>
       <handler event="dragstart"><![CDATA[
         invokeEventDragSession(this.mOccurrence.clone(), this);
       ]]></handler>
     </handlers>
   </binding>
 </bindings>
--- a/calendar/base/content/calendar-base-view.xml
+++ b/calendar/base/content/calendar-base-view.xml
@@ -1,19 +1,18 @@
 <?xml version="1.0"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/.
--->
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <bindings id="calendar-multiday-view-bindings"
-  xmlns="http://www.mozilla.org/xbl"
-  xmlns:html="http://www.w3.org/1999/xhtml"
-  xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-  xmlns:xbl="http://www.mozilla.org/xbl">
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="calendar-base-view">
     <resources>
       <stylesheet src="chrome://calendar-common/skin/calendar-alarms.css"/>
     </resources>
     <implementation>
       <field name="mWeekStartOffset">0</field>
       <field name="mRangeStartDate">null</field>;
@@ -39,29 +38,29 @@
       <field name="mMagnifyAmount">0</field>
       <field name="mPixelScrollDelta">0</field>
       <field name="mViewStart">null</field>
       <field name="mViewEnd">null</field>
       <field name="mToggleStatus">0</field>
       <field name="mLog">null</field>
       <field name="mToggleStatusFlag"><![CDATA[
       ({
-         WorkdaysOnly:  1,
-         TasksInView:   2,
-         ShowCompleted: 4,
+          WorkdaysOnly: 1,
+          TasksInView: 2,
+          ShowCompleted: 4,
       })
       ]]></field>
 
       <field name="mPrefObserver"><![CDATA[
       ({
-         calView: this,
-         observe: function(subj, topic, pref) {
-             this.calView.handlePreference(subj, topic, pref);
-             return;
-         }
+          calView: this,
+          observe: function(subj, topic, pref) {
+              this.calView.handlePreference(subj, topic, pref);
+              return;
+          }
       })
       ]]></field>
 
       <field name="mObserver"><![CDATA[
         // the calIObserver, calICompositeObserver, and calIAlarmServiceObserver
         ({
             QueryInterface: XPCOMUtils.generateQI([
                 Components.interfaces.calIObserver,
@@ -359,39 +358,39 @@
           this.mCalendar.addObserver(this.mObserver);
           this.refresh();
           return val;
         ]]></setter>
       </property>
 
       <property name="initialized">
         <getter><![CDATA[
-            let retval;
+          let retval;
 
-            // Some views throw when accessing an uninitialized startDay
-            try {
-                retval = this.displayCalendar && this.startDay &&
-                         this.endDay;
-            } catch (ex) {
-                return false;
-            }
-            return retval;
+          // Some views throw when accessing an uninitialized startDay
+          try {
+              retval = this.displayCalendar && this.startDay &&
+                       this.endDay;
+          } catch (ex) {
+              return false;
+          }
+          return retval;
         ]]></getter>
       </property>
 
       <method name="goToDay">
         <parameter name="aDate"/>
         <body><![CDATA[
-            this.showDate(aDate);
+          this.showDate(aDate);
         ]]></body>
       </method>
 
       <method name="getRangeDescription">
         <body><![CDATA[
-            return getDateFormatter().formatInterval(this.rangeStartDate, this.rangeEndDate);
+          return getDateFormatter().formatInterval(this.rangeStartDate, this.rangeEndDate);
         ]]></body>
       </method>
 
       <!-- This function guarantees that the
        labels are clipped in the instance that the overflow occurrs,
        avoiding horizontal scrollbars from showing up for a short period. -->
       <method name="adjustWeekdayLength">
         <parameter name="forceShortName"/>
@@ -550,18 +549,18 @@
 
           refreshJob.execute();
         ]]></body>
       </method>
 
       <method name="deleteItemsFromCalendar">
         <parameter name="aCalendar"/>
         <body><![CDATA[
-            /* This method must be implemented in subclasses. */
-            throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
+          /* This method must be implemented in subclasses. */
+          throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
         ]]></body>
       </method>
 
       <!-- the end date that should be used for getItems and similar queries -->
       <property name="queryEndDate" readonly="true">
         <getter><![CDATA[
           let end = this.endDate;
           if (!end) {
@@ -582,20 +581,20 @@
           event.initEvent(aEventName, true, false);
           event.detail = aEventDetail;
           this.dispatchEvent(event);
         ]]></body>
       </method>
 
       <method name="removeDropShadows">
         <body><![CDATA[
-            let dropbox = document.getAnonymousElementByAttribute(this, "dropbox", "true");
-            if (dropbox && dropbox !== undefined) {
-                dropbox.setAttribute("dropbox", "false");
-            }
+          let dropbox = document.getAnonymousElementByAttribute(this, "dropbox", "true");
+          if (dropbox && dropbox !== undefined) {
+              dropbox.setAttribute("dropbox", "false");
+          }
         ]]></body>
       </method>
 
       <method name="getLongWeekdayTotalPixels">
         <body><![CDATA[
           if (this.mLongWeekdayTotalPixels <= 0) {
               let maxDayWidth = 0;
               for (let label of this.labeldaybox.childNodes) {
@@ -615,74 +614,74 @@
 
       <!-- A preference handler which is called by the preference observer.
            Can be overwritten in derived bindings. -->
       <method name="handleCommonPreference">
         <parameter name="aSubject"/>
         <parameter name="aTopic"/>
         <parameter name="aPreference"/>
         <body><![CDATA[
-           // refresh view if categories seem to have changed
-           if (aPreference.startsWith("calendar.category.color")) {
-               this.refreshView();
-               return;
-           }
-           switch (aPreference) {
-               case "calendar.week.d0sundaysoff":
-               case "calendar.week.d1mondaysoff":
-               case "calendar.week.d2tuesdaysoff":
-               case "calendar.week.d3wednesdaysoff":
-               case "calendar.week.d4thursdaysoff":
-               case "calendar.week.d5fridaysoff":
-               case "calendar.week.d6saturdaysoff":
-                   this.updateDaysOffPrefs();
-                   break;
-               case "calendar.timezone.local":
-                   this.timezone = calendarDefaultTimezone();
-                   this.refreshView();
-                   break;
-               case "calendar.alarms.indicator.show":
-                   // Break here to ensure the view is refreshed
-                   break;
-               case "calendar.week.start":
-                   this.weekStartOffset = aSubject.getIntPref(aPreference);
-                   break;
-               case "calendar.date.format":
-                   this.refreshView();
-                   break;
-               default:
-                   return;
-            }
-            this.refreshView();
+          // refresh view if categories seem to have changed
+          if (aPreference.startsWith("calendar.category.color")) {
+              this.refreshView();
+              return;
+          }
+          switch (aPreference) {
+              case "calendar.week.d0sundaysoff":
+              case "calendar.week.d1mondaysoff":
+              case "calendar.week.d2tuesdaysoff":
+              case "calendar.week.d3wednesdaysoff":
+              case "calendar.week.d4thursdaysoff":
+              case "calendar.week.d5fridaysoff":
+              case "calendar.week.d6saturdaysoff":
+                  this.updateDaysOffPrefs();
+                  break;
+              case "calendar.timezone.local":
+                  this.timezone = calendarDefaultTimezone();
+                  this.refreshView();
+                  break;
+              case "calendar.alarms.indicator.show":
+                  // Break here to ensure the view is refreshed
+                  break;
+              case "calendar.week.start":
+                  this.weekStartOffset = aSubject.getIntPref(aPreference);
+                  break;
+              case "calendar.date.format":
+                  this.refreshView();
+                  break;
+              default:
+                  return;
+          }
+          this.refreshView();
         ]]></body>
       </method>
 
       <method name="updateDaysOffPrefs">
         <body><![CDATA[
-            const weekPrefix = "calendar.week.";
-            const prefNames = ["d0sundaysoff", "d1mondaysoff", "d2tuesdaysoff",
-                               "d3wednesdaysoff", "d4thursdaysoff",
-                               "d5fridaysoff", "d6saturdaysoff"];
-            const defaults = ["true", "false", "false", "false",
-                              "false", "false", "true"];
-            let daysOff = [];
-            for (let i in prefNames) {
-                if (Preferences.get(weekPrefix + prefNames[i], defaults[i])) {
-                    daysOff.push(Number(i));
-                }
-            }
-            this.daysOffArray = daysOff;
+          const weekPrefix = "calendar.week.";
+          const prefNames = ["d0sundaysoff", "d1mondaysoff", "d2tuesdaysoff",
+                             "d3wednesdaysoff", "d4thursdaysoff",
+                             "d5fridaysoff", "d6saturdaysoff"];
+          const defaults = ["true", "false", "false", "false",
+                            "false", "false", "true"];
+          let daysOff = [];
+          for (let i in prefNames) {
+              if (Preferences.get(weekPrefix + prefNames[i], defaults[i])) {
+                  daysOff.push(Number(i));
+              }
+          }
+          this.daysOffArray = daysOff;
         ]]></body>
       </method>
 
       <method name="refreshView">
         <body><![CDATA[
           if (!this.startDay || !this.endDay) {
-             // don't refresh if we're not initialized
-             return;
+              // don't refresh if we're not initialized
+              return;
           }
           // Just refresh, the goToDay function will notice
           this.goToDay(this.selectedDay);
           this.forceRefresh();
         ]]></body>
       </method>
 
       <!-- Default implementations follow, these make things easier for
@@ -757,21 +756,19 @@
       </method>
       <method name="zoomReset">
         <body><![CDATA[
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
-      <handler event="move">
-        <![CDATA[
-          this.moveView(event.detail);
-        ]]>
-      </handler>
+      <handler event="move"><![CDATA[
+        this.moveView(event.detail);
+      ]]></handler>
       <handler event="keypress"><![CDATA[
         const kKE = Components.interfaces.nsIDOMKeyEvent;
         switch (event.keyCode) {
             case kKE.DOM_VK_PAGE_UP:
                 this.moveView(-1);
                 break;
             case kKE.DOM_VK_PAGE_DOWN:
                 this.moveView(1);
--- a/calendar/base/content/calendar-common-sets.js
+++ b/calendar/base/content/calendar-common-sets.js
@@ -123,20 +123,20 @@ var calendarController = {
             case "calendar_delete_event_command":
                 return CalendarDeleteCommandEnabled && this.selected_items_writable;
             case "calendar_new_todo_command":
             case "calendar_new_todo_context_command":
             case "calendar_new_todo_todaypane_command":
                 return CalendarNewTasksCommandEnabled;
             case "calendar_modify_todo_command":
             case "calendar_modify_todo_todaypane_command":
-                 return this.todo_items_selected;
-                 // This code is temporarily commented out due to
-                 // bug 469684 Unifinder-todo: raising of the context menu fires blur-event
-                 // this.todo_tasktree_focused;
+                return this.todo_items_selected;
+                // This code is temporarily commented out due to
+                // bug 469684 Unifinder-todo: raising of the context menu fires blur-event
+                // this.todo_tasktree_focused;
             case "calendar_edit_calendar_command":
                 return this.isCalendarInForeground();
             case "calendar_task_filter_command":
                 return true;
             case "calendar_delete_todo_command":
                 if (!CalendarDeleteCommandEnabled) {
                     return false;
                 }
@@ -231,21 +231,21 @@ var calendarController = {
             default:
                 if (this.defaultController && !this.isCalendarInForeground()) {
                     // The delete-button demands a special handling in mail-mode
                     // as it is supposed to delete an element of the focused pane
                     if (aCommand == "cmd_delete" || aCommand == "button_delete") {
                         let focusedElement = document.commandDispatcher.focusedElement;
                         if (focusedElement) {
                             if (focusedElement.getAttribute("id") == "agenda-listbox") {
-                                 return agendaListbox.isEventSelected();
+                                return agendaListbox.isEventSelected();
                             } else if (focusedElement.className == "calendar-task-tree") {
-                                 return this.writable &&
-                                        this.todo_items_selected &&
-                                        this.todo_items_writable;
+                                return this.writable &&
+                                       this.todo_items_selected &&
+                                       this.todo_items_writable;
                             }
                         }
                     }
 
                     if (this.defaultController.supportsCommand(aCommand)) {
                         return this.defaultController.isCommandEnabled(aCommand);
                     }
                 }
@@ -690,18 +690,18 @@ var calendarController2 = {
                 goSetMenuValue(aCommand, "valueDefault");
                 return canRedo();
             case "button_delete":
             case "cmd_delete":
                 return calendarController.isCommandEnabled("calendar_delete_focused_item_command");
             case "cmd_fullZoomReduce":
             case "cmd_fullZoomEnlarge":
             case "cmd_fullZoomReset":
-              return calendarController.isInMode("calendar") &&
-                     currentView().supportsZoom;
+                return calendarController.isInMode("calendar") &&
+                       currentView().supportsZoom;
             case "cmd_properties":
             case "cmd_printpreview":
                 return false;
             case "cmd_showQuickFilterBar":
                 return calendarController.isInMode("task");
             default:
                 return true;
         }
@@ -832,36 +832,36 @@ function setupContextItemType(event, ite
  * Shows the given date in the current view, if in calendar mode.
  *
  * XXX This function is misplaced, should go to calendar-views.js or a minimonth
  * specific js file.
  *
  * @param aNewDate      The new date as a JSDate.
  */
 function minimonthPick(aNewDate) {
-  if (gCurrentMode == "calendar" || gCurrentMode == "task") {
-      let cdt = cal.jsDateToDateTime(aNewDate, currentView().timezone);
-      cdt.isDate = true;
-      currentView().goToDay(cdt);
+    if (gCurrentMode == "calendar" || gCurrentMode == "task") {
+        let cdt = cal.jsDateToDateTime(aNewDate, currentView().timezone);
+        cdt.isDate = true;
+        currentView().goToDay(cdt);
 
-      // update date filter for task tree
-      let tree = document.getElementById("calendar-task-tree");
-      tree.updateFilter();
-  }
+        // update date filter for task tree
+        let tree = document.getElementById("calendar-task-tree");
+        tree.updateFilter();
+    }
 }
 
 /**
  * Selects all items, based on which mode we are currently in and what task tree is focused
  */
 function selectAllItems() {
-  if (calendarController.todo_tasktree_focused) {
-    getTaskTree().selectAll();
-  } else if (calendarController.isInMode("calendar")) {
-    selectAllEvents();
-  }
+    if (calendarController.todo_tasktree_focused) {
+        getTaskTree().selectAll();
+    } else if (calendarController.isInMode("calendar")) {
+        selectAllEvents();
+    }
 }
 
 /**
  * Returns the selected items, based on which mode we are currently in and what task tree is focused
  */
 function getSelectedItems() {
     if (calendarController.todo_tasktree_focused) {
         return getSelectedTasks();
--- a/calendar/base/content/calendar-daypicker.xml
+++ b/calendar/base/content/calendar-daypicker.xml
@@ -24,33 +24,29 @@
                    class="toolbarbutton-text"
                    flex="1"
                    xbl:inherits="value=label"/>
       </xul:hbox>
     </content>
     <implementation>
       <method name="onmodified">
         <parameter name="aEvent"/>
-        <body>
-          <![CDATA[
-            if (aEvent.attrName == "checked") {
-                let event = document.createEvent("Events");
-                event.initEvent("select", true, true);
-                this.calendar.dispatchEvent(event);
-            }
-          ]]>
-        </body>
+        <body><![CDATA[
+          if (aEvent.attrName == "checked") {
+              let event = document.createEvent("Events");
+              event.initEvent("select", true, true);
+              this.calendar.dispatchEvent(event);
+          }
+        ]]></body>
       </method>
-      <constructor>
-        <![CDATA[
-          this.setAttribute("autoCheck", "true");
-          this.setAttribute("type", "checkbox");
-          this.addEventListener("DOMAttrModified", this.onmodified, false);
-        ]]>
-      </constructor>
+      <constructor><![CDATA[
+        this.setAttribute("autoCheck", "true");
+        this.setAttribute("type", "checkbox");
+        this.addEventListener("DOMAttrModified", this.onmodified, false);
+      ]]></constructor>
     </implementation>
   </binding>
 
   <!--
   ########################################################################
   ## daypicker-weekday
   ########################################################################
   -->
@@ -137,77 +133,76 @@
             if (dow >= 7) {
                 dow -= 7;
             }
             let day = props.GetStringFromName("day." + (dow + 1) + ".Mmm");
             child.label = day;
             child.calendar = this;
         }
       ]]></constructor>
-
     </implementation>
   </binding>
 
   <!--
   ########################################################################
   ## daypicker-monthday
   ########################################################################
   -->
 
   <binding id="daypicker-monthday" extends="xul:box">
     <resources>
       <stylesheet src="chrome://calendar/skin/calendar-daypicker.css"/>
     </resources>
 
     <content>
-          <xul:vbox anonid="mainbox" class="daypicker-monthday-mainbox" flex="1" >
-            <xul:hbox class="daypicker-row" flex="1">
-              <daypicker label="1" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="2" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="3" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="4" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="5" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="6" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="7" right="true" xbl:inherits="disabled, mode=id"/>
-            </xul:hbox>
-            <xul:hbox class="daypicker-row" flex="1">
-              <daypicker label="8" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="9" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="10" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="11" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="12" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="13" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="14" right="true" xbl:inherits="disabled, mode=id"/>
-            </xul:hbox>
-            <xul:hbox class="daypicker-row" flex="1">
-              <daypicker label="15" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="16" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="17" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="18" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="19" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="20" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="21" right="true" xbl:inherits="disabled, mode=id"/>
-            </xul:hbox>
-            <xul:hbox class="daypicker-row" flex="1">
-              <daypicker label="22" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="23" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="24" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="25" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="26" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="27" xbl:inherits="disabled, mode=id"/>
-              <daypicker label="28" right="true" xbl:inherits="disabled, mode=id"/>
-            </xul:hbox>
-            <xul:hbox class="daypicker-row" flex="1">
-              <daypicker bottom="true" label="29" xbl:inherits="disabled, mode=id"/>
-              <daypicker bottom="true" label="30" xbl:inherits="disabled, mode=id"/>
-              <daypicker bottom="true" label="31" xbl:inherits="disabled, mode=id"/>
-              <daypicker bottom="true" right="true" label="" xbl:inherits="disabled, mode=id"/>
-            </xul:hbox>
-          </xul:vbox>
-        </content>
+      <xul:vbox anonid="mainbox" class="daypicker-monthday-mainbox" flex="1" >
+        <xul:hbox class="daypicker-row" flex="1">
+          <daypicker label="1" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="2" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="3" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="4" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="5" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="6" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="7" right="true" xbl:inherits="disabled, mode=id"/>
+        </xul:hbox>
+        <xul:hbox class="daypicker-row" flex="1">
+          <daypicker label="8" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="9" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="10" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="11" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="12" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="13" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="14" right="true" xbl:inherits="disabled, mode=id"/>
+        </xul:hbox>
+        <xul:hbox class="daypicker-row" flex="1">
+          <daypicker label="15" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="16" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="17" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="18" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="19" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="20" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="21" right="true" xbl:inherits="disabled, mode=id"/>
+        </xul:hbox>
+        <xul:hbox class="daypicker-row" flex="1">
+          <daypicker label="22" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="23" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="24" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="25" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="26" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="27" xbl:inherits="disabled, mode=id"/>
+          <daypicker label="28" right="true" xbl:inherits="disabled, mode=id"/>
+        </xul:hbox>
+        <xul:hbox class="daypicker-row" flex="1">
+          <daypicker bottom="true" label="29" xbl:inherits="disabled, mode=id"/>
+          <daypicker bottom="true" label="30" xbl:inherits="disabled, mode=id"/>
+          <daypicker bottom="true" label="31" xbl:inherits="disabled, mode=id"/>
+          <daypicker bottom="true" right="true" label="" xbl:inherits="disabled, mode=id"/>
+        </xul:hbox>
+      </xul:vbox>
+    </content>
     <implementation>
       <property name="days">
         <setter><![CDATA[
           let mainbox =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "mainbox");
           let numRows = mainbox.childNodes.length;
           let days = [];
--- a/calendar/base/content/calendar-invitations-manager.js
+++ b/calendar/base/content/calendar-invitations-manager.js
@@ -88,17 +88,17 @@ InvitationsManager.prototype = {
      */
     scheduleInvitationsUpdate: function(firstDelay, operationListener) {
         this.cancelInvitationsUpdate();
 
         this.mTimer = setTimeout(() => {
             if (Preferences.get("calendar.invitations.autorefresh.enabled", true)) {
                 this.mTimer = setInterval(() => {
                     this.getInvitations(operationListener);
-                    }, Preferences.get("calendar.invitations.autorefresh.timeout", 3) * 60000);
+                }, Preferences.get("calendar.invitations.autorefresh.timeout", 3) * 60000);
             }
             this.getInvitations(operationListener);
         }, firstDelay);
     },
 
     /**
      * Cancel pending any pending invitations update.
      */
--- a/calendar/base/content/calendar-item-bindings.xml
+++ b/calendar/base/content/calendar-item-bindings.xml
@@ -24,30 +24,30 @@
     </resources>      
     <content xbl:inherits="mode">
       <xul:label anonid="item-datetime-label"
                  class="headline"
                  xbl:inherits="align"/>
       <xul:label anonid="item-datetime-value"/>
     </content>
     <implementation>
-      <field name="mItem">null</field>  
+      <field name="mItem">null</field>
       <property name="mode"
                 readonly="true">
         <getter><![CDATA[
-            if (this.hasAttribute("mode")) {
-                return this.getAttribute("mode");
-            } else {
-                return "start";
-            }
+          if (this.hasAttribute("mode")) {
+              return this.getAttribute("mode");
+          } else {
+              return "start";
+          }
         ]]></getter>
       </property>
       <property name="Item">
         <getter><![CDATA[
-            return mItem;
+          return mItem;
         ]]></getter>
         <setter><![CDATA[
           this.mItem = val;
           let headerLabel = document.getAnonymousElementByAttribute(this, "anonid", "item-datetime-label");
           let itemDateTimeLabel = document.getAnonymousElementByAttribute(this, "anonid", "item-datetime-value");
           let date;
           if (this.mode == "start") {
               date = this.mItem[calGetStartDateProp(this.mItem)];
@@ -60,17 +60,17 @@
                   }
                   headerLabel.value = label;
               }
           } else {
               date = this.mItem[calGetEndDateProp(this.mItem)];
               if (date) {
                   let label;
                   if (isToDo(this.mItem)) {
-                          label = this.getAttribute("taskDueLabel");
+                      label = this.getAttribute("taskDueLabel");
                   } else {
                       label = this.getAttribute("eventEndLabel");
                   }
                   headerLabel.value = label;
               }
           }
           let hideLabels = (date == null);
           if (hideLabels) {
--- a/calendar/base/content/calendar-menus.xml
+++ b/calendar/base/content/calendar-menus.xml
@@ -1,74 +1,74 @@
 <?xml version="1.0"?>
-
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!DOCTYPE bindings SYSTEM "chrome://calendar/locale/calendar.dtd">
 
 <bindings id="calendar-menu-bindings"
- xmlns="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:xbl="http://www.mozilla.org/xbl">
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="task-menupopup" extends="xul:menupopup">
     <implementation>
       <field name="mType">null</field>;
       <field name="mPopupHandler">null</field>
       <field name="mParentMenuPopup">null</field>
+
       <constructor><![CDATA[
         this.mPopupHandler = () => { this.schangeMenuByPropertyName(); };
         this.mParentMenuPopup = getParentNodeOrThis(this, "menupopup");
         this.mParentMenuPopup.addEventListener("popupshowing", this.mPopupHandler, true);
       ]]></constructor>
+
       <destructor><![CDATA[
         this.mParentMenuPopup.removeEventListener("popupshowing", this.mPopupHandler, true);
       ]]></destructor>
 
-<!-- This method checks a command which naming follows
- *  the notation 'calendar_' +  mType + ' + '-' + propertyValue + 'command',
- *  when its propertyValue part matches the propertyValue of the selected tasks
- *  as long as the selected tasks share common propertyValues.
- * -->
+      <!-- This method checks a command which naming follows
+           the notation 'calendar_' +  mType + ' + '-' + propertyValue + 'command',
+           when its propertyValue part matches the propertyValue of the selected tasks
+           as long as the selected tasks share common propertyValues. -->
       <method name="changeMenuByPropertyName">
         <body><![CDATA[
-            let liveList = document.getAnonymousNodes(this);
-            for (let item of liveList) {
-                let commandName = item.getAttribute("command");
-                let command = document.getElementById(commandName);
-                if (command) {
-                    command.setAttribute("checked", "false");
-                    item.setAttribute("checked", "false");
-                }
-            }
-            let propertyValue;
-            if (gTabmail && gTabmail.currentTabInfo.mode.type == "calendarTask") {
-                // We are in a task tab (editing a single task).
-                propertyValue = gConfig[this.mType];
-            } else {
-                // We are in the Tasks tab.
-                let tasks = getSelectedTasks();
-                let tasksSelected = (tasks != null) && (tasks.length > 0);
-                if (tasksSelected) {
-                    let task = tasks[0];
-                    if (isPropertyValueSame(tasks, this.mType)) {
-                        propertyValue = task[this.mType];
-                    }
-                } else {
-                    applyAttributeToMenuChildren(this, "disabled", !tasksSelected);
-                }
-            }
-            if (propertyValue || propertyValue == 0) {
-                let command = document.getElementById("calendar_" + this.mType + "-" + propertyValue + "_command");
-                if (command) {
-                    command.setAttribute("checked", "true");
-                }
-            }
+          let liveList = document.getAnonymousNodes(this);
+          for (let item of liveList) {
+              let commandName = item.getAttribute("command");
+              let command = document.getElementById(commandName);
+              if (command) {
+                  command.setAttribute("checked", "false");
+                  item.setAttribute("checked", "false");
+              }
+          }
+          let propertyValue;
+          if (gTabmail && gTabmail.currentTabInfo.mode.type == "calendarTask") {
+              // We are in a task tab (editing a single task).
+              propertyValue = gConfig[this.mType];
+          } else {
+              // We are in the Tasks tab.
+              let tasks = getSelectedTasks();
+              let tasksSelected = (tasks != null) && (tasks.length > 0);
+              if (tasksSelected) {
+                  let task = tasks[0];
+                  if (isPropertyValueSame(tasks, this.mType)) {
+                      propertyValue = task[this.mType];
+                  }
+              } else {
+                  applyAttributeToMenuChildren(this, "disabled", !tasksSelected);
+              }
+          }
+          if (propertyValue || propertyValue == 0) {
+              let command = document.getElementById("calendar_" + this.mType + "-" + propertyValue + "_command");
+              if (command) {
+                  command.setAttribute("checked", "true");
+              }
+          }
         ]]></body>
       </method>
     </implementation>
    </binding>
 
   <binding id="task-progress-menupopup" extends="chrome://calendar/content/calendar-menus.xml#task-menupopup">
     <content>
       <xul:menuitem anonid="percent-0-menuitem"
@@ -100,50 +100,50 @@
                 label="&progress.level.100;"
                 accesskey="&progress.level.100.accesskey;"
                 observes="calendar_percentComplete-100_command"
                 command="calendar_percentComplete-100_command"/>
       <children/>
     </content>
     <implementation>
       <constructor><![CDATA[
-          this.mType = "percentComplete";
-          this.changeMenuByPropertyName();
+        this.mType = "percentComplete";
+        this.changeMenuByPropertyName();
       ]]></constructor>
     </implementation>
    </binding>
 
   <binding id="task-priority-menupopup" extends="chrome://calendar/content/calendar-menus.xml#task-menupopup">
     <content>
-          <xul:menuitem id="priority-0-menuitem"
+      <xul:menuitem id="priority-0-menuitem"
                     type="checkbox"
                     label="&priority.level.none;"
                     accesskey="&priority.level.none.accesskey;"
                     command="calendar_priority-0_command"
                     observes="calendar_priority-0_command"/>
-          <xul:menuitem id="priority-9-menuitem"
+      <xul:menuitem id="priority-9-menuitem"
                     type="checkbox"
                     label="&priority.level.low;"
                     accesskey="&priority.level.low.accesskey;"
                     command="calendar_priority-9_command"
                     observes="calendar_priority-9_command"/>
-          <xul:menuitem id="priority-5-menuitem"
+      <xul:menuitem id="priority-5-menuitem"
                     type="checkbox"
                     label="&priority.level.normal;"
                     accesskey="&priority.level.normal.accesskey;"
                     command="calendar_priority-5_command"
                     observes="calendar_priority-5_command"/>
-          <xul:menuitem id="priority-1-menuitem"
-                    type="checkbox"
-                    label="&priority.level.high;"
-                    accesskey="&priority.level.high.accesskey;"
-                    command="calendar_priority-1_command"
-                    observes="calendar_priority-1_command"/>
-      <children/>                    
-     </content>
+      <xul:menuitem id="priority-1-menuitem"
+                type="checkbox"
+                label="&priority.level.high;"
+                accesskey="&priority.level.high.accesskey;"
+                command="calendar_priority-1_command"
+                observes="calendar_priority-1_command"/>
+      <children/>
+    </content>
     <implementation>
       <constructor><![CDATA[
-          this.mType = "priority";
-          this.changeMenuByPropertyName();
+        this.mType = "priority";
+        this.changeMenuByPropertyName();
       ]]></constructor>
     </implementation>
    </binding>
 </bindings>
--- a/calendar/base/content/calendar-month-view.xml
+++ b/calendar/base/content/calendar-month-view.xml
@@ -1,23 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/.
--->
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!-- Note that this file depends on helper functions in calUtils.js-->
 
 <!DOCTYPE bindings SYSTEM "chrome://global/locale/global.dtd" >
 
 <bindings id="calendar-month-view-bindings"
-  xmlns="http://www.mozilla.org/xbl"
-  xmlns:html="http://www.w3.org/1999/xhtml"
-  xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-  xmlns:xbl="http://www.mozilla.org/xbl">
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="calendar-month-day-box-item" extends="chrome://calendar/content/calendar-view-core.xml#calendar-editable-item">
     <content mousethrough="never" tooltip="itemTooltip">
       <xul:vbox flex="1">
         <xul:hbox>
           <xul:box anonid="event-container"
                    class="calendar-color-box"
                    xbl:inherits="calendar-uri,calendar-id"
@@ -69,49 +68,49 @@
             </xul:box>
           </xul:box>
         </xul:hbox>
       </xul:vbox>
     </content>
     <implementation>
       <property name="occurrence">
         <getter><![CDATA[
-            return this.mOccurrence;
+          return this.mOccurrence;
         ]]></getter>
         <setter><![CDATA[
           ASSERT(!this.mOccurrence, "Code changes needed to set the occurrence twice", true);
           this.mOccurrence = val;
           if (cal.isEvent(val)) {
-            if (!val.startDate.isDate) {
-              let label = document.getAnonymousElementByAttribute(this, "anonid", "item-label");
-              let formatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
-                                        .getService(Components.interfaces.calIDateTimeFormatter);
-              let timezone = this.calendarView ? this.calendarView.mTimezone
-                                               : calendarDefaultTimezone();
-              let parentDate = ensureDateTime(this.parentBox.date);
-              let startTime = val.startDate.getInTimezone(timezone);
-              let endTime = val.endDate.getInTimezone(timezone);
-              let nextDay = parentDate.clone();
-              nextDay.day++;
-              let comp = endTime.compare(nextDay);
-              if (startTime.compare(parentDate) == -1) {
-                if (comp == 1) {
-                  label.value = "↔";
-                } else if (comp == 0) {
-                  label.value = "↤";
-                } else {
-                  label.value = "⇥ " + formatter.formatTime(endTime);
-                }
-              } else if (comp == 1) {
-                label.value = "⇤ " + formatter.formatTime(startTime);
-              } else {
-                label.value = formatter.formatTime(startTime);
+              if (!val.startDate.isDate) {
+                  let label = document.getAnonymousElementByAttribute(this, "anonid", "item-label");
+                  let formatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
+                                            .getService(Components.interfaces.calIDateTimeFormatter);
+                  let timezone = this.calendarView ? this.calendarView.mTimezone
+                                                   : calendarDefaultTimezone();
+                  let parentDate = ensureDateTime(this.parentBox.date);
+                  let startTime = val.startDate.getInTimezone(timezone);
+                  let endTime = val.endDate.getInTimezone(timezone);
+                  let nextDay = parentDate.clone();
+                  nextDay.day++;
+                  let comp = endTime.compare(nextDay);
+                  if (startTime.compare(parentDate) == -1) {
+                      if (comp == 1) {
+                          label.value = "↔";
+                      } else if (comp == 0) {
+                          label.value = "↤";
+                      } else {
+                          label.value = "⇥ " + formatter.formatTime(endTime);
+                      }
+                  } else if (comp == 1) {
+                      label.value = "⇤ " + formatter.formatTime(startTime);
+                  } else {
+                      label.value = formatter.formatTime(startTime);
+                  }
+                  label.setAttribute("time", "true");
               }
-              label.setAttribute("time", "true");
-            }
           }
 
           this.setEditableLabel();
           this.setCSSClasses();
           return val;
         ]]></setter>
       </property>
     </implementation>
@@ -146,95 +145,95 @@
       <property name="date"
                 onget="return this.mDate"
                 onset="this.setDate(val); return val;"/>
 
       <property name="selected">
         <getter><![CDATA[
           let sel = this.getAttribute("selected");
           if (sel && sel == "true") {
-            return true;
+              return true;
           }
 
           return false;
         ]]></getter>
         <setter><![CDATA[
           if (val) {
-            this.setAttribute("selected", "true");
+              this.setAttribute("selected", "true");
           } else {
-            this.removeAttribute("selected");
+              this.removeAttribute("selected");
           }
           return val;
         ]]></setter>
       </property>
 
       <property name="dayitems">
         <getter>return document.getAnonymousElementByAttribute(this, "anonid", "day-items");</getter>
       </property>
 
       <property name="showMonthLabel">
         <getter><![CDATA[
           return this.mShowMonthLabel;
         ]]></getter>
         <setter><![CDATA[
           if (this.mShowMonthLabel == val) {
-            return val;
+              return val;
           }
           this.mShowMonthLabel = val;
 
           if (!this.mDate) {
-            return val;
+              return val;
           }
           if (val) {
-            this.setAttribute("value", getDateFormatter().formatDateWithoutYear(this.mDate));
+              this.setAttribute("value", getDateFormatter().formatDateWithoutYear(this.mDate));
           } else {
-            this.setAttribute("value", this.mDate.day);
+              this.setAttribute("value", this.mDate.day);
           }
           return val;
         ]]></setter>
       </property>
 
       <method name="setDate">
         <parameter name="aDate"/>
         <body><![CDATA[
           if (!aDate) {
-            throw Components.results.NS_ERROR_NULL_POINTER;
+              throw Components.results.NS_ERROR_NULL_POINTER;
           }
 
           // Remove all the old events
           this.mItemHash = {};
           removeChildren(this);
 
           if (this.mDate && this.mDate.compare(aDate) == 0) {
-            return;
+              return;
           }
 
           this.mDate = aDate;
 
           // Set up DOM attributes for custom CSS coloring.
           let weekTitle = cal.getWeekInfoService().getWeekTitle(aDate);
           this.setAttribute("year", aDate.year);
           this.setAttribute("month", aDate.month + 1);
           this.setAttribute("week", weekTitle);
           this.setAttribute("day", aDate.day);
 
           if (this.mShowMonthLabel) {
-             let monthName = calGetString("dateFormat", "month." + (aDate.month + 1) + ".Mmm");
-             this.setAttribute("value", aDate.day + " " + monthName);
+              let monthName = calGetString("dateFormat", "month." + (aDate.month + 1) + ".Mmm");
+              this.setAttribute("value", aDate.day + " " + monthName);
           } else {
-             this.setAttribute("value", aDate.day);
+              this.setAttribute("value", aDate.day);
           }
         ]]></body>
       </method>
 
       <method name="addItem">
         <parameter name="aItem"/>
         <body><![CDATA[
           if (aItem.hashId in this.mItemHash) {
-            this.deleteItem(aItem);
+              this.deleteItem(aItem);
           }
 
           let box = createXULElement("calendar-month-day-box-item");
           let context = this.getAttribute("item-context") ||
                         this.getAttribute("context");
           box.setAttribute("context", context);
           box.setAttribute("calendar-uri", aItem.calendar.uri.spec);
           box.setAttribute("calendar-id", aItem.calendar.id);
@@ -250,37 +249,37 @@
           return box;
         ]]></body>
       </method>
 
       <method name="selectItem">
         <parameter name="aItem"/>
         <body><![CDATA[
           if (aItem.hashId in this.mItemHash) {
-            this.mItemHash[aItem.hashId].selected = true;
+              this.mItemHash[aItem.hashId].selected = true;
           }
         ]]></body>
       </method>
 
       <method name="unselectItem">
         <parameter name="aItem"/>
         <body><![CDATA[
           if (aItem.hashId in this.mItemHash) {
-            this.mItemHash[aItem.hashId].selected = false;
+              this.mItemHash[aItem.hashId].selected = false;
           }
         ]]></body>
       </method>
 
       <method name="deleteItem">
         <parameter name="aItem"/>
         <body><![CDATA[
           if (aItem.hashId in this.mItemHash) {
-            let node = this.mItemHash[aItem.hashId];
-            node.remove();
-            delete this.mItemHash[aItem.hashId];
+              let node = this.mItemHash[aItem.hashId];
+              node.remove();
+              delete this.mItemHash[aItem.hashId];
           }
         ]]></body>
       </method>
 
       <method name="onDropItem">
         <parameter name="aItem"/>
         <body><![CDATA[
           // When item's timezone is different than the default one, the
@@ -299,33 +298,32 @@
               let dayDiff = start.subtractDate(startInDefaultTz);
               // Change the day where to drop the item.
               dayboxDate.addDuration(dayDiff);
           }
 
           return cal.moveItem(aItem, dayboxDate);
         ]]></body>
       </method>
-
     </implementation>
 
     <handlers>
       <handler event="mousedown"><![CDATA[
         event.stopPropagation();
         if (this.mDate) {
-          this.calendarView.selectedDay = this.mDate;
+            this.calendarView.selectedDay = this.mDate;
         }
       ]]></handler>
       <handler event="dblclick"><![CDATA[
         event.stopPropagation();
         this.calendarView.controller.createNewEvent();
       ]]></handler>
       <handler event="click" button="0"><![CDATA[
         if (!(event.ctrlKey || event.metaKey)) {
-          this.calendarView.setSelectedItems(0, []);
+            this.calendarView.setSelectedItems(0, []);
         }
       ]]></handler>
       <handler event="wheel"><![CDATA[
         if (getParentNodeOrThisByAttribute(event.originalTarget, "anonid", "day-label") == null) {
             if (this.dayitems.scrollHeight > this.dayitems.clientHeight) {
                 event.stopPropagation();
             }
         }
@@ -407,38 +405,35 @@
               <xul:calendar-month-day-box/>
             </xul:row>
           </xul:rows>
         </xul:grid>
       </xul:vbox>
     </content>
 
     <implementation implements="calICalendarView">
+      <constructor><![CDATA[
+        Components.utils.import("resource://gre/modules/Preferences.jsm");
+        Components.utils.import("resource://calendar/modules/calViewUtils.jsm");
 
-      <!-- constructor -->
-      <constructor><![CDATA[
-          Components.utils.import("resource://gre/modules/Preferences.jsm");
-          Components.utils.import("resource://calendar/modules/calViewUtils.jsm");
-
-          // Set the preference for the default start of the week
-          this.weekStartOffset = Preferences.get("calendar.week.start", 0);
+        // Set the preference for the default start of the week
+        this.weekStartOffset = Preferences.get("calendar.week.start", 0);
 
-          for (let i = 0; i < 7; i++) {
-              let hdr = createXULElement("calendar-day-label");
-              this.labeldaybox.appendChild(hdr);
-              hdr.weekDay = (i + this.mWeekStartOffset) % 7;
-              hdr.shortWeekNames = false;
-          }
+        for (let i = 0; i < 7; i++) {
+            let hdr = createXULElement("calendar-day-label");
+            this.labeldaybox.appendChild(hdr);
+            hdr.weekDay = (i + this.mWeekStartOffset) % 7;
+            hdr.shortWeekNames = false;
+        }
 
-          // Set the preference for displaying the week number
-          this.mShowWeekNumber = Preferences.get("calendar.view-minimonth.showWeekNumber", true);
+        // Set the preference for displaying the week number
+        this.mShowWeekNumber = Preferences.get("calendar.view-minimonth.showWeekNumber", true);
       ]]></constructor>
 
       <!-- fields -->
-
       <field name="mDateBoxes">null</field>
       <field name="mSelectedDayBox">null</field>
 
       <field name="mShowDaysOutsideMonth">true</field>
       <field name="mShowFullMonth">true</field>
       <field name="mShowWeekNumber">true</field>
 
       <field name="mClickedTime">null</field>
@@ -493,48 +488,48 @@
         ]]></setter>
       </property>
 
       <method name="handlePreference">
         <parameter name="aSubject"/>
         <parameter name="aTopic"/>
         <parameter name="aPreference"/>
         <body><![CDATA[
-           aSubject.QueryInterface(Components.interfaces.nsIPrefBranch);
+          aSubject.QueryInterface(Components.interfaces.nsIPrefBranch);
 
-           switch (aPreference) {
-               case "calendar.previousweeks.inview":
-                   this.updateDaysOffPrefs();
-                   this.refreshView();
-                   break;
+          switch (aPreference) {
+              case "calendar.previousweeks.inview":
+                  this.updateDaysOffPrefs();
+                  this.refreshView();
+                  break;
 
-               case "calendar.week.start":
-                   this.weekStartOffset = aSubject.getIntPref(aPreference);
-                   // Refresh the view so the settings take effect
-                   this.refreshView();
-                   break;
+              case "calendar.week.start":
+                  this.weekStartOffset = aSubject.getIntPref(aPreference);
+                  // Refresh the view so the settings take effect
+                  this.refreshView();
+                  break;
 
-               case "calendar.weeks.inview":
-                   this.weeksInView = aSubject.getIntPref(aPreference);
-                   break;
+              case "calendar.weeks.inview":
+                  this.weeksInView = aSubject.getIntPref(aPreference);
+                  break;
 
-               case "calendar.view-minimonth.showWeekNumber":
-                   this.mShowWeekNumber = aSubject.getBoolPref(aPreference);
-                   if (this.mShowWeekNumber) {
-                       this.refreshView();
-                   } else {
-                       this.hideWeekNumbers();
-                   }
-                   break;
+              case "calendar.view-minimonth.showWeekNumber":
+                  this.mShowWeekNumber = aSubject.getBoolPref(aPreference);
+                  if (this.mShowWeekNumber) {
+                      this.refreshView();
+                  } else {
+                      this.hideWeekNumbers();
+                  }
+                  break;
 
-               default:
-                   this.handleCommonPreference(aSubject, aTopic, aPreference);
-                   break;
-           }
-           return;
+              default:
+                  this.handleCommonPreference(aSubject, aTopic, aPreference);
+                  break;
+          }
+          return;
         ]]></body>
       </method>
 
       <method name="getSelectedItems">
         <parameter name="aCount"/>
         <body><![CDATA[
           aCount.value = this.mSelectedItems.length;
           return this.mSelectedItems;
@@ -575,35 +570,35 @@
       <method name="centerSelectedItems">
         <body>
         </body>
       </method>
 
       <property name="selectedDay">
         <getter><![CDATA[
           if (this.mSelectedDayBox) {
-            return this.mSelectedDayBox.date.clone();
+              return this.mSelectedDayBox.date.clone();
           }
 
           return null;
         ]]></getter>
         <setter><![CDATA[
           if (this.mSelectedDayBox) {
-            this.mSelectedDayBox.selected = false;
+              this.mSelectedDayBox.selected = false;
           }
 
           let realVal = val;
           if (!realVal.isDate) {
-            realVal = val.clone();
-            realVal.isDate = true;
+              realVal = val.clone();
+              realVal.isDate = true;
           }
           let box = this.findDayBoxForDate(realVal);
           if (box) {
-            box.selected = true;
-            this.mSelectedDayBox = box;
+              box.selected = true;
+              this.mSelectedDayBox = box;
           }
           this.fireEvent("dayselect", realVal);
           return val;
         ]]></setter>
       </property>
 
       <property name="selectedDateTime">
         <getter><![CDATA[
@@ -687,44 +682,44 @@
 
         ]]></body>
       </method>
 
       <method name="getDateList">
         <parameter name="aCount"/>
         <body><![CDATA[
           if (!this.mStartDate || !this.mEndDate) {
-            aCount.value = 0;
-            return [];
+              aCount.value = 0;
+              return [];
           }
 
           let results = [];
           let curDate = this.mStartDate.clone();
           curDate.isDate = true;
 
           while (curDate.compare(this.mEndDate) <= 0) {
-            results.push(curDate.clone());
-            curDate.day += 1;
+              results.push(curDate.clone());
+              curDate.day += 1;
           }
           aCount.value = results.length;
           return results;
         ]]></body>
       </method>
 
       <!-- public properties and methods -->
 
       <!-- whether to show days outside of the current month -->
       <property name="showDaysOutsideMonth">
         <getter><![CDATA[
           return this.mShowDaysOutsideMonth;
         ]]></getter>
         <setter><![CDATA[
           if (this.mShowDaysOutsideMonth != val) {
-            this.mShowDaysOutsideMonth = val;
-            this.refresh();
+              this.mShowDaysOutsideMonth = val;
+              this.refresh();
           }
           return val;
         ]]></setter>
       </property>
 
       <!-- private properties and methods -->
 
       <property name="monthgrid" readonly="true"
@@ -732,36 +727,36 @@
 
       <property name="monthgridrows" readonly="true"
                 onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'monthgridrows');"/>
 
       <method name="relayout">
         <body><![CDATA[
           // Adjust headers based on the starting day of the week, if necessary
           if (this.labeldaybox.firstChild.weekDay != this.weekStartOffset) {
-            for (let i = 0; i < this.labeldaybox.childNodes.length; i++) {
-              this.labeldaybox.childNodes[i].weekDay = (i + this.weekStartOffset) % 7;
-            }
+              for (let i = 0; i < this.labeldaybox.childNodes.length; i++) {
+                  this.labeldaybox.childNodes[i].weekDay = (i + this.weekStartOffset) % 7;
+              }
           }
 
           if (this.mSelectedItems.length) {
-            this.mSelectedItems = [];
+              this.mSelectedItems = [];
           }
 
           if (!this.mStartDate || !this.mEndDate) {
-            throw Components.results.NS_ERROR_FAILURE;
+              throw Components.results.NS_ERROR_FAILURE;
           }
 
           // Days that are not in the main month on display are displayed with
           // a gray background.  Unless the month actually starts on a Sunday,
           // this means that mStartDate.month is 1 month less than the main month
           let mainMonth = this.mStartDate.month;
           if (this.mStartDate.day != 1) {
-            mainMonth++;
-            mainMonth = mainMonth % 12;
+              mainMonth++;
+              mainMonth = mainMonth % 12;
           }
 
           let dateBoxes = [];
           let today = this.today();
 
           // This gets set to true, telling us to collapse the rest of the rows
           let finished = false;
           let dateList = this.getDateList({});
@@ -772,111 +767,111 @@
 
           let rows = this.monthgridrows.childNodes;
 
           // Iterate through each monthgridrow and set up the day-boxes that
           // are its child nodes.  Remember, childNodes is not a normal array,
           // so don't use the in operator if you don't want extra properties
           // coming out.
           for (let i = 0; i < rows.length; i++) {
-            let row = rows[i];
-            // If we've already assigned all of the day-boxes that we need, just
-            // collapse the rest of the rows, otherwise expand them if needed.
-            if (finished) {
-              row.setAttribute("collapsed", true);
-              continue;
-            } else {
-              row.removeAttribute("collapsed");
-            }
-            for (let j = 0; j < row.childNodes.length; j++) {
-              let daybox = row.childNodes[j];
-              let date = dateList[dateBoxes.length];
+              let row = rows[i];
+              // If we've already assigned all of the day-boxes that we need, just
+              // collapse the rest of the rows, otherwise expand them if needed.
+              if (finished) {
+                  row.setAttribute("collapsed", true);
+                  continue;
+              } else {
+                  row.removeAttribute("collapsed");
+              }
+              for (let j = 0; j < row.childNodes.length; j++) {
+                  let daybox = row.childNodes[j];
+                  let date = dateList[dateBoxes.length];
 
-              // Remove the attribute "relation" for all the column headers.
-              // Consider only the first row index otherwise it will be
-              // removed again afterwards the correct setting.
-              if (i == 0) {
-                  this.labeldaybox.childNodes[j].removeAttribute("relation");
-              }
+                  // Remove the attribute "relation" for all the column headers.
+                  // Consider only the first row index otherwise it will be
+                  // removed again afterwards the correct setting.
+                  if (i == 0) {
+                      this.labeldaybox.childNodes[j].removeAttribute("relation");
+                  }
 
-              daybox.setAttribute("context", this.getAttribute("context"));
-              daybox.setAttribute("item-context", this.getAttribute("item-context") || this.getAttribute("context"));
+                  daybox.setAttribute("context", this.getAttribute("context"));
+                  daybox.setAttribute("item-context", this.getAttribute("item-context") || this.getAttribute("context"));
 
-              // Set the box-class depending on if this box displays a day in
-              // the month being currently shown or not.
-              let boxClass;
-              if (this.showFullMonth) {
-                  boxClass = "calendar-month-day-box-" +
-                             (mainMonth == date.month ? "current-month" : "other-month");
-              } else {
-                  boxClass = "calendar-month-day-box-current-month";
-              }
-              if (this.mDaysOffArray.some(dayOffNum => dayOffNum == date.weekday)) {
-                boxClass = "calendar-month-day-box-day-off " + boxClass;
-              }
+                  // Set the box-class depending on if this box displays a day in
+                  // the month being currently shown or not.
+                  let boxClass;
+                  if (this.showFullMonth) {
+                      boxClass = "calendar-month-day-box-" +
+                                 (mainMonth == date.month ? "current-month" : "other-month");
+                  } else {
+                      boxClass = "calendar-month-day-box-current-month";
+                  }
+                  if (this.mDaysOffArray.some(dayOffNum => dayOffNum == date.weekday)) {
+                      boxClass = "calendar-month-day-box-day-off " + boxClass;
+                  }
 
-              // Set up date relations
-              switch (date.compare(today)) {
-                  case -1:
-                      daybox.setAttribute("relation", "past");
-                      break;
-                  case 0:
-                      daybox.setAttribute("relation", "today");
-                      this.labeldaybox.childNodes[j].setAttribute("relation", "today");
-                      break;
-                  case 1:
-                      daybox.setAttribute("relation", "future");
-                      break;
-              }
-
-              // Set up label with the week number in the first day of the row.
-              if (this.mShowWeekNumber) {
-                let weekLabel = document.getAnonymousElementByAttribute(daybox, "anonid", "week-label");
-                if (weekLabelColumnPos < 0) {
-                  let isDayOff = this.mDaysOffArray.includes((j + this.mWeekStartOffset) % 7);
-                  if (this.mDisplayDaysOff || !isDayOff) {
-                    weekLabelColumnPos = j;
+                  // Set up date relations
+                  switch (date.compare(today)) {
+                      case -1:
+                          daybox.setAttribute("relation", "past");
+                          break;
+                      case 0:
+                          daybox.setAttribute("relation", "today");
+                          this.labeldaybox.childNodes[j].setAttribute("relation", "today");
+                          break;
+                      case 1:
+                          daybox.setAttribute("relation", "future");
+                          break;
                   }
-                }
-                // Build and set the label.
-                if (j == weekLabelColumnPos) {
-                  weekLabel.removeAttribute("hidden");
-                  let weekNumber = cal.getWeekInfoService().getWeekTitle(date);
-                  let weekString = cal.calGetString("calendar", "abbreviationOfWeek", [weekNumber]);
-                  weekLabel.value = weekString;
-                } else {
-                  weekLabel.hidden = true;
-                }
-              }
-
-              daybox.setAttribute("class", boxClass);
 
-              daybox.setDate(date);
-              if (date.day == 1 || date.day == date.endOfMonth.day) {
-                daybox.showMonthLabel = true;
-              } else {
-                daybox.showMonthLabel = false;
+                  // Set up label with the week number in the first day of the row.
+                  if (this.mShowWeekNumber) {
+                      let weekLabel = document.getAnonymousElementByAttribute(daybox, "anonid", "week-label");
+                      if (weekLabelColumnPos < 0) {
+                          let isDayOff = this.mDaysOffArray.includes((j + this.mWeekStartOffset) % 7);
+                          if (this.mDisplayDaysOff || !isDayOff) {
+                              weekLabelColumnPos = j;
+                          }
+                      }
+                      // Build and set the label.
+                      if (j == weekLabelColumnPos) {
+                          weekLabel.removeAttribute("hidden");
+                          let weekNumber = cal.getWeekInfoService().getWeekTitle(date);
+                          let weekString = cal.calGetString("calendar", "abbreviationOfWeek", [weekNumber]);
+                          weekLabel.value = weekString;
+                      } else {
+                          weekLabel.hidden = true;
+                      }
+                  }
+
+                  daybox.setAttribute("class", boxClass);
+
+                  daybox.setDate(date);
+                  if (date.day == 1 || date.day == date.endOfMonth.day) {
+                      daybox.showMonthLabel = true;
+                  } else {
+                      daybox.showMonthLabel = false;
+                  }
+                  daybox.calendarView = this;
+                  daybox.date = date;
+                  dateBoxes.push(daybox);
+
+                  // If we've now assigned all of our dates, set this to true so we
+                  // know we can just collapse the rest of the rows.
+                  if (dateBoxes.length == dateList.length) {
+                      finished = true;
+                  }
               }
-              daybox.calendarView = this;
-              daybox.date = date;
-              dateBoxes.push(daybox);
-
-              // If we've now assigned all of our dates, set this to true so we
-              // know we can just collapse the rest of the rows.
-              if (dateBoxes.length == dateList.length) {
-                finished = true;
-              }
-            }
           }
 
           // If we're not showing a full month, then add a few extra labels to
           // help the user orient themselves in the view.
           if (!this.mShowFullMonth) {
-            dateBoxes[0].showMonthLabel = true;
-            dateBoxes[dateBoxes.length - 1].showMonthLabel = true;
+              dateBoxes[0].showMonthLabel = true;
+              dateBoxes[dateBoxes.length - 1].showMonthLabel = true;
           }
 
           // Store these, so that we can access them later
           this.mDateBoxes = dateBoxes;
           this.hideDaysOff();
 
           this.adjustWeekdayLength();
 
@@ -902,49 +897,49 @@
           this.mToggleStatus = toggleStatus;
         ]]></body>
       </method>
 
       <method name="hideWeekNumbers">
         <body><![CDATA[
           let rows = this.monthgridrows.childNodes;
           for (let i = 0; i < rows.length; i++) {
-            let row = rows[i];
-            for (let j = 0; j < row.childNodes.length; j++) {
-              let daybox = row.childNodes[j];
-              let weekLabel = document.getAnonymousElementByAttribute(daybox, "anonid", "week-label");
-              weekLabel.hidden = true;
-            }
+              let row = rows[i];
+              for (let j = 0; j < row.childNodes.length; j++) {
+                  let daybox = row.childNodes[j];
+                  let weekLabel = document.getAnonymousElementByAttribute(daybox, "anonid", "week-label");
+                  weekLabel.hidden = true;
+              }
           }
         ]]></body>
       </method>
 
       <method name="hideDaysOff">
         <body><![CDATA[
           let columns = document.getAnonymousElementByAttribute(this, "anonid", "monthgridcolumns").childNodes;
           let headerkids = document.getAnonymousElementByAttribute(this, "anonid", "labeldaybox").childNodes;
           for (let i = 0; i < columns.length; i++) {
-            let dayForColumn = (i + this.mWeekStartOffset) % 7;
-            let dayOff = this.mDaysOffArray.includes(dayForColumn);
-            columns[i].collapsed = dayOff && !this.mDisplayDaysOff;
-            headerkids[i].collapsed = dayOff && !this.mDisplayDaysOff;
+              let dayForColumn = (i + this.mWeekStartOffset) % 7;
+              let dayOff = this.mDaysOffArray.includes(dayForColumn);
+              columns[i].collapsed = dayOff && !this.mDisplayDaysOff;
+              headerkids[i].collapsed = dayOff && !this.mDisplayDaysOff;
           }
         ]]></body>
       </method>
 
       <method name="findDayBoxForDate">
         <parameter name="aDate"/>
         <body><![CDATA[
           if (!this.mDateBoxes) {
-            return null;
+              return null;
           }
           for (let box of this.mDateBoxes) {
-            if (box.mDate.compare(aDate) == 0) {
-              return box;
-            }
+              if (box.mDate.compare(aDate) == 0) {
+                  return box;
+              }
           }
           return null;
         ]]></body>
       </method>
 
       <method name="findDayBoxesForItem">
         <parameter name="aItem"/>
         <body><![CDATA[
@@ -964,47 +959,47 @@
               }
           }
 
           if (!targetDate) {
               return boxes;
           }
 
           if (!finishDate) {
-            let maybeBox = this.findDayBoxForDate(targetDate);
-            if (maybeBox) {
-              boxes.push(maybeBox);
-            }
-            return boxes;
+              let maybeBox = this.findDayBoxForDate(targetDate);
+              if (maybeBox) {
+                  boxes.push(maybeBox);
+              }
+              return boxes;
           }
 
           if (!targetDate.isDate) {
-            // Reset the time to 00:00, so that we really get all the boxes
-            targetDate.hour = 0;
-            targetDate.minute = 0;
-            targetDate.second = 0;
+              // Reset the time to 00:00, so that we really get all the boxes
+              targetDate.hour = 0;
+              targetDate.minute = 0;
+              targetDate.second = 0;
           }
 
           if (targetDate.compare(finishDate) == 0) {
               // We have also to handle zero length events in particular for
               // tasks without entry or due date.
               let box = this.findDayBoxForDate(targetDate);
               if (box) {
                   boxes.push(box);
               }
           }
 
           while (targetDate.compare(finishDate) == -1) {
-            let box = this.findDayBoxForDate(targetDate);
+              let box = this.findDayBoxForDate(targetDate);
 
-            // This might not exist, if the event spans the view start or end
-            if (box) {
-                boxes.push(box);
-            }
-            targetDate.day += 1;
+              // This might not exist, if the event spans the view start or end
+              if (box) {
+                  boxes.push(box);
+              }
+              targetDate.day += 1;
           }
 
           return boxes;
 	]]></body>
       </method>
 
       <method name="doAddItem">
         <parameter name="aItem"/>
@@ -1047,65 +1042,65 @@
           }
         ]]></body>
       </method>
 
       <method name="deleteItemsFromCalendar">
         <parameter name="aCalendar"/>
         <body><![CDATA[
           if (!this.mDateBoxes) {
-            return;
+              return;
           }
           for (let box of this.mDateBoxes) {
-            for (let id in box.mItemHash) {
-              let node = box.mItemHash[id];
-              let item = node.item;
-              if (item.calendar.id == aCalendar.id) {
-                box.deleteItem(item);
+              for (let id in box.mItemHash) {
+                  let node = box.mItemHash[id];
+                  let item = node.item;
+                  if (item.calendar.id == aCalendar.id) {
+                      box.deleteItem(item);
+                  }
               }
-            }
           }
         ]]></body>
       </method>
 
       <method name="flashAlarm">
         <parameter name="aAlarmItem"/>
         <parameter name="aStop"/>
         <body><![CDATA[
           let showIndicator = Preferences.get("calendar.alarms.indicator.show", true);
           let totaltime = Preferences.get("calendar.alarms.indicator.totaltime", 3600);
 
           if (!aStop && (!showIndicator || totaltime < 1)) {
-            // No need to animate if the indicator should not be shown.
-            return;
+              // No need to animate if the indicator should not be shown.
+              return;
           }
 
           // Make sure the flashing attribute is set or reset on all visible
           // boxes.
           let boxes = this.findDayBoxesForItem(aAlarmItem);
           for (let box of boxes) {
-            for (let id in box.mItemHash) {
-              let itemData = box.mItemHash[id];
-              if (itemData.item.hasSameIds(aAlarmItem)) {
-                if (aStop) {
-                  itemData.removeAttribute("flashing");
-                } else {
-                  itemData.setAttribute("flashing", "true");
-                }
+              for (let id in box.mItemHash) {
+                  let itemData = box.mItemHash[id];
+                  if (itemData.item.hasSameIds(aAlarmItem)) {
+                      if (aStop) {
+                          itemData.removeAttribute("flashing");
+                      } else {
+                          itemData.setAttribute("flashing", "true");
+                      }
+                  }
               }
-            }
           }
 
           if (aStop) {
-            // We are done flashing, prevent newly created event boxes from flashing.
-            delete this.mFlashingEvents[aAlarmItem.hashId];
+              // We are done flashing, prevent newly created event boxes from flashing.
+              delete this.mFlashingEvents[aAlarmItem.hashId];
           } else {
-            // Set up a timer to stop the flashing after the total time.
-            this.mFlashingEvents[aAlarmItem.hashId] = aAlarmItem;
-            setTimeout(() => this.flashAlarm(aAlarmItem, true), totaltime);
+              // Set up a timer to stop the flashing after the total time.
+              this.mFlashingEvents[aAlarmItem.hashId] = aAlarmItem;
+              setTimeout(() => this.flashAlarm(aAlarmItem, true), totaltime);
           }
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
       <handler event="wheel"><![CDATA[
         const pixelThreshold = 150;
@@ -1133,11 +1128,10 @@
             }
 
             if (deltaView != 0) {
                 this.moveView(deltaView);
             }
         }
       ]]></handler>
     </handlers>
-
   </binding>
 </bindings>
--- a/calendar/base/content/calendar-multiday-view.xml
+++ b/calendar/base/content/calendar-multiday-view.xml
@@ -1,13 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/.
--->
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!-- Note that this file depends on helper functions in calUtils.js-->
 
 <!DOCTYPE bindings SYSTEM "chrome://global/locale/global.dtd" >
 
 <bindings id="calendar-multiday-view-bindings"
   xmlns="http://www.mozilla.org/xbl"
   xmlns:html="http://www.w3.org/1999/xhtml"
@@ -85,18 +84,18 @@
               this.relayout();
           }
 
           return ret;
         ]]></body>
       </method>
 
       <property name="pixelsPerMinute"
-        onget="return this.mPixPerMin"
-        onset="if (this.mPixPerMin != val) { this.mPixPerMin = val; this.relayout(); } return val;"/>
+                onget="return this.mPixPerMin"
+                onset="if (this.mPixPerMin != val) { this.mPixPerMin = val; this.relayout(); } return val;"/>
 
       <method name="relayout">
         <body><![CDATA[
           let topbox = document.getAnonymousElementByAttribute(this, "anonid", "topbox");
           let orient = topbox.getAttribute("orient");
 
           function makeTimeBox(timestr, size) {
               let box = createXULElement("box");
@@ -174,24 +173,24 @@
   </binding>
 
   <!--
      - A simple gripbar that is displayed at the start and end of an
      - event box.  Needs to handle being dragged and resizing the
      - event, thus changing its start/end time.
     -->
   <binding id="calendar-event-gripbar">
-     <content>
-       <xul:box anonid="thebox"
-                flex="1"
-                pack="center"
-                xbl:inherits="align=whichside">
-         <xul:image xbl:inherits="class"/>
-       </xul:box>
-     </content>
+    <content>
+      <xul:box anonid="thebox"
+               flex="1"
+               pack="center"
+               xbl:inherits="align=whichside">
+        <xul:image xbl:inherits="class"/>
+      </xul:box>
+    </content>
 
     <implementation>
       <property name="parentorient">
         <getter><![CDATA[
           return this.getAttribute("parentorient");
         ]]></getter>
         <setter><![CDATA[
           let thebox = document.getAnonymousElementByAttribute(this, "anonid", "thebox");
@@ -308,25 +307,25 @@
       <field name="mSelected">false</field>
       <property name="selected">
         <getter><![CDATA[
           return this.mSelected;
         ]]></getter>
         <setter><![CDATA[
           this.mSelected = val;
           if (this.bgbox && this.bgbox.hasChildNodes()) {
-            let child = this.bgbox.firstChild;
-            while (child) {
-              if (val) {
-                child.setAttribute("selected", "true");
-              } else {
-                child.removeAttribute("selected");
+              let child = this.bgbox.firstChild;
+              while (child) {
+                  if (val) {
+                      child.setAttribute("selected", "true");
+                  } else {
+                      child.removeAttribute("selected");
+                  }
+                  child = child.nextSibling;
               }
-              child = child.nextSibling;
-            }
           }
           return val;
         ]]></setter>
       </property>
 
       <property name="date">
         <getter><![CDATA[
           return this.mDate;
@@ -341,40 +340,34 @@
               }
           }
 
           return val;
         ]]></setter>
       </property>
 
       <property name="calendarView"
-        onget="return this.mCalendarView;"
-        onset="return (this.mCalendarView = val);" />
-
-      <property
-        name="topbox"
-        readonly="true">
+                onget="return this.mCalendarView;"
+                onset="return (this.mCalendarView = val);" />
+
+      <property name="topbox" readonly="true">
         <getter><![CDATA[
           return document.getAnonymousElementByAttribute(this, "anonid", "topbox");
         ]]></getter>
       </property>
 
-      <property
-        name="bgbox"
-        readonly="true">
+      <property name="bgbox" readonly="true">
         <getter><![CDATA[
           return document.getAnonymousElementByAttribute(this, "anonid", "bgbox");
         ]]></getter>
       </property>
 
       <field name="mFgboxes">null</field>
       <field name="mMinDuration">null</field>
-      <property
-        name="fgboxes"
-        readonly="true">
+      <property name="fgboxes" readonly="true">
         <getter><![CDATA[
           if (this.mFgboxes == null) {
               this.mFgboxes = {
                   box: document.getAnonymousElementByAttribute(this, "anonid", "fgbox"),
                   dragbox: document.getAnonymousElementByAttribute(this, "anonid", "fgdragbox"),
                   dragspacer: document.getAnonymousElementByAttribute(this, "anonid", "fgdragspacer"),
                   startlabel: document.getAnonymousElementByAttribute(this, "anonid", "fgdragbox-startlabel"),
                   endlabel: document.getAnonymousElementByAttribute(this, "anonid", "fgdragbox-endlabel")
@@ -386,20 +379,17 @@
 
       <property name="timeIndicatorBox"
         readonly="true">
         <getter><![CDATA[
           return document.getAnonymousElementByAttribute(this, "anonid", "timeIndicatorBox");
         ]]></getter>
       </property>
 
-      <property
-        name="events"
-        readonly="true"
-        onget="return this.methods"/>
+      <property name="events" readonly="true" onget="return this.methods"/>
 
       <field name="mDayOff">false</field>
       <property name="dayOff">
         <getter><![CDATA[
           return this.mDayOff;
         ]]></getter>
         <setter><![CDATA[
           this.mDayOff = val;
@@ -481,36 +471,36 @@
 
           return ret;
         ]]></body>
       </method>
 
       <method name="internalDeleteEvent">
         <parameter name="aOccurrence"/>
         <body><![CDATA[
-           let itemIndex = -1;
-           let occ;
-           for (let i in this.mEventInfos) {
-               occ = this.mEventInfos[i].event;
-               if (occ.hashId == aOccurrence.hashId) {
-                   itemIndex = i;
-                   break;
-               }
-           }
-
-           if (itemIndex == -1) {
-               return false;
-           } else {
-               delete this.mSelectedItemIds[occ.hashId];
-               this.mSelectedChunks = this.mSelectedChunks.filter((item) => {
-                   return !item.occurrence || (item.occurrence.hashId != aOccurrence.hashId);
-               });
-               this.mEventInfos.splice(itemIndex, 1);
-               return true;
-           }
+          let itemIndex = -1;
+          let occ;
+          for (let i in this.mEventInfos) {
+              occ = this.mEventInfos[i].event;
+              if (occ.hashId == aOccurrence.hashId) {
+                  itemIndex = i;
+                  break;
+              }
+          }
+
+          if (itemIndex == -1) {
+              return false;
+          } else {
+              delete this.mSelectedItemIds[occ.hashId];
+              this.mSelectedChunks = this.mSelectedChunks.filter((item) => {
+                  return !item.occurrence || (item.occurrence.hashId != aOccurrence.hashId);
+              });
+              this.mEventInfos.splice(itemIndex, 1);
+              return true;
+          }
         ]]></body>
       </method>
 
       <method name="recalculateStartEndMinutes">
         <body><![CDATA[
           for (let chunk of this.mEventInfos) {
               let mins = this.getStartEndMinutesForOccurrence(chunk.event);
               chunk.startMinute = mins.start;
@@ -523,101 +513,101 @@
 
       <!-- This function returns the start and end minutes of the occurrence
            part in the day of this column, moreover, the real start and end
            minutes of the whole occurrence (which could span multiple days)
            relative to the time 0:00 of the day in this column -->
       <method name="getStartEndMinutesForOccurrence">
         <parameter name="aOccurrence"/>
         <body><![CDATA[
-           let stdate = aOccurrence.startDate || aOccurrence.entryDate || aOccurrence.dueDate;
-           let enddate = aOccurrence.endDate || aOccurrence.dueDate || aOccurrence.entryDate;
-
-           if (!compareObjects(stdate.timezone, this.mTimezone)) {
-               stdate = stdate.getInTimezone(this.mTimezone);
-           }
-
-           if (!compareObjects(enddate.timezone, this.mTimezone)) {
-               enddate = enddate.getInTimezone(this.mTimezone);
-           }
-
-           let startHour = stdate.hour;
-           let startMinute = stdate.minute;
-           let endHour = enddate.hour;
-           let endMinute = enddate.minute;
-
-           // Handle cases where an event begins or ends on a day other than this
-           if (stdate.compare(this.mDate) == -1) {
-               startHour = 0;
-               startMinute = 0;
-           }
-           if (enddate.compare(this.mDate) == 1) {
-               endHour = 24;
-               endMinute = 0;
-           }
-
-           // For occurrences that span multiple days, we figure out the real
-           // occurrence start and end minutes relative to the date of this
-           // column and time 0:00
-           let durend = enddate.subtractDate(this.mDate);
-           let durstart = stdate.subtractDate(this.mDate);
-           // 'durend' is always positive, instead 'durstart' might be negative
-           // if the event starts one or more days before the date of this column
-           let realStart_ = (durstart.days * 24 + durstart.hours) * 60 + durstart.minutes;
-           realStart_ = durstart.isNegative ? -1 * realStart_ : realStart_;
-           let realEnd_ = (durend.days * 24 + durend.hours) * 60 + durend.minutes;
-
-           return {
-               start: startHour * 60 + startMinute,
-               end: endHour * 60 + endMinute,
-               realStart: realStart_,
-               realEnd: realEnd_
-           };
+          let stdate = aOccurrence.startDate || aOccurrence.entryDate || aOccurrence.dueDate;
+          let enddate = aOccurrence.endDate || aOccurrence.dueDate || aOccurrence.entryDate;
+
+          if (!compareObjects(stdate.timezone, this.mTimezone)) {
+              stdate = stdate.getInTimezone(this.mTimezone);
+          }
+
+          if (!compareObjects(enddate.timezone, this.mTimezone)) {
+              enddate = enddate.getInTimezone(this.mTimezone);
+          }
+
+          let startHour = stdate.hour;
+          let startMinute = stdate.minute;
+          let endHour = enddate.hour;
+          let endMinute = enddate.minute;
+
+          // Handle cases where an event begins or ends on a day other than this
+          if (stdate.compare(this.mDate) == -1) {
+              startHour = 0;
+              startMinute = 0;
+          }
+          if (enddate.compare(this.mDate) == 1) {
+              endHour = 24;
+              endMinute = 0;
+          }
+
+          // For occurrences that span multiple days, we figure out the real
+          // occurrence start and end minutes relative to the date of this
+          // column and time 0:00
+          let durend = enddate.subtractDate(this.mDate);
+          let durstart = stdate.subtractDate(this.mDate);
+          // 'durend' is always positive, instead 'durstart' might be negative
+          // if the event starts one or more days before the date of this column
+          let realStart_ = (durstart.days * 24 + durstart.hours) * 60 + durstart.minutes;
+          realStart_ = durstart.isNegative ? -1 * realStart_ : realStart_;
+          let realEnd_ = (durend.days * 24 + durend.hours) * 60 + durend.minutes;
+
+          return {
+              start: startHour * 60 + startMinute,
+              end: endHour * 60 + endMinute,
+              realStart: realStart_,
+              realEnd: realEnd_
+          };
         ]]></body>
       </method>
 
       <method name="createChunk">
         <parameter name="aOccurrence"/>
         <body><![CDATA[
-           let mins = this.getStartEndMinutesForOccurrence(aOccurrence);
-
-           let chunk = {
-               startMinute: mins.start,
-               endMinute: mins.end,
-               event: aOccurrence
-           };
-           return chunk;
+          let mins = this.getStartEndMinutesForOccurrence(aOccurrence);
+
+          let chunk = {
+              startMinute: mins.start,
+              endMinute: mins.end,
+              event: aOccurrence
+          };
+          return chunk;
         ]]></body>
       </method>
 
       <method name="addEvent">
         <parameter name="aOccurrence"/>
         <body><![CDATA[
-           this.internalDeleteEvent(aOccurrence);
-
-           let chunk = this.createChunk(aOccurrence);
-           this.mEventInfos.push(chunk);
-           if (this.mEventMapTimeout) {
-               clearTimeout(this.mEventMapTimeout);
-           }
-
-           if (this.mCreatedNewEvent) {
-               this.mEventToEdit = aOccurrence;
-           }
-
-           this.mEventMapTimeout = setTimeout(() => this.relayout(), 5);
+          this.internalDeleteEvent(aOccurrence);
+
+          let chunk = this.createChunk(aOccurrence);
+          this.mEventInfos.push(chunk);
+          if (this.mEventMapTimeout) {
+              clearTimeout(this.mEventMapTimeout);
+          }
+
+          if (this.mCreatedNewEvent) {
+              this.mEventToEdit = aOccurrence;
+          }
+
+          this.mEventMapTimeout = setTimeout(() => this.relayout(), 5);
         ]]></body>
       </method>
 
       <method name="deleteEvent">
         <parameter name="aOccurrence"/>
         <body><![CDATA[
-           if (this.internalDeleteEvent(aOccurrence)) {
-               this.relayout();
-           }
+          if (this.internalDeleteEvent(aOccurrence)) {
+              this.relayout();
+          }
         ]]></body>
       </method>
 
       <method name="clear">
         <body><![CDATA[
           while (this.bgbox && this.bgbox.hasChildNodes()) {
               this.bgbox.lastChild.remove();
           }
@@ -629,17 +619,16 @@
           }
           this.mHandlersToRemove = [];
           this.mSelectedChunks = [];
         ]]></body>
       </method>
 
       <method name="relayout">
         <body><![CDATA[
-
           if (this.mLayoutBatchCount > 0) {
               return;
           }
           this.clear();
 
           let orient = this.getAttribute("orient");
           this.bgbox.setAttribute("orient", orient);
 
@@ -894,19 +883,19 @@
               let start = item.startDate || item.entryDate || item.dueDate;
               start = start.getInTimezone(this.mTimezone);
               aEventInfo.layoutStart = start;
               let end = item.endDate || item.dueDate || item.entryDate;
               end = end.getInTimezone(this.mTimezone);
               let secEnd = start.clone();
               secEnd.addDuration(this.mMinDuration);
               if (secEnd.nativeTime > end.nativeTime) {
-                   aEventInfo.layoutEnd = secEnd;
+                  aEventInfo.layoutEnd = secEnd;
               } else {
-                   aEventInfo.layoutEnd = end;
+                  aEventInfo.layoutEnd = end;
               }
               return aEventInfo;
           });
           this.mEventInfos.sort(sortByStart);
 
           // The end time of the last ending event in the entire blob
           let latestItemEnd;
 
@@ -926,17 +915,17 @@
            */
           for (let i in this.mEventInfos) {
               let curItemInfo = {
                   event: this.mEventInfos[i].event,
                   layoutStart: this.mEventInfos[i].layoutStart,
                   layoutEnd: this.mEventInfos[i].layoutEnd
               };
               if (!latestItemEnd) {
-                 latestItemEnd = curItemInfo.layoutEnd;
+                  latestItemEnd = curItemInfo.layoutEnd;
               }
               if (currentBlob.length && latestItemEnd &&
                   curItemInfo.layoutStart.compare(latestItemEnd) != -1) {
                   // We're done with this current blob because item starts
                   // after the last event in the current blob ended.
                   blobs.push({ blob: currentBlob, totalCols: colEndArray.length });
 
                   // Reset our variables
@@ -1102,16 +1091,17 @@
           // Add the last blob
           blobs.push({
               blob: currentBlob,
               totalCols: colEndArray.length
           });
           return this.setupBoxStructure(blobs);
         ]]></body>
       </method>
+
       <method name="setupBoxStructure">
         <parameter name="aBlobs"/>
         <body><![CDATA[
           // This is actually going to end up being a 3-d array
           // 1st dimension: "layers", sets of columns of events that all
           //                should have equal width*
           // 2nd dimension: "columns", individual columns of non-conflicting
           //                items
@@ -1242,38 +1232,38 @@
           return layers;
         ]]></body>
       </method>
 
       <method name="getShadowElements">
         <parameter name="aStart"/>
         <parameter name="aEnd"/>
         <body><![CDATA[
-            // aStart and aEnd are start and end minutes of the occurrence
-            // from time 0:00 of the dragging column
-            let shadows = 1;
-            let offset = 0;
-            let startMin;
-            if (aStart < 0) {
-                shadows += Math.ceil(Math.abs(aStart) / this.mEndMin);
-                offset = shadows - 1;
-                let reminder = Math.abs(aStart) % this.mEndMin;
-                startMin = this.mEndMin - (reminder ? reminder : this.mEndMin);
-            } else {
-                startMin = aStart;
-            }
-            shadows += Math.floor(aEnd / this.mEndMin);
-
-            // return values needed to build the shadows while dragging
-            return {
-                shadows: shadows,             // number of shadows
-                offset: offset,               // Offset first<->selected shadows
-                startMin: startMin,           // First shadow start minute
-                endMin: aEnd % this.mEndMin   // Last shadow end minute
-            };
+          // aStart and aEnd are start and end minutes of the occurrence
+          // from time 0:00 of the dragging column
+          let shadows = 1;
+          let offset = 0;
+          let startMin;
+          if (aStart < 0) {
+              shadows += Math.ceil(Math.abs(aStart) / this.mEndMin);
+              offset = shadows - 1;
+              let reminder = Math.abs(aStart) % this.mEndMin;
+              startMin = this.mEndMin - (reminder ? reminder : this.mEndMin);
+          } else {
+              startMin = aStart;
+          }
+          shadows += Math.floor(aEnd / this.mEndMin);
+
+          // return values needed to build the shadows while dragging
+          return {
+              shadows: shadows,             // number of shadows
+              offset: offset,               // Offset first<->selected shadows
+              startMin: startMin,           // First shadow start minute
+              endMin: aEnd % this.mEndMin   // Last shadow end minute
+          };
         ]]></body>
       </method>
 
       <method name="firstLastShadowColumns">
         <parameter name="aOffset"/>
         <parameter name="aShadows"/>
         <body><![CDATA[
           let firstCol = this; // eslint-disable-line consistent-this
@@ -1405,18 +1395,18 @@
               diffStart = event.clientY - scrollbox.boxObject.y;
               diffEnd = scrollbox.boxObject.y + scrollbox.boxObject.height - event.clientY;
           } else {
               diffStart = event.clientX - scrollbox.boxObject.x;
               diffEnd = scrollbox.boxObject.x + scrollbox.boxObject.width - event.clientX;
           }
 
           const SCROLLZONE = 55;     // Size (pixels) of the top/bottom view where the scroll starts.
-          const MAXTIMEOUT = 250,    // Max and min time interval (ms) between
-                MINTIMEOUT = 30;     // two consecutive scrolls.
+          const MAXTIMEOUT = 250;    // Max and min time interval (ms) between
+          const MINTIMEOUT = 30;     // two consecutive scrolls.
           const SCROLLBYHOUR = 0.33; // Part of hour to move for each scroll.
           let insideScrollZone = 0;
           let pxPerHr = event.target.mPixPerMin * 60;
           let scrollBy = Math.floor(pxPerHr * SCROLLBYHOUR);
           if (diffStart < SCROLLZONE) {
               insideScrollZone = SCROLLZONE - diffStart;
               scrollBy *= -1;
           } else if (diffEnd < SCROLLZONE) {
@@ -1992,23 +1982,22 @@
         ]]></body>
       </method>
 
       <method name="setDayStartEndMinutes">
         <parameter name="aDayStartMin"/>
         <parameter name="aDayEndMin"/>
         <body><![CDATA[
           if (aDayStartMin < this.mStartMin || aDayStartMin > aDayEndMin ||
-            aDayEndMin > this.mEndMin) {
-            throw Components.results.NS_ERROR_INVALID_ARG;
+              aDayEndMin > this.mEndMin) {
+              throw Components.results.NS_ERROR_INVALID_ARG;
           }
-          if (this.mDayStartMin != aDayStartMin ||
-              this.mDayEndMin != aDayEndMin) {
-            this.mDayStartMin = aDayStartMin;
-            this.mDayEndMin = aDayEndMin;
+          if (this.mDayStartMin != aDayStartMin || this.mDayEndMin != aDayEndMin) {
+              this.mDayStartMin = aDayStartMin;
+              this.mDayEndMin = aDayEndMin;
           }
         ]]></body>
       </method>
 
       <method name="getClickedDateTime">
         <parameter name="event"/>
         <body><![CDATA[
           let newStart = this.date.clone();
@@ -2036,18 +2025,18 @@
         if (this.calendarView.controller) {
             let newStart = getClickedDateTime(event);
             this.calendarView.controller.createNewEvent(null, newStart, null);
         }
       ]]></handler>
 
       <handler event="click" button="0"><![CDATA[
         if (!(event.ctrlKey || event.metaKey)) {
-          this.calendarView.setSelectedItems(0, []);
-          this.focus();
+            this.calendarView.setSelectedItems(0, []);
+            this.focus();
         }
       ]]></handler>
 
       <handler event="click" button="2"><![CDATA[
         let newStart = getClickedDateTime(event);
         this.calendarView.selectedDateTime = newStart;
       ]]></handler>
 
@@ -2106,17 +2095,17 @@
         window.addEventListener("mouseup", this.onEventSweepMouseUp, false);
         window.addEventListener("keypress", this.onEventSweepKeypress, false);
       ]]></handler>
     </handlers>
   </binding>
 
   <binding id="calendar-header-container" extends="chrome://calendar/content/widgets/calendar-widgets.xml#dragndropContainer">
     <content xbl:inherits="selected" flex="1" class="calendar-event-column-header">
-        <children/>
+      <children/>
     </content>
 
     <implementation>
       <field name="mItemBoxes">null</field>
       <constructor><![CDATA[
         this.mItemBoxes = [];
       ]]></constructor>
 
@@ -2143,45 +2132,45 @@
         ]]></body>
       </method>
 
       <method name="addEvent">
         <parameter name="aItem"/>
         <body><![CDATA[
           // prevent same items being added
           if (this.mItemBoxes.some(itemBox => itemBox.occurrence.hashId == aItem.hashId)) {
-            return;
+              return;
           }
 
           let itemBox = createXULElement("calendar-editable-item");
           this.appendChild(itemBox);
           itemBox.calendarView = this.calendarView;
           itemBox.occurrence = aItem;
           let ctxt = this.calendarView.getAttribute("item-context") ||
                      this.calendarView.getAttribute("context");
           itemBox.setAttribute("context", ctxt);
 
           if (aItem.hashId in this.calendarView.mFlashingEvents) {
-            itemBox.setAttribute("flashing", "true");
+              itemBox.setAttribute("flashing", "true");
           }
 
           this.mItemBoxes.push(itemBox);
           itemBox.parentBox = this;
         ]]></body>
       </method>
 
       <method name="deleteEvent">
         <parameter name="aItem"/>
         <body><![CDATA[
           for (let i in this.mItemBoxes) {
-            if (this.mItemBoxes[i].occurrence.hashId == aItem.hashId) {
-              this.mItemBoxes[i].remove();
-              this.mItemBoxes.splice(i, 1);
-              break;
-            }
+              if (this.mItemBoxes[i].occurrence.hashId == aItem.hashId) {
+                  this.mItemBoxes[i].remove();
+                  this.mItemBoxes.splice(i, 1);
+                  break;
+              }
           }
         ]]></body>
       </method>
 
       <method name="onDropItem">
         <parameter name="aItem"/>
         <body><![CDATA[
          let newItem = cal.moveItem(aItem, this.mDate);
@@ -2189,45 +2178,45 @@
          return newItem;
         ]]></body>
       </method>
 
       <method name="selectOccurrence">
         <parameter name="aItem"/>
         <body><![CDATA[
           for (let itemBox of this.mItemBoxes) {
-            if (aItem && (itemBox.occurrence.hashId == aItem.hashId)) {
-              itemBox.selected = true;
-            }
+              if (aItem && (itemBox.occurrence.hashId == aItem.hashId)) {
+                  itemBox.selected = true;
+              }
           }
         ]]></body>
       </method>
       <method name="unselectOccurrence">
         <parameter name="aItem"/>
         <body><![CDATA[
           for (let itemBox of this.mItemBoxes) {
-            if (aItem && (itemBox.occurrence.hashId == aItem.hashId)) {
-              itemBox.selected = false;
-            }
+              if (aItem && (itemBox.occurrence.hashId == aItem.hashId)) {
+                  itemBox.selected = false;
+              }
           }
         ]]></body>
       </method>
 
     </implementation>
 
     <handlers>
       <handler event="dblclick" button="0"><![CDATA[
         this.calendarView.controller.createNewEvent(null, this.mDate, null, true);
       ]]></handler>
       <handler event="mousedown"><![CDATA[
         this.calendarView.selectedDay = this.mDate;
       ]]></handler>
       <handler event="click" button="0"><![CDATA[
         if (!(event.ctrlKey || event.metaKey)) {
-          this.calendarView.setSelectedItems(0, []);
+            this.calendarView.setSelectedItems(0, []);
         }
       ]]></handler>
       <handler event="click" button="2"><![CDATA[
         let newStart = this.calendarView.selectedDay.clone();
         newStart.isDate = true;
         this.calendarView.selectedDateTime = newStart;
         event.stopPropagation();
       ]]></handler>
@@ -2249,73 +2238,73 @@
     </handlers>
   </binding>
 
   <!--
      -  An individual event box, to be inserted into a column.
     -->
   <binding id="calendar-event-box" extends="chrome://calendar/content/calendar-view-core.xml#calendar-editable-item">
     <content mousethrough="never" tooltip="itemTooltip">
-        <xul:box xbl:inherits="orient,width,height" flex="1">
-          <xul:box anonid="event-container"
-                   class="calendar-color-box"
-                   xbl:inherits="orient,readonly,flashing,alarm,allday,priority,progress,
-                                 status,calendar,categories,calendar-uri,calendar-id,todoType"
-                   flex="1">
-            <xul:box class="calendar-event-selection" orient="horizontal" flex="1">
-              <xul:stack anonid="eventbox"
-                         align="stretch"
-                         class="calendar-event-box-container"
-                         flex="1"
-                         xbl:inherits="context,parentorient=orient,readonly,flashing,alarm,allday,priority,progress,status,calendar,categories">
-                <xul:hbox class="calendar-event-details"
-                          anonid="calendar-event-details"
-                          align="start">
-                  <xul:image anonid="item-icon"
-                             class="calendar-item-image"
-                             xbl:inherits="progress,allday,itemType,todoType"/>
-                  <xul:description anonid="event-name" class="calendar-event-details-core" flex="1"/>
-                  <xul:textbox anonid="event-name-textbox"
-                               class="plain calendar-event-details-core calendar-event-name-textbox"
-                               flex="1"
-                               hidden="true"
-                               wrap="true"/>
+      <xul:box xbl:inherits="orient,width,height" flex="1">
+        <xul:box anonid="event-container"
+                 class="calendar-color-box"
+                 xbl:inherits="orient,readonly,flashing,alarm,allday,priority,progress,
+                               status,calendar,categories,calendar-uri,calendar-id,todoType"
+                 flex="1">
+          <xul:box class="calendar-event-selection" orient="horizontal" flex="1">
+            <xul:stack anonid="eventbox"
+                       align="stretch"
+                       class="calendar-event-box-container"
+                       flex="1"
+                       xbl:inherits="context,parentorient=orient,readonly,flashing,alarm,allday,priority,progress,status,calendar,categories">
+              <xul:hbox class="calendar-event-details"
+                        anonid="calendar-event-details"
+                        align="start">
+                <xul:image anonid="item-icon"
+                           class="calendar-item-image"
+                           xbl:inherits="progress,allday,itemType,todoType"/>
+                <xul:description anonid="event-name" class="calendar-event-details-core" flex="1"/>
+                <xul:textbox anonid="event-name-textbox"
+                             class="plain calendar-event-details-core calendar-event-name-textbox"
+                             flex="1"
+                             hidden="true"
+                             wrap="true"/>
+              </xul:hbox>
+              <xul:stack mousethrough="always">
+                <xul:calendar-category-box anonid="category-box" xbl:inherits="categories" pack="end" />
+                <xul:hbox align="right">
+                  <xul:hbox anonid="alarm-icons-box"
+                            class="alarm-icons-box"
+                            pack="end"
+                            align="top"
+                            xbl:inherits="flashing"/>
+                  <xul:image anonid="item-classification-box"
+                             class="item-classification-box"
+                             pack="end"/>
                 </xul:hbox>
-                <xul:stack mousethrough="always">
-                  <xul:calendar-category-box anonid="category-box" xbl:inherits="categories" pack="end" />
-                  <xul:hbox align="right">
-                    <xul:hbox anonid="alarm-icons-box"
-                              class="alarm-icons-box"
-                              pack="end"
-                              align="top"
-                              xbl:inherits="flashing"/>
-                    <xul:image anonid="item-classification-box"
-                               class="item-classification-box"
-                               pack="end"/>
-                  </xul:hbox>
-                </xul:stack>
-                <xul:box xbl:inherits="orient">
-                  <xul:calendar-event-gripbar anonid="gripbar1"
-                                              class="calendar-event-box-grippy-top"
-                                              mousethrough="never"
-                                              whichside="start"
-                                              xbl:inherits="parentorient=orient"/>
-                  <xul:spacer mousethrough="always" flex="1"/>
-                  <xul:calendar-event-gripbar anonid="gripbar2"
-                                              class="calendar-event-box-grippy-bottom"
-                                              mousethrough="never"
-                                              whichside="end"
-                                              xbl:inherits="parentorient=orient"/>
-                </xul:box>
-                <!-- Do not insert anything here, otherwise the event boxes will
-                     not be resizable using the gripbars. If you want to insert
-                     additional elements, do so above the box with the gripbars. -->
               </xul:stack>
-            </xul:box>
+              <xul:box xbl:inherits="orient">
+                <xul:calendar-event-gripbar anonid="gripbar1"
+                                            class="calendar-event-box-grippy-top"
+                                            mousethrough="never"
+                                            whichside="start"
+                                            xbl:inherits="parentorient=orient"/>
+                <xul:spacer mousethrough="always" flex="1"/>
+                <xul:calendar-event-gripbar anonid="gripbar2"
+                                            class="calendar-event-box-grippy-bottom"
+                                            mousethrough="never"
+                                            whichside="end"
+                                            xbl:inherits="parentorient=orient"/>
+              </xul:box>
+              <!-- Do not insert anything here, otherwise the event boxes will
+                   not be resizable using the gripbars. If you want to insert
+                   additional elements, do so above the box with the gripbars. -->
+            </xul:stack>
           </xul:box>
+        </xul:box>
       </xul:box>
     </content>
 
     <implementation>
       <constructor><![CDATA[
          this.orient = this.getAttribute("orient");
       ]]></constructor>
 
@@ -2370,44 +2359,44 @@
       </method>
 
       <property name="parentColumn"
         onget="return this.mParentColumn;"
         onset="return (this.mParentColumn = val);"/>
 
       <property name="startMinute" readonly="true">
         <getter><![CDATA[
-            if (!this.mOccurrence) {
-                return 0;
-            }
-            let startDate = this.mOccurrence.startDate || this.mOccurrence.entryDate;
-            return startDate.hour * 60 + startDate.minute;
+          if (!this.mOccurrence) {
+              return 0;
+          }
+          let startDate = this.mOccurrence.startDate || this.mOccurrence.entryDate;
+          return startDate.hour * 60 + startDate.minute;
         ]]></getter>
       </property>
 
       <property name="endMinute" readonly="true">
         <getter><![CDATA[
-            if (!this.mOccurrence) {
-                return 0;
-            }
-            let endDate = this.mOccurrence.endDate || this.mOccurrence.dueDate;
-            return endDate.hour * 60 + endDate.minute;
+          if (!this.mOccurrence) {
+              return 0;
+          }
+          let endDate = this.mOccurrence.endDate || this.mOccurrence.dueDate;
+          return endDate.hour * 60 + endDate.minute;
         ]]></getter>
       </property>
 
       <method name="setEditableLabel">
         <body><![CDATA[
           let evl = this.eventNameLabel;
           let item = this.mOccurrence;
 
           if (item.title && item.title != "") {
-            // Use <description> textContent so it can wrap.
-            evl.textContent = item.title;
+              // Use <description> textContent so it can wrap.
+              evl.textContent = item.title;
           } else {
-            evl.textContent = calGetString("calendar", "eventUntitled");
+              evl.textContent = calGetString("calendar", "eventUntitled");
           }
 
           let gripbar = document.getAnonymousElementByAttribute(this, "anonid", "gripbar1").boxObject.height;
           let height = document.getAnonymousElementByAttribute(this, "anonid", "eventbox").boxObject.height;
           evl.setAttribute("style", "max-height: " + Math.max(0, height-gripbar * 2) + "px");
         ]]></body>
       </method>
     </implementation>
@@ -2751,54 +2740,55 @@
       <field name="mTimeIndicatorInterval">15</field>
       <field name="mModeHandler">null</field>
       <field name="mTimeIndicatorMinutes">0</field>
 
       <method name="flashAlarm">
         <parameter name="aAlarmItem"/>
         <parameter name="aStop"/>
         <body><![CDATA[
+          // Helper function to save some duplicate code
+          function setFlashingAttribute(aBox) {
+              if (aStop) {
+                  aBox.removeAttribute("flashing");
+              } else {
+                  aBox.setAttribute("flashing", "true");
+              }
+          }
+
           let showIndicator = Preferences.get("calendar.alarms.indicator.show", true);
           let totaltime = Preferences.get("calendar.alarms.indicator.totaltime", 3600);
 
           if (!aStop && (!showIndicator || totaltime < 1)) {
-            // No need to animate if the indicator should not be shown.
-            return;
+              // No need to animate if the indicator should not be shown.
+              return;
           }
 
-          // Helper function to save some duplicate code
-          function setFlashingAttribute(aBox) {
-            if (aStop) {
-              aBox.removeAttribute("flashing");
-            } else {
-              aBox.setAttribute("flashing", "true");
-            }
-          }
 
           // Make sure the flashing attribute is set or reset on all visible
           // boxes.
           let columns = this.findColumnsForItem(aAlarmItem);
           for (let col of columns) {
-            let box = col.column.findChunkForOccurrence(aAlarmItem);
-            if (box && box.eventbox) {
-              setFlashingAttribute(box.eventbox);
-            }
-            box = col.header.findBoxForItem(aAlarmItem);
-            if (box) {
-              setFlashingAttribute(box);
-            }
+              let box = col.column.findChunkForOccurrence(aAlarmItem);
+              if (box && box.eventbox) {
+                  setFlashingAttribute(box.eventbox);
+              }
+              box = col.header.findBoxForItem(aAlarmItem);
+              if (box) {
+                  setFlashingAttribute(box);
+              }
           }
 
           if (aStop) {
-            // We are done flashing, prevent newly created event boxes from flashing.
-            delete this.mFlashingEvents[aAlarmItem.hashId];
+              // We are done flashing, prevent newly created event boxes from flashing.
+              delete this.mFlashingEvents[aAlarmItem.hashId];
           } else {
-            // Set up a timer to stop the flashing after the total time.
-            this.mFlashingEvents[aAlarmItem.hashId] = aAlarmItem;
-            setTimeout(() => this.flashAlarm(aAlarmItem, true), totaltime);
+              // Set up a timer to stop the flashing after the total time.
+              this.mFlashingEvents[aAlarmItem.hashId] = aAlarmItem;
+              setTimeout(() => this.flashAlarm(aAlarmItem, true), totaltime);
           }
         ]]></body>
       </method>
 
       <!-- calICalendarView -->
       <property name="supportsDisjointDates"
         onget="return true"/>
       <property name="hasDisjointDates"
@@ -2846,19 +2836,19 @@
                       return;
                   }
               }
           }
 
           // if we're only showing one date, then continue
           // to only show one date; otherwise, show the week.
           if (this.numVisibleDates == 1) {
-            this.setDateRange(aDate, aDate);
+              this.setDateRange(aDate, aDate);
           } else {
-            this.setDateRange(aDate.startOfWeek, aDate.endOfWeek);
+              this.setDateRange(aDate.startOfWeek, aDate.endOfWeek);
           }
 
           this.selectedDay = targetDate;
         ]]></body>
       </method>
 
       <method name="setDateRange">
         <parameter name="aStartDate"/>
@@ -2912,40 +2902,40 @@
               this.refresh();
           }
         ]]></body>
       </method>
 
       <method name="getDateList">
         <parameter name="aCount"/>
         <body><![CDATA[
-           let dates = [];
-           if (this.mStartDate && this.mEndDate) {
-               let date = this.mStartDate.clone();
-               while (date.compare(this.mEndDate) <= 0) {
-                   dates.push(d.clone());
-                   date.day += 1;
-               }
-           } else if (this.mDateList) {
-               for (let date of this.mDateList) {
-                   dates.push(date.clone());
-               }
-           }
-
-           aCount.value = dates.length;
-           return dates;
+          let dates = [];
+          if (this.mStartDate && this.mEndDate) {
+              let date = this.mStartDate.clone();
+              while (date.compare(this.mEndDate) <= 0) {
+                  dates.push(d.clone());
+                  date.day += 1;
+              }
+          } else if (this.mDateList) {
+              for (let date of this.mDateList) {
+                  dates.push(date.clone());
+              }
+          }
+
+          aCount.value = dates.length;
+          return dates;
         ]]></body>
       </method>
 
       <property name="selectedDateTime">
         <getter><![CDATA[
-            return this.mClickedTime;
+          return this.mClickedTime;
         ]]></getter>
         <setter><![CDATA[
-            this.mClickedTime = val;
+          this.mClickedTime = val;
         ]]></setter>
       </property>
 
       <property name="selectedDay">
         <getter><![CDATA[
           let selected;
           if (this.numVisibleDates == 1) {
               selected = this.mDateColumns[0].date;
@@ -2958,34 +2948,34 @@
           // TODO Make sure the selected day is valid
           // TODO select now if it is in the range?
           return selected;
         ]]></getter>
         <setter><![CDATA[
           // ignore if just 1 visible, it's always selected,
           // but we don't indicate it
           if (this.numVisibleDates == 1) {
-            this.fireEvent("dayselect", val);
-            return val;
+              this.fireEvent("dayselect", val);
+              return val;
           }
 
           if (this.mSelectedDayCol) {
-            this.mSelectedDayCol.column.selected = false;
-            this.mSelectedDayCol.header.removeAttribute("selected");
+              this.mSelectedDayCol.column.selected = false;
+              this.mSelectedDayCol.header.removeAttribute("selected");
           }
 
           if (val) {
-            this.mSelectedDayCol = this.findColumnForDate(val);
-            if (this.mSelectedDayCol) {
-              this.mSelectedDay = this.mSelectedDayCol.date;
-              this.mSelectedDayCol.column.selected = true;
-              this.mSelectedDayCol.header.setAttribute("selected", "true");
-            } else {
-              this.mSelectedDay = val;
-            }
+              this.mSelectedDayCol = this.findColumnForDate(val);
+              if (this.mSelectedDayCol) {
+                  this.mSelectedDay = this.mSelectedDayCol.date;
+                  this.mSelectedDayCol.column.selected = true;
+                  this.mSelectedDayCol.header.setAttribute("selected", "true");
+              } else {
+                  this.mSelectedDay = val;
+              }
           }
           this.fireEvent("dayselect", val);
           return val;
         ]]></setter>
       </property>
 
       <method name="getSelectedItems">
         <parameter name="aCount"/>
@@ -3077,17 +3067,17 @@
                   // if just has single datetime, treat as zero duration item
                   // (such as task with due datetime or start datetime only)
                   occStart = occStart || occEnd;
                   occEnd = occEnd || occStart;
                   // Now both occStart and occEnd are datetimes.
 
                   // skip occurrence if all-day: it won't show in time view.
                   if (occStart.isDate || occEnd.isDate) {
-                     continue;
+                      continue;
                   }
 
                   // Trim dates to view.  (Not mutated so just reuse view dates)
                   if (this.startDate.compare(occStart) > 0) {
                       occStart = this.startDate;
                   }
                   if (this.queryEndDate.compare(occEnd) < 0) {
                       occEnd = this.queryEndDate;
@@ -3155,39 +3145,44 @@
         ]]></setter>
       </property>
 
       <!-- private -->
 
       <property name="numVisibleDates" readonly="true">
         <getter><![CDATA[
           if (this.mDateList) {
-            return this.mDateList.length;
+              return this.mDateList.length;
           }
 
           let count = 0;
 
           if (!this.mStartDate || !this.mEndDate) {
-            // The view has not been initialized, so there are 0 visible dates.
-            return count;
+              // The view has not been initialized, so there are 0 visible dates.
+              return count;
           }
 
           let date = this.mStartDate.clone();
           while (date.compare(this.mEndDate) <= 0) {
-            count++;
-            date.day += 1;
+              count++;
+              date.day += 1;
           }
 
           return count;
         ]]></getter>
       </property>
 
       <property name="orient">
-        <getter><![CDATA[return this.getAttribute("orient") || "vertical";]]></getter>
-        <setter><![CDATA[this.setAttribute("orient", val); return val;]]></setter>
+        <getter><![CDATA[
+          return this.getAttribute("orient") || "vertical";
+        ]]></getter>
+        <setter><![CDATA[
+          this.setAttribute("orient", val);
+          return val;
+        ]]></setter>
       </property>
 
       <property name="timeBarTimeIndicator" readonly="true">
         <getter><![CDATA[
           let timebar = document.getAnonymousElementByAttribute(this, "anonid", "timebar");
           return document.getAnonymousElementByAttribute(timebar, "anonid", "timeIndicatorBoxTimeBar");
         ]]></getter>
       </property>
@@ -3493,41 +3488,41 @@
           }
           return null;
         ]]></body>
       </method>
 
       <method name="findDayBoxForDate">
         <parameter name="aDate"/>
         <body><![CDATA[
-            let col = this.findColumnForDate(aDate);
-            return (col && col.header);
+          let col = this.findColumnForDate(aDate);
+          return (col && col.header);
         ]]></body>
       </method>
 
       <method name="selectColumnHeader">
         <parameter name="aDate"/>
         <body><![CDATA[
           let child = this.labeldaybox.firstChild;
           while (child) {
               if (child.date.compare(aDate) == 0) {
                   child.setAttribute("selected", "true");
               } else {
                   child.removeAttribute("selected");
               }
               child = child.nextSibling;
-            }
+          }
         ]]></body>
       </method>
 
       <method name="findColumnsForOccurrences">
         <parameter name="aOccurrences"/>
         <body><![CDATA[
           if (!this.mDateColumns || !this.mDateColumns.length) {
-            return [];
+              return [];
           }
 
           let occMap = {};
           for (let occ of aOccurrences) {
               let startDate = occ[calGetStartDateProp(occ)]
                               .getInTimezone(this.mStartDate.timezone);
               let endDate = occ[calGetEndDateProp(occ)]
                               .getInTimezone(this.mEndDate.timezone) || startDate;
@@ -3544,53 +3539,53 @@
       </method>
 
       <method name="findColumnsForItem">
         <parameter name="aItem"/>
         <body><![CDATA[
           let columns = [];
 
           if (!this.mDateColumns) {
-            return columns;
+              return columns;
           }
 
           // Note that these may be dates or datetimes
           let startDate = aItem.startDate || aItem.entryDate || aItem.dueDate;
           if (!startDate) {
               return columns;
           }
           let timezone = this.mDateColumns[0].date.timezone;
           let targetDate = startDate.getInTimezone(timezone);
           let finishDate = (aItem.endDate || aItem.dueDate || aItem.entryDate || startDate)
                                .getInTimezone(timezone);
 
           if (!targetDate.isDate) {
-            // Set the time to 00:00 so that we get all the boxes
-            targetDate.hour = 0;
-            targetDate.minute = 0;
-            targetDate.second = 0;
+              // Set the time to 00:00 so that we get all the boxes
+              targetDate.hour = 0;
+              targetDate.minute = 0;
+              targetDate.second = 0;
           }
 
           if (targetDate.compare(finishDate) == 0) {
               // We have also to handle zero length events in particular for
               // tasks without entry or due date.
               let col = this.findColumnForDate(targetDate);
               if (col) {
                   columns.push(col);
               }
           }
 
           while (targetDate.compare(finishDate) == -1) {
-            let col = this.findColumnForDate(targetDate);
-
-            // This might not exist if the event spans the view start or end
-            if (col) {
-                columns.push(col);
-            }
-            targetDate.day += 1;
+              let col = this.findColumnForDate(targetDate);
+
+              // This might not exist if the event spans the view start or end
+              if (col) {
+                  columns.push(col);
+              }
+              targetDate.day += 1;
           }
 
           return columns;
         ]]></body>
       </method>
 
       <!-- for the given client-coord-system point, return
          - the calendar-event-column that contains it.  If
@@ -3717,34 +3712,33 @@
               propertyName = "width";
           } else {
               propertyName = "height";
           }
 
           // get the width/height of the scrollbox scrollbar
           let scrollbox = document.getAnonymousElementByAttribute(
                          this, "anonid", "scrollbox");
-          let propertyValue = scrollbox.boxObject.firstChild
-                              .boxObject[propertyName];
+          let propertyValue = scrollbox.boxObject.firstChild.boxObject[propertyName];
           // Check if we need to show the headerScrollbarSpacer at all
           let headerPropertyValue = propertyValue;
           let headerDayBox = document.getAnonymousElementByAttribute(
                              this, "anonid", "headerdaybox");
           if (headerDayBox) {
-            // Only do this when there are multiple days
-            let headerDayBoxMaxHeight = parseInt(document.defaultView.getComputedStyle(headerDayBox, null)
-                                                         .getPropertyValue("max-height"), 10);
-            if (this.getAttribute("orient") == "vertical" &&
-                headerDayBox.boxObject.height >= headerDayBoxMaxHeight) {
-                // If the headerDayBox is just as high as the max-height, then
-                // there is already a scrollbar and we don't need to show the
-                // headerScrollbarSpacer. This is only valid for the non-rotated
-                // view.
-                headerPropertyValue = 0;
-            }
+              // Only do this when there are multiple days
+              let headerDayBoxMaxHeight = parseInt(document.defaultView.getComputedStyle(headerDayBox, null)
+                                                           .getPropertyValue("max-height"), 10);
+              if (this.getAttribute("orient") == "vertical" &&
+                  headerDayBox.boxObject.height >= headerDayBoxMaxHeight) {
+                  // If the headerDayBox is just as high as the max-height, then
+                  // there is already a scrollbar and we don't need to show the
+                  // headerScrollbarSpacer. This is only valid for the non-rotated
+                  // view.
+                  headerPropertyValue = 0;
+              }
           }
 
           // set the same width/height for the label and header box spacers
           let headerScrollBarSpacer = document.getAnonymousElementByAttribute(
                                       this, "anonid", "headerscrollbarspacer");
           headerScrollBarSpacer.setAttribute(propertyName, headerPropertyValue);
           let labelScrollBarSpacer = document.getAnonymousElementByAttribute(
                                      this, "anonid", "labelscrollbarspacer");
@@ -3761,63 +3755,63 @@
           // 'aMinute' will be the first minute showed in the view, so it must
           // belong to the range 0 <-> (24*60 - minutes_showed_in_the_view) but
           // we consider 25 hours instead of 24 to let the view scroll until
           // showing events that start just before 0.00
           let maxFirstMin = 25 * 60 - Math.round(scrollBoxObject.height / this.mPixPerMin);
           aMinute = Math.min(maxFirstMin, Math.max(0, aMinute));
 
           if (scrollBoxObject && scrollbox.scrollHeight > 0) {
-            let x = {}, y = {};
-            scrollBoxObject.getPosition(x, y);
-            let pos = Math.round(aMinute * this.mPixPerMin);
-            if (scrollbox.getAttribute("orient") == "horizontal") {
-              scrollBoxObject.scrollTo(x.value, pos);
-            } else {
-              scrollBoxObject.scrollTo(pos, y.value);
-            }
+              let x = {}, y = {};
+              scrollBoxObject.getPosition(x, y);
+              let pos = Math.round(aMinute * this.mPixPerMin);
+              if (scrollbox.getAttribute("orient") == "horizontal") {
+                  scrollBoxObject.scrollTo(x.value, pos);
+              } else {
+                  scrollBoxObject.scrollTo(pos, y.value);
+              }
           }
 
           // Set the first visible minute in any case, we want to move to the
           // right minute as soon as possible if we couldn't do so above.
           this.mFirstVisibleMinute = aMinute;
         ]]></body>
       </method>
 
       <method name="setDayStartEndMinutes">
         <parameter name="aDayStartMin"/>
         <parameter name="aDayEndMin"/>
         <body><![CDATA[
           if (aDayStartMin < this.mStartMin || aDayStartMin > aDayEndMin ||
-            aDayEndMin > this.mEndMin) {
-            throw Components.results.NS_ERROR_INVALID_ARG;
+              aDayEndMin > this.mEndMin) {
+              throw Components.results.NS_ERROR_INVALID_ARG;
           }
           if (this.mDayStartMin != aDayStartMin ||
               this.mDayEndMin != aDayEndMin) {
-            this.mDayStartMin = aDayStartMin;
-            this.mDayEndMin = aDayEndMin;
-
-            // Also update on the time-bar
-            document.getAnonymousElementByAttribute(this, "anonid", "timebar")
-                    .setDayStartEndHours(this.mDayStartMin / 60,
-                                         this.mDayEndMin / 60);
+              this.mDayStartMin = aDayStartMin;
+              this.mDayEndMin = aDayEndMin;
+
+              // Also update on the time-bar
+              document.getAnonymousElementByAttribute(this, "anonid", "timebar")
+                      .setDayStartEndHours(this.mDayStartMin / 60,
+                                           this.mDayEndMin / 60);
           }
 
         ]]></body>
       </method>
 
       <method name="setVisibleMinutes">
         <parameter name="aVisibleMinutes"/>
         <body><![CDATA[
           if (aVisibleMinutes <= 0 ||
-            aVisibleMinutes > (this.mEndMin - this.mStartMin)) {
-            throw Components.results.NS_ERROR_INVALID_ARG;
+              aVisibleMinutes > (this.mEndMin - this.mStartMin)) {
+              throw Components.results.NS_ERROR_INVALID_ARG;
           }
           if (this.mVisibleMinutes != aVisibleMinutes) {
-            this.mVisibleMinutes = aVisibleMinutes;
+              this.mVisibleMinutes = aVisibleMinutes;
           }
           return this.mVisibleMinutes;
         ]]></body>
       </method>
 
       <method name="zoomIn">
         <parameter name="aLevel"/>
         <body><![CDATA[
@@ -3856,19 +3850,19 @@
             if (event.deltaMode == event.DOM_DELTA_LINE) {
                 if (this.rotated && event.deltaX != 0) {
                     minute += event.deltaX < 0 ? -60 : 60;
                 } else if (!this.rotated && event.deltaY != 0) {
                     minute += event.deltaY < 0 ? -60 : 60;
                 }
             } else if (event.deltaMode == event.DOM_DELTA_PIXEL) {
                 if (this.rotated && event.deltaX != 0) {
-                   minute += Math.ceil(event.deltaX / this.mPixPerMin);
+                    minute += Math.ceil(event.deltaX / this.mPixPerMin);
                 } else if (!this.rotated && event.deltaY != 0) {
-                   minute += Math.ceil(event.deltaY / this.mPixPerMin);
+                    minute += Math.ceil(event.deltaY / this.mPixPerMin);
                 }
             }
             this.scrollToMinute(minute);
         }
 
         // We are taking care of scrolling, so prevent the default
         // action in any case.
         event.preventDefault();
--- a/calendar/base/content/calendar-statusbar.js
+++ b/calendar/base/content/calendar-statusbar.js
@@ -5,107 +5,107 @@
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 /* exported gCalendarStatusFeedback */
 
 /**
  * This code might change soon if we support Thunderbird's activity manager.
  * NOTE: The naming "Meteors" is historical.
  */
- let gCalendarStatusFeedback = {
-     mCalendarStep: 0,
-     mCalendarCount: 0,
-     mWindow: null,
-     mStatusText: null,
-     mStatusBar: null,
-     mStatusProgressPanel: null,
-     mThrobber: null,
-     mProgressMode: Components.interfaces.calIStatusObserver.NO_PROGRESS,
-     mCurIndex: 0,
-     mInitialized: false,
-     mCalendars: {},
+var gCalendarStatusFeedback = {
+    mCalendarStep: 0,
+    mCalendarCount: 0,
+    mWindow: null,
+    mStatusText: null,
+    mStatusBar: null,
+    mStatusProgressPanel: null,
+    mThrobber: null,
+    mProgressMode: Components.interfaces.calIStatusObserver.NO_PROGRESS,
+    mCurIndex: 0,
+    mInitialized: false,
+    mCalendars: {},
 
     QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIStatusObserver]),
 
-     initialize: function(aWindow) {
+    initialize: function(aWindow) {
         if (!this.mInitialized) {
             this.mWindow = aWindow;
             this.mStatusText = this.mWindow.document.getElementById("statusText");
             this.mStatusBar = this.mWindow.document.getElementById("statusbar-icon");
             this.mStatusProgressPanel = this.mWindow.document.getElementById("statusbar-progresspanel");
             this.mThrobber = this.mWindow.document.getElementById("navigator-throbber");
             this.mInitialized = true;
         }
-     },
+    },
 
-     showStatusString: function(status) {
-         this.mStatusText.setAttribute("label", status);
-     },
+    showStatusString: function(status) {
+        this.mStatusText.setAttribute("label", status);
+    },
 
-     get spinning() {
-         return this.mProgressMode;
-     },
+    get spinning() {
+        return this.mProgressMode;
+    },
 
-     startMeteors: function(aProgressMode, aCalendarCount) {
-         if (aProgressMode != Components.interfaces.calIStatusObserver.NO_PROGRESS) {
-             if (!this.mInitialized) {
+    startMeteors: function(aProgressMode, aCalendarCount) {
+        if (aProgressMode != Components.interfaces.calIStatusObserver.NO_PROGRESS) {
+            if (!this.mInitialized) {
                 Components.utils.reportError("StatusObserver has not been initialized!");
                 return;
-             }
-             this.mCalendars = {};
-             this.mCurIndex = 0;
-             if (aCalendarCount) {
-                 this.mCalendarCount = this.mCalendarCount + aCalendarCount;
-                 this.mCalendarStep = Math.trunc(100 / this.mCalendarCount);
-             }
-             this.mProgressMode = aProgressMode;
-             this.mStatusProgressPanel.removeAttribute("collapsed");
-             if (this.mProgressMode == Components.interfaces.calIStatusObserver.DETERMINED_PROGRESS) {
-                 this.mStatusBar.removeAttribute("collapsed");
-                 this.mStatusBar.setAttribute("mode", "determined");
-                 this.mStatusBar.value = 0;
-                 let commonStatus = calGetString("calendar", "gettingCalendarInfoCommon");
-                 this.showStatusString(commonStatus);
-             }
-             if (this.mThrobber) {
-                 this.mThrobber.setAttribute("busy", true);
-             }
-         }
-     },
+            }
+            this.mCalendars = {};
+            this.mCurIndex = 0;
+            if (aCalendarCount) {
+                this.mCalendarCount = this.mCalendarCount + aCalendarCount;
+                this.mCalendarStep = Math.trunc(100 / this.mCalendarCount);
+            }
+            this.mProgressMode = aProgressMode;
+            this.mStatusProgressPanel.removeAttribute("collapsed");
+            if (this.mProgressMode == Components.interfaces.calIStatusObserver.DETERMINED_PROGRESS) {
+                this.mStatusBar.removeAttribute("collapsed");
+                this.mStatusBar.setAttribute("mode", "determined");
+                this.mStatusBar.value = 0;
+                let commonStatus = calGetString("calendar", "gettingCalendarInfoCommon");
+                this.showStatusString(commonStatus);
+            }
+            if (this.mThrobber) {
+                this.mThrobber.setAttribute("busy", true);
+            }
+        }
+    },
 
-     stopMeteors: function() {
-         if (!this.mInitialized) {
+    stopMeteors: function() {
+        if (!this.mInitialized) {
             return;
-         }
-         if (this.spinning != Components.interfaces.calIStatusObserver.NO_PROGRESS) {
-             this.mProgressMode = Components.interfaces.calIStatusObserver.NO_PROGRESS;
-             this.mStatusProgressPanel.collapsed = true;
-             this.mStatusBar.setAttribute("mode", "normal");
-             this.mStatusBar.value = 0;
-             this.mCalendarCount = 0;
-             this.showStatusString("");
-             if (this.mThrobber) {
-                 this.mThrobber.setAttribute("busy", false);
-             }
-         }
-     },
+        }
+        if (this.spinning != Components.interfaces.calIStatusObserver.NO_PROGRESS) {
+            this.mProgressMode = Components.interfaces.calIStatusObserver.NO_PROGRESS;
+            this.mStatusProgressPanel.collapsed = true;
+            this.mStatusBar.setAttribute("mode", "normal");
+            this.mStatusBar.value = 0;
+            this.mCalendarCount = 0;
+            this.showStatusString("");
+            if (this.mThrobber) {
+                this.mThrobber.setAttribute("busy", false);
+            }
+        }
+    },
 
-     calendarCompleted: function(aCalendar) {
-         if (!this.mInitialized) {
+    calendarCompleted: function(aCalendar) {
+        if (!this.mInitialized) {
             return;
-         }
-         if (this.spinning != Components.interfaces.calIStatusObserver.NO_PROGRESS) {
-             if (this.spinning == Components.interfaces.calIStatusObserver.DETERMINED_PROGRESS) {
-                 if (!this.mCalendars[aCalendar.id] || this.mCalendars[aCalendar.id] === undefined) {
-                     this.mCalendars[aCalendar.id] = true;
-                     this.mStatusBar.value = parseInt(this.mStatusBar.value, 10) + this.mCalendarStep;
-                     this.mCurIndex++;
-                     let curStatus = calGetString("calendar", "gettingCalendarInfoDetail",
-                                                  [this.mCurIndex, this.mCalendarCount]);
-                     this.showStatusString(curStatus);
-                 }
-             }
-             if (this.mThrobber) {
-                 this.mThrobber.setAttribute("busy", true);
-             }
-         }
-     }
- };
+        }
+        if (this.spinning != Components.interfaces.calIStatusObserver.NO_PROGRESS) {
+            if (this.spinning == Components.interfaces.calIStatusObserver.DETERMINED_PROGRESS) {
+                if (!this.mCalendars[aCalendar.id] || this.mCalendars[aCalendar.id] === undefined) {
+                    this.mCalendars[aCalendar.id] = true;
+                    this.mStatusBar.value = parseInt(this.mStatusBar.value, 10) + this.mCalendarStep;
+                    this.mCurIndex++;
+                    let curStatus = calGetString("calendar", "gettingCalendarInfoDetail",
+                                                 [this.mCurIndex, this.mCalendarCount]);
+                    this.showStatusString(curStatus);
+                }
+            }
+            if (this.mThrobber) {
+                this.mThrobber.setAttribute("busy", true);
+            }
+        }
+    }
+};
--- a/calendar/base/content/calendar-task-tree.js
+++ b/calendar/base/content/calendar-task-tree.js
@@ -155,22 +155,22 @@ function contextChangeTaskProgress(aEven
 
 /**
  * Handler function to change the calendar of the selected tasks. The targeted
  * menuitem must have "calendar" property that implements calICalendar.
  *
  * @param aEvent      The DOM event that triggered this command.
  */
 function contextChangeTaskCalendar(aEvent) {
-   startBatchTransaction();
-   let tasks = getSelectedTasks(aEvent);
-   for (let task of tasks) {
-       let newTask = task.clone();
-       newTask.calendar = aEvent.target.calendar;
-       doTransaction("modify", newTask, newTask.calendar, task, null);
+    startBatchTransaction();
+    let tasks = getSelectedTasks(aEvent);
+    for (let task of tasks) {
+        let newTask = task.clone();
+        newTask.calendar = aEvent.target.calendar;
+        doTransaction("modify", newTask, newTask.calendar, task, null);
     }
     endBatchTransaction();
 }
 
 /**
  * Handler function to change the priority of the selected tasks, or of
  * the task loaded in the current tab.
  *
@@ -234,17 +234,17 @@ function contextPostponeTask(aEvent, aDu
  * @param aEvent        The DOM event that triggered this command.
  * @param initialDate   (optional) The initial date for new task datepickers
  */
 function modifyTaskFromContext(aEvent, initialDate) {
     let tasks = getSelectedTasks(aEvent);
     for (let task of tasks) {
         modifyEventWithDialog(task, null, true, initialDate);
     }
- }
+}
 
 /**
  *  Delete the current selected item with focus from the task tree
  *
  * @param aEvent          The DOM event that triggered this command.
  * @param aDoNotConfirm   If true, the user will not be asked to delete.
  */
 function deleteToDoCommand(aEvent, aDoNotConfirm) {
--- a/calendar/base/content/calendar-task-tree.xml
+++ b/calendar/base/content/calendar-task-tree.xml
@@ -4,19 +4,19 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!DOCTYPE dialog [
   <!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
   <!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
 ]>
 
 <bindings id="calendar-task-tree-bindings"
-  xmlns="http://www.mozilla.org/xbl"
-  xmlns:xbl="http://www.mozilla.org/xbl"
-  xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:xbl="http://www.mozilla.org/xbl"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <binding id="calendar-task-tree">
     <resources>
       <stylesheet src="chrome://calendar/skin/calendar-task-tree.css"/>
     </resources>
     <content>
       <xul:tree anonid="calendar-task-tree"
                 class="calendar-task-tree"
@@ -151,70 +151,70 @@
         for (let i = 0; i < treecols.length; i++) {
             let content = treecols[i].getAttribute("itemproperty");
             if (names.some(element => element == content)) {
                 treecols[i].removeAttribute("hidden");
             } else {
                 treecols[i].setAttribute("hidden", "true");
             }
             if (ordinals && ordinals.length > 0) {
-               treecols[i].ordinal = Number(ordinals.shift());
+                treecols[i].ordinal = Number(ordinals.shift());
             }
             if (widths && widths.length > 0) {
-               treecols[i].width = Number(widths.shift());
+                treecols[i].width = Number(widths.shift());
             }
             if (sorted && sorted.length > 0) {
                 if (sorted == content) {
                     this.mTreeView.sortDirection = sortDirection;
                     this.mTreeView.selectedColumn = treecols[i];
                 }
             }
         }
       ]]></constructor>
       <destructor><![CDATA[
-          Components.utils.import("resource://gre/modules/Services.jsm");
+        Components.utils.import("resource://gre/modules/Services.jsm");
 
-          // remove composite calendar observer
-          let composite = getCompositeCalendar();
-          composite.removeObserver(this.mTaskTreeObserver);
+        // remove composite calendar observer
+        let composite = getCompositeCalendar();
+        composite.removeObserver(this.mTaskTreeObserver);
 
-          // remove the preference observer
-          let branch = Services.prefs.getBranch("");
-          branch.removeObserver("calendar.", this, false);
+        // remove the preference observer
+        let branch = Services.prefs.getBranch("");
+        branch.removeObserver("calendar.", this, false);
 
-          let widths = "";
-          let ordinals = "";
-          let visible = "";
-          let sorted = this.mTreeView.selectedColumn;
-          let tree = document.getAnonymousNodes(this)[0];
-          let treecols = tree.getElementsByTagNameNS(tree.namespaceURI, "treecol");
-          for (let i = 0; i < treecols.length; i++) {
-              if (treecols[i].getAttribute("hidden") != "true") {
+        let widths = "";
+        let ordinals = "";
+        let visible = "";
+        let sorted = this.mTreeView.selectedColumn;
+        let tree = document.getAnonymousNodes(this)[0];
+        let treecols = tree.getElementsByTagNameNS(tree.namespaceURI, "treecol");
+        for (let i = 0; i < treecols.length; i++) {
+            if (treecols[i].getAttribute("hidden") != "true") {
                 let content = treecols[i].getAttribute("itemproperty");
                 visible += visible.length > 0 ? " " + content : content;
-              }
-              if (ordinals.length > 0) {
-                  ordinals += " ";
-              }
-              ordinals += treecols[i].ordinal;
-              if (widths.length > 0) {
-                  widths += " ";
-              }
-              widths += treecols[i].width || 0;
-          }
-          this.setAttribute("visible-columns", visible);
-          this.setAttribute("ordinals", ordinals);
-          this.setAttribute("widths", widths);
-          if (sorted) {
-              this.setAttribute("sort-active", sorted.getAttribute("itemproperty"));
-              this.setAttribute("sort-direction", this.mTreeView.sortDirection);
-          } else {
-              this.removeAttribute("sort-active");
-              this.removeAttribute("sort-direction");
-          }
+            }
+            if (ordinals.length > 0) {
+                ordinals += " ";
+            }
+            ordinals += treecols[i].ordinal;
+            if (widths.length > 0) {
+                widths += " ";
+            }
+            widths += treecols[i].width || 0;
+        }
+        this.setAttribute("visible-columns", visible);
+        this.setAttribute("ordinals", ordinals);
+        this.setAttribute("widths", widths);
+        if (sorted) {
+            this.setAttribute("sort-active", sorted.getAttribute("itemproperty"));
+            this.setAttribute("sort-direction", this.mTreeView.sortDirection);
+        } else {
+            this.removeAttribute("sort-active");
+            this.removeAttribute("sort-direction");
+        }
       ]]></destructor>
 
       <field name="mTaskArray">[]</field>
       <field name="mHash2Index"><![CDATA[({})]]></field>
       <field name="mPendingRefreshJobs"><![CDATA[({})]]></field>
       <field name="mShowCompletedTasks">true</field>
       <field name="mFilter">null</field>
       <field name="mStartDate">null</field>
@@ -630,32 +630,32 @@
           // This method is only called for columns of type other than text.
           setCellValue: function(aRow, aCol, aValue) {
               return null;
           },
 
           // The image path for a given cell. For defining an icon for a cell.
           // If the empty string is returned, the :moz-tree-image pseudoelement will be used.
           getImageSrc: function(aRow, aCol) {
-             // Return the empty string in order
-             // to use moz-tree-image pseudoelement :
-             // it is mandatory to return "" and not false :-(
-             return "";
+              // Return the empty string in order
+              // to use moz-tree-image pseudoelement :
+              // it is mandatory to return "" and not false :-(
+              return "";
           },
 
           // IsEditable is called to ask the view if the cell contents are editable.
           // A value of true will result in the tree popping up a text field when the user
           // tries to inline edit the cell.
           isEditable: function(aRow, aCol) {
               return true;
           },
 
           // Called during initialization to link the view to the front end box object.
           setTree: function(aTreeBox) {
-            this.treebox = aTreeBox;
+              this.treebox = aTreeBox;
           },
 
           // Methods that can be used to test whether or not a twisty should
           // be drawn, and if so, whether an open or closed twisty should be used.
           isContainer: function(aRow) {
               return false;
           },
           isContainerOpen: function(aRow) {
@@ -785,23 +785,23 @@
               }
           },
 
           /**
            * Private methods and attributes
            */
 
           _getItemFromEvent: function(event, aCol, aRow) {
-            aRow = aRow || {};
-            let childElt = {};
-            this.treebox.getCellAt(event.clientX, event.clientY, aRow, aCol || {}, childElt);
-            if (!childElt.value) {
-                return false;
-            }
-            return aRow && aRow.value > -1 && this.binding.mTaskArray[aRow.value];
+              aRow = aRow || {};
+              let childElt = {};
+              this.treebox.getCellAt(event.clientX, event.clientY, aRow, aCol || {}, childElt);
+              if (!childElt.value) {
+                  return false;
+              }
+              return aRow && aRow.value > -1 && this.binding.mTaskArray[aRow.value];
           },
 
           // Helper function to display datetimes
           _formatDateTime: function(aDateTime) {
               let dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
                                             .getService(Components.interfaces.calIDateTimeFormatter);
 
               // datetime is from todo object, it is not a javascript date
@@ -963,17 +963,17 @@
 
           refreshJob.execute();
         ]]></body>
       </method>
 
       <method name="selectAll">
         <body><![CDATA[
           if (this.mTreeView.selection) {
-            this.mTreeView.selection.selectAll();
+              this.mTreeView.selection.selectAll();
           }
         ]]></body>
       </method>
 
       <!-- Called by event observers to update the display -->
       <method name="refresh">
         <parameter name="aFilter"/>
         <body><![CDATA[
@@ -985,27 +985,27 @@
           }
         ]]></body>
       </method>
 
       <method name="onCalendarAdded">
         <parameter name="aCalendar"/>
         <parameter name="aFilter"/>
         <body><![CDATA[
-            if (!aCalendar.getProperty("disabled")) {
-                this.refreshFromCalendar(aCalendar, aFilter);
-            }
+          if (!aCalendar.getProperty("disabled")) {
+              this.refreshFromCalendar(aCalendar, aFilter);
+          }
         ]]></body>
       </method>
 
       <method name="onCalendarRemoved">
         <parameter name="aCalendar"/>
         <body><![CDATA[
-            let tasks = this.mTaskArray.filter(task => task.calendar.id == aCalendar.id);
-            this.mTreeView.removeItems(tasks);
+          let tasks = this.mTaskArray.filter(task => task.calendar.id == aCalendar.id);
+          this.mTreeView.removeItems(tasks);
         ]]></body>
       </method>
 
       <method name="sortItems">
         <body><![CDATA[
           if (this.mTreeView.selectedColumn) {
               let modifier = (this.mTreeView.sortDirection == "descending" ? -1 : 1);
               let column = this.mTreeView.selectedColumn;
@@ -1028,97 +1028,96 @@
       <method name="recreateHashTable">
         <body><![CDATA[
           this.mHash2Index = {};
           for (let i = 0; i < this.mTaskArray.length; i++) {
               let item = this.mTaskArray[i];
               this.mHash2Index[item.hashId] = i;
           }
           if (this.mTreeView.treebox) {
-            this.mTreeView.treebox.invalidate();
+              this.mTreeView.treebox.invalidate();
           }
         ]]></body>
       </method>
 
       <method name="getInitialDate">
         <body><![CDATA[
           let initialDate = currentView().selectedDay;
           return initialDate ? initialDate : now();
         ]]></body>
       </method>
 
       <method name="doUpdateFilter">
         <parameter name="aFilter"/>
         <body><![CDATA[
-            let needsRefresh = false;
-            let oldStart = this.mFilter.mStartDate;
-            let oldEnd = this.mFilter.mEndDate;
-            let filterText = this.mFilter.filterText || "";
+          let needsRefresh = false;
+          let oldStart = this.mFilter.mStartDate;
+          let oldEnd = this.mFilter.mEndDate;
+          let filterText = this.mFilter.filterText || "";
 
-            if (aFilter) {
-                let props = this.mFilter.filterProperties;
-                this.mFilter.applyFilter(aFilter);
-                needsRefresh = !props || !props.equals(this.mFilter.filterProperties);
-            } else {
-                this.mFilter.updateFilterDates();
-            }
+          if (aFilter) {
+              let props = this.mFilter.filterProperties;
+              this.mFilter.applyFilter(aFilter);
+              needsRefresh = !props || !props.equals(this.mFilter.filterProperties);
+          } else {
+              this.mFilter.updateFilterDates();
+          }
 
-            if (this.mTextFilterField) {
-                let field = document.getElementById(this.mTextFilterField);
-                if (field) {
-                    this.mFilter.filterText = field.value;
-                    needsRefresh = needsRefresh || filterText.toLowerCase() != this.mFilter.filterText.toLowerCase();
-                }
-            }
+          if (this.mTextFilterField) {
+              let field = document.getElementById(this.mTextFilterField);
+              if (field) {
+                  this.mFilter.filterText = field.value;
+                  needsRefresh = needsRefresh || filterText.toLowerCase() != this.mFilter.filterText.toLowerCase();
+              }
+          }
 
-            // we only need to refresh the tree if the filter properties or date range changed
-            if (needsRefresh ||
-                !((!oldStart && !this.mFilter.mStartDate) ||
-                  (oldStart && this.mFilter.mStartDate && oldStart.compare(this.mFilter.mStartDate) == 0)) ||
-                !((!oldEnd && !this.mFilter.mEndDate) ||
-                  (oldEnd && this.mFilter.mEndDate && oldEnd.compare(this.mFilter.mEndDate) == 0))) {
-                this.refresh();
-            }
+          // we only need to refresh the tree if the filter properties or date range changed
+          if (needsRefresh ||
+              !((!oldStart && !this.mFilter.mStartDate) ||
+                (oldStart && this.mFilter.mStartDate && oldStart.compare(this.mFilter.mStartDate) == 0)) ||
+              !((!oldEnd && !this.mFilter.mEndDate) ||
+                (oldEnd && this.mFilter.mEndDate && oldEnd.compare(this.mFilter.mEndDate) == 0))) {
+              this.refresh();
+          }
         ]]></body>
       </method>
 
       <method name="updateFilter">
         <parameter name="aFilter"/>
         <body><![CDATA[
-            this.doUpdateFilter(aFilter);
+          this.doUpdateFilter(aFilter);
         ]]></body>
       </method>
 
       <method name="updateFocus">
         <body><![CDATA[
-            let tree = document.getAnonymousElementByAttribute(this, "anonid", "calendar-task-tree");
-            let menuOpen = false;
+          let tree = document.getAnonymousElementByAttribute(this, "anonid", "calendar-task-tree");
+          let menuOpen = false;
 
-            // we need to consider the tree focused if the context menu is open.
-            if (this.hasAttribute("context")) {
-                let context = document.getElementById(this.getAttribute("context"));
-                if (context && context.state) {
-                    menuOpen = (context.state == "open") || (context.state == "showing");
-                }
-            }
+          // we need to consider the tree focused if the context menu is open.
+          if (this.hasAttribute("context")) {
+              let context = document.getElementById(this.getAttribute("context"));
+              if (context && context.state) {
+                  menuOpen = (context.state == "open") || (context.state == "showing");
+              }
+          }
 
-            let focused = (document.activeElement == tree) || menuOpen;
+          let focused = (document.activeElement == tree) || menuOpen;
 
-            calendarController.onSelectionChanged({ detail: focused ? this.selectedTasks : [] });
-            calendarController.todo_tasktree_focused = focused;
+          calendarController.onSelectionChanged({ detail: focused ? this.selectedTasks : [] });
+          calendarController.todo_tasktree_focused = focused;
         ]]></body>
       </method>
-
     </implementation>
 
     <handlers>
       <handler event="select"><![CDATA[
         this.mTreeView.onSelect(event);
         if (calendarController.todo_tasktree_focused) {
-          calendarController.onSelectionChanged({ detail: this.selectedTasks });
+            calendarController.onSelectionChanged({ detail: this.selectedTasks });
         }
       ]]></handler>
       <handler event="focus"><![CDATA[
         this.updateFocus();
       ]]></handler>
       <handler event="blur"><![CDATA[
         this.updateFocus();
       ]]></handler>
@@ -1138,61 +1137,60 @@
             return;
         }
 
         let tree = document.getAnonymousElementByAttribute(this, "anonid", "calendar-task-tree");
 
         // let's build the drag region
         let region = null;
         try {
-          region = Components.classes["@mozilla.org/gfx/region;1"].createInstance(Components.interfaces.nsIScriptableRegion);
-          region.init();
-          let treeBox = tree.treeBox;
-          let bodyBox = treeBox.treeBody.boxObject;
-          let sel = tree.view.selection;
+            region = Components.classes["@mozilla.org/gfx/region;1"].createInstance(Components.interfaces.nsIScriptableRegion);
+            region.init();
+            let treeBox = tree.treeBox;
+            let bodyBox = treeBox.treeBody.boxObject;
+            let sel = tree.view.selection;
 
-          let rowX = bodyBox.x;
-          let rowY = bodyBox.y;
-          let rowHeight = treeBox.rowHeight;
-          let rowWidth = bodyBox.width;
+            let rowX = bodyBox.x;
+            let rowY = bodyBox.y;
+            let rowHeight = treeBox.rowHeight;
+            let rowWidth = bodyBox.width;
 
-          // add a rectangle for each visible selected row
-          for (let i = treeBox.getFirstVisibleRow(); i <= treeBox.getLastVisibleRow(); i++) {
-            if (sel.isSelected(i)) {
-              region.unionRect(rowX, rowY, rowWidth, rowHeight);
+            // add a rectangle for each visible selected row
+            for (let i = treeBox.getFirstVisibleRow(); i <= treeBox.getLastVisibleRow(); i++) {
+                if (sel.isSelected(i)) {
+                    region.unionRect(rowX, rowY, rowWidth, rowHeight);
+                }
+                rowY = rowY + rowHeight;
             }
-            rowY = rowY + rowHeight;
-          }
 
-          // and finally, clip the result to be sure we don't spill over...
-          if (!region.isEmpty()) {
-            region.intersectRect(bodyBox.x, bodyBox.y, bodyBox.width, bodyBox.height);
-          }
+            // and finally, clip the result to be sure we don't spill over...
+            if (!region.isEmpty()) {
+                region.intersectRect(bodyBox.x, bodyBox.y, bodyBox.width, bodyBox.height);
+            }
         } catch (ex) {
-          ASSERT(false, "Error while building selection region: " + ex + "\n");
-          region = null;
+            ASSERT(false, "Error while building selection region: " + ex + "\n");
+            region = null;
         }
         invokeEventDragSession(item, event.target);
       ]]></handler>
     </handlers>
 
   </binding>
 
   <binding id="calendar-task-tree-todaypane" extends="chrome://calendar/content/calendar-task-tree.xml#calendar-task-tree">
     <implementation>
       <method name="getInitialDate">
-            <body><![CDATA[
-              let initialDate = agendaListbox.today ? agendaListbox.today.start : now();
-              return initialDate ? initialDate : now();
-            ]]></body>
+        <body><![CDATA[
+          let initialDate = agendaListbox.today ? agendaListbox.today.start : now();
+          return initialDate ? initialDate : now();
+        ]]></body>
       </method>
       <method name="updateFilter">
         <parameter name="aFilter"/>
         <body><![CDATA[
-            this.mFilter.selectedDate = agendaListbox.today && agendaListbox.today.start ?
-                                        agendaListbox.today.start : now();
-
-            this.doUpdateFilter(aFilter);
+          this.mFilter.selectedDate = agendaListbox.today && agendaListbox.today.start ?
+                                      agendaListbox.today.start : now();
+          this.doUpdateFilter(aFilter);
         ]]></body>
       </method>
     </implementation>
   </binding>
 </bindings>
--- a/calendar/base/content/calendar-task-view.js
+++ b/calendar/base/content/calendar-task-view.js
@@ -32,24 +32,24 @@ var taskDetailsView = {
             displayElement("calendar-task-details-title-row", true);
             document.getElementById("calendar-task-details-title").textContent =
                 (item.title ? item.title.replace(/\n/g, " ") : "");
 
             let organizer = item.organizer;
             if (displayElement("calendar-task-details-organizer-row", organizer != null)) {
                 let name = organizer.commonName;
                 if (!name || name.length <= 0) {
-                  if (organizer.id && organizer.id.length) {
-                      name = organizer.id;
-                      let re = new RegExp("^mailto:(.*)", "i");
-                      let matches = re.exec(name);
-                      if (matches) {
-                          name = matches[1];
-                      }
-                  }
+                    if (organizer.id && organizer.id.length) {
+                        name = organizer.id;
+                        let re = new RegExp("^mailto:(.*)", "i");
+                        let matches = re.exec(name);
+                        if (matches) {
+                            name = matches[1];
+                        }
+                    }
                 }
                 if (displayElement("calendar-task-details-organizer-row", name && name.length)) {
                     document.getElementById("calendar-task-details-organizer").value = name;
                 }
             }
 
             let priority = 0;
             if (item.calendar.getProperty("capabilities.priority.supported") != false) {
--- a/calendar/base/content/calendar-ui-utils.js
+++ b/calendar/base/content/calendar-ui-utils.js
@@ -50,18 +50,18 @@ function setElementValue(aElement, aNewV
             } catch (e) {
                 cal.ERROR("setElementValue: aElement.setAttribute couldn't set " +
                 aPropertyName + " from " + (aElement && aElement.localName) + " to " + aNewValue +
                 " e: " + e + "\n");
             }
         } else {
             aElement.value = aNewValue;
         }
-     }
- }
+    }
+}
 
 /**
  * Helper function for getting data from the form,
  * Get the value of a property of a XUL element
  *
  * @param aElement      ID of XUL element to set, or the element node itself
  * @param propertyName  OPTIONAL name of property to set, default is "value",
  *                        use "checked" for radios & checkboxes, "data" for
@@ -586,17 +586,17 @@ function getOptimalMinimumHeight(aXULEle
 /**
  * Gets the "other" orientation value, i.e if "horizontal" is passed, "vertical"
  * is returned and vice versa.
  *
  * @param aOrientation    The orientation value to turn around.
  * @return                The opposite orientation value.
  */
 function getOtherOrientation(aOrientation) {
-     return (aOrientation == "horizontal" ? "vertical" : "horizontal");
+    return (aOrientation == "horizontal" ? "vertical" : "horizontal");
 }
 
 /**
  * Setting labels on a menuitem doesn't update the label that is shown when the
  * menuitem is selected. This function takes care by reselecting the item
  *
  * @param aElement  The element to update, or its id as a string
  */
--- a/calendar/base/content/calendar-unifinder.js
+++ b/calendar/base/content/calendar-unifinder.js
@@ -107,17 +107,17 @@ var unifinderObserver = {
         switch (aName) {
             case "disabled":
                 refreshEventTree();
                 break;
         }
     },
 
     onPropertyDeleting: function(aCalendar, aName) {
-      this.onPropertyChanged(aCalendar, aName, null, null);
+        this.onPropertyChanged(aCalendar, aName, null, null);
     },
 
     // calICompositeObserver:
     onCalendarAdded: function(aAddedCalendar) {
         if (!aAddedCalendar.getProperty("disabled")) {
             addItemsFromCalendar(aAddedCalendar,
                                  addItemsFromSingleCalendarInternal);
         }
@@ -338,17 +338,17 @@ function unifinderSelect(event) {
 
     for (let range = 0; range < numRanges; range++) {
         tree.view.selection.getRangeAt(range, start, end);
 
         for (let i = start.value; i <= end.value; i++) {
             try {
                 selectedItems.push(unifinderTreeView.getItemAt(i));
             } catch (e) {
-               WARN("Error getting Event from row: " + e + "\n");
+                WARN("Error getting Event from row: " + e + "\n");
             }
         }
     }
 
     if (selectedItems.length == 1) {
         // Go to the day of the selected item in the current view.
         currentView().goToDay(selectedItems[0].startDate);
     }
@@ -415,18 +415,18 @@ var unifinderTreeView = {
     /**
      * Sets the currently selected column in the unifinder (used for sorting).
      */
     set selectedColumn(aCol) {
         let tree = document.getElementById("unifinder-search-results-tree");
         let treecols = tree.getElementsByTagName("treecol");
         for (let col of treecols) {
             if (col.getAttribute("sortActive")) {
-                  col.removeAttribute("sortActive");
-                  col.removeAttribute("sortDirection");
+                col.removeAttribute("sortActive");
+                col.removeAttribute("sortDirection");
             }
             if (aCol.getAttribute("itemproperty") == col.getAttribute("itemproperty")) {
                 col.setAttribute("sortActive", "true");
                 col.setAttribute("sortDirection", this.sortDirection);
             }
         }
         return (this.mSelectedColumn = aCol);
     },
@@ -627,18 +627,18 @@ var unifinderTreeView = {
         this.treeElement.removeEventListener("select", unifinderSelect, true);
         this.tree.view.selection.selectEventsSuppressed = true;
         this.tree.view.selection.clearSelection();
 
         if (aItemArray && aItemArray.length == 1) {
             // If only one item is selected, scroll to it
             let rowToScrollTo = this.getItemRow(aItemArray[0]);
             if (rowToScrollTo > -1) {
-               this.tree.ensureRowIsVisible(rowToScrollTo);
-               this.tree.view.selection.select(rowToScrollTo);
+                this.tree.ensureRowIsVisible(rowToScrollTo);
+                this.tree.view.selection.select(rowToScrollTo);
             }
         } else if (aItemArray && aItemArray.length > 1) {
             // If there is more than one item, just select them all.
             for (let item of aItemArray) {
                 let row = this.getItemRow(item);
                 this.tree.view.selection.rangedSelect(row, row, true);
             }
         }
--- a/calendar/base/content/calendar-view-core.xml
+++ b/calendar/base/content/calendar-view-core.xml
@@ -1,21 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/.
--->
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!-- Note that this file depends on helper functions in calUtils.js-->
 
 <bindings id="calendar-core-view-bindings"
-    xmlns="http://www.mozilla.org/xbl"
-    xmlns:html="http://www.w3.org/1999/xhtml"
-    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-    xmlns:xbl="http://www.mozilla.org/xbl">
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="calendar-editable-item">
     <content mousethrough="never"
              tooltip="itemTooltip"
              tabindex="-1">
       <xul:vbox flex="1">
         <xul:hbox>
           <xul:box anonid="event-container"
@@ -62,44 +61,44 @@
             </xul:box>
           </xul:box>
         </xul:hbox>
       </xul:vbox>
     </content>
 
     <implementation>
       <constructor><![CDATA[
-         Components.utils.import("resource://calendar/modules/calAlarmUtils.jsm");
-         Components.utils.import("resource://calendar/modules/calUtils.jsm");
-         Components.utils.import("resource://gre/modules/Preferences.jsm");
+        Components.utils.import("resource://calendar/modules/calAlarmUtils.jsm");
+        Components.utils.import("resource://calendar/modules/calUtils.jsm");
+        Components.utils.import("resource://gre/modules/Preferences.jsm");
 
-         this.eventNameTextbox.onblur = () => {
-             this.stopEditing(true);
-         };
-         this.eventNameTextbox.onkeypress = (event) => {
-             // save on enter
-             if (event.keyCode == 13) {
-                 this.stopEditing(true);
-             // abort on escape
-             } else if (event.keyCode == 27) {
-                 this.stopEditing(false);
-             }
-         };
-         let stopPropagationIfEditing = (event) => {
-           if (this.mEditing) {
-             event.stopPropagation();
-           }
-         };
-         // while editing, single click positions cursor, so don't propagate.
-         this.eventNameTextbox.onclick = stopPropagationIfEditing;
-         // while editing, double click selects words, so don't propagate.
-         this.eventNameTextbox.ondblclick = stopPropagationIfEditing;
-         // while editing, don't propagate mousedown/up (selects calEvent).
-         this.eventNameTextbox.onmousedown = stopPropagationIfEditing;
-         this.eventNameTextbox.onmouseup = stopPropagationIfEditing;
+        this.eventNameTextbox.onblur = () => {
+            this.stopEditing(true);
+        };
+        this.eventNameTextbox.onkeypress = (event) => {
+            // save on enter
+            if (event.keyCode == 13) {
+                this.stopEditing(true);
+            // abort on escape
+            } else if (event.keyCode == 27) {
+                this.stopEditing(false);
+            }
+        };
+        let stopPropagationIfEditing = (event) => {
+            if (this.mEditing) {
+                event.stopPropagation();
+            }
+        };
+        // while editing, single click positions cursor, so don't propagate.
+        this.eventNameTextbox.onclick = stopPropagationIfEditing;
+        // while editing, double click selects words, so don't propagate.
+        this.eventNameTextbox.ondblclick = stopPropagationIfEditing;
+        // while editing, don't propagate mousedown/up (selects calEvent).
+        this.eventNameTextbox.onmousedown = stopPropagationIfEditing;
+        this.eventNameTextbox.onmouseup = stopPropagationIfEditing;
       ]]></constructor>
 
       <field name="mOccurrence">null</field>
       <field name="mSelected">false</field>
       <field name="mCalendarView">null</field>
 
       <property name="parentBox"
                 onget="return this.mParentBox;"
@@ -158,18 +157,18 @@
 
       <method name="setCSSClasses">
         <body><![CDATA[
           let item = this.mOccurrence;
           this.setAttribute("calendar-uri", item.calendar.uri.spec);
           this.setAttribute("calendar-id", item.calendar.id);
           let categoriesArray = item.getCategories({});
           if (categoriesArray.length > 0) {
-            let cssClassesArray = categoriesArray.map(formatStringForCSSRule);
-            this.setAttribute("categories", cssClassesArray.join(" "));
+              let cssClassesArray = categoriesArray.map(formatStringForCSSRule);
+              this.setAttribute("categories", cssClassesArray.join(" "));
           }
 
           // Add alarm icons as needed.
           let alarms = item.getAlarms({});
           if (alarms.length && Preferences.get("calendar.alarms.indicator.show", true)) {
               let iconsBox = document.getAnonymousElementByAttribute(this, "anonid", "alarm-icons-box");
               cal.alarms.addReminderImages(iconsBox, alarms);
 
@@ -258,31 +257,31 @@
           this.eventNameTextbox.value = this.mOriginalTextLabel;
           this.eventNameTextbox.removeAttribute("hidden");
           this.eventNameTextbox.select();
         ]]></body>
       </method>
       <method name="select">
         <parameter name="event"/>
         <body><![CDATA[
-            if (!this.calendarView) {
-                return;
-            }
-            let items = this.calendarView.mSelectedItems.slice();
-            if (event.ctrlKey || event.metaKey) {
-                if (this.selected) {
-                    let pos = items.indexOf(this.mOccurrence);
-                    items.splice(pos, 1);
-                } else {
-                    items.push(this.mOccurrence);
-                }
-            } else {
-                items = [this.mOccurrence];
-            }
-            this.calendarView.setSelectedItems(items.length, items);
+          if (!this.calendarView) {
+              return;
+          }
+          let items = this.calendarView.mSelectedItems.slice();
+          if (event.ctrlKey || event.metaKey) {
+              if (this.selected) {
+                  let pos = items.indexOf(this.mOccurrence);
+                  items.splice(pos, 1);
+              } else {
+                  items.push(this.mOccurrence);
+              }
+          } else {
+              items = [this.mOccurrence];
+          }
+          this.calendarView.setSelectedItems(items.length, items);
         ]]></body>
       </method>
       <method name="stopEditing">
         <parameter name="saveChanges"/>
         <body><![CDATA[
           if (!this.mEditing) {
               return;
           }
@@ -304,20 +303,20 @@
           this.eventNameLabel.removeAttribute("hidden");
           return;
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
       <handler event="contextmenu" phase="capturing"><![CDATA[
-       // If the middle/right button was used for click just select the item.
-       if (!this.selected) {
-         this.select(event);
-       }
+        // If the middle/right button was used for click just select the item.
+        if (!this.selected) {
+            this.select(event);
+        }
       ]]></handler>
       <handler event="click" button="0"><![CDATA[
         if (this.mEditing) {
             return;
         }
 
         // If the left button was used and the item is already selected
         // and there are no multiple items selected start
@@ -382,10 +381,9 @@
                 xbl:inherits="categories">
         <xul:hbox flex="1">
           <xul:image class="calendar-category-box-gradient" height="1"/>
         </xul:hbox>
         <xul:hbox height="1"/>
       </xul:vbox>
     </content>
   </binding>
-
 </bindings>
--- a/calendar/base/content/calendar-views.js
+++ b/calendar/base/content/calendar-views.js
@@ -214,18 +214,18 @@ function switchToView(aViewType) {
 
     // 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",
      "appmenu_calendar-go-menu-next",
      "appmenu_calendar-go-menu-previous"].forEach((x) => {
-            setupViewNode(x, "label");
-            setupViewNode(x, "accesskey");
+         setupViewNode(x, "label");
+         setupViewNode(x, "accesskey");
      });
 
     // Set up the labels for the view navigation
     ["previous-view-button",
      "today-view-button",
      "next-view-button"].forEach(x => setupViewNode(x, "tooltiptext"));
 
     try {
@@ -314,29 +314,29 @@ function scheduleMidnightUpdate(aRefresh
         }
     };
 
     if (gMidnightTimer) {
         gMidnightTimer.cancel();
     } else {
         // Observer for wake after sleep/hibernate/standby to create new timers and refresh UI
         let 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);
-               }
-           }
+            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
         Services.obs.addObserver(wakeObserver, "wake_notification", false);
 
         // Remove observer on unload
         window.addEventListener("unload", () => {
             Services.obs.removeObserver(wakeObserver, "wake_notification");
@@ -348,26 +348,26 @@ function scheduleMidnightUpdate(aRefresh
 }
 
 /**
  * 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 (let sheet of document.styleSheets) {
-          if (sheet.href == cssUri) {
-              getViewStyleSheet.sheet = sheet;
-              break;
-          }
-      }
-  }
-  return getViewStyleSheet.sheet;
+    if (!getViewStyleSheet.sheet) {
+        const cssUri = "chrome://calendar/content/calendar-view-bindings.css";
+        for (let sheet of 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.
@@ -400,44 +400,44 @@ function updateStyleSheetForViews(aCalen
  * 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: XPCOMUtils.generateQI([Components.interfaces.nsIObserver]),
 
     initCategories: function() {
-      categoryPrefBranch = Services.prefs.getBranch("calendar.category.color.");
-      let categories = categoryPrefBranch.getChildList("");
+        categoryPrefBranch = Services.prefs.getBranch("calendar.category.color.");
+        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)) {
-                  categories.splice(i, 1); // remove illegal name
-              } else {
-                  let color = categoryPrefBranch.getCharPref(category);
-                  categoryPrefBranch.setCharPref(categoryFix, color);
-                  categoryPrefBranch.clearUserPref(category); // not usable
-                  categories[i] = categoryFix;  // replace illegal name
-              }
-          }
-      }
+        // 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)) {
+                    categories.splice(i, 1); // remove illegal name
+                } else {
+                    let color = categoryPrefBranch.getCharPref(category);
+                    categoryPrefBranch.setCharPref(categoryFix, color);
+                    categoryPrefBranch.clearUserPref(category); // not usable
+                    categories[i] = categoryFix;  // replace illegal name
+                }
+            }
+        }
 
-      // Add color information to the stylesheets.
-      categories.forEach(categoryManagement.updateStyleSheetForCategory,
-                         categoryManagement);
-      categoryPrefBranch.addObserver("", categoryManagement, false);
+        // Add color information to the stylesheets.
+        categories.forEach(categoryManagement.updateStyleSheetForCategory,
+                           categoryManagement);
+        categoryPrefBranch.addObserver("", categoryManagement, false);
     },
 
     cleanupCategories: function() {
-      categoryPrefBranch = Services.prefs.getBranch("calendar.category.color.");
-      categoryPrefBranch.removeObserver("", categoryManagement);
+        categoryPrefBranch = Services.prefs.getBranch("calendar.category.color.");
+        categoryPrefBranch.removeObserver("", categoryManagement);
     },
 
     observe: function(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
--- a/calendar/base/content/calendar-views.xml
+++ b/calendar/base/content/calendar-views.xml
@@ -1,289 +1,289 @@
 <?xml version="1.0"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/.
--->
-
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <bindings id="calendar-specific-view-bindings"
-    xmlns="http://www.mozilla.org/xbl"
-    xmlns:html="http://www.w3.org/1999/xhtml"
-    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-    xmlns:xbl="http://www.mozilla.org/xbl">
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
 
-    <binding id="calendar-day-view"
-             extends="chrome://calendar/content/calendar-multiday-view.xml#calendar-multiday-view">
-        <implementation implements="calICalendarView">
-            <property name="observerID">
-                <getter><![CDATA[
-                    return "day-view-observer";
-                ]]></getter>
-            </property>
-            <property name="supportsWorkdaysOnly"
-                      readonly="true"
-                      onget="return false;"/>
+  <binding id="calendar-day-view"
+           extends="chrome://calendar/content/calendar-multiday-view.xml#calendar-multiday-view">
+    <implementation implements="calICalendarView">
+      <property name="observerID">
+        <getter><![CDATA[
+          return "day-view-observer";
+        ]]></getter>
+      </property>
+      <property name="supportsWorkdaysOnly"
+                readonly="true"
+                onget="return false;"/>
 
-            <!--Public methods-->
-            <method name="goToDay">
-                <parameter name="aDate"/>
-                <body><![CDATA[
-                    if (!aDate) {
-                        this.refresh();
-                        return;
-                    }
-                    aDate = aDate.getInTimezone(this.timezone);
-                    this.setDateRange(aDate, aDate);
-                    this.selectedDay = aDate;
-                ]]></body>
-            </method>
-            <method name="moveView">
-                <parameter name="aNumber"/>
-                <body><![CDATA[
-                    if (aNumber) {
-                        let currentDay = this.startDay.clone();
-                        currentDay.day += aNumber;
-                        this.goToDay(currentDay);
-                    } else {
-                        this.goToDay(now());
-                    }
-                ]]></body>
-            </method>
-        </implementation>
-    </binding>
+      <!-- Public methods -->
+      <method name="goToDay">
+        <parameter name="aDate"/>
+        <body><![CDATA[
+          if (!aDate) {
+              this.refresh();
+              return;
+          }
+          aDate = aDate.getInTimezone(this.timezone);
+          this.setDateRange(aDate, aDate);
+          this.selectedDay = aDate;
+        ]]></body>
+      </method>
+      <method name="moveView">
+        <parameter name="aNumber"/>
+        <body><![CDATA[
+          if (aNumber) {
+              let currentDay = this.startDay.clone();
+              currentDay.day += aNumber;
+              this.goToDay(currentDay);
+          } else {
+              this.goToDay(now());
+          }
+        ]]></body>
+      </method>
+    </implementation>
+  </binding>
 
-    <binding id="calendar-week-view"
-             extends="chrome://calendar/content/calendar-multiday-view.xml#calendar-multiday-view">
-        <implementation implements="calICalendarView">
-            <constructor><![CDATA[
-                // add a listener for the mode change
-                this.mModeHandler = (event) => {
-                    if (event.attrName == "mode") {
-                        this.onModeChanged(event);
-                    }
-                };
-                document.getElementById("modeBroadcaster").addEventListener("DOMAttrModified", this.mModeHandler, true);
-            ]]></constructor>
-            <destructor><![CDATA[
-                document.getElementById("modeBroadcaster").removeEventListener("DOMAttrModified", this.mModeHandler, true);
-            ]]></destructor>
+  <binding id="calendar-week-view"
+           extends="chrome://calendar/content/calendar-multiday-view.xml#calendar-multiday-view">
+    <implementation implements="calICalendarView">
+      <constructor><![CDATA[
+        // add a listener for the mode change
+        this.mModeHandler = (event) => {
+            if (event.attrName == "mode") {
+                this.onModeChanged(event);
+            }
+        };
+        document.getElementById("modeBroadcaster").addEventListener("DOMAttrModified", this.mModeHandler, true);
+      ]]></constructor>
+      <destructor><![CDATA[
+        document.getElementById("modeBroadcaster").removeEventListener("DOMAttrModified", this.mModeHandler, true);
+      ]]></destructor>
 
-            <property name="observerID">
-                <getter><![CDATA[
-                    return "week-view-observer";
-                ]]></getter>
-            </property>
+      <property name="observerID">
+        <getter><![CDATA[
+          return "week-view-observer";
+        ]]></getter>
+      </property>
 
-            <method name="onModeChanged">
-              <parameter name="aEvent"/>
-              <body><![CDATA[
-                let currentMode = document.getElementById("modeBroadcaster").getAttribute("mode");
-                if (currentMode != "calendar") {
-                    timeIndicator.cancel();
-                }
-              ]]></body>
-            </method>
+      <method name="onModeChanged">
+        <parameter name="aEvent"/>
+        <body><![CDATA[
+          let currentMode = document.getElementById("modeBroadcaster").getAttribute("mode");
+          if (currentMode != "calendar") {
+              timeIndicator.cancel();
+          }
+        ]]></body>
+      </method>
 
-            <!--Public methods-->
-            <method name="goToDay">
-                <parameter name="aDate"/>
-                <body><![CDATA[
-                    this.displayDaysOff = !this.mWorkdaysOnly;
+      <!--Public methods-->
+      <method name="goToDay">
+        <parameter name="aDate"/>
+        <body><![CDATA[
+          this.displayDaysOff = !this.mWorkdaysOnly;
 
-                    if (!aDate) {
-                        this.refresh();
-                        return;
-                    }
-                    aDate = aDate.getInTimezone(this.timezone);
-                    let weekStart = getWeekInfoService().getStartOfWeek(aDate);
-                    let weekEnd = weekStart.clone();
-                    weekEnd.day += 6;
-                    this.setDateRange(weekStart, weekEnd);
-                    this.selectedDay = aDate;
-                ]]></body>
-            </method>
-            <method name="moveView">
-                <parameter name="aNumber"/>
-                <body><![CDATA[
-                    if (aNumber) {
-                        let date = this.selectedDay.clone();
-                        date.day += 7 * aNumber;
-                        this.goToDay(date);
-                    } else {
-                        this.goToDay(now());
-                    }
-                ]]></body>
-            </method>
-        </implementation>
-    </binding>
+          if (!aDate) {
+              this.refresh();
+              return;
+          }
+          aDate = aDate.getInTimezone(this.timezone);
+          let weekStart = cal.getWeekInfoService().getStartOfWeek(aDate);
+          let weekEnd = weekStart.clone();
+          weekEnd.day += 6;
+          this.setDateRange(weekStart, weekEnd);
+          this.selectedDay = aDate;
+        ]]></body>
+      </method>
+      <method name="moveView">
+        <parameter name="aNumber"/>
+        <body><![CDATA[
+          if (aNumber) {
+              let date = this.selectedDay.clone();
+              date.day += 7 * aNumber;
+              this.goToDay(date);
+          } else {
+              this.goToDay(now());
+          }
+        ]]></body>
+      </method>
+    </implementation>
+  </binding>
 
-    <binding id="calendar-multiweek-view" extends="chrome://calendar/content/calendar-month-view.xml#calendar-month-base-view">
-        <implementation implements="calICalendarView">
-	        <constructor><![CDATA[
-                Components.utils.import("resource://gre/modules/Preferences.jsm");
-                this.mWeeksInView = Preferences.get("calendar.weeks.inview", 4);
-            ]]></constructor>
+  <binding id="calendar-multiweek-view" extends="chrome://calendar/content/calendar-month-view.xml#calendar-month-base-view">
+    <implementation implements="calICalendarView">
+      <constructor><![CDATA[
+        Components.utils.import("resource://gre/modules/Preferences.jsm");
+        this.mWeeksInView = Preferences.get("calendar.weeks.inview", 4);
+      ]]></constructor>
 
-            <field name="mWeeksInView">4</field>
+      <field name="mWeeksInView">4</field>
 
-            <property name="weeksInView">
-                <getter><![CDATA[
-                    return this.mWeeksInView;
-                ]]></getter>
-                <setter><![CDATA[
-                    this.mWeeksInView = val;
-                    Preferences.set("calendar.weeks.inview", Number(val));
-                    this.refreshView();
-                    return val;
-                ]]></setter>
-            </property>
+      <property name="weeksInView">
+        <getter><![CDATA[
+          return this.mWeeksInView;
+        ]]></getter>
+        <setter><![CDATA[
+          this.mWeeksInView = val;
+          Preferences.set("calendar.weeks.inview", Number(val));
+          this.refreshView();
+          return val;
+        ]]></setter>
+      </property>
 
-            <property name="supportsZoom" readonly="true"
-                      onget="return true;"/>
+      <property name="supportsZoom" readonly="true"
+                onget="return true;"/>
 
-            <method name="zoomIn">
-              <parameter name="aLevel"/>
-              <body><![CDATA[
-                let visibleWeeks = Preferences.get("calendar.weeks.inview", 4);
-                visibleWeeks += (aLevel || 1);
+      <method name="zoomIn">
+        <parameter name="aLevel"/>
+        <body><![CDATA[
+          let visibleWeeks = Preferences.get("calendar.weeks.inview", 4);
+          visibleWeeks += (aLevel || 1);
 
-                Preferences.set("calendar.weeks.inview", Math.min(visibleWeeks, 6));
-              ]]></body>
-            </method>
-            <method name="zoomOut">
-              <parameter name="aLevel"/>
-              <body><![CDATA[
-                let visibleWeeks = Preferences.get("calendar.weeks.inview", 4);
-                visibleWeeks -= (aLevel || 1);
+          Preferences.set("calendar.weeks.inview", Math.min(visibleWeeks, 6));
+        ]]></body>
+      </method>
+
+      <method name="zoomOut">
+        <parameter name="aLevel"/>
+        <body><![CDATA[
+          let visibleWeeks = Preferences.get("calendar.weeks.inview", 4);
+          visibleWeeks -= aLevel || 1;
+
+          Preferences.set("calendar.weeks.inview", Math.max(visibleWeeks, 2));
+        ]]></body>
+      </method>
+
+      <method name="zoomReset">
+        <body><![CDATA[
+          Preferences.set("calendar.view.visiblehours", 4);
+        ]]></body>
+      </method>
+
+      <property name="observerID">
+        <getter><![CDATA[
+          return "multiweek-view-observer";
+        ]]></getter>
+      </property>
 
-                Preferences.set("calendar.weeks.inview", Math.max(visibleWeeks, 2));
-              ]]></body>
-            </method>
-            <method name="zoomReset">
-              <body><![CDATA[
-                Preferences.set("calendar.view.visiblehours", 4);
-              ]]></body>
-            </method>
+      <!--Public methods-->
+      <method name="goToDay">
+        <parameter name="aDate"/>
+        <body><![CDATA[
+          this.showFullMonth = false;
+          this.displayDaysOff = !this.mWorkdaysOnly;
 
-            <property name="observerID">
-                <getter><![CDATA[
-                    return "multiweek-view-observer";
-                ]]></getter>
-            </property>
-
-            <!--Public methods-->
-            <method name="goToDay">
-                <parameter name="aDate"/>
-                <body><![CDATA[
-                    this.showFullMonth = false;
-                    this.displayDaysOff = !this.mWorkdaysOnly;
+          // If aDate is null it means that only a refresh is needed
+          // without changing the start and end of the view.
+          if (aDate) {
+              aDate = aDate.getInTimezone(this.timezone);
+              // Get the first date that should be shown. This is the
+              // start of the week of the day that we're centering around
+              // adjusted for the day the week starts on and the number
+              // of previous weeks we're supposed to display.
+              let dayStart = cal.getWeekInfoService().getStartOfWeek(aDate);
+              dayStart -= 7 * Preferences.get("calendar.previousweeks.inview", 0);
+              // The last day we're supposed to show
+              let dayEnd = dayStart.clone();
+              dayEnd += (7 * this.mWeeksInView) - 1;
+              this.setDateRange(dayStart, dayEnd);
+              this.selectedDay = aDate;
+          } else {
+              this.refresh();
+          }
+        ]]></body>
+      </method>
 
-                    // If aDate is null it means that only a refresh is needed
-                    // without changing the start and end of the view.
-                    if (aDate) {
-                        aDate = aDate.getInTimezone(this.timezone);
-                        // Get the first date that should be shown. This is the
-                        // start of the week of the day that we're centering around
-                        // adjusted for the day the week starts on and the number
-                        // of previous weeks we're supposed to display.
-                        let dayStart = getWeekInfoService().getStartOfWeek(aDate);
-                        dayStart.day -= (7 * Preferences.get("calendar.previousweeks.inview", 0));
-                        // The last day we're supposed to show
-                        let dayEnd = dayStart.clone();
-                        dayEnd.day += ((7 * this.mWeeksInView) - 1);
-                        this.setDateRange(dayStart, dayEnd);
-                        this.selectedDay = aDate;
-                    } else {
-                        this.refresh();
-                    }
-                ]]></body>
-            </method>
-            <method name="moveView">
-                <parameter name="aNumber"/>
-                <body><![CDATA[
-                    if (aNumber) {
-                        let date = this.startDay.clone();
-                        let savedSelectedDay = this.selectedDay.clone();
-                        // aNumber only corresponds to the number of weeks to move
-                        // make sure to compensate for previous weeks in view too
-                        date.day += 7 * (aNumber + Preferences.get("calendar.previousweeks.inview", 4));
-                        this.goToDay(date);
-                        savedSelectedDay.day += 7 * aNumber;
-                        this.selectedDay = savedSelectedDay;
-                    } else {
-                        let date = now();
-                        this.goToDay(date);
-                        this.selectedDay = date;
-                    }
-                ]]></body>
-            </method>
-        </implementation>
-    </binding>
+      <method name="moveView">
+        <parameter name="aNumber"/>
+        <body><![CDATA[
+          if (aNumber) {
+              let date = this.startDay.clone();
+              let savedSelectedDay = this.selectedDay.clone();
+              // aNumber only corresponds to the number of weeks to move
+              // make sure to compensate for previous weeks in view too
+              date.day += 7 * (aNumber + Preferences.get("calendar.previousweeks.inview", 4));
+              this.goToDay(date);
+              savedSelectedDay.day += 7 * aNumber;
+              this.selectedDay = savedSelectedDay;
+          } else {
+              let date = now();
+              this.goToDay(date);
+              this.selectedDay = date;
+          }
+        ]]></body>
+      </method>
+    </implementation>
+  </binding>
 
-    <binding id="calendar-month-view" extends="chrome://calendar/content/calendar-month-view.xml#calendar-month-base-view">
-        <implementation implements="calICalendarView">
+  <binding id="calendar-month-view" extends="chrome://calendar/content/calendar-month-view.xml#calendar-month-base-view">
+    <implementation implements="calICalendarView">
+      <property name="observerID">
+        <getter><![CDATA[
+          return "month-view-observer";
+        ]]></getter>
+      </property>
 
-            <property name="observerID">
-                <getter><![CDATA[
-                    return "month-view-observer";
-                ]]></getter>
-            </property>
+      <!--Public methods-->
+      <method name="goToDay">
+        <parameter name="aDate"/>
+        <body><![CDATA[
+          this.displayDaysOff = !this.mWorkdaysOnly;
 
-            <!--Public methods-->
-            <method name="goToDay">
-                <parameter name="aDate"/>
-                <body><![CDATA[
-                    this.displayDaysOff = !this.mWorkdaysOnly;
+          if (aDate) {
+              aDate = aDate.getInTimezone(this.timezone);
+          }
+          this.showDate(aDate);
+        ]]></body>
+      </method>
+      <method name="getRangeDescription">
+        <body><![CDATA[
+          let monthName = cal.formatMonth(this.rangeStartDate.month + 1,
+                                          "calendar", "monthInYear");
+          return calGetString("calendar", "monthInYear", [monthName, this.rangeStartDate.year]);
+         ]]></body>
+       </method>
+      <method name="moveView">
+        <parameter name="aNumber"/>
+        <body><![CDATA[
+          let dates = this.getDateList({});
+          this.displayDaysOff = !this.mWorkdaysOnly;
 
-                    if (aDate) {
-                        aDate = aDate.getInTimezone(this.timezone);
-                    }
-                    this.showDate(aDate);
-                ]]></body>
-            </method>
-            <method name="getRangeDescription">
-                <body><![CDATA[
-                    let monthName = cal.formatMonth(this.rangeStartDate.month + 1,
-                                                    "calendar", "monthInYear");
-                    return calGetString("calendar", "monthInYear", [monthName, this.rangeStartDate.year]);
-                 ]]></body>
-             </method>
-            <method name="moveView">
-                <parameter name="aNumber"/>
-                <body><![CDATA[
-                    let dates = this.getDateList({});
-                    this.displayDaysOff = !this.mWorkdaysOnly;
+          if (aNumber) {
+              // The first few dates in this list are likely in the month
+              // prior to the one actually being shown (since the month
+              // probably doesn't start on a Sunday).  The 7th item must
+              // be in correct month though.
+              let date = dates[6].clone();
 
-                    if (aNumber) {
-                        // The first few dates in this list are likely in the month
-                        // prior to the one actually being shown (since the month
-                        // probably doesn't start on a Sunday).  The 7th item must
-                        // be in correct month though.
-                        let date = dates[6].clone();
+              date.month += aNumber;
+              // Need to store this before we move
+              let oldSelectedDay = this.selectedDay;
 
-                        date.month += aNumber;
-                        // Need to store this before we move
-                        let oldSelectedDay = this.selectedDay;
-
-                        this.goToDay(date);
+              this.goToDay(date);
 
-                        // Most of the time we want to select the date with the
-                        // same day number in the next month
-                        let newSelectedDay = oldSelectedDay.clone();
-                        newSelectedDay.month += aNumber;
-                        // correct for accidental rollover into the next month
-                        if ((newSelectedDay.month - aNumber + 12) % 12 != oldSelectedDay.month) {
-                            newSelectedDay.month -= 1;
-                            newSelectedDay.day = newSelectedDay.endOfMonth.day;
-                        }
+              // Most of the time we want to select the date with the
+              // same day number in the next month
+              let newSelectedDay = oldSelectedDay.clone();
+              newSelectedDay.month += aNumber;
+              // correct for accidental rollover into the next month
+              if ((newSelectedDay.month - aNumber + 12) % 12 != oldSelectedDay.month) {
+                  newSelectedDay.month -= 1;
+                  newSelectedDay.day = newSelectedDay.endOfMonth.day;
+              }
 
-                        this.selectedDay = newSelectedDay;
-                    } else {
-                        let date = now();
-                        this.goToDay(date);
-                        this.selectedDay = date;
-                    }
-                ]]></body>
-            </method>
-        </implementation>
-    </binding>
+              this.selectedDay = newSelectedDay;
+          } else {
+              let date = now();
+              this.goToDay(date);
+              this.selectedDay = date;
+          }
+        ]]></body>
+      </method>
+    </implementation>
+  </binding>
 </bindings>
--- a/calendar/base/content/dialogs/calendar-dialog-utils.js
+++ b/calendar/base/content/dialogs/calendar-dialog-utils.js
@@ -235,19 +235,19 @@ function matchCustomReminderToMenuitem(r
         // If the time duration for offset is 0, means the reminder is '0 minutes before'
         if (reminder.offset.inSeconds == 0 || reminder.offset.isNegative) {
             origin = "before";
         } else {
             origin = "after";
         }
 
         let unitMap = {
-          days: 86400,
-          hours: 3600,
-          minutes: 60
+            days: 86400,
+            hours: 3600,
+            minutes: 60
         };
 
         for (let menuitem of reminderPopup.childNodes) {
             if (menuitem.localName == "menuitem" &&
                 menuitem.hasAttribute("length") &&
                 menuitem.getAttribute("origin") == origin &&
                 menuitem.getAttribute("relation") == relation) {
                 let unitMult = unitMap[menuitem.getAttribute("unit")] || 1;
@@ -347,17 +347,17 @@ function saveReminder(item) {
         if (ics in oldAlarmMap) {
             // The new alarm is also in the old set, remember this
             delete oldAlarmMap[ics];
         } else {
             // The new alarm is not in the old set, this means the alarms
             // differ and we can break out.
             oldAlarmMap[ics] = true;
             break;
-       }
+        }
     }
 
     // If the alarms differ, clear the snooze/dismiss properties
     if (Object.keys(oldAlarmMap).length > 0) {
         let cmp = "X-MOZ-SNOOZE-TIME";
 
         // Recurring item alarms potentially have more snooze props, remove them
         // all.
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
@@ -788,17 +788,17 @@ function applyCurrentZoomFactor() {
 /**
  * Force the time grid to show 24 hours.
  *
  * @param aValue        If true, the view will be forced to 24 hours.
  * @return              aValue (for chaining)
  */
 function setForce24Hours(aValue) {
     if (gForce24Hours == aValue) {
-      return aValue;
+        return aValue;
     }
 
     gForce24Hours = aValue;
     initTimeRange();
     let timebar = document.getElementById("timebar");
     timebar.force24Hours = gForce24Hours;
     let selectionbar = document.getElementById("selection-bar");
     selectionbar.force24Hours = gForce24Hours;
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
@@ -243,18 +243,18 @@
           }
 
           // trim spaces if any
           inputValue = inputValue.trim();
 
           // don't set value with null, otherwise autocomplete stops working,
           // but make sure attendee and dirty are set
           if (inputValue.length) {
-	          input.setAttribute("value", inputValue);
-	          input.value = inputValue;
+              input.setAttribute("value", inputValue);
+              input.value = inputValue;
           }
           input.attendee = aAttendee;
           input.setAttribute("dirty", "true");
 
           if (aAttendee) {
               // Set up userType
               setElementValue(userTypeIcon, aAttendee.userType || false, "cutype");
               this.updateTooltip(userTypeIcon);
@@ -455,79 +455,79 @@
     </method>
 
     <method name="_findListInAddrBooks">
         <parameter name="entryname"/>
         <body><![CDATA[
             let allAddressBooks = MailServices.ab.directories;
 
             while (allAddressBooks.hasMoreElements()) {
-              let abDir = null;
-              try {
-                abDir = allAddressBooks.getNext()
-                                  .QueryInterface(Components.interfaces.nsIAbDirectory);
-              } catch (ex) {
-                cal.WARN("[eventDialog] Error Encountered" + ex);
-              }
+                let abDir = null;
+                try {
+                    abDir = allAddressBooks.getNext()
+                                           .QueryInterface(Components.interfaces.nsIAbDirectory);
+                } catch (ex) {
+                    cal.WARN("[eventDialog] Error Encountered" + ex);
+                }
 
-              if (abDir != null && abDir.supportsMailingLists) {
-                let childNodes = abDir.childNodes;
-                while (childNodes.hasMoreElements()) {
-                  let dir = null;
-                  try {
-                    dir = childNodes.getNext().QueryInterface(Components.interfaces.nsIAbDirectory);
-                  } catch (ex) {
-                    cal.WARN("[eventDialog] Error Encountered" + ex);
-                  }
+                if (abDir != null && abDir.supportsMailingLists) {
+                    let childNodes = abDir.childNodes;
+                    while (childNodes.hasMoreElements()) {
+                        let dir = null;
+                        try {
+                            dir = childNodes.getNext().QueryInterface(Components.interfaces.nsIAbDirectory);
+                        } catch (ex) {
+                            cal.WARN("[eventDialog] Error Encountered" + ex);
+                        }
 
-                  if (dir && dir.isMailList && (dir.dirName == entryname)) {
-                    return dir;
-                  }
+                        if (dir && dir.isMailList && (dir.dirName == entryname)) {
+                            return dir;
+                        }
+                    }
                 }
-              }
             }
             return null;
         ]]></body>
     </method>
 
     <method name="_getListEntriesInt">
         <parameter name="mailingList"/>
         <parameter name="attendees"/>
         <parameter name="allListsUri"/>
         <body><![CDATA[
             let addressLists = mailingList.addressLists;
             for (let i = 0; i < addressLists.length; i++) {
-              let abCard = addressLists.queryElementAt(i, Components.interfaces.nsIAbCard);
-              let thisId = abCard.primaryEmail;
-              if (abCard.displayName.length > 0) {
-                  let rCn = abCard.displayName;
-                  if (rCn.includes(",")) {
-                      rCn = '"' + rCn + '"';
-                  }
-                  thisId = rCn + " <" + thisId + ">";
-              }
-              if (attendees.some(att => att == thisId)) {
-                continue;
-              }
+                let abCard = addressLists.queryElementAt(i, Components.interfaces.nsIAbCard);
+                let thisId = abCard.primaryEmail;
+                if (abCard.displayName.length > 0) {
+                    let rCn = abCard.displayName;
+                    if (rCn.includes(",")) {
+                        rCn = '"' + rCn + '"';
+                    }
+                    thisId = rCn + " <" + thisId + ">";
+                }
+                if (attendees.some(att => att == thisId)) {
+                    continue;
+                }
 
-              if (abCard.displayName.length > 0) {
-                let list = this._findListInAddrBooks(abCard.displayName);
-                if (list) {
-                  if (allListsUri.some(uri => uri == list.URI)) {
-                    continue;
-                  }
-                  allListsUri.push(list.URI);
+                if (abCard.displayName.length > 0) {
+                    let list = this._findListInAddrBooks(abCard.displayName);
+                    if (list) {
+                        if (allListsUri.some(uri => uri == list.URI)) {
+                            continue;
+                        }
+                        allListsUri.push(list.URI);
 
-                  this._getListEntriesInt(list, attendees, allListsUri);
+                        this._getListEntriesInt(list, attendees, allListsUri);
 
-                  continue;
+                        continue;
+                    }
                 }
-              }
 
-              attendees.push(thisId);
+                attendees.push(thisId);
             }
 
             return attendees;
           ]]></body>
     </method>
 
     <method name="_getListEntries">
         <parameter name="mailingList"/>
@@ -572,54 +572,54 @@
             let userTypeIcon = document.getAnonymousElementByAttribute(listitem, "anonid", "usertype-icon");
             userTypeIcon.removeAttribute("disabled");
             userTypeIcon.setAttribute("id", "attendeeCol2#" + rowNumber);
             userTypeIcon.setAttribute("cutype", newAttendee.userType);
           ]]></body>
     </method>
 
     <method name="resolvePotentialList">
-        <parameter name="aInput"/>
-        <body><![CDATA[
-            let fieldValue = aInput.value;
-            if (aInput.id.length > 0 && fieldValue.length > 0) {
-                let mailingList = this._resolveListByName(fieldValue);
-                if (mailingList) {
-                    let entries = this._getListEntries(mailingList);
-                      if (entries.length > 0) {
-                          let currentIndex = parseInt(aInput.id.substr(13), 10);
-                          let template = document.getAnonymousElementByAttribute(this, "anonid", "item");
-                          let currentNode = template.parentNode.childNodes[currentIndex];
-                          this._fillListItemWithEntry(currentNode, entries[0], currentIndex);
-                          entries.shift();
-                          let nextNode = template.parentNode.childNodes[currentIndex + 1];
+      <parameter name="aInput"/>
+      <body><![CDATA[
+          let fieldValue = aInput.value;
+          if (aInput.id.length > 0 && fieldValue.length > 0) {
+              let mailingList = this._resolveListByName(fieldValue);
+              if (mailingList) {
+                  let entries = this._getListEntries(mailingList);
+                  if (entries.length > 0) {
+                      let currentIndex = parseInt(aInput.id.substr(13), 10);
+                      let template = document.getAnonymousElementByAttribute(this, "anonid", "item");
+                      let currentNode = template.parentNode.childNodes[currentIndex];
+                      this._fillListItemWithEntry(currentNode, entries[0], currentIndex);
+                      entries.shift();
+                      let nextNode = template.parentNode.childNodes[currentIndex + 1];
+                      currentIndex++;
+                      for (let entry of entries) {
+                          currentNode = template.cloneNode(true);
+                          template.parentNode.insertBefore(currentNode, nextNode);
+                          this._fillListItemWithEntry(currentNode, entry, currentIndex);
                           currentIndex++;
-                          for (let entry of entries) {
-                              currentNode = template.cloneNode(true);
-                              template.parentNode.insertBefore(currentNode, nextNode);
-                              this._fillListItemWithEntry(currentNode, entry, currentIndex);
-                              currentIndex++;
-                          }
-                          this.mMaxAttendees += entries.length;
-                          for (let i = currentIndex; i <= this.mMaxAttendees; i++) {
-                              let row = template.parentNode.childNodes[i];
-                              let roleStatusIcon = document.getAnonymousElementByAttribute(row, "anonid", "rolestatus-icon");
-                              roleStatusIcon.setAttribute("id", "attendeeCol1#" + i);
+                      }
+                      this.mMaxAttendees += entries.length;
+                      for (let i = currentIndex; i <= this.mMaxAttendees; i++) {
+                          let row = template.parentNode.childNodes[i];
+                          let roleStatusIcon = document.getAnonymousElementByAttribute(row, "anonid", "rolestatus-icon");
+                          roleStatusIcon.setAttribute("id", "attendeeCol1#" + i);
 
-                              let userTypeIcon = document.getAnonymousElementByAttribute(row, "anonid", "usertype-icon");
-                              userTypeIcon.setAttribute("id", "attendeeCol2#" + i);
+                          let userTypeIcon = document.getAnonymousElementByAttribute(row, "anonid", "usertype-icon");
+                          userTypeIcon.setAttribute("id", "attendeeCol2#" + i);
 
-                              let input = document.getAnonymousElementByAttribute(row, "anonid", "input");
-                              input.setAttribute("id", "attendeeCol3#" + i);
-                              input.setAttribute("dirty", "true");
-                          }
+                          let input = document.getAnonymousElementByAttribute(row, "anonid", "input");
+                          input.setAttribute("id", "attendeeCol3#" + i);
+                          input.setAttribute("dirty", "true");
                       }
                   }
               }
-            ]]></body>
+          }
+        ]]></body>
       </method>
 
       <method name="onModify">
         <body><![CDATA[
           let list = [];
           for (let i = 1; i <= this.mMaxAttendees; i++) {
               // retrieve the string from the appropriate row
               let input = this.getInputElement(i);
@@ -652,20 +652,20 @@
       <parameter name="targetIcon"/>
       <body><![CDATA[
         // Function setting the tooltip of attendeeicons based on their role
         if (targetIcon.className == "role-icon") {
             let role = targetIcon.getAttribute("role");
             // Set tooltip for rolenames
 
             const roleMap = {
-              "REQ-PARTICIPANT": "required",
-              "OPT-PARTICIPANT": "optional",
-              "NON-PARTICIPANT": "nonparticipant",
-              "CHAIR": "chair"
+                "REQ-PARTICIPANT": "required",
+                "OPT-PARTICIPANT": "optional",
+                "NON-PARTICIPANT": "nonparticipant",
+                "CHAIR": "chair"
             };
 
             let roleNameString = "event.attendee.role." + (role in roleMap ? roleMap[role] : "unknown");
             let tooltip = cal.calGetString("calendar-event-dialog-attendees",
                                            roleNameString,
                                            role in roleMap ? null : [role]);
             targetIcon.setAttribute("tooltiptext", tooltip);
         } else if (targetIcon.className == "usertype-icon") {
@@ -865,19 +865,19 @@
 
       <method name="setFocus">
         <parameter name="aRow"/>
         <body><![CDATA[
           let self = this;
           let set_focus = function() {
               let node;
               if (typeof aRow == "number") {
-                node = self.getListItem(aRow);
+                  node = self.getListItem(aRow);
               } else {
-                node = aRow;
+                  node = aRow;
               }
 
               // do we need to scroll in order to see the selected row?
               let listbox =
                   document.getAnonymousElementByAttribute(
                       self, "anonid", "listbox");
               let firstVisibleRow = listbox.getIndexOfFirstVisibleRow();
               let numOfVisibleRows = listbox.getNumberOfVisibleRows();
@@ -1321,19 +1321,19 @@
         <getter><![CDATA[
           return this.mEndDate;
         ]]></getter>
       </property>
 
       <property name="leftdragWidth">
         <getter><![CDATA[
           if (!this.mLeftBox) {
-            this.mLeftBox =
-                document.getAnonymousElementByAttribute(
-                    this, "anonid", "leftbox");
+              this.mLeftBox =
+                  document.getAnonymousElementByAttribute(
+                      this, "anonid", "leftbox");
           }
           return this.mLeftBox.boxObject.width;
         ]]></getter>
       </property>
       <property name="rightdragWidth">
         <getter><![CDATA[
           if (!this.mRightBox) {
               this.mRightBox =
@@ -1595,10 +1595,9 @@
       ]]></handler>
 
       <handler event="mouseup"><![CDATA[
         this.mDragState = 0;
         window.setCursor("auto");
       ]]></handler>
     </handlers>
   </binding>
-
 </bindings>
--- a/calendar/base/content/dialogs/calendar-event-dialog-freebusy.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-freebusy.xml
@@ -298,17 +298,17 @@
           this.initTimeRange();
 
           let template =
               document.getAnonymousElementByAttribute(
                   this, "anonid", "template");
 
           let parent = template.parentNode;
           while (parent.childNodes.length > 1) {
-            parent.lastChild.remove();
+              parent.lastChild.remove();
           }
 
           template.force24Hours = this.mForce24Hours;
           template.zoomFactor = this.mZoomFactor;
 
           this.onLoad();
 
           return val;
@@ -913,47 +913,47 @@
           let duration = aEndTime.subtractDate(aStartTime);
           let newEndTime = newTime.clone();
           newEndTime.addDuration(duration);
 
           let kDefaultTimezone = calendarDefaultTimezone();
 
           if (this.mEntries) {
               for (let entry of this.mEntries) {
-                let rangeStart =
-                    entry.interval.start.getInTimezone(kDefaultTimezone);
-                let rangeEnd =
-                    entry.interval.end.getInTimezone(kDefaultTimezone);
+                  let rangeStart =
+                      entry.interval.start.getInTimezone(kDefaultTimezone);
+                  let rangeEnd =
+                      entry.interval.end.getInTimezone(kDefaultTimezone);
 
-                let isZeroLength = !newTime.compare(newEndTime);
-                if ((isZeroLength &&
-                     newTime.compare(rangeStart) >= 0 &&
-                     newTime.compare(rangeEnd) < 0) ||
-                    (!isZeroLength &&
-                     newTime.compare(rangeEnd) < 0 &&
-                     newEndTime.compare(rangeStart) > 0)) {
-                    // Current range of event conflicts with another event.
-                    // we need to find a new time for this event. A trivial approach
-                    // is to set the new start-time of the event equal to the end-time
-                    // of the conflict-range. All-day events need to be considered
-                    // separately, in which case we skip to the next day.
-                    newTime = rangeEnd.clone();
-                    if (allDay) {
-                        if (!((newTime.hour == 0) &&
-                             (newTime.minute == 0) &&
-                             (newTime.second == 0))) {
-                            newTime.day++;
-                            newTime.hour = 0;
-                            newTime.minute = 0;
-                            newTime.second = 0;
-                        }
-                    }
-                    newEndTime = newTime.clone();
-                    newEndTime.addDuration(duration);
-                }
+                  let isZeroLength = !newTime.compare(newEndTime);
+                  if ((isZeroLength &&
+                       newTime.compare(rangeStart) >= 0 &&
+                       newTime.compare(rangeEnd) < 0) ||
+                      (!isZeroLength &&
+                       newTime.compare(rangeEnd) < 0 &&
+                       newEndTime.compare(rangeStart) > 0)) {
+                      // Current range of event conflicts with another event.
+                      // we need to find a new time for this event. A trivial approach
+                      // is to set the new start-time of the event equal to the end-time
+                      // of the conflict-range. All-day events need to be considered
+                      // separately, in which case we skip to the next day.
+                      newTime = rangeEnd.clone();
+                      if (allDay) {
+                          if (!((newTime.hour == 0) &&
+                               (newTime.minute == 0) &&
+                               (newTime.second == 0))) {
+                              newTime.day++;
+                              newTime.hour = 0;
+                              newTime.minute = 0;
+                              newTime.second = 0;
+                          }
+                      }
+                      newEndTime = newTime.clone();
+                      newEndTime.addDuration(duration);
+                  }
               }
           }
 
           return newTime;
         ]]></body>
       </method>
 
       <method name="initTimeRange">
@@ -1344,42 +1344,42 @@
           let recheck;
           do {
               recheck = false;
 
               for (let i = 1; i <= this.mMaxFreeBusy; i++) {
                   let row = this.getFreeBusyElement(i);
                   let newTime = row.nextSlot(startTime, endTime, allDay);
                   if (newTime) {
-                    if (newTime.compare(startTime) != 0) {
-                        startTime = newTime;
+                      if (newTime.compare(startTime) != 0) {
+                          startTime = newTime;
 
-                        if (startTime.hour < this.mStartHour) {
-                            startTime.hour = this.mStartHour;
-                            startTime.minute = 0;
-                        }
+                          if (startTime.hour < this.mStartHour) {
+                              startTime.hour = this.mStartHour;
+                              startTime.minute = 0;
+                          }
 
-                        endTime = startTime.clone();
-                        endTime.addDuration(duration);
+                          endTime = startTime.clone();
+                          endTime.addDuration(duration);
 
-                        if (endTime.hour > this.mEndHour) {
-                            startTime.day++;
-                            startTime.hour = this.mStartHour;
-                            startTime.minute = 0;
-                            endTime = startTime.clone();
-                            endTime.addDuration(duration);
-                        }
+                          if (endTime.hour > this.mEndHour) {
+                              startTime.day++;
+                              startTime.hour = this.mStartHour;
+                              startTime.minute = 0;
+                              endTime = startTime.clone();
+                              endTime.addDuration(duration);
+                          }
 
-                        recheck = true;
-                    }
-                } else {
-                    // A new slot could not be found
-                    // and the given time was also invalid.
-                    return this.mStartDate.clone();
-                }
+                          recheck = true;
+                      }
+                  } else {
+                      // A new slot could not be found
+                      // and the given time was also invalid.
+                      return this.mStartDate.clone();
+                  }
               }
           } while (recheck);
 
           // Return the unmodifed startdate of the item
           // in case no possible match was found.
           if (startTime.compare(this.mStartDate) == 0) {
               return this.mStartDate.clone();
           }
--- a/calendar/base/content/dialogs/calendar-event-dialog-recurrence-preview.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-recurrence-preview.xml
@@ -26,17 +26,16 @@
               <xul:spacer/>
             </xul:row>
           </xul:rows>
         </xul:grid>
       </xul:box>
     </content>
 
     <implementation>
-
       <field name="mRecurrenceInfo">null</field>
       <field name="mResizeHandler">null</field>
       <field name="mDateTime">null</field>
 
       <constructor><![CDATA[
         this.mResizeHandler = this.onResize.bind(this);
         window.addEventListener("resize", this.mResizeHandler, true);
       ]]></constructor>
@@ -201,42 +200,42 @@
                       let occurrence = null;
                       if (index < dates.length) {
                           occurrence =
                               dates[index++]
                                   .getInTimezone(start.timezone);
                       }
                       let current = start.clone();
                       while (current.compare(end) < 0) {
-                        let box = minimonth.getBoxForDate(current);
-                        if (box) {
-                            if (occurrence &&
-                                occurrence.day == current.day &&
-                                occurrence.month == current.month &&
-                                occurrence.year == current.year) {
-                                box.setAttribute("busy", 1);
-                                if (index < dates.length) {
-                                    occurrence =
-                                        dates[index++]
-                                            .getInTimezone(start.timezone);
-                                    // take into account that the very next occurrence
-                                    // can happen at the same day as the previous one.
-                                    if (occurrence.day == current.day &&
-                                        occurrence.month == current.month &&
-                                        occurrence.year == current.year) {
-                                        continue;
-                                    }
-                                } else {
-                                    occurrence = null;
-                                }
-                            } else {
-                                box.removeAttribute("busy");
-                            }
-                        }
-                        current.day++;
+                          let box = minimonth.getBoxForDate(current);
+                          if (box) {
+                              if (occurrence &&
+                                  occurrence.day == current.day &&
+                                  occurrence.month == current.month &&
+                                  occurrence.year == current.year) {
+                                  box.setAttribute("busy", 1);
+                                  if (index < dates.length) {
+                                      occurrence =
+                                          dates[index++]
+                                              .getInTimezone(start.timezone);
+                                      // take into account that the very next occurrence
+                                      // can happen at the same day as the previous one.
+                                      if (occurrence.day == current.day &&
+                                          occurrence.month == current.month &&
+                                          occurrence.year == current.year) {
+                                          continue;
+                                      }
+                                  } else {
+                                      occurrence = null;
+                                  }
+                              } else {
+                                  box.removeAttribute("busy");
+                              }
+                          }
+                          current.day++;
                       }
                   }
                   start.month++;
                   end.month++;
               }
               row = row.nextSibling;
           }
         ]]></body>
--- a/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
@@ -460,17 +460,17 @@ function onChangeCalendar(calendar) {
  * - disable-on-readonly
  *
  * A task without a start time is also considered readonly.
  *
  * @param item        The item to check.
  */
 function disableOrEnable(item) {
     if (item.parentItem != item) {
-       disableRecurrenceFields("disable-on-occurrence");
+        disableRecurrenceFields("disable-on-occurrence");
     } else if (gIsReadOnly) {
         disableRecurrenceFields("disable-on-readonly");
     } else if (isToDo(item) && !gStartTime) {
         disableRecurrenceFields("disable-on-readonly");
     } else {
         enableRecurrenceFields("disable-on-readonly");
     }
 }
--- a/calendar/base/content/dialogs/calendar-invitations-list.xml
+++ b/calendar/base/content/dialogs/calendar-invitations-list.xml
@@ -65,24 +65,26 @@
     <implementation>
       <!-- fields -->
       <field name="mDateFormatter">null</field>
       <field name="mCalendarItem">null</field>
       <field name="mInitialParticipationStatus">null</field>
       <field name="mParticipationStatus">null</field>
 
       <property name="mStrings">
-        <getter>return {
-            alldayEvent: "&calendar.invitations.list.alldayevent.text;",
-            recurrentEvent: "&calendar.invitations.list.recurrentevent.text;",
-            location: "&calendar.invitations.list.location.text;",
-            organizer: "&calendar.invitations.list.organizer.text;",
-            attendee: "&calendar.invitations.list.attendee.text;",
-            none: "&calendar.invitations.list.none.text;"
-        };</getter>
+        <getter>
+          return {
+              alldayEvent: "&calendar.invitations.list.alldayevent.text;",
+              recurrentEvent: "&calendar.invitations.list.recurrentevent.text;",
+              location: "&calendar.invitations.list.location.text;",
+              organizer: "&calendar.invitations.list.organizer.text;",
+              attendee: "&calendar.invitations.list.attendee.text;",
+              none: "&calendar.invitations.list.none.text;"
+          };
+        </getter>
       </property>
 
       <!-- properties -->
       <property name="calendarItem">
         <getter><![CDATA[
           return this.mCalendarItem;
         ]]></getter>
         <setter><![CDATA[
@@ -119,81 +121,81 @@
         Components.utils.import("resource://calendar/modules/calUtils.jsm");
         this.mDateFormatter = getDateFormatter();
       ]]></constructor>
 
       <!-- methods -->
       <method name="setCalendarItem">
         <parameter name="aItem"/>
         <body><![CDATA[
-            this.mCalendarItem = aItem;
-            this.mInitialParticipationStatus =
-                this.getCalendarItemParticipationStatus(aItem);
-            this.participationStatus = this.mInitialParticipationStatus;
+          this.mCalendarItem = aItem;
+          this.mInitialParticipationStatus =
+              this.getCalendarItemParticipationStatus(aItem);
+          this.participationStatus = this.mInitialParticipationStatus;
 
-            let titleLabel = document.getAnonymousElementByAttribute(
-                this, "anonid", "title");
-            titleLabel.setAttribute("value", aItem.title);
+          let titleLabel = document.getAnonymousElementByAttribute(
+              this, "anonid", "title");
+          titleLabel.setAttribute("value", aItem.title);
 
-            let dateLabel = document.getAnonymousElementByAttribute(
-                this, "anonid", "date");
-            let dateString = this.mDateFormatter.formatItemInterval(aItem);
-            if (aItem.startDate.isDate) {
-                dateString += ", " + this.mStrings.alldayEvent;
-            }
-            dateLabel.setAttribute("value", dateString);
+          let dateLabel = document.getAnonymousElementByAttribute(
+              this, "anonid", "date");
+          let dateString = this.mDateFormatter.formatItemInterval(aItem);
+          if (aItem.startDate.isDate) {
+              dateString += ", " + this.mStrings.alldayEvent;
+          }
+          dateLabel.setAttribute("value", dateString);
 
-            let recurrenceLabel = document.getAnonymousElementByAttribute(
-                this, "anonid", "recurrence");
-            if (aItem.recurrenceInfo) {
-                recurrenceLabel.setAttribute("value", this.mStrings.recurrentEvent);
-            } else {
-                recurrenceLabel.setAttribute("hidden", "true");
-                let spacer = document.getAnonymousElementByAttribute(
-                    this, "anonid", "spacer");
-                spacer.removeAttribute("hidden");
-            }
+          let recurrenceLabel = document.getAnonymousElementByAttribute(
+              this, "anonid", "recurrence");
+          if (aItem.recurrenceInfo) {
+              recurrenceLabel.setAttribute("value", this.mStrings.recurrentEvent);
+          } else {
+              recurrenceLabel.setAttribute("hidden", "true");
+              let spacer = document.getAnonymousElementByAttribute(
+                  this, "anonid", "spacer");
+              spacer.removeAttribute("hidden");
+          }
 
-            let locationLabel = document.getAnonymousElementByAttribute(
-                this, "anonid", "location");
-            let locationString = this.mStrings.location;
-            let locationProperty = aItem.getProperty("LOCATION");
-            if (locationProperty && locationProperty.length > 0) {
-                locationString += locationProperty;
-            } else {
-                locationString += this.mStrings.none;
-            }
-            locationLabel.setAttribute("value", locationString);
+          let locationLabel = document.getAnonymousElementByAttribute(
+              this, "anonid", "location");
+          let locationString = this.mStrings.location;
+          let locationProperty = aItem.getProperty("LOCATION");
+          if (locationProperty && locationProperty.length > 0) {
+              locationString += locationProperty;
+          } else {
+              locationString += this.mStrings.none;
+          }
+          locationLabel.setAttribute("value", locationString);
 
-            let organizerLabel = document.getAnonymousElementByAttribute(
-                this, "anonid", "organizer");
-            let organizerString = this.mStrings.organizer;
-            let org = aItem.organizer;
-            if (org) {
-                if (org.commonName && org.commonName.length > 0) {
-                    organizerString += org.commonName;
-                } else if (org.id) {
-                    organizerString += org.id.replace(/^mailto:/i, "");
-                }
-            }
-            organizerLabel.setAttribute("value", organizerString);
+          let organizerLabel = document.getAnonymousElementByAttribute(
+              this, "anonid", "organizer");
+          let organizerString = this.mStrings.organizer;
+          let org = aItem.organizer;
+          if (org) {
+              if (org.commonName && org.commonName.length > 0) {
+                  organizerString += org.commonName;
+              } else if (org.id) {
+                  organizerString += org.id.replace(/^mailto:/i, "");
+              }
+          }
+          organizerLabel.setAttribute("value", organizerString);
 
-            let attendeeLabel = document.getAnonymousElementByAttribute(
-                this, "anonid", "attendee");
-            let attendeeString = this.mStrings.attendee;
-            let att = cal.getInvitedAttendee(aItem);
-            if (att) {
-                if (att.commonName && att.commonName.length > 0) {
-                    attendeeString += att.commonName;
-                } else if (att.id) {
-                    attendeeString += att.id.replace(/^mailto:/i, "");
-                }
-            }
-            attendeeLabel.setAttribute("value", attendeeString);
-            this.setAttribute("itemId", aItem.hashId);
+          let attendeeLabel = document.getAnonymousElementByAttribute(
+              this, "anonid", "attendee");
+          let attendeeString = this.mStrings.attendee;
+          let att = cal.getInvitedAttendee(aItem);
+          if (att) {
+              if (att.commonName && att.commonName.length > 0) {
+                  attendeeString += att.commonName;
+              } else if (att.id) {
+                  attendeeString += att.id.replace(/^mailto:/i, "");
+              }
+          }
+          attendeeLabel.setAttribute("value", attendeeString);
+          this.setAttribute("itemId", aItem.hashId);
           ]]>
         </body>
       </method>
 
       <method name="getCalendarItemParticipationStatus">
         <parameter name="aItem"/>
         <body><![CDATA[
           let att = cal.getInvitedAttendee(aItem);
--- a/calendar/base/content/dialogs/calendar-print-dialog.js
+++ b/calendar/base/content/dialogs/calendar-print-dialog.js
@@ -197,59 +197,59 @@ function getFilter(settings) {
 
 /**
  * Looks at the selections the user has made (start date, layout, etc.), and
  * updates the HTML in the iframe accordingly. This is also called when a
  * dialog UI element has changed, since we'll want to refresh the preview.
  */
 function refreshHtml(finishFunc) {
     getPrintSettings((settings) => {
-            document.title = calGetString("calendar", "PrintPreviewWindowTitle", [settings.title]);
+        document.title = calGetString("calendar", "PrintPreviewWindowTitle", [settings.title]);
 
-            let printformatter = Components.classes[settings.layoutCId]
-                                           .createInstance(Components.interfaces.calIPrintFormatter);
-            let html = "";
+        let printformatter = Components.classes[settings.layoutCId]
+                                       .createInstance(Components.interfaces.calIPrintFormatter);
+        let html = "";
+        try {
+            let pipe = Components.classes["@mozilla.org/pipe;1"]
+                                 .createInstance(Components.interfaces.nsIPipe);
+            const PR_UINT32_MAX = 4294967295; // signals "infinite-length"
+            pipe.init(true, true, 0, PR_UINT32_MAX, null);
+            printformatter.formatToHtml(pipe.outputStream,
+                                        settings.start,
+                                        settings.end,
+                                        settings.eventList.length,
+                                        settings.eventList,
+                                        settings.title);
+            pipe.outputStream.close();
+            // convert byte-array to UTF-8 string:
+            let convStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
+                                       .createInstance(Components.interfaces.nsIConverterInputStream);
+            convStream.init(pipe.inputStream, "UTF-8", 0,
+                            Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
             try {
-                let pipe = Components.classes["@mozilla.org/pipe;1"]
-                                     .createInstance(Components.interfaces.nsIPipe);
-                const PR_UINT32_MAX = 4294967295; // signals "infinite-length"
-                pipe.init(true, true, 0, PR_UINT32_MAX, null);
-                printformatter.formatToHtml(pipe.outputStream,
-                                            settings.start,
-                                            settings.end,
-                                            settings.eventList.length,
-                                            settings.eventList,
-                                            settings.title);
-                pipe.outputStream.close();
-                // convert byte-array to UTF-8 string:
-                let convStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
-                                           .createInstance(Components.interfaces.nsIConverterInputStream);
-                convStream.init(pipe.inputStream, "UTF-8", 0,
-                                Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
-                try {
-                    let portion = {};
-                    while (convStream.readString(-1, portion)) {
-                        html += portion.value;
-                    }
-                } finally {
-                    convStream.close();
+                let portion = {};
+                while (convStream.readString(-1, portion)) {
+                    html += portion.value;
                 }
-            } catch (e) {
-                Components.utils.reportError("Calendar print dialog:refreshHtml: " + e);
+            } finally {
+                convStream.close();
             }
+        } catch (e) {
+            Components.utils.reportError("Calendar print dialog:refreshHtml: " + e);
+        }
 
-            let iframeDoc = document.getElementById("content").contentDocument;
-            iframeDoc.documentElement.innerHTML = html;
-            iframeDoc.title = settings.title;
+        let iframeDoc = document.getElementById("content").contentDocument;
+        iframeDoc.documentElement.innerHTML = html;
+        iframeDoc.title = settings.title;
 
-            if (finishFunc) {
-                finishFunc();
-            }
+        if (finishFunc) {
+            finishFunc();
         }
-    );
+    }
+);
 }
 
 /**
  * This is a nsIWebProgressListener that closes the dialog on completion, makes
  * sure printing works without issues
  */
 var closeOnComplete = {
     onStateChange: function(aProgress, aRequest, aStateFlags, aStatus) {
--- a/calendar/base/content/dialogs/calendar-properties-dialog.js
+++ b/calendar/base/content/dialogs/calendar-properties-dialog.js
@@ -164,15 +164,15 @@ function initRefreshInterval() {
         }
 
         if (refreshInterval == 0) {
             menulist.selectedItem = document.getElementById("calendar-refreshInterval-manual");
             foundValue = true;
         }
 
         if (!foundValue) {
-          // Special menuitem in case the user changed the value in the config editor.
-          let menuitem = createMenuItem(refreshInterval);
-          separator.parentNode.insertBefore(menuitem, separator.nextSibling);
-          menulist.selectedItem = menuitem;
+            // Special menuitem in case the user changed the value in the config editor.
+            let menuitem = createMenuItem(refreshInterval);
+            separator.parentNode.insertBefore(menuitem, separator.nextSibling);
+            menulist.selectedItem = menuitem;
         }
     }
 }
--- a/calendar/base/content/dialogs/calendar-summary-dialog.js
+++ b/calendar/base/content/dialogs/calendar-summary-dialog.js
@@ -228,30 +228,30 @@ function updateInvitationStatus() {
     }
 }
 
 /**
  * When the summary dialog is showing an invitation, this function updates the
  * user's invitation status from the value chosen in the dialog.
  */
 function updatePartStat() {
-  let statusElement = document.getElementById("item-participation");
-  if (window.attendee) {
-      let item = window.arguments[0];
-      let aclEntry = item.calendar.aclEntry;
-      if (aclEntry) {
-          let userAddresses = aclEntry.getUserAddresses({});
-          if (userAddresses.length > 0 &&
-              !cal.attendeeMatchesAddresses(window.attendee, userAddresses)) {
-              window.attendee.setProperty("SENT-BY", "mailto:" + userAddresses[0]);
-          }
-      }
+    let statusElement = document.getElementById("item-participation");
+    if (window.attendee) {
+        let item = window.arguments[0];
+        let aclEntry = item.calendar.aclEntry;
+        if (aclEntry) {
+            let userAddresses = aclEntry.getUserAddresses({});
+            if (userAddresses.length > 0 &&
+                !cal.attendeeMatchesAddresses(window.attendee, userAddresses)) {
+                window.attendee.setProperty("SENT-BY", "mailto:" + userAddresses[0]);
+            }
+        }
 
-      window.attendee.participationStatus = statusElement.value;
-  }
+        window.attendee.participationStatus = statusElement.value;
+    }
 }
 
 /**
  * Updates the dialog w.r.t recurrence, i.e shows a text describing the item's
  * recurrence)
  */
 function updateRepeatDetails() {
     let args = window.arguments[0];
--- a/calendar/base/content/preferences/categories.js
+++ b/calendar/base/content/preferences/categories.js
@@ -296,17 +296,17 @@ var gCategoriesPane = {
 
     /**
      * Reverts category preferences in case the cancel button is pressed.
      */
     panelOnCancel: function() {
         for (let i = 0; i < parent.backupPrefList.length; i++) {
             if (parent.backupPrefList[i].color == "##NEW") {
                 try {
-                   categoryPrefBranch.clearUserPref(parent.backupPrefList[i].name);
+                    categoryPrefBranch.clearUserPref(parent.backupPrefList[i].name);
                 } catch (ex) {
                     dump("Exception caught in 'panelOnCancel': " + ex + "\n");
                 }
             } else {
                 categoryPrefBranch.setCharPref(parent.backupPrefList[i].name,
                                                parent.backupPrefList[i].color);
             }
         }
--- a/calendar/base/content/preferences/editCategory.js
+++ b/calendar/base/content/preferences/editCategory.js
@@ -99,12 +99,12 @@ function clickColor() {
  * Call the function after the given timeout, resetting the timer if delay is
  * called again with the same function.
  *
  * @param timeout   The timeout interval.
  * @param func      The function to call after the timeout.
  */
 function delay(timeout, func) {
     if (func.timer) {
-      clearTimeout(func.timer);
+        clearTimeout(func.timer);
     }
     func.timer = setTimeout(func, timeout);
 }
--- a/calendar/base/content/widgets/calendar-alarm-widget.xml
+++ b/calendar/base/content/widgets/calendar-alarm-widget.xml
@@ -5,19 +5,19 @@
 
 <!DOCTYPE bindings
 [
   <!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
   <!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
 ]>
 
 <bindings id="calendar-alarms"
-   xmlns="http://www.mozilla.org/xbl"
-   xmlns:xbl="http://www.mozilla.org/xbl"
-   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:xbl="http://www.mozilla.org/xbl"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <binding id="calendar-alarm-widget" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
     <resources>
       <stylesheet src="chrome://global/skin/button.css"/>
       <stylesheet src="chrome://calendar/skin/calendar-alarm-dialog.css"/>
     </resources>
 
     <content orient="horizontal">
@@ -242,17 +242,17 @@
       </xul:hbox>
     </content>
     <implementation>
       <constructor><![CDATA[
         Components.utils.import("resource://gre/modules/Preferences.jsm");
 
         let snoozePref = Preferences.get("calendar.alarms.defaultsnoozelength", 0);
         if (snoozePref <= 0) {
-          snoozePref = 5;
+            snoozePref = 5;
         }
 
         let unitList = document.getAnonymousElementByAttribute(this, "anonid", "snooze-unit-menulist");
         let unitValue = document.getAnonymousElementByAttribute(this, "anonid", "snooze-value-textbox");
 
         let selectedIndex = 0;
         if ((snoozePref % 60) == 0) {
             snoozePref = snoozePref / 60;
--- a/calendar/base/content/widgets/calendar-list-tree.xml
+++ b/calendar/base/content/widgets/calendar-list-tree.xml
@@ -61,92 +61,92 @@
           // in the compositeCalendar setter.
           throw Components.Exception("Seting calendars on type='full' is not supported",
                                      Components.results.NS_ERROR_NOT_IMPLEMENTED);
         ]]></setter>
       </property>
 
       <field name="calMgrObserver"><![CDATA[
       ({
-        listTree: this,
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICalendarManagerObserver]),
+          listTree: this,
+          QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICalendarManagerObserver]),
 
-        // calICalendarManagerObserver
-        onCalendarRegistered: function(aCalendar) {
-            this.listTree.addCalendar(aCalendar);
-            let composite = this.listTree.compositeCalendar;
-            let inComposite = aCalendar.getProperty(composite.prefPrefix +
-                                                    "-in-composite");
-            if ((inComposite === null) || inComposite) {
-                composite.addCalendar(aCalendar);
-            }
-        },
+          // calICalendarManagerObserver
+          onCalendarRegistered: function(aCalendar) {
+              this.listTree.addCalendar(aCalendar);
+              let composite = this.listTree.compositeCalendar;
+              let inComposite = aCalendar.getProperty(composite.prefPrefix +
+                                                      "-in-composite");
+              if ((inComposite === null) || inComposite) {
+                  composite.addCalendar(aCalendar);
+              }
+          },
 
-        onCalendarUnregistering: function(aCalendar) {
-            this.listTree.removeCalendar(aCalendar);
-        },
+          onCalendarUnregistering: function(aCalendar) {
+              this.listTree.removeCalendar(aCalendar);
+          },
 
-        onCalendarDeleting: function(aCalendar) {
-            // Now that the calendar is unregistered, update the commands to
-            // make sure that New Event/Task commands are correctly
-            // enabled/disabled.
-            document.commandDispatcher.updateCommands("calendar_commands");
-        }
+          onCalendarDeleting: function(aCalendar) {
+              // Now that the calendar is unregistered, update the commands to
+              // make sure that New Event/Task commands are correctly
+              // enabled/disabled.
+              document.commandDispatcher.updateCommands("calendar_commands");
+          }
       })
       ]]></field>
       <field name="compositeObserver"><![CDATA[
       ({
-        listTree: this,
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICompositeObserver,
-                                               Components.interfaces.calIObserver]),
+          listTree: this,
+          QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICompositeObserver,
+                                                 Components.interfaces.calIObserver]),
 
-        // calICompositeObserver
-        onCalendarAdded: function(aCalendar) {
-            // Make sure the checkbox state is updated
-            this.listTree.updateCalendar(aCalendar);
-        },
+          // calICompositeObserver
+          onCalendarAdded: function(aCalendar) {
+              // Make sure the checkbox state is updated
+              this.listTree.updateCalendar(aCalendar);
+          },
 
-        onCalendarRemoved: function(aCalendar) {
-            // Make sure the checkbox state is updated
-            this.listTree.updateCalendar(aCalendar);
-        },
+          onCalendarRemoved: function(aCalendar) {
+              // Make sure the checkbox state is updated
+              this.listTree.updateCalendar(aCalendar);
+          },
 
-        onDefaultCalendarChanged: function(aCalendar) {
-        },
+          onDefaultCalendarChanged: function(aCalendar) {
+          },
 
-        // calIObserver
-        onStartBatch: function() { },
-        onEndBatch: function() { },
-        onLoad: function() { },
+          // calIObserver
+          onStartBatch: function() { },
+          onEndBatch: function() { },
+          onLoad: function() { },
 
-        onAddItem: function(aItem) {
-            if (aItem.calendar.type != "caldav") {
-                this.listTree.ensureCalendarVisible(aItem.calendar);
-            }
-        },
-        onModifyItem: function(aNewItem, aOldItem) {
-            if (aNewItem.calendar.type != "caldav") {
-                this.listTree.ensureCalendarVisible(aNewItem.calendar);
-            }
-        },
-        onDeleteItem: function(aDeletedItem) { },
-        onError: function(aCalendar, aErrNo, aMessage) { },
+          onAddItem: function(aItem) {
+              if (aItem.calendar.type != "caldav") {
+                  this.listTree.ensureCalendarVisible(aItem.calendar);
+              }
+          },
+          onModifyItem: function(aNewItem, aOldItem) {
+              if (aNewItem.calendar.type != "caldav") {
+                  this.listTree.ensureCalendarVisible(aNewItem.calendar);
+              }
+          },
+          onDeleteItem: function(aDeletedItem) { },
+          onError: function(aCalendar, aErrNo, aMessage) { },
 
-        onPropertyChanged: function(aCalendar, aName, aValue, aOldValue) {
-            switch (aName) {
-                case "disabled":
-                case "readOnly":
-                    calendarUpdateNewItemsCommand();
-                    document.commandDispatcher.updateCommands("calendar_commands");
-                    break;
-            }
-        },
+          onPropertyChanged: function(aCalendar, aName, aValue, aOldValue) {
+              switch (aName) {
+                  case "disabled":
+                  case "readOnly":
+                      calendarUpdateNewItemsCommand();
+                      document.commandDispatcher.updateCommands("calendar_commands");
+                      break;
+              }
+          },
 
-        onPropertyDeleting: function(aCalendar, aName) {
-        }
+          onPropertyDeleting: function(aCalendar, aName) {
+          }
       })
       ]]></field>
     </implementation>
     <handlers>
       <handler event="dblclick"><![CDATA[
         let col = {};
         let calendar = this.getCalendarFromEvent(event, col);
         if (event.button != 0 ||
@@ -245,74 +245,74 @@
 
         if (this.mCompositeCalendar) {
             this.mCompositeCalendar.removeObserver(this.compositeObserver);
         }
       ]]></destructor>
 
       <field name="calObserver"><![CDATA[
       ({
-        listTree: this,
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIObserver]),
+          listTree: this,
+          QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIObserver]),
 
-        // calIObserver. Note that each registered calendar uses this observer
-        onStartBatch: function() { },
-        onEndBatch: function() { },
-        onLoad: function() { },
+          // calIObserver. Note that each registered calendar uses this observer
+          onStartBatch: function() { },
+          onEndBatch: function() { },
+          onLoad: function() { },
 
-        onAddItem: function(aItem) { },
-        onModifyItem: function(aNewItem, aOldItem) { },
-        onDeleteItem: function(aDeletedItem) { },
-        onError: function(aCalendar, aErrNo, aMessage) { },
+          onAddItem: function(aItem) { },
+          onModifyItem: function(aNewItem, aOldItem) { },
+          onDeleteItem: function(aDeletedItem) { },
+          onError: function(aCalendar, aErrNo, aMessage) { },
 
-        onPropertyChanged: function(aCalendar, aName, aValue, aOldValue) {
-            switch (aName) {
-                case "color":
-                    // TODO See other TODO in this file about updateStyleSheetForViews
-                    if ("updateStyleSheetForViews" in window) {
-                        updateStyleSheetForViews(aCalendar);
-                    }
-                    this.listTree.updateCalendarColor(aCalendar);
-                    // Fall through, update item in any case
-                case "name":
-                case "currentStatus":
-                case "readOnly":
-                case "disabled":
-                    this.listTree.updateCalendar(aCalendar);
-                    // Fall through, update commands in any cases.
-            }
-        },
+          onPropertyChanged: function(aCalendar, aName, aValue, aOldValue) {
+              switch (aName) {
+                  case "color":
+                      // TODO See other TODO in this file about updateStyleSheetForViews
+                      if ("updateStyleSheetForViews" in window) {
+                          updateStyleSheetForViews(aCalendar);
+                      }
+                      this.listTree.updateCalendarColor(aCalendar);
+                      // Fall through, update item in any case
+                  case "name":
+                  case "currentStatus":
+                  case "readOnly":
+                  case "disabled":
+                      this.listTree.updateCalendar(aCalendar);
+                      // Fall through, update commands in any cases.
+              }
+          },
 
-        onPropertyDeleting: function(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);
-        }
+          onPropertyDeleting: function(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);
+          }
       })
       ]]></field>
 
       <field name="compositeObserver"><![CDATA[
       ({
-        listTree: this,
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICompositeObserver]),
+          listTree: this,
+          QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICompositeObserver]),
 
-        // calICompositeObserver
-        onCalendarAdded: function(aCalendar) {
-            // Make sure the checkbox state is updated
-            this.listTree.updateCalendar(aCalendar);
-        },
+          // calICompositeObserver
+          onCalendarAdded: function(aCalendar) {
+              // Make sure the checkbox state is updated
+              this.listTree.updateCalendar(aCalendar);
+          },
 
-        onCalendarRemoved: function(aCalendar) {
-            // Make sure the checkbox state is updated
-            this.listTree.updateCalendar(aCalendar);
-        },
+          onCalendarRemoved: function(aCalendar) {
+              // Make sure the checkbox state is updated
+              this.listTree.updateCalendar(aCalendar);
+          },
 
-        onDefaultCalendarChanged: function(aCalendar) {
-        }
+          onDefaultCalendarChanged: function(aCalendar) {
+          }
       })
       ]]></field>
 
       <property name="treechildren"
                 readonly="true"
                 onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'treechildren')"/>
       <property name="tree"
                 readonly="true"
@@ -324,18 +324,18 @@
           if (!this.mCachedSheet) {
               for (let sheet of document.styleSheets) {
                   if (sheet.href == "chrome://calendar/skin/calendar-management.css") {
                       this.mCachedSheet = sheet;
                       break;
                   }
               }
               if (!this.mCachedSheet) {
-                cal.ERROR("Could not find calendar-management.css, needs to be added to " +
-                          window.document.title + "'s stylesheets");
+                  cal.ERROR("Could not find calendar-management.css, needs to be added to " +
+                            window.document.title + "'s stylesheets");
               }
           }
 
           return this.mCachedSheet;
         ]]></getter>
       </property>
 
       <property name="calendars">
@@ -403,18 +403,18 @@
               let func = new Function("event", handler);
               func(event);
           }
         ]]></body>
       </method>
       <method name="displayScrollbarSpacer">
         <parameter name="aShouldDisplay"/>
         <body><![CDATA[
-            let spacer = document.getAnonymousElementByAttribute(this, "anonid", "scrollbar-spacer");
-            spacer.collapsed = !aShouldDisplay;
+          let spacer = document.getAnonymousElementByAttribute(this, "anonid", "scrollbar-spacer");
+          spacer.collapsed = !aShouldDisplay;
         ]]></body>
       </method>
 
       <method name="ensureCalendarVisible">
         <parameter name="aCalendar"/>
         <body><![CDATA[
           this.compositeCalendar.addCalendar(aCalendar);
         ]]></body>
@@ -954,29 +954,29 @@
           this.treebox.invalidateRow(aRow);
           this.mCycleTimer = setTimeout(this.cycleCellCommit.bind(this), 200);
         ]]></body>
       </method>
 
       <method name="cycleCellCommit">
         <body><![CDATA[
           let composite = this.compositeCalendar;
-              try {
-                  composite.startBatch();
-                  for (let id in this.mCycleCalendarFlag) {
-                      if (composite.getCalendarById(id)) {
-                          composite.removeCalendar(this.mCycleCalendarFlag[id]);
-                      } else {
-                          composite.addCalendar(this.mCycleCalendarFlag[id]);
-                      }
-                      delete this.mCycleCalendarFlag[id];
+          try {
+              composite.startBatch();
+              for (let id in this.mCycleCalendarFlag) {
+                  if (composite.getCalendarById(id)) {
+                      composite.removeCalendar(this.mCycleCalendarFlag[id]);
+                  } else {
+                      composite.addCalendar(this.mCycleCalendarFlag[id]);
                   }
-              } finally {
-                  composite.endBatch();
+                  delete this.mCycleCalendarFlag[id];
               }
+          } finally {
+              composite.endBatch();
+          }
         ]]></body>
       </method>
 
       <method name="isEditable">
         <parameter name="aRow"/>
         <parameter name="aCol"/>
         <body><![CDATA[
           return false;
@@ -1034,32 +1034,35 @@
         <body><![CDATA[
         ]]></body>
       </method>
     </implementation>
     <handlers>
       <handler event="select"><![CDATA[
         this.compositeCalendar.defaultCalendar = this.getCalendar(this.tree.currentIndex);
       ]]></handler>
+
       <handler event="keypress" keycode="VK_DELETE"><![CDATA[
         if (this.writable) {
             promptDeleteCalendar(this.compositeCalendar.defaultCalendar);
             event.preventDefault();
         }
       ]]></handler>
+
       <!-- use key=" " since keycode="VK_SPACE" doesn't work -->
       <handler event="keypress" key=" "><![CDATA[
         if (this.tree.currentIndex > -1) {
             this.cycleCell(this.tree.currentIndex, this.getColumn("checkbox-treecol"));
             event.preventDefault();
         }
       ]]></handler>
+
       <handler event="keypress" keycode="VK_DOWN" modifiers="control"><![CDATA[
         if (!this.allowDrag) {
-          return;
+            return;
         }
 
         let idx = this.tree.currentIndex;
 
         if (idx < this.mCalendarList.length - 1) {
             this.mCalendarList.splice(idx + 1, 0, this.mCalendarList.splice(idx, 1)[0]);
             this.treebox.invalidateRange(idx, idx + 1);
 
@@ -1072,19 +1075,20 @@
             }
 
             // Fire event
             this.sortOrderChanged();
         }
         // Don't call the default <key> handler.
         event.preventDefault();
       ]]></handler>
+
       <handler event="keypress" keycode="VK_UP" modifiers="control"><![CDATA[
         if (!this.allowDrag) {
-          return;
+            return;
         }
 
         let idx = this.tree.currentIndex;
         if (idx > 0) {
             this.mCalendarList.splice(idx - 1, 0, this.mCalendarList.splice(idx, 1)[0]);
             this.treebox.invalidateRange(idx - 1, idx);
 
             if (this.tree.view.selection.isSelected(idx)) {
--- a/calendar/base/content/widgets/calendar-subscriptions-list.xml
+++ b/calendar/base/content/widgets/calendar-subscriptions-list.xml
@@ -1,70 +1,60 @@
 <?xml version="1.0"?>
-
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/.
 -->
 
 <bindings id="calendar-subscriptions-list-bindings"
-  xmlns="http://www.mozilla.org/xbl"
-  xmlns:html="http://www.w3.org/1999/xhtml"
-  xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-  xmlns:xbl="http://www.mozilla.org/xbl">
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:html="http://www.w3.org/1999/xhtml"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="calendar-subscriptions-richlistbox"
            extends="chrome://global/content/bindings/richlistbox.xml#richlistbox"
            xbl:inherits="flex">
 
     <implementation>
-
-      <!-- methods -->
-
       <method name="addCalendar">
         <parameter name="aCalendar"/>
         <parameter name="bSubscribed"/>
         <body><![CDATA[
           let newNode = createXULElement("calendar-subscriptions-richlistitem");
           this.appendChild(newNode);
           newNode.setAttribute("anonid", "subscriptions-listitem");
           newNode.calendar = aCalendar;
           newNode.subscribed = bSubscribed;
         ]]></body>
       </method>
 
       <method name="clear">
         <body><![CDATA[
           while (this.hasChildNodes()) {
-            this.lastChild.remove();
+              this.lastChild.remove();
           }
         ]]></body>
       </method>
-
     </implementation>
   </binding>
 
   <binding id="calendar-subscriptions-richlistitem"
            extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
     <content>
       <xul:hbox flex="1">
         <xul:checkbox anonid="subscription-checkbox" class="calendar-subscriptions-richlistitem-checkbox"/>
         <xul:label anonid="subscription-name" flex="1" crop="end"/>
       </xul:hbox>
     </content>
 
     <implementation>
-
-      <!-- fields -->
-
       <field name="mCalendar">null</field>
       <field name="mSubscribed">false</field>
 
-      <!-- properties -->
-
       <property name="calendar">
         <getter><![CDATA[
           return this.mCalendar;
         ]]></getter>
         <setter><![CDATA[
           this.setCalendar(val);
           return val;
         ]]></setter>
@@ -81,66 +71,59 @@
         ]]></setter>
       </property>
 
       <property name="checked">
         <getter><![CDATA[
           let checkbox = document.getAnonymousElementByAttribute(
             this, "anonid", "subscription-checkbox");
           if (checkbox.getAttribute("checked") == "true") {
-            return true;
+              return true;
           } else {
-            return false;
+              return false;
           }
         ]]></getter>
         <setter><![CDATA[
           let checkbox = document.getAnonymousElementByAttribute(
             this, "anonid", "subscription-checkbox");
           if (val) {
-            checkbox.setAttribute("checked", "true");
+              checkbox.setAttribute("checked", "true");
           } else {
-            checkbox.removeAttribute("checked");
+              checkbox.removeAttribute("checked");
           }
           return val;
         ]]></setter>
       </property>
 
       <property name="disabled">
         <getter><![CDATA[
           let checkbox = document.getAnonymousElementByAttribute(
             this, "anonid", "subscription-checkbox");
           if (checkbox.getAttribute("disabled") == "true") {
-            return true;
+              return true;
           } else {
-            return false;
+              return false;
           }
         ]]></getter>
         <setter><![CDATA[
           let checkbox = document.getAnonymousElementByAttribute(
             this, "anonid", "subscription-checkbox");
           if (val) {
-            checkbox.setAttribute("disabled", "true");
+              checkbox.setAttribute("disabled", "true");
           } else {
-            checkbox.removeAttribute("disabled");
+              checkbox.removeAttribute("disabled");
           }
           return val;
         ]]></setter>
       </property>
 
-      <!-- methods -->
-
       <method name="setCalendar">
         <parameter name="aCalendar"/>
-        <body>
-          <![CDATA[
-            this.mCalendar = aCalendar;
-            let label = document.getAnonymousElementByAttribute(
-                this, "anonid", "subscription-name");
-            label.setAttribute("value", aCalendar.name);
-          ]]>
-        </body>
+        <body><![CDATA[
+          this.mCalendar = aCalendar;
+          let label = document.getAnonymousElementByAttribute(
+              this, "anonid", "subscription-name");
+          label.setAttribute("value", aCalendar.name);
+        ]]></body>
       </method>
-
     </implementation>
-
   </binding>
-
 </bindings>
--- a/calendar/base/content/widgets/calendar-widgets.xml
+++ b/calendar/base/content/widgets/calendar-widgets.xml
@@ -20,17 +20,17 @@
         <xul:image class="menulist-icon" xbl:inherits="src=image,src"/>
         <xul:label class="menulist-label" xbl:inherits="value=label,crop,accesskey" crop="right" flex="1"/>
       </xul:hbox>
       <xul:dropmarker class="menulist-dropmarker" type="menu" xbl:inherits="disabled,open"/>
       <children includes="menupopup|panel"/>
     </content>
   </binding>
 
-   <binding id="category-panel" extends="chrome://global/content/bindings/popup.xml#panel">
+  <binding id="category-panel" extends="chrome://global/content/bindings/popup.xml#panel">
     <resources>
       <stylesheet src="chrome://calendar/skin/widgets/calendar-widgets.css"/>
     </resources>
     <content>
         <xul:textbox  anonid="category-textbox"
                       class="categories-textbox"
                       type="search"
                       searchbutton="true"
@@ -42,138 +42,145 @@
                    onselect="document.getBindingParent(this).selectCategory()"
                    selType="multiple"
                    >
         <children/>
       </xul:listbox>
     </content>
     <implementation>
       <field name="_maxCount">0</field>
+
       <property name="categories" readonly="true">
         <getter><![CDATA[
-            let categoryListbox = document.getAnonymousElementByAttribute(this, "anonid", "categories-listbox");
-            if (this.maxCount == 1) {
-                let selectedItem = categoryListbox.selectedItem;
-                return selectedItem ? [selectedItem.getAttribute("value")] : [];
-            } else {
-                let checkedNodes = categoryListbox.getElementsByAttribute("checked", "true");
-                let sliceEnd = this.maxCount > 0 ? this.maxCount : checkedNodes.length;
-                return Array.slice(checkedNodes, 0, sliceEnd)
-                            .map(x => x.getAttribute("value"));
-            }
+          let categoryListbox = document.getAnonymousElementByAttribute(this, "anonid", "categories-listbox");
+          if (this.maxCount == 1) {
+              let selectedItem = categoryListbox.selectedItem;
+              return selectedItem ? [selectedItem.getAttribute("value")] : [];
+          } else {
+              let checkedNodes = categoryListbox.getElementsByAttribute("checked", "true");
+              let sliceEnd = this.maxCount > 0 ? this.maxCount : checkedNodes.length;
+              return Array.slice(checkedNodes, 0, sliceEnd)
+                          .map(x => x.getAttribute("value"));
+          }
         ]]></getter>
       </property>
+
       <property name="maxCount">
         <getter><![CDATA[
-            return this._maxCount;
+          return this._maxCount;
         ]]></getter>
         <setter><![CDATA[
-            if (this._maxCount != val) {
-                this._maxCount = val;
-                this.setupSelection();
-            }
+          if (this._maxCount != val) {
+              this._maxCount = val;
+              this.setupSelection();
+          }
         ]]></setter>
       </property>
+
       <method name="selectCategory">
         <body><![CDATA[
-            this.setupSelection();
-            if (this.maxCount == 1) {
-                this.hidePopup();
-            }
+          this.setupSelection();
+          if (this.maxCount == 1) {
+              this.hidePopup();
+          }
         ]]></body>
       </method>
+
       <method name="setupSelection">
         <body><![CDATA[
-            let categoryListbox = document.getAnonymousElementByAttribute(this, "anonid", "categories-listbox");
-            categoryListbox.setAttribute("seltype", this.maxCount == 1 ? "single" : "multiple");
+          let categoryListbox = document.getAnonymousElementByAttribute(this, "anonid", "categories-listbox");
+          categoryListbox.setAttribute("seltype", this.maxCount == 1 ? "single" : "multiple");
 
-            if (this.maxCount == 1) {
-                for (let node of categoryListbox.childNodes) {
-                    // Single selection doesn't have checkboxes
-                    node.removeAttribute("type");
+          if (this.maxCount == 1) {
+              for (let node of categoryListbox.childNodes) {
+                  // Single selection doesn't have checkboxes
+                  node.removeAttribute("type");
 
-                    // Even though we have single select, these may be checked
-                    // in case the user switches between calendars that support
-                    // one vs multiple categories. Uncheck the other nodes to
-                    // make sure the UX is not weird.
-                    setBooleanAttribute(node, "checked", node == categoryListbox.selectedItem);
-                }
-            } else {
-                let categoryTextbox = document.getAnonymousElementByAttribute(this, "anonid", "category-textbox");
-                let maxCountReached = this.maxCount > 0 && this.categories.length == this.maxCount;
-                setBooleanAttribute(categoryTextbox, "disabled", maxCountReached);
+                  // Even though we have single select, these may be checked
+                  // in case the user switches between calendars that support
+                  // one vs multiple categories. Uncheck the other nodes to
+                  // make sure the UX is not weird.
+                  setBooleanAttribute(node, "checked", node == categoryListbox.selectedItem);
+              }
+          } else {
+              let categoryTextbox = document.getAnonymousElementByAttribute(this, "anonid", "category-textbox");
+              let maxCountReached = this.maxCount > 0 && this.categories.length == this.maxCount;
+              setBooleanAttribute(categoryTextbox, "disabled", maxCountReached);
 
-                for (let node of categoryListbox.childNodes) {
-                    // Multiselect has checkboxes
-                    node.setAttribute("type", "checkbox");
+              for (let node of categoryListbox.childNodes) {
+                  // Multiselect has checkboxes
+                  node.setAttribute("type", "checkbox");
 
-                    if (maxCountReached && node.getAttribute("checked") != "true") {
-                        // If the maxcount is reached, disable all unchecked items
-                        node.setAttribute("disabled", "true");
-                    } else if (!maxCountReached) {
-                        // If its not reached, remove the disabled attribute
-                        node.removeAttribute("disabled");
-                    }
-                }
-            }
+                  if (maxCountReached && node.getAttribute("checked") != "true") {
+                      // If the maxcount is reached, disable all unchecked items
+                      node.setAttribute("disabled", "true");
+                  } else if (!maxCountReached) {
+                      // If its not reached, remove the disabled attribute
+                      node.removeAttribute("disabled");
+                  }
+              }
+          }
         ]]></body>
       </method>
+
       <method name="insertCategory">
         <parameter name="category" />
         <parameter name="categories" />
         <parameter name="categoryListbox" />
         <parameter name="compare" />
         <body><![CDATA[
-            let newIndex = cal.binaryInsert(categories, category, compare, true);
-            let item = categoryListbox.childNodes[Math.min(newIndex, categoryListbox.childNodes.length - 1)];
+          let newIndex = cal.binaryInsert(categories, category, compare, true);
+          let item = categoryListbox.childNodes[Math.min(newIndex, categoryListbox.childNodes.length - 1)];
 
-            if (!item || item.getAttribute("value") != category) {
-                // The item doesn't exist, insert it at the correct spot.
-                item = categoryListbox.insertItemAt(newIndex, category, category);
+          if (!item || item.getAttribute("value") != category) {
+              // The item doesn't exist, insert it at the correct spot.
+              item = categoryListbox.insertItemAt(newIndex, category, category);
 
-                if (this.maxCount != 1) {
-                    item.setAttribute("type", "checkbox");
-                }
-            }
+              if (this.maxCount != 1) {
+                  item.setAttribute("type", "checkbox");
+              }
+          }
 
-            item.setAttribute("checked", "true");
-            return item;
+          item.setAttribute("checked", "true");
+          return item;
           ]]></body>
       </method>
+
       <method name="addNewCategory">
-      <body><![CDATA[
+        <body><![CDATA[
           let categoryListbox = document.getAnonymousElementByAttribute(this, "anonid", "categories-listbox");
           let categoryTextbox = document.getAnonymousElementByAttribute(this, "anonid", "category-textbox");
           let category = categoryTextbox.value;
 
           if (!category) {
-            return;
+              return;
           }
 
           let localeCollator = cal.createLocaleCollator();
           let compare = localeCollator.compareString.bind(localeCollator, 0);
 
           let children = categoryListbox.childNodes;
           let categories = [];
           for (let i = 0; i < children.length; i++) {
-            categories.push(children[i].label);
+              categories.push(children[i].label);
           }
 
           let item = this.insertCategory(category, categories, categoryListbox, compare);
           categoryTextbox.value = "";
 
           if (this.maxCount == 1) {
-            categoryListbox.selectedItem = item;
+              categoryListbox.selectedItem = item;
           } else {
-            this.selectCategory();
+              this.selectCategory();
           }
 
           categoryListbox.ensureElementIsVisible(item);
         ]]></body>
-    </method>
+      </method>
+
       <method name="loadItem">
         <parameter name="aItem"/>
         <body><![CDATA[
           let categoryListbox = document.getAnonymousElementByAttribute(this, "anonid", "categories-listbox");
           let categoryList = getPrefCategoriesArray();
 
           cal.sortArrayByLocaleCollator(categoryList);
 
@@ -186,28 +193,29 @@
           }
 
           if (aItem) {
               let localeCollator = cal.createLocaleCollator();
               let compare = localeCollator.compareString.bind(localeCollator, 0);
 
               // Ensure the item's categories are in the list and they are checked.
               for (let cat of aItem.getCategories({})) {
-                this.insertCategory(cat, categoryList, categoryListbox, compare);
+                  this.insertCategory(cat, categoryList, categoryListbox, compare);
               }
           }
         ]]></body>
       </method>
     </implementation>
   </binding>
 
   <binding id="doubleimage-toolbarbutton" extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton">
     <resources>
       <stylesheet src="chrome://calendar/skin/widgets/calendar-widgets.css"/>
     </resources>
+
     <content>
       <children includes="observes|template|menupopup|tooltip"/>
       <xul:image class="toolbarbutton-icon-begin" xbl:inherits="validate,src-begin=image,toolbarmode,buttonstyle"/>
       <xul:label class="toolbarbutton-text" crop="right" flex="1"
                  xbl:inherits="value=label,accesskey,crop,toolbarmode,buttonstyle"/>
       <xul:image class="toolbarbutton-icon-end" xbl:inherits="validate,src-end=image,toolbarmode,buttonstyle"/>
     </content>
   </binding>
@@ -218,24 +226,26 @@
       <xul:stack pack="center" align="end">
         <xul:image class="toolbarbutton-icon-begin" xbl:inherits="validate,src-begin=image,toolbarmode,buttonstyle"/>
         <xul:label anonid="day-label" class="toolbarbutton-day-text"/>
       </xul:stack>
       <xul:label class="toolbarbutton-text" crop="right" flex="1"
                  xbl:inherits="value=label,accesskey,crop,toolbarmode,buttonstyle"/>
       <xul:image class="toolbarbutton-icon-end" xbl:inherits="validate,src-end=image,toolbarmode,buttonstyle"/>
     </content>
+
     <implementation>
       <constructor><![CDATA[
-          this.setUpTodayDate();
+        this.setUpTodayDate();
       ]]></constructor>
+
       <method name="setUpTodayDate">
         <body><![CDATA[
-            let dayNumber = calGetString("dateFormat", "day." + cal.now().day + ".number");
-            document.getAnonymousElementByAttribute(this, "anonid", "day-label").value = dayNumber;
+          let dayNumber = calGetString("dateFormat", "day." + cal.now().day + ".number");
+          document.getAnonymousElementByAttribute(this, "anonid", "day-label").value = dayNumber;
         ]]></body>
       </method>
     </implementation>
    </binding>
 
   <!-- this binding directly extends to a checkbox but is visualized as
        a treenode in a treecontrol-->
   <binding id="treenode-checkbox" extends="chrome://global/content/bindings/checkbox.xml#checkbox-baseline">
@@ -245,21 +255,22 @@
   </binding>
 
   <!-- this binding directly extends to a xul:box element and automatically
        sets the "orient" attribute to "vertical" thus behaving like a vbox-->
   <binding id="modevbox" extends="chrome://calendar/content/widgets/calendar-widgets.xml#modebox">
     <resources>
       <stylesheet src="chrome://calendar/skin/widgets/calendar-widgets.css"/>
     </resources>
+
     <implementation>
       <constructor><![CDATA[
-            this.setAttribute("orient", "vertical");
+        this.setAttribute("orient", "vertical");
       ]]></constructor>
-      </implementation>
+    </implementation>
   </binding>
 
   <!-- this binding directly extends to a xul:box element and automatically
        sets the "orient" attribute to "horizontal" thus behaving like a vbox-->
   <binding id="modehbox" extends="chrome://calendar/content/widgets/calendar-widgets.xml#modebox">
     <resources>
       <stylesheet src="chrome://calendar/skin/widgets/calendar-widgets.css"/>
     </resources>
@@ -291,16 +302,17 @@
     <resources>
       <stylesheet src="chrome://calendar/skin/widgets/calendar-widgets.css"/>
     </resources>
     <implementation>
       <field name="mBroadcaster">null</field>;
       <field name="mModHandler">null</field>;
       <field name="mRefControl">null</field>;
       <field name="mControlHandler">null</field>;
+
       <constructor><![CDATA[
         if (this.hasAttribute("broadcaster")) {
             this.setAttribute("broadcaster", this.getAttribute("broadcaster"));
         }
         if (this.hasAttribute("refcontrol")) {
             this.mRefControl = document.getElementById(this.getAttribute("refcontrol"));
             if (this.mRefControl && ((this.mRefControl.localName == "treenode-checkbox") ||
                                   (this.mRefControl.localName == "checkbox"))) {
@@ -308,228 +320,228 @@
                     binding: this,
                     handleEvent: function(aEvent, aHandled) {
                         return this.binding.onCheckboxStateChange(aEvent, this.binding);
                     }
                 };
                 this.mRefControl.addEventListener("CheckboxStateChange", this.mControlHandler, true);
             }
         }
-      ]]>
-      </constructor>
+      ]]></constructor>
+
       <destructor><![CDATA[
-          if (this.mBroadcaster) {
-              this.mBroadcaster.removeEventListener("DOMAttrModified", this.mModHandler, true);
-          }
-          if (this.mRefControl) {
-              this.mRefControl.removeEventListener("CheckboxStateChange", this.mControlHandler, true);
-          }
+        if (this.mBroadcaster) {
+            this.mBroadcaster.removeEventListener("DOMAttrModified", this.mModHandler, true);
+        }
+        if (this.mRefControl) {
+            this.mRefControl.removeEventListener("CheckboxStateChange", this.mControlHandler, true);
+        }
       ]]></destructor>
 
       <property name="currentMode">
         <getter><![CDATA[
-            if (this.mBroadcaster && this.mBroadcaster.hasAttribute("mode")) {
-                return this.mBroadcaster.getAttribute("mode");
-            } else {
-                return "";
-            }
+          if (this.mBroadcaster && this.mBroadcaster.hasAttribute("mode")) {
+              return this.mBroadcaster.getAttribute("mode");
+          } else {
+              return "";
+          }
         ]]></getter>
       </property>
 
       <method name="isVisible">
         <parameter name="aMode"/>
         <body><![CDATA[
-            let lMode = aMode || this.currentMode;
-            if (!this.isVisibleInMode(lMode)) {
-                return false;
-            }
-            let collapsedModes = this.getAttribute("collapsedinmodes").split(",");
-            return (!collapsedModes.includes(lMode));
+          let lMode = aMode || this.currentMode;
+          if (!this.isVisibleInMode(lMode)) {
+              return false;
+          }
+          let collapsedModes = this.getAttribute("collapsedinmodes").split(",");
+          return !collapsedModes.includes(lMode);
         ]]></body>
       </method>
 
       <method name="setModeAttribute">
         <parameter name="aModeAttribute"/>
         <parameter name="aModeValue"/>
         <parameter name="amode"/>
         <body><![CDATA[
-            if (this.hasAttribute(aModeAttribute)) {
-                let lMode = amode || this.currentMode;
-                let modeAttributeValues = this.getAttribute(aModeAttribute).split(",");
-                let modes = this.getAttribute("mode").split(",");
-                modeAttributeValues[modes.indexOf(lMode)] = aModeValue;
-                this.setAttribute(aModeAttribute, modeAttributeValues.join(","));
-            }
+          if (this.hasAttribute(aModeAttribute)) {
+              let lMode = amode || this.currentMode;
+              let modeAttributeValues = this.getAttribute(aModeAttribute).split(",");
+              let modes = this.getAttribute("mode").split(",");
+              modeAttributeValues[modes.indexOf(lMode)] = aModeValue;
+              this.setAttribute(aModeAttribute, modeAttributeValues.join(","));
+          }
         ]]></body>
       </method>
 
       <method name="getModeAttribute">
         <parameter name="aModeAttribute"/>
         <parameter name="aAttribute"/>
         <parameter name="amode"/>
         <body><![CDATA[
-            if (this.hasAttribute(aModeAttribute)) {
-                let lMode = amode || this.currentMode;
-                let modeAttributeValues = this.getAttribute(aModeAttribute).split(",");
-                let modes = this.getAttribute("mode").split(",");
-                return modeAttributeValues[modes.indexOf(lMode)];
-            } else {
-                return "";
-            }
+          if (this.hasAttribute(aModeAttribute)) {
+              let lMode = amode || this.currentMode;
+              let modeAttributeValues = this.getAttribute(aModeAttribute).split(",");
+              let modes = this.getAttribute("mode").split(",");
+              return modeAttributeValues[modes.indexOf(lMode)];
+          } else {
+              return "";
+          }
         ]]></body>
       </method>
 
       <method name="setVisible">
         <parameter name="aVisible"/>
         <parameter name="aPushModeCollapsedAttribute"/>
         <parameter name="aNotifyRefControl"/>
         <body><![CDATA[
-            let notifyRefControl = aNotifyRefControl == null || aNotifyRefControl === true;
-            let pushModeCollapsedAttribute = aPushModeCollapsedAttribute == null ||
-                                             aPushModeCollapsedAttribute === true;
-            let collapsedModes = [];
-            let modeIndex = -1;
-            let display = aVisible;
-            let collapsedInMode = false;
-            if (this.hasAttribute("collapsedinmodes")) {
-                collapsedModes = this.getAttribute("collapsedinmodes").split(",");
-                modeIndex = collapsedModes.indexOf(this.currentMode);
-                collapsedInMode = (modeIndex > -1);
-            }
-            if ((aVisible === true) && (pushModeCollapsedAttribute == false)) {
-                display = (aVisible === true) && (!collapsedInMode);
-            }
+          let notifyRefControl = aNotifyRefControl == null || aNotifyRefControl === true;
+          let pushModeCollapsedAttribute = aPushModeCollapsedAttribute == null ||
+                                           aPushModeCollapsedAttribute === true;
+          let collapsedModes = [];
+          let modeIndex = -1;
+          let display = aVisible;
+          let collapsedInMode = false;
+          if (this.hasAttribute("collapsedinmodes")) {
+              collapsedModes = this.getAttribute("collapsedinmodes").split(",");
+              modeIndex = collapsedModes.indexOf(this.currentMode);
+              collapsedInMode = modeIndex > -1;
+          }
+          if (aVisible === true && pushModeCollapsedAttribute == false) {
+              display = (aVisible === true) && (!collapsedInMode);
+          }
 
-            setBooleanAttribute(this, "collapsed", !display || !this.isVisibleInMode());
-            if (pushModeCollapsedAttribute) {
-                if (!display) {
-                    if (modeIndex == -1) {
-                        collapsedModes.push(this.currentMode);
-                        if (this.getAttribute("collapsedinmodes") == ",") {
-                            collapsedModes.splice(0, 2);
-                        }
-                    }
-                } else if (modeIndex > -1) {
-                    collapsedModes.splice(modeIndex, 1);
-                    if (collapsedModes.join(",") == "") {
-                        collapsedModes[0] = ",";
-                    }
-                }
-                this.setAttribute("collapsedinmodes", collapsedModes.join(","));
-                let id = this.getAttribute("id");
-                if (id) {
-                    document.persist(id, "collapsedinmodes");
-                }
-            }
-            if (notifyRefControl === true) {
-                if (this.hasAttribute("refcontrol")) {
-                    let command = document.getElementById(this.getAttribute("refcontrol"));
-                    if (command) {
-                        command.setAttribute("checked", display);
-                        setBooleanAttribute(command, "disabled", !this.isVisibleInMode());
-                    }
-                }
-            }
+          setBooleanAttribute(this, "collapsed", !display || !this.isVisibleInMode());
+          if (pushModeCollapsedAttribute) {
+              if (!display) {
+                  if (modeIndex == -1) {
+                      collapsedModes.push(this.currentMode);
+                      if (this.getAttribute("collapsedinmodes") == ",") {
+                          collapsedModes.splice(0, 2);
+                      }
+                  }
+              } else if (modeIndex > -1) {
+                  collapsedModes.splice(modeIndex, 1);
+                  if (collapsedModes.join(",") == "") {
+                      collapsedModes[0] = ",";
+                  }
+              }
+              this.setAttribute("collapsedinmodes", collapsedModes.join(","));
+              let id = this.getAttribute("id");
+              if (id) {
+                  document.persist(id, "collapsedinmodes");
+              }
+          }
+          if (notifyRefControl === true) {
+              if (this.hasAttribute("refcontrol")) {
+                  let command = document.getElementById(this.getAttribute("refcontrol"));
+                  if (command) {
+                      command.setAttribute("checked", display);
+                      setBooleanAttribute(command, "disabled", !this.isVisibleInMode());
+                  }
+              }
+          }
         ]]></body>
       </method>
 
       <method name="isVisibleInMode">
         <parameter name="aMode"/>
         <body><![CDATA[
-            let lMode = aMode || this.currentMode;
-            let display = true;
-            let lModes = [];
-            if (this.hasAttribute("mode")) {
-                let modeString = this.getAttribute("mode");
-                lModes = modeString.split(",");
-            }
-            if (lModes && lModes.length > 0) {
-                display = lModes.includes(lMode);
-            }
-            return display;
+          let lMode = aMode || this.currentMode;
+          let display = true;
+          let lModes = [];
+          if (this.hasAttribute("mode")) {
+              let modeString = this.getAttribute("mode");
+              lModes = modeString.split(",");
+          }
+          if (lModes && lModes.length > 0) {
+              display = lModes.includes(lMode);
+          }
+          return display;
         ]]></body>
       </method>
 
       <method name="onModeModified">
         <parameter name="aEvent"/>
         <parameter name="aBinding"/>
         <body><![CDATA[
-            if (aEvent.attrName == "mode") {
-                let display = aBinding.isVisibleInMode(aEvent.newValue);
-                aBinding.setVisible(display, false, true);
-            }
+          if (aEvent.attrName == "mode") {
+              let display = aBinding.isVisibleInMode(aEvent.newValue);
+              aBinding.setVisible(display, false, true);
+          }
         ]]></body>
       </method>
 
       <method name="togglePane">
         <parameter name="aEvent"/>
         <body><![CDATA[
-            let command = aEvent.target;
-            let newValue = (command.getAttribute("checked") == "true" ? "false" : "true");
-            command.setAttribute("checked", newValue);
-            this.setVisible(newValue == "true", true, true);
+          let command = aEvent.target;
+          let newValue = (command.getAttribute("checked") == "true" ? "false" : "true");
+          command.setAttribute("checked", newValue);
+          this.setVisible(newValue == "true", true, true);
         ]]></body>
       </method>
 
       <method name="onCheckboxStateChange">
         <parameter name="aEvent"/>
         <parameter name="aBinding"/>
         <body><![CDATA[
-            let newValue = aEvent.target.checked;
-            this.setVisible(newValue, true, true);
+          let newValue = aEvent.target.checked;
+          this.setVisible(newValue, true, true);
         ]]></body>
       </method>
+
       <method name="setAttribute">
         <parameter name="aAttr"/>
         <parameter name="aVal"/>
         <body><![CDATA[
           if (aAttr == "broadcaster") {
               this.mBroadcaster = document.getElementById(aVal);
               if (this.mBroadcaster) {
                   this.mModHandler = {
-                  binding: this,
-                  handleEvent: function(aEvent, aHandled) {
-                      return this.binding.onModeModified(aEvent, this.binding);
-                  }
-              };
-              this.mBroadcaster.addEventListener("DOMAttrModified", this.mModHandler, true);
-            }
+                      binding: this,
+                      handleEvent: function(aEvent, aHandled) {
+                          return this.binding.onModeModified(aEvent, this.binding);
+                      }
+                  };
+                  this.mBroadcaster.addEventListener("DOMAttrModified", this.mModHandler, true);
+              }
           }
           return XULElement.prototype.setAttribute.call(this, aAttr, aVal);
         ]]></body>
       </method>
     </implementation>
   </binding>
 
-<!-- This binding may server as a droptarget container for arbitrary items
-     it contains methods to add DropShadows. This binding is meant to be used
-     as a parent binding. The methods may be overwritten.
--->
-<binding id="dragndropContainer">
+  <!-- This binding may server as a droptarget container for arbitrary items
+       it contains methods to add DropShadows. This binding is meant to be used
+       as a parent binding. The methods may be overwritten. -->
+  <binding id="dragndropContainer">
     <implementation>
       <field name="mDropShadows">[]</field>
       <field name="mCalendarView">null</field>
 
       <!-- The ViewController that supports the interface 'calICalendarView'-->
       <property name="calendarView"
                 onget="return this.mCalendarView;"
                 onset="return (this.mCalendarView = val);"/>
 
-       <!-- method to add individual code e.g to set up the new item during
+      <!-- method to add individual code e.g to set up the new item during
        'ondrop' -->
       <method name="onDropItem">
         <parameter name="aItem"/>
         <body><![CDATA[
-            // method that may be overridden by derived bindings...
+          // method that may be overridden by derived bindings...
         ]]></body>
       </method>
 
       <method name="getDropShadows">
         <body><![CDATA[
-            return this.mDropShadows;
+          return this.mDropShadows;
         ]]></body>
       </method>
 
       <!-- Adds the dropshadows to the children of the binding. The dropshadows
            are added at the first position of the children -->
       <method name="addDropShadows">
         <body><![CDATA[
           if (this.mDropShadows) {
@@ -559,23 +571,23 @@
           }
         ]]></body>
       </method>
 
       <!-- removes all dropShadows from the binding. Dropshadows are recognized
            as such by carrying an attribute "dropshadow" -->
       <method name="removeDropShadows">
         <body><![CDATA[
-            // method that may be overwritten by derived bindings...
-            if (this.calendarView.mDropShadows) {
-                for (let shadow of this.calendarView.mDropShadows) {
-                    cal.removeChildElementsByAttribute(shadow, "class", "dropshadow");
-                }
-            }
-            this.calendarView.mDropShadows = null;
+          // method that may be overwritten by derived bindings...
+          if (this.calendarView.mDropShadows) {
+              for (let shadow of this.calendarView.mDropShadows) {
+                  cal.removeChildElementsByAttribute(shadow, "class", "dropshadow");
+              }
+          }
+          this.calendarView.mDropShadows = null;
         ]]></body>
       </method>
 
       <!-- By setting the attribute "dropbox" to "true" or "false" the
            dropshadows are added or removed -->
       <method name="setAttribute">
         <parameter name="aAttr"/>
         <parameter name="aVal"/>
@@ -592,122 +604,121 @@
                   } else {
                       this.removeDropShadows();
                   }
               }
           }
           return XULElement.prototype.setAttribute.call(this, aAttr, aVal);
         ]]></body>
       </method>
-
     </implementation>
 
     <handlers>
       <handler event="dragstart" phase="capturing"><![CDATA[
-         let draggedDOMNode = event.target;
-         if (!draggedDOMNode || draggedDOMNode.parentNode != this) {
-             return;
-         }
-         let item = draggedDOMNode.occurrence.clone();
-         let beginMoveDate = draggedDOMNode.mParentBox.date;
-         let itemStartDate = (item.startDate || item.entryDate || item.dueDate).getInTimezone(calendarView.mTimezone);
-         let itemEndDate = (item.endDate || item.dueDate || item.entryDate).getInTimezone(calendarView.mTimezone);
-         let oneMoreDay = (itemEndDate.hour > 0 || itemEndDate.minute > 0);
-         itemStartDate.isDate = true;
-         itemEndDate.isDate = true;
-         let offsetDuration = itemStartDate.subtractDate(beginMoveDate);
-         let lenDuration = itemEndDate.subtractDate(itemStartDate);
-         let len = lenDuration.weeks * 7 + lenDuration.days;
-         this.calendarView.mShadowOffset = offsetDuration;
-         this.calendarView.mDropShadowsLength = oneMoreDay ? len + 1 : len;
+        let draggedDOMNode = event.target;
+        if (!draggedDOMNode || draggedDOMNode.parentNode != this) {
+            return;
+        }
+        let item = draggedDOMNode.occurrence.clone();
+        let beginMoveDate = draggedDOMNode.mParentBox.date;
+        let itemStartDate = (item.startDate || item.entryDate || item.dueDate).getInTimezone(calendarView.mTimezone);
+        let itemEndDate = (item.endDate || item.dueDate || item.entryDate).getInTimezone(calendarView.mTimezone);
+        let oneMoreDay = (itemEndDate.hour > 0 || itemEndDate.minute > 0);
+        itemStartDate.isDate = true;
+        itemEndDate.isDate = true;
+        let offsetDuration = itemStartDate.subtractDate(beginMoveDate);
+        let lenDuration = itemEndDate.subtractDate(itemStartDate);
+        let len = lenDuration.weeks * 7 + lenDuration.days;
+        this.calendarView.mShadowOffset = offsetDuration;
+        this.calendarView.mDropShadowsLength = oneMoreDay ? len + 1 : len;
       ]]></handler>
 
       <handler event="dragover"><![CDATA[
-         let session = cal.getDragService().getCurrentSession();
-         if (!session || !session.sourceNode || !session.sourceNode.sourceObject) {
+        let session = cal.getDragService().getCurrentSession();
+        if (!session || !session.sourceNode || !session.sourceNode.sourceObject) {
             // No source item? Then this is not for us.
             return;
-         }
+        }
 
-         // We handled the event
-         event.preventDefault();
+        // We handled the event
+        event.preventDefault();
       ]]></handler>
 
       <handler event="dragenter"><![CDATA[
-       if (event.target.localName == this.localName) {
-           let session = cal.getDragService().getCurrentSession();
-           if (session) {
-               if (!session.sourceNode || !session.sourceNode.sourceObject) {
-                  // No source item? Then this is not for us.
-                  return;
-               }
+        if (event.target.localName == this.localName) {
+            let session = cal.getDragService().getCurrentSession();
+            if (session) {
+                if (!session.sourceNode || !session.sourceNode.sourceObject) {
+                    // No source item? Then this is not for us.
+                    return;
+                }
 
-               // We can drop now, tell the drag service.
-               event.preventDefault();
+                // We can drop now, tell the drag service.
+                event.preventDefault();
 
-               if (!this.hasAttribute("dropbox") || this.getAttribute("dropbox") == "false") {
-                   // As it turned out it was not possible to remove the remaining dropshadows
-                   // at the "dragleave" or "dragexit" event, majorly because it was not reliably
-                   // fired. As the dragndropcontainer may be anonymous it is further on not
-                   // possible to remove the dropshadows by something like
-                   // "document.getElementsByAttribute('dropbox').removeDropShadows();";
-                   // So we have to remove them at the currentView(). The restriction of course is
-                   // that these containers so far may not be used for drag and drop from/to e.g.
-                   // the today-pane.
-                   currentView().removeDropShadows();
-               }
-               this.setAttribute("dropbox", "true");
-           }
-       }
+                if (!this.hasAttribute("dropbox") || this.getAttribute("dropbox") == "false") {
+                    // As it turned out it was not possible to remove the remaining dropshadows
+                    // at the "dragleave" or "dragexit" event, majorly because it was not reliably
+                    // fired. As the dragndropcontainer may be anonymous it is further on not
+                    // possible to remove the dropshadows by something like
+                    // "document.getElementsByAttribute('dropbox').removeDropShadows();";
+                    // So we have to remove them at the currentView(). The restriction of course is
+                    // that these containers so far may not be used for drag and drop from/to e.g.
+                    // the today-pane.
+                    currentView().removeDropShadows();
+                }
+                this.setAttribute("dropbox", "true");
+            }
+        }
       ]]></handler>
 
       <handler event="drop"><![CDATA[
-         let session = cal.getDragService().getCurrentSession();
-         if (!session || !session.sourceNode || !session.sourceNode.sourceObject) {
+        let session = cal.getDragService().getCurrentSession();
+        if (!session || !session.sourceNode || !session.sourceNode.sourceObject) {
             // No source node? Not our drag.
             return;
-         }
-         let item = session.sourceNode.sourceObject.clone();
-         this.setAttribute("dropbox", "false");
-         let transfer = Components.classes["@mozilla.org/widget/transferable;1"]
-                                  .createInstance(Components.interfaces.nsITransferable);
-         transfer.init(null);
+        }
+        let item = session.sourceNode.sourceObject.clone();
+        this.setAttribute("dropbox", "false");
+        let transfer = Components.classes["@mozilla.org/widget/transferable;1"]
+                                 .createInstance(Components.interfaces.nsITransferable);
+        transfer.init(null);
 
-         if (isEvent(item)) {
-             transfer.addDataFlavor("application/x-moz-cal-event");
-         } else {
-             transfer.addDataFlavor("application/x-moz-cal-task");
-         }
+        if (isEvent(item)) {
+            transfer.addDataFlavor("application/x-moz-cal-event");
+        } else {
+            transfer.addDataFlavor("application/x-moz-cal-task");
+        }
 
-         session.getData(transfer, 0);
-         item = session.sourceNode.sourceObject;
+        session.getData(transfer, 0);
+        item = session.sourceNode.sourceObject;
 
-         let newItem = this.onDropItem(item).clone();
-         let newStart = newItem.startDate || newItem.entryDate || newItem.dueDate;
-         let newEnd = newItem.endDate || newItem.dueDate || newItem.entryDate;
-         let offset = this.calendarView.mShadowOffset;
-         newStart.addDuration(offset);
-         newEnd.addDuration(offset);
-         this.calendarView.controller.modifyOccurrence(item, newStart, newEnd);
+        let newItem = this.onDropItem(item).clone();
+        let newStart = newItem.startDate || newItem.entryDate || newItem.dueDate;
+        let newEnd = newItem.endDate || newItem.dueDate || newItem.entryDate;
+        let offset = this.calendarView.mShadowOffset;
+        newStart.addDuration(offset);
+        newEnd.addDuration(offset);
+        this.calendarView.controller.modifyOccurrence(item, newStart, newEnd);
 
-         // We handled the event
-         event.stopPropagation();
+        // We handled the event
+        event.stopPropagation();
       ]]></handler>
 
       <handler event="dragend"><![CDATA[
-          currentView().removeDropShadows();
+        currentView().removeDropShadows();
       ]]></handler>
-
     </handlers>
   </binding>
 
   <binding id="view-tab" extends="chrome://global/content/bindings/tabbox.xml#tab">
     <resources>
       <stylesheet src="chrome://calendar/skin/widgets/calendar-widgets.css"/>
     </resources>
+
     <content>
       <xul:hbox class="tab-middle box-inherit" xbl:inherits="align,dir,pack,orient,selected" flex="1">
         <xul:image class="tab-icon" xbl:inherits="validate,src=image"/>
         <xul:stack>
           <xul:label class="tab-text unselected-text"
                      xbl:inherits="value=label,accesskey,crop,disabled,selected"
                      flex="1"/>
           <xul:label class="tab-text selected-text"
--- a/calendar/base/content/widgets/minimonth.xml
+++ b/calendar/base/content/widgets/minimonth.xml
@@ -1,10 +1,9 @@
 <?xml version="1.0"?>
-
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!--
    MiniMonth Calendar: day-of-month grid XBL component.
    Displays month name and year above grid of days of month by week rows.
    Arrows move forward or back a month.
@@ -22,459 +21,466 @@
    Use attributes onpopuplisthidden and onmonthchange for working around
    bugs that occur when minimonth is displayed in a popup (as in datepicker):
      Currently (2005.3)
        whenever a child popup is hidden, the parent popup needs to be reshown.
          Use onpopuplisthidden to reshow parent popop (hidePopup, openPopup).
        When title month or year changes, parent popup may need to be reshown.
          Use onmonthchange to reshow parent popop (hidePopup, openPopup).
 -->
+
 <!DOCTYPE bindings
 [
     <!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
     <!ENTITY % dtd2 SYSTEM "chrome://global/locale/global.dtd" > %dtd2;
 ]>
 
 <bindings id="xulMiniMonth"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xbl="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-   <binding id="minimonth-header" extends="xul:box">
-     <content class="minimonth-month-box" align="center">
-         <xul:deck anonid="monthheader" xbl:inherits="selectedIndex=month" class="minimonth-month-name-readonly">
-           <xul:text value="&month.1.name;"/>
-           <xul:text value="&month.2.name;"/>
-           <xul:text value="&month.3.name;"/>
-           <xul:text value="&month.4.name;"/>
-           <xul:text value="&month.5.name;"/>
-           <xul:text value="&month.6.name;"/>
-           <xul:text value="&month.7.name;"/>
-           <xul:text value="&month.8.name;"/>
-           <xul:text value="&month.9.name;"/>
-           <xul:text value="&month.10.name;"/>
-           <xul:text value="&month.11.name;"/>
-           <xul:text value="&month.12.name;"/>
-         </xul:deck>
-         <xul:text anonid="yearcell" class="minimonth-year-name-readonly" xbl:inherits="value=year"/>
-         <xul:spacer flex="1"/>
-     </content>
-   </binding>
+  <binding id="minimonth-header" extends="xul:box">
+    <content class="minimonth-month-box" align="center">
+      <xul:deck anonid="monthheader" xbl:inherits="selectedIndex=month" class="minimonth-month-name-readonly">
+        <xul:text value="&month.1.name;"/>
+        <xul:text value="&month.2.name;"/>
+        <xul:text value="&month.3.name;"/>
+        <xul:text value="&month.4.name;"/>
+        <xul:text value="&month.5.name;"/>
+        <xul:text value="&month.6.name;"/>
+        <xul:text value="&month.7.name;"/>
+        <xul:text value="&month.8.name;"/>
+        <xul:text value="&month.9.name;"/>
+        <xul:text value="&month.10.name;"/>
+        <xul:text value="&month.11.name;"/>
+        <xul:text value="&month.12.name;"/>
+      </xul:deck>
+      <xul:text anonid="yearcell" class="minimonth-year-name-readonly" xbl:inherits="value=year"/>
+      <xul:spacer flex="1"/>
+    </content>
+  </binding>
 
-   <binding id="active-minimonth-header" extends="chrome://calendar/content/widgets/minimonth.xml#minimonth-header">
-       <content class="minimonth-month-box" align="center">
-         <xul:deck anonid="monthheader" xbl:inherits="selectedIndex=month"  class="minimonth-month-name">
-           <xul:toolbarbutton label="&month.1.name;" oncommand="showPopupList(event, 'months-popup')"/>
-           <xul:toolbarbutton label="&month.2.name;"  oncommand="showPopupList(event, 'months-popup')"/>
-           <xul:toolbarbutton label="&month.3.name;"  oncommand="showPopupList(event, 'months-popup')"/>
-           <xul:toolbarbutton label="&month.4.name;"  oncommand="showPopupList(event, 'months-popup')"/>
-           <xul:toolbarbutton label="&month.5.name;"  oncommand="showPopupList(event, 'months-popup')"/>
-           <xul:toolbarbutton label="&month.6.name;"  oncommand="showPopupList(event, 'months-popup')"/>
-           <xul:toolbarbutton label="&month.7.name;"  oncommand="showPopupList(event, 'months-popup')"/>
-           <xul:toolbarbutton label="&month.8.name;"  oncommand="showPopupList(event, 'months-popup')"/>
-           <xul:toolbarbutton label="&month.9.name;"  oncommand="showPopupList(event, 'months-popup')"/>
-           <xul:toolbarbutton label="&month.10.name;"  oncommand="showPopupList(event, 'months-popup')"/>
-           <xul:toolbarbutton label="&month.11.name;"  oncommand="showPopupList(event, 'months-popup')"/>
-           <xul:toolbarbutton label="&month.12.name;"  oncommand="showPopupList(event, 'months-popup')"/>
-         </xul:deck>
-         <xul:toolbarbutton anonid="yearcell"
-                            class="minimonth-year-name"
-                            oncommand="showPopupList(event, 'years-popup')"
-                            xbl:inherits="label=year"/>
-         <xul:spacer flex="1"/>
-         <xul:toolbarbutton anonid="back-button" class="minimonth-nav-btns" dir="-1"
-                            oncommand="this.kMinimonth.advanceMonth(parseInt(this.getAttribute('dir'), 10))"
-                            tooltiptext="&onemonthbackward.tooltip;"/>
-         <xul:toolbarbutton anonid="today-button" class="minimonth-nav-btns" dir="0"
-                            oncommand="this.kMinimonth.value = new Date();"
-                            tooltiptext="&showToday.tooltip;"/>
-         <xul:toolbarbutton anonid="forward-button" class="minimonth-nav-btns" dir="1"
-                            oncommand="this.kMinimonth.advanceMonth(parseInt(this.getAttribute('dir'), 10))"
-                            tooltiptext="&onemonthforward.tooltip;"/>
-       <xul:popupset anonid="minmonth-popupset">
-         <xul:menupopup anonid="months-popup" position="after_start"
-                        onpopupshowing="event.stopPropagation();"
-                        onpopuphidden="firePopupListHidden();">
-           <xul:vbox>
-             <xul:text class="minimonth-list" value="&month.1.name;" index="0"/>
-             <xul:text class="minimonth-list" value="&month.2.name;" index="1"/>
-             <xul:text class="minimonth-list" value="&month.3.name;" index="2"/>
-             <xul:text class="minimonth-list" value="&month.4.name;" index="3"/>
-             <xul:text class="minimonth-list" value="&month.5.name;" index="4"/>
-             <xul:text class="minimonth-list" value="&month.6.name;" index="5"/>
-             <xul:text class="minimonth-list" value="&month.7.name;" index="6"/>
-             <xul:text class="minimonth-list" value="&month.8.name;" index="7"/>
-             <xul:text class="minimonth-list" value="&month.9.name;" index="8"/>
-             <xul:text class="minimonth-list" value="&month.10.name;" index="9"/>
-             <xul:text class="minimonth-list" value="&month.11.name;" index="10"/>
-             <xul:text class="minimonth-list" value="&month.12.name;" index="11"/>
-           </xul:vbox>
-         </xul:menupopup>
-         <xul:menupopup anonid="years-popup" position="after_start"
-                        onpopupshowing="moveYears('reset', 0); event.stopPropagation();"
-                        onpopuphidden="firePopupListHidden();">
-           <xul:vbox>
-             <xul:autorepeatbutton class="autorepeatbutton-up"
-                                   orient="vertical"
-                                   oncommand="moveYears('up', 1);"/>
-             <xul:text class="minimonth-list"/>
-             <xul:text class="minimonth-list"/>
-             <xul:text class="minimonth-list"/>
-             <xul:text class="minimonth-list"/>
-             <xul:text class="minimonth-list"/>
-             <xul:text class="minimonth-list"/>
-             <xul:text class="minimonth-list"/>
-             <xul:text class="minimonth-list"/>
-             <xul:text class="minimonth-list"/>
-             <xul:autorepeatbutton class="autorepeatbutton-down"
-                                   orient="vertical"
-                                   oncommand="moveYears('down', 1);"/>
-           </xul:vbox>
-         </xul:menupopup>
-       </xul:popupset>
-     </content>
-     <implementation>
-       <field name="kMinimonth">null</field>
-       <field name="mPopup">null</field>
-       <field name="mScrollYearsHandler">null</field>
-       <field name="mPixelScrollDelta">0</field>
-       <constructor><![CDATA[
-         this.kMinimonth = getParentNodeOrThis(this, "minimonth");
-         document.getAnonymousElementByAttribute(this, "anonid", "back-button").kMinimonth = this.kMinimonth;
-         document.getAnonymousElementByAttribute(this, "anonid", "today-button").kMinimonth = this.kMinimonth;
-         document.getAnonymousElementByAttribute(this, "anonid", "forward-button").kMinimonth = this.kMinimonth;
+  <binding id="active-minimonth-header" extends="chrome://calendar/content/widgets/minimonth.xml#minimonth-header">
+    <content class="minimonth-month-box" align="center">
+      <xul:deck anonid="monthheader" xbl:inherits="selectedIndex=month"  class="minimonth-month-name">
+        <xul:toolbarbutton label="&month.1.name;" oncommand="showPopupList(event, 'months-popup')"/>
+        <xul:toolbarbutton label="&month.2.name;"  oncommand="showPopupList(event, 'months-popup')"/>
+        <xul:toolbarbutton label="&month.3.name;"  oncommand="showPopupList(event, 'months-popup')"/>
+        <xul:toolbarbutton label="&month.4.name;"  oncommand="showPopupList(event, 'months-popup')"/>
+        <xul:toolbarbutton label="&month.5.name;"  oncommand="showPopupList(event, 'months-popup')"/>
+        <xul:toolbarbutton label="&month.6.name;"  oncommand="showPopupList(event, 'months-popup')"/>
+        <xul:toolbarbutton label="&month.7.name;"  oncommand="showPopupList(event, 'months-popup')"/>
+        <xul:toolbarbutton label="&month.8.name;"  oncommand="showPopupList(event, 'months-popup')"/>
+        <xul:toolbarbutton label="&month.9.name;"  oncommand="showPopupList(event, 'months-popup')"/>
+        <xul:toolbarbutton label="&month.10.name;"  oncommand="showPopupList(event, 'months-popup')"/>
+        <xul:toolbarbutton label="&month.11.name;"  oncommand="showPopupList(event, 'months-popup')"/>
+        <xul:toolbarbutton label="&month.12.name;"  oncommand="showPopupList(event, 'months-popup')"/>
+      </xul:deck>
+      <xul:toolbarbutton anonid="yearcell"
+                         class="minimonth-year-name"
+                         oncommand="showPopupList(event, 'years-popup')"
+                         xbl:inherits="label=year"/>
+      <xul:spacer flex="1"/>
+      <xul:toolbarbutton anonid="back-button" class="minimonth-nav-btns" dir="-1"
+                         oncommand="this.kMinimonth.advanceMonth(parseInt(this.getAttribute('dir'), 10))"
+                         tooltiptext="&onemonthbackward.tooltip;"/>
+      <xul:toolbarbutton anonid="today-button" class="minimonth-nav-btns" dir="0"
+                         oncommand="this.kMinimonth.value = new Date();"
+                         tooltiptext="&showToday.tooltip;"/>
+      <xul:toolbarbutton anonid="forward-button" class="minimonth-nav-btns" dir="1"
+                         oncommand="this.kMinimonth.advanceMonth(parseInt(this.getAttribute('dir'), 10))"
+                         tooltiptext="&onemonthforward.tooltip;"/>
+      <xul:popupset anonid="minmonth-popupset">
+        <xul:menupopup anonid="months-popup" position="after_start"
+                       onpopupshowing="event.stopPropagation();"
+                       onpopuphidden="firePopupListHidden();">
+          <xul:vbox>
+            <xul:text class="minimonth-list" value="&month.1.name;" index="0"/>
+            <xul:text class="minimonth-list" value="&month.2.name;" index="1"/>
+            <xul:text class="minimonth-list" value="&month.3.name;" index="2"/>
+            <xul:text class="minimonth-list" value="&month.4.name;" index="3"/>
+            <xul:text class="minimonth-list" value="&month.5.name;" index="4"/>
+            <xul:text class="minimonth-list" value="&month.6.name;" index="5"/>
+            <xul:text class="minimonth-list" value="&month.7.name;" index="6"/>
+            <xul:text class="minimonth-list" value="&month.8.name;" index="7"/>
+            <xul:text class="minimonth-list" value="&month.9.name;" index="8"/>
+            <xul:text class="minimonth-list" value="&month.10.name;" index="9"/>
+            <xul:text class="minimonth-list" value="&month.11.name;" index="10"/>
+            <xul:text class="minimonth-list" value="&month.12.name;" index="11"/>
+          </xul:vbox>
+        </xul:menupopup>
+        <xul:menupopup anonid="years-popup" position="after_start"
+                       onpopupshowing="moveYears('reset', 0); event.stopPropagation();"
+                       onpopuphidden="firePopupListHidden();">
+          <xul:vbox>
+            <xul:autorepeatbutton class="autorepeatbutton-up"
+                                  orient="vertical"
+                                  oncommand="moveYears('up', 1);"/>
+            <xul:text class="minimonth-list"/>
+            <xul:text class="minimonth-list"/>
+            <xul:text class="minimonth-list"/>
+            <xul:text class="minimonth-list"/>
+            <xul:text class="minimonth-list"/>
+            <xul:text class="minimonth-list"/>
+            <xul:text class="minimonth-list"/>
+            <xul:text class="minimonth-list"/>
+            <xul:text class="minimonth-list"/>
+            <xul:autorepeatbutton class="autorepeatbutton-down"
+                                  orient="vertical"
+                                  oncommand="moveYears('down', 1);"/>
+          </xul:vbox>
+        </xul:menupopup>
+      </xul:popupset>
+    </content>
+    <implementation>
+      <field name="kMinimonth">null</field>
+      <field name="mPopup">null</field>
+      <field name="mScrollYearsHandler">null</field>
+      <field name="mPixelScrollDelta">0</field>
+      <constructor><![CDATA[
+        this.kMinimonth = getParentNodeOrThis(this, "minimonth");
+        document.getAnonymousElementByAttribute(this, "anonid", "back-button").kMinimonth = this.kMinimonth;
+        document.getAnonymousElementByAttribute(this, "anonid", "today-button").kMinimonth = this.kMinimonth;
+        document.getAnonymousElementByAttribute(this, "anonid", "forward-button").kMinimonth = this.kMinimonth;
 
-         this.mScrollYearsHandler = this.scrollYears.bind(this);
-         document.getAnonymousElementByAttribute(this, "anonid", "years-popup")
-                 .addEventListener("wheel", this.mScrollYearsHandler, true);
-       ]]></constructor>
-       <destructor><![CDATA[
-         document.getAnonymousElementByAttribute(this, "anonid", "years-popup")
-                 .removeEventListener("wheel", this.mScrollYearsHandler, true);
-         this.mScrollYearsHandler = null;
-       ]]></destructor>
+        this.mScrollYearsHandler = this.scrollYears.bind(this);
+        document.getAnonymousElementByAttribute(this, "anonid", "years-popup")
+                .addEventListener("wheel", this.mScrollYearsHandler, true);
+      ]]></constructor>
+