# HG changeset patch # User Philipp Kewisch # Date 1517401888 -3600 # Node ID 0250e2262e3c746f8717d588addbff47f3584329 # Parent cc049fbd669b7e49f6a08652ceeaabd2666a45ed Bug 1434737 - Move to ChromeUtils.import() - Calendar part. r=MakeMyDay MozReview-Commit-ID: 4ahbZ5P9Ad diff --git a/calendar/base/backend/calBackendLoader.js b/calendar/base/backend/calBackendLoader.js --- a/calendar/base/backend/calBackendLoader.js +++ b/calendar/base/backend/calBackendLoader.js @@ -1,14 +1,14 @@ /* 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/. */ -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -Components.utils.import("resource://gre/modules/Services.jsm"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); +ChromeUtils.import("resource://gre/modules/Services.jsm"); function calBackendLoader() { this.wrappedJSObject = this; try { this.loadBackend(); } catch (e) { dump("### Error loading backend: " + e + "\n"); } diff --git a/calendar/base/backend/icaljs/calDateTime.js b/calendar/base/backend/icaljs/calDateTime.js --- a/calendar/base/backend/icaljs/calDateTime.js +++ b/calendar/base/backend/icaljs/calDateTime.js @@ -1,15 +1,15 @@ /* 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/. */ -Components.utils.import("resource://calendar/modules/ical.js"); -Components.utils.import("resource://calendar/modules/calUtils.jsm"); -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); +ChromeUtils.import("resource://calendar/modules/ical.js"); +ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); var UNIX_TIME_TO_PRTIME = 1000000; function calDateTime(innerObject) { this.wrappedJSObject = this; this.innerObject = innerObject || ICAL.Time.epochTime.clone(); } diff --git a/calendar/base/backend/icaljs/calDuration.js b/calendar/base/backend/icaljs/calDuration.js --- a/calendar/base/backend/icaljs/calDuration.js +++ b/calendar/base/backend/icaljs/calDuration.js @@ -1,14 +1,14 @@ /* 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/. */ -Components.utils.import("resource://calendar/modules/ical.js"); -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); +ChromeUtils.import("resource://calendar/modules/ical.js"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); function calDuration(innerObject) { this.innerObject = innerObject || new ICAL.Duration(); this.wrappedJSObject = this; } var calDurationInterfaces = [Components.interfaces.calIDuration]; var calDurationClassID = Components.ID("{7436f480-c6fc-4085-9655-330b1ee22288}"); diff --git a/calendar/base/backend/icaljs/calICALJSComponents.js b/calendar/base/backend/icaljs/calICALJSComponents.js --- a/calendar/base/backend/icaljs/calICALJSComponents.js +++ b/calendar/base/backend/icaljs/calICALJSComponents.js @@ -1,13 +1,13 @@ /* 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/. */ -Components.utils.import("resource://calendar/modules/calUtils.jsm"); +ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); var scriptLoadOrder = [ "calTimezone.js", "calDateTime.js", "calDuration.js", "calICSService.js", "calPeriod.js", "calRecurrenceRule.js", diff --git a/calendar/base/backend/icaljs/calICSService.js b/calendar/base/backend/icaljs/calICSService.js --- a/calendar/base/backend/icaljs/calICSService.js +++ b/calendar/base/backend/icaljs/calICSService.js @@ -1,15 +1,15 @@ /* 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/. */ -Components.utils.import("resource://calendar/modules/ical.js"); -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -Components.utils.import("resource://calendar/modules/calUtils.jsm"); +ChromeUtils.import("resource://calendar/modules/ical.js"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); +ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); function calIcalProperty(innerObject) { this.innerObject = innerObject || new ICAL.Property(); this.wrappedJSObject = this; } var calIcalPropertyInterfaces = [Components.interfaces.calIIcalProperty]; var calIcalPropertyClassID = Components.ID("{423ac3f0-f612-48b3-953f-47f7f8fd705b}"); diff --git a/calendar/base/backend/icaljs/calPeriod.js b/calendar/base/backend/icaljs/calPeriod.js --- a/calendar/base/backend/icaljs/calPeriod.js +++ b/calendar/base/backend/icaljs/calPeriod.js @@ -1,14 +1,14 @@ /* 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/. */ -Components.utils.import("resource://calendar/modules/ical.js"); -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); +ChromeUtils.import("resource://calendar/modules/ical.js"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); function calPeriod(innerObject) { this.innerObject = innerObject || new ICAL.Period({}); this.wrappedJSObject = this; } var calPeriodInterfaces = [Components.interfaces.calIPeriod]; var calPeriodClassID = Components.ID("{394a281f-7299-45f7-8b1f-cce21258972f}"); diff --git a/calendar/base/backend/icaljs/calRecurrenceRule.js b/calendar/base/backend/icaljs/calRecurrenceRule.js --- a/calendar/base/backend/icaljs/calRecurrenceRule.js +++ b/calendar/base/backend/icaljs/calRecurrenceRule.js @@ -1,15 +1,15 @@ /* 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/. */ -Components.utils.import("resource://calendar/modules/ical.js"); -Components.utils.import("resource://calendar/modules/calUtils.jsm"); -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); +ChromeUtils.import("resource://calendar/modules/ical.js"); +ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); function calRecurrenceRule(innerObject) { this.innerObject = innerObject || new ICAL.Recur(); this.wrappedJSObject = this; } var calRecurrenceRuleInterfaces = [Components.interfaces.calIRecurrenceRule]; var calRecurrenceRuleClassID = Components.ID("{df19281a-5389-4146-b941-798cb93a7f0d}"); diff --git a/calendar/base/content/agenda-listbox.js b/calendar/base/content/agenda-listbox.js --- a/calendar/base/content/agenda-listbox.js +++ b/calendar/base/content/agenda-listbox.js @@ -1,17 +1,17 @@ /* 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/. */ -Components.utils.import("resource://gre/modules/Services.jsm"); -Components.utils.import("resource://gre/modules/Preferences.jsm"); -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); +ChromeUtils.import("resource://gre/modules/Services.jsm"); +ChromeUtils.import("resource://gre/modules/Preferences.jsm"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); -Components.utils.import("resource://calendar/modules/calUtils.jsm"); +ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); function Synthetic(aOpen, aDuration, aMultiday) { this.open = aOpen; this.duration = aDuration; this.multiday = aMultiday; } var agendaListbox = { diff --git a/calendar/base/content/agenda-listbox.xml b/calendar/base/content/agenda-listbox.xml --- a/calendar/base/content/agenda-listbox.xml +++ b/calendar/base/content/agenda-listbox.xml @@ -42,17 +42,17 @@ null; @@ -106,17 +106,17 @@ null; null null; null null { this.changeMenuByPropertyName(); }; this.mParentMenuPopup = cal.view.getParentNodeOrThis(this, "menupopup"); this.mParentMenuPopup.addEventListener("popupshowing", this.mPopupHandler, true); ]]> null {} false null @@ -2300,17 +2300,17 @@ null @@ -2517,18 +2517,18 @@ diff --git a/calendar/base/content/calendar-task-view.js b/calendar/base/content/calendar-task-view.js --- a/calendar/base/content/calendar-task-view.js +++ b/calendar/base/content/calendar-task-view.js @@ -1,18 +1,18 @@ /* 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/. */ /* exported taskDetailsView, sendMailToOrganizer, taskViewCopyLink */ -Components.utils.import("resource://calendar/modules/calUtils.jsm"); -Components.utils.import("resource://calendar/modules/calRecurrenceUtils.jsm"); -Components.utils.import("resource://gre/modules/Services.jsm"); -Components.utils.import("resource://gre/modules/AppConstants.jsm"); +ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); +ChromeUtils.import("resource://calendar/modules/calRecurrenceUtils.jsm"); +ChromeUtils.import("resource://gre/modules/Services.jsm"); +ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); var taskDetailsView = { /** * Task Details Events * * XXXberend Please document this function, possibly also consolidate since * its the only function in taskDetailsView. diff --git a/calendar/base/content/calendar-ui-utils.js b/calendar/base/content/calendar-ui-utils.js --- a/calendar/base/content/calendar-ui-utils.js +++ b/calendar/base/content/calendar-ui-utils.js @@ -7,19 +7,19 @@ * enableElementWithLock, uncheckChildNodes, removeChildren, * appendCalendarItems, setAttributeToChildren, checkRadioControl, * processEnableCheckbox, updateListboxDeleteButton, * updateUnitLabelPlural, updateMenuLabelsPlural, menuListSelectItem, * getOptimalMinimumWidth, getOptimalMinimumHeight, * getOtherOrientation, updateSelectedLabel, setupAttendanceMenu */ -Components.utils.import("resource://calendar/modules/calUtils.jsm"); -Components.utils.import("resource://gre/modules/Preferences.jsm"); -Components.utils.import("resource://gre/modules/PluralForm.jsm"); +ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); +ChromeUtils.import("resource://gre/modules/Preferences.jsm"); +ChromeUtils.import("resource://gre/modules/PluralForm.jsm"); /** * Helper function for filling the form, * Set the value of a property of a XUL element * * @param aElement ID of XUL element to set, or the element node itself * @param aNewValue value to set property to ( if undefined no change is made ) * @param aPropertyName OPTIONAL name of property to set, default is "value", diff --git a/calendar/base/content/calendar-unifinder.js b/calendar/base/content/calendar-unifinder.js --- a/calendar/base/content/calendar-unifinder.js +++ b/calendar/base/content/calendar-unifinder.js @@ -11,19 +11,19 @@ * * This is a hacked in interface to the unifinder. We will need to * improve this to make it usable in general. * * NOTE: Including this file will cause a load handler to be added to the * window. */ -Components.utils.import("resource://calendar/modules/calUtils.jsm"); -Components.utils.import("resource://gre/modules/Services.jsm"); -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); +ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); +ChromeUtils.import("resource://gre/modules/Services.jsm"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); // Set this to true when the calendar event tree is clicked to allow for // multiple selection var gCalendarEventTreeClicked = false; // Store the start and enddate, because the providers can't be trusted when // dealing with all-day events. So we need to filter later. See bug 306157 diff --git a/calendar/base/content/calendar-view-core.xml b/calendar/base/content/calendar-view-core.xml --- a/calendar/base/content/calendar-view-core.xml +++ b/calendar/base/content/calendar-view-core.xml @@ -59,19 +59,19 @@ { this.stopEditing(true); }; this.eventNameTextbox.onkeypress = (event) => { // save on enter if (event.keyCode == 13) { this.stopEditing(true); diff --git a/calendar/base/content/calendar-views.js b/calendar/base/content/calendar-views.js --- a/calendar/base/content/calendar-views.js +++ b/calendar/base/content/calendar-views.js @@ -4,21 +4,21 @@ /* exported switchToView, getSelectedDay, scheduleMidnightUpdate, * updateStyleSheetForViews, observeViewDaySelect, toggleOrientation, * toggleWorkdaysOnly, toggleTasksInView, toggleShowCompletedInView, * goToDate, getLastCalendarView, deleteSelectedEvents, * editSelectedEvents, selectAllEvents */ -Components.utils.import("resource://calendar/modules/calUtils.jsm"); -Components.utils.import("resource://calendar/modules/calAlarmUtils.jsm"); -Components.utils.import("resource://gre/modules/Services.jsm"); -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -Components.utils.import("resource://gre/modules/Preferences.jsm"); +ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); +ChromeUtils.import("resource://calendar/modules/calAlarmUtils.jsm"); +ChromeUtils.import("resource://gre/modules/Services.jsm"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); +ChromeUtils.import("resource://gre/modules/Preferences.jsm"); /** * Controller for the views * @see calIcalendarViewController */ var calendarViewController = { QueryInterface: function(aIID) { if (!aIID.equals(Components.interfaces.calICalendarViewController) && diff --git a/calendar/base/content/calendar-views.xml b/calendar/base/content/calendar-views.xml --- a/calendar/base/content/calendar-views.xml +++ b/calendar/base/content/calendar-views.xml @@ -8,17 +8,17 @@ 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"> { if (event.attrName == "mode") { this.onModeChanged(event); } }; document.getElementById("modeBroadcaster").addEventListener("DOMAttrModified", this.mModeHandler, true); @@ -117,18 +117,18 @@ ]]> 4 diff --git a/calendar/base/content/dialogs/calendar-alarm-dialog.js b/calendar/base/content/dialogs/calendar-alarm-dialog.js --- a/calendar/base/content/dialogs/calendar-alarm-dialog.js +++ b/calendar/base/content/dialogs/calendar-alarm-dialog.js @@ -1,19 +1,19 @@ /* 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/. */ /* exported onDismissAllAlarms, setupWindow, finishWindow, addWidgetFor, * removeWidgetFor, onSelectAlarm, ensureCalendarVisible */ -Components.utils.import("resource://gre/modules/PluralForm.jsm"); -Components.utils.import("resource://calendar/modules/calUtils.jsm"); -Components.utils.import("resource://gre/modules/Preferences.jsm"); +ChromeUtils.import("resource://gre/modules/PluralForm.jsm"); +ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); +ChromeUtils.import("resource://gre/modules/Preferences.jsm"); /** * Helper function to get the alarm service and cache it. * * @return The alarm service component */ function getAlarmService() { if (!("mAlarmService" in window)) { diff --git a/calendar/base/content/dialogs/calendar-conflicts-dialog.xul b/calendar/base/content/dialogs/calendar-conflicts-dialog.xul --- a/calendar/base/content/dialogs/calendar-conflicts-dialog.xul +++ b/calendar/base/content/dialogs/calendar-conflicts-dialog.xul @@ -10,17 +10,17 @@ windowtype="Calendar:Conflicts" onload="onLoad()" ondialogaccept="return onAccept();" ondialogcancel="return onCancel();" persist="screenX screenY" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">