Bug 1557624 - correct usage of the global cal import. r=pmorris
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Fri, 07 Jun 2019 21:52:10 +0300
changeset 35804 e5ed77a2a024206e348ebc9ea509d95cee64382b
parent 35803 d00844c4eba4bd98a20376942673520047193337
child 35805 6e3ad4974173c6c96e493bbaf746750162fcc3e4
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewerspmorris
bugs1557624
Bug 1557624 - correct usage of the global cal import. r=pmorris
calendar/base/content/agenda-listbox.js
calendar/base/content/calendar-day-label.js
calendar/base/content/calendar-item-bindings.js
calendar/base/content/calendar-month-base-view.js
calendar/base/content/calendar-multiday-base-view.js
calendar/base/content/calendar-views.js
calendar/base/content/widgets/calendar-alarm-widget.js
calendar/providers/gdata/content/gdata-list-tree.js
calendar/resources/content/datetimepickers/datetimepickers.js
--- a/calendar/base/content/agenda-listbox.js
+++ b/calendar/base/content/agenda-listbox.js
@@ -1,17 +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/. */
 
 "use strict";
 
-/* global MozXULElement, MozElements, unitPluralForm, cal, agendaListbox,
+/* global MozXULElement, MozElements, unitPluralForm, agendaListbox,
    invokeEventDragSession, setBooleanAttribute, hideElement, onMouseOverItem */
 {
+    var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
     /**
      * The MozAgendaHeaderRichlistItem widget is typically used to display the
      * Today, Tomorrow, and Upcoming headers of the Today Pane listing.
      *
      * @extends {MozElements.MozRichlistitem}
      */
     class MozAgendaHeaderRichlistItem extends MozElements.MozRichlistitem {
         static get inheritedAttributes() {
--- a/calendar/base/content/calendar-day-label.js
+++ b/calendar/base/content/calendar-day-label.js
@@ -1,13 +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/. */
 
-/* global MozXULElement, setBooleanAttribute, getSummarizedStyleValues, cal */
+/* global MozXULElement, setBooleanAttribute, getSummarizedStyleValues */
+
+var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 class MozCalendarDayLabel extends MozXULElement {
     static get observedAttributes() {
         return ["selected", "relation"];
     }
 
     connectedCallback() {
         if (this.delayConnectedCallback()) {
--- a/calendar/base/content/calendar-item-bindings.js
+++ b/calendar/base/content/calendar-item-bindings.js
@@ -1,15 +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/. */
 
 "use strict";
 
-/* global MozXULElement, cal */
+/* global MozXULElement */
+
+var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 /**
  * Date info that is displayed on task details and event details.
  *
  * @extends MozXULElement
  */
 class MozCalendarItemDate extends MozXULElement {
     static get inheritedAttributes() {
--- a/calendar/base/content/calendar-month-base-view.js
+++ b/calendar/base/content/calendar-month-base-view.js
@@ -1,16 +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/. */
 
-/* globals cal CalendarBaseView MozElements MozXULElement Services timeIndicator */
+/* global CalendarBaseView, MozElements, MozXULElement, Services, timeIndicator */
 
 "use strict";
 
+var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
+
 // Wrap in a block to prevent leaking to window scope.
 {
     /**
      * Abstract base class that is used for the month and multiweek calendar view custom elements.
      *
      * @implements {calICalendarView}
      * @extends {MozElements.CalendarBaseView}
      * @abstract
--- a/calendar/base/content/calendar-multiday-base-view.js
+++ b/calendar/base/content/calendar-multiday-base-view.js
@@ -1,19 +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/. */
 
-/* globals cal CalendarBaseView currentView getOtherOrientation MozElements MozXULElement Services
-   setAttributeToChildren setBooleanAttribute timeIndicator */
+/* global CalendarBaseView, currentView, getOtherOrientation, MozElements, MozXULElement, Services,
+   setAttributeToChildren, setBooleanAttribute, timeIndicator */
 
 "use strict";
 
 // Wrap in a block to prevent leaking to window scope.
 {
+    var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
     /**
      * The time bar that displays time divisions to the side or top of a multiday (day or week) view.
      */
     class CalendarTimeBar extends MozXULElement {
         static get inheritedAttributes() {
             return {
                 ".timebarboxstack": "orient,width,height",
                 ".topbox": "orient,width,height",
--- a/calendar/base/content/calendar-views.js
+++ b/calendar/base/content/calendar-views.js
@@ -1,27 +1,27 @@
 /* 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/. */
 
-/* globals cal MozElements MozXULElement Services timeIndicator */
+/* global MozElements, MozXULElement, Services, timeIndicator */
 
 "use strict";
 
 //                           The calendar view class hierarchy.
 //
 //                                     CalendarBaseView
 //                                     /               \
 //             CalendarMultidayBaseView                CalendarMonthBaseView
 //                 /           \                           /               \
 //     CalendarDayView     CalendarWeekView    CalendarMultiweekView    CalendarMonthView
 
-
 // Wrap in a block to prevent leaking to window scope.
 {
+    var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
     /**
      * The calendar view for viewing a single day.
      *
      * @extends {MozElements.CalendarMultidayBaseView}
      */
     class CalendarDayView extends MozElements.CalendarMultidayBaseView {
         connectedCallback() {
             if (this.delayConnectedCallback() || this.hasConnected) {
--- a/calendar/base/content/widgets/calendar-alarm-widget.js
+++ b/calendar/base/content/widgets/calendar-alarm-widget.js
@@ -1,18 +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/. */
 
 "use strict";
 
-/* global cal Cr MozElements MozXULElement PluralForm Services */
+/* global Cr MozElements MozXULElement PluralForm Services */
 
 // Wrap in a block to prevent leaking to window scope.
 {
+    var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
     /**
      * Represents an alarm in the alarms dialog. It appears there when an alarm is fired, and
      * allows the alarm to be snoozed, dismissed, etc.
      * @extends MozElements.MozRichlistitem
      */
     class MozCalendarAlarmWidget extends MozElements.MozRichlistitem {
         connectedCallback() {
             if (this.delayConnectedCallback() || this.hasConnected) {
--- a/calendar/providers/gdata/content/gdata-list-tree.js
+++ b/calendar/providers/gdata/content/gdata-list-tree.js
@@ -1,18 +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/. */
 
 "use strict";
 
-/* globals cal Services customElements MozXULElement */
+/* global Services, customElements, MozXULElement */
 
 // Wrap in a block to prevent leaking to window scope.
 {
+    var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
     /**
      * The calendar list used when adding a new calendar from a Google account. It appears in the
      * new calendar dialog. The list of calendars is subdivided into "Calendars" and "Task Lists".
      * This is done by including "mock" calendar rows that are just header rows for the sections.
      */
     class CalendarListTreeGdata extends customElements.get("calendar-list-tree") {
         connectedCallback() {
             if (this.delayConnectedCallback() || this.hasConnected) {
--- a/calendar/resources/content/datetimepickers/datetimepickers.js
+++ b/calendar/resources/content/datetimepickers/datetimepickers.js
@@ -1,17 +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/. */
 
-/* globals MozElements, MozXULElement, cal */
-
-var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+/* global MozElements, MozXULElement */
 
 {
+    var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+    var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
+
     let probeSucceeded;
     let alphaMonths;
     let yearIndex, monthIndex, dayIndex;
     let ampmIndex, amRegExp, pmRegExp;
     let parseTimeRegExp, parseShortDateRegex;
 
     class MozTimepickerMinute extends MozXULElement {
         static get observedAttributes() {