# HG changeset patch # User Philipp Kewisch # Date 1519492129 -3600 # Sa Feb 24 18:08:49 2018 +0100 # Node ID 38580db43336d5df16f0141a4e9fcdefc25a9192 # Parent e0982a11f18380f679f8f775a908843f39a6598b Bug 1440980 - Load sub-modules via calUtils.jsm - calPrintUtils. r=MakeMyDay MozReview-Commit-ID: FKBOtJfRrVo diff --git a/calendar/base/modules/calPrintUtils.jsm b/calendar/base/modules/calPrintUtils.jsm --- a/calendar/base/modules/calPrintUtils.jsm +++ b/calendar/base/modules/calPrintUtils.jsm @@ -1,17 +1,20 @@ /* 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/. */ -ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); ChromeUtils.import("resource://gre/modules/Preferences.jsm"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); -this.EXPORTED_SYMBOLS = ["cal"]; // even though it's defined in calUtils.jsm, import needs this -cal.print = { +XPCOMUtils.defineLazyModuleGetter(this, "cal", "resource://calendar/modules/calUtils.jsm", "cal"); + +this.EXPORTED_SYMBOLS = ["calprint"]; /* exported calprint */ + +var calprint = { /** * Returns a simple key in the format YYYY-MM-DD for use in the table of * dates to day boxes * * @param dt The date to translate * @return YYYY-MM-DD */ getDateKey: function(date) { diff --git a/calendar/base/modules/calUtils.jsm b/calendar/base/modules/calUtils.jsm --- a/calendar/base/modules/calUtils.jsm +++ b/calendar/base/modules/calUtils.jsm @@ -363,16 +363,17 @@ XPCOMUtils.defineLazyModuleGetter(cal, " XPCOMUtils.defineLazyModuleGetter(cal, "auth", "resource://calendar/modules/calAuthUtils.jsm", "calauth"); XPCOMUtils.defineLazyModuleGetter(cal, "category", "resource://calendar/modules/calCategoryUtils.jsm", "calcategory"); XPCOMUtils.defineLazyModuleGetter(cal, "data", "resource://calendar/modules/calDataUtils.jsm", "caldata"); XPCOMUtils.defineLazyModuleGetter(cal, "dtz", "resource://calendar/modules/calDateTimeUtils.jsm", "caldtz"); XPCOMUtils.defineLazyModuleGetter(cal, "email", "resource://calendar/modules/calEmailUtils.jsm", "calemail"); XPCOMUtils.defineLazyModuleGetter(cal, "item", "resource://calendar/modules/calItemUtils.jsm", "calitem"); XPCOMUtils.defineLazyModuleGetter(cal, "itip", "resource://calendar/modules/calItipUtils.jsm", "calitip"); XPCOMUtils.defineLazyModuleGetter(cal, "l10n", "resource://calendar/modules/calL10NUtils.jsm", "call10n"); +XPCOMUtils.defineLazyModuleGetter(cal, "print", "resource://calendar/modules/calPrintUtils.jsm", "calprint"); XPCOMUtils.defineLazyModuleGetter(cal, "provider", "resource://calendar/modules/calProviderUtils.jsm", "calprovider"); XPCOMUtils.defineLazyModuleGetter(cal, "unifinder", "resource://calendar/modules/calUnifinderUtils.jsm", "calunifinder"); XPCOMUtils.defineLazyModuleGetter(cal, "view", "resource://calendar/modules/calViewUtils.jsm", "calview"); XPCOMUtils.defineLazyModuleGetter(cal, "window", "resource://calendar/modules/calWindowUtils.jsm", "calwindow"); /** * Returns a function that provides access to the given service. * diff --git a/calendar/import-export/calMonthGridPrinter.js b/calendar/import-export/calMonthGridPrinter.js --- a/calendar/import-export/calMonthGridPrinter.js +++ b/calendar/import-export/calMonthGridPrinter.js @@ -1,17 +1,16 @@ /* 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/. */ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); ChromeUtils.import("resource://calendar/modules/calXMLUtils.jsm"); -ChromeUtils.import("resource://calendar/modules/calPrintUtils.jsm"); ChromeUtils.import("resource://gre/modules/Preferences.jsm"); /** * Prints a rough month-grid of events/tasks */ function calMonthPrinter() { this.wrappedJSObject = this; } diff --git a/calendar/import-export/calWeekPrinter.js b/calendar/import-export/calWeekPrinter.js --- a/calendar/import-export/calWeekPrinter.js +++ b/calendar/import-export/calWeekPrinter.js @@ -2,17 +2,16 @@ * 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/. */ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); ChromeUtils.import("resource://gre/modules/Preferences.jsm"); ChromeUtils.import("resource://calendar/modules/calUtils.jsm"); ChromeUtils.import("resource://calendar/modules/calXMLUtils.jsm"); -ChromeUtils.import("resource://calendar/modules/calPrintUtils.jsm"); /** * Prints a two column view of a week of events, much like a paper day-planner */ function calWeekPrinter() { this.wrappedJSObject = this; }