Bug 1570872 - Remove backwards-compatibility shims from calendar. r=pmorris DONTBUILD
This commit is contained in:
Родитель
e719b36efa
Коммит
2d079399f2
|
@ -89,7 +89,7 @@
|
|||
oncommand="PrintUtils.showPageSetup()"/>
|
||||
<command id="cmd_print"
|
||||
disabled="true"
|
||||
oncommand="cal.calPrint(window)"/>
|
||||
oncommand="cal.window.openPrintDialog(window)"/>
|
||||
|
||||
<!-- Edit menu -->
|
||||
<command id="cmd_undo"
|
||||
|
|
|
@ -517,7 +517,3 @@ function makeQI(aInterfaces) {
|
|||
throw Cr.NS_ERROR_NO_INTERFACE;
|
||||
};
|
||||
}
|
||||
|
||||
// Backwards compatibility for bug 905097. Please remove with Thunderbird 61.
|
||||
var { injectCalUtilsCompat } = ChromeUtils.import("resource://calendar/modules/calUtilsCompat.jsm");
|
||||
injectCalUtilsCompat(cal);
|
||||
|
|
|
@ -1,222 +0,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/. */
|
||||
|
||||
/*
|
||||
* Backwards compat for calUtils migration.
|
||||
*/
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
|
||||
/* exported injectCalUtilsCompat */
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["injectCalUtilsCompat"];
|
||||
|
||||
/**
|
||||
* Migration data for backwards compatibility, will be used with
|
||||
* injectCalUtilsCompat.
|
||||
*/
|
||||
var migrations = {
|
||||
acl: {
|
||||
isCalendarWritable: "isCalendarWritable",
|
||||
userCanAddItemsToCalendar: "userCanAddItemsToCalendar",
|
||||
userCanDeleteItemsFromCalendar: "userCanDeleteItemsFromCalendar",
|
||||
userCanModifyItem: "userCanModifyItem"
|
||||
},
|
||||
category: {
|
||||
setupDefaultCategories: "setupDefaultCategories",
|
||||
getPrefCategoriesArray: "fromPrefs",
|
||||
categoriesStringToArray: "stringToArray",
|
||||
categoriesArrayToString: "arrayToString"
|
||||
},
|
||||
data: {
|
||||
binarySearch: "binarySearch",
|
||||
binaryInsertNode: "binaryInsertNode",
|
||||
binaryInsert: "binaryInsert",
|
||||
compareObjects: "compareObjects",
|
||||
// isPropertyValueSame has been removed, it can simply be done with Array every()
|
||||
},
|
||||
dtz: {
|
||||
now: "now",
|
||||
ensureDateTime: "ensureDateTime",
|
||||
getRecentTimezones: "getRecentTimezones",
|
||||
saveRecentTimezone: "saveRecentTimezone",
|
||||
getDefaultStartDate: "getDefaultStartDate",
|
||||
setDefaultStartEndHour: "setDefaultStartEndHour",
|
||||
calGetStartDateProp: "startDateProp",
|
||||
calGetEndDateProp: "endDateProp",
|
||||
sameDay: "sameDay",
|
||||
jsDateToDateTime: "jsDateToDateTime",
|
||||
dateTimeToJsDate: "dateTimeToJsDate",
|
||||
fromRFC3339: "fromRFC3339",
|
||||
toRFC3339: "toRFC3339",
|
||||
|
||||
// The following are now getters
|
||||
calendarDefaultTimezone: "defaultTimezone",
|
||||
floating: "floating",
|
||||
UTC: "UTC"
|
||||
},
|
||||
email: {
|
||||
sendMailTo: "sendMailTo",
|
||||
calIterateEmailIdentities: "iterateIdentities",
|
||||
prependMailTo: "prependMailTo",
|
||||
removeMailTo: "removeMailTo",
|
||||
getRecipientList: "createRecipientList",
|
||||
getAttendeeEmail: "getAttendeeEmail",
|
||||
validateRecipientList: "validateRecipientList",
|
||||
attendeeMatchesAddresses: "attendeeMatchesAddresses"
|
||||
},
|
||||
item: {
|
||||
// ItemDiff also belongs here, but is separately migrated in
|
||||
// calItemUtils.jsm
|
||||
isItemSupported: "isItemSupported",
|
||||
isEventCalendar: "isEventCalendar",
|
||||
isTaskCalendar: "isTaskCalendar",
|
||||
isEvent: "isEvent",
|
||||
isToDo: "isToDo",
|
||||
checkIfInRange: "checkIfInRange",
|
||||
setItemProperty: "setItemProperty",
|
||||
getEventDefaultTransparency: "getEventDefaultTransparency"
|
||||
},
|
||||
iterate: {
|
||||
itemIterator: "items",
|
||||
forEach: "forEach",
|
||||
ical: {
|
||||
calendarComponentIterator: "items",
|
||||
subcomponentIterator: "icalSubcomponent",
|
||||
propertyIterator: "icalProperty",
|
||||
paramIterator: "icalParameter"
|
||||
}
|
||||
},
|
||||
itip: {
|
||||
getPublishLikeItemCopy: "getPublishLikeItemCopy",
|
||||
isInvitation: "isInvitation",
|
||||
isOpenInvitation: "isOpenInvitation",
|
||||
resolveDelegation: "resolveDelegation",
|
||||
getInvitedAttendee: "getInvitedAttendee",
|
||||
getAttendeesBySender: "getAttendeesBySender"
|
||||
},
|
||||
provider: {
|
||||
prepHttpChannel: "prepHttpChannel",
|
||||
sendHttpRequest: "sendHttpRequest",
|
||||
createStreamLoader: "createStreamLoader",
|
||||
convertByteArray: "convertByteArray",
|
||||
InterfaceRequestor_getInterface: "InterfaceRequestor_getInterface",
|
||||
getImipTransport: "getImipTransport",
|
||||
getEmailIdentityOfCalendar: "getEmailIdentityOfCalendar",
|
||||
promptOverwrite: "promptOverwrite",
|
||||
getCalendarDirectory: "getCalendarDirectory"
|
||||
},
|
||||
unifinder: {
|
||||
sortEntryComparer: "sortEntryComparer",
|
||||
getItemSortKey: "getItemSortKey",
|
||||
// compareNative*, compareNumber, sortEntry, sortEntryItem, sortEntryKey and
|
||||
// getSortTypeForSortKey are no longer available. There is a new
|
||||
// cal.unifinder.sortItems though that should do everything necessary.
|
||||
},
|
||||
view: {
|
||||
isMouseOverBox: "isMouseOverBox",
|
||||
// calRadioGroupSelectItem and applyAttributeToMenuChildren are no longer available.
|
||||
removeChildElementsByAttribute: "removeChildElementsByAttribute",
|
||||
getParentNodeOrThis: "getParentNodeOrThis",
|
||||
getParentNodeOrThisByAttribute: "getParentNodeOrThisByAttribute",
|
||||
formatStringForCSSRule: "formatStringForCSSRule",
|
||||
getCompositeCalendar: "getCompositeCalendar",
|
||||
hashColor: "hashColor",
|
||||
getContrastingTextColor: "getContrastingTextColor"
|
||||
},
|
||||
window: {
|
||||
openCalendarWizard: "openCalendarWizard",
|
||||
openCalendarProperties: "openCalendarProperties",
|
||||
calPrint: "openPrintDialog",
|
||||
getCalendarWindow: "getCalendarWindow"
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Generate a forward function on the given global, for the namespace from the
|
||||
* migrations data.
|
||||
*
|
||||
* @param global The global object to inject on.
|
||||
* @param namespace The new namespace in the cal object.
|
||||
* @param from The function/property name being migrated from
|
||||
* @param to The function/property name being migrated to
|
||||
*/
|
||||
function generateForward(global, namespace, from, to, targetGlobal=null) {
|
||||
// Protect from footguns
|
||||
if (typeof global[from] != "undefined") {
|
||||
throw new Error(from + " is already defined on the cal. namespace!");
|
||||
}
|
||||
|
||||
global[from] = function(...args) {
|
||||
let suffix = "";
|
||||
let target = (targetGlobal || global)[namespace][to];
|
||||
if (typeof target == "function") {
|
||||
target = target(...args);
|
||||
suffix = "()";
|
||||
}
|
||||
|
||||
Deprecated.warning(`calUtils' cal.${from}() has changed to cal.${namespace}.${to}${suffix}`,
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
||||
|
||||
return target;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Inject the backwards compatibility functions using above migration data
|
||||
*
|
||||
* @param global The global object to inject on.
|
||||
*/
|
||||
function injectCalUtilsCompat(global) {
|
||||
for (let [namespace, nsdata] of Object.entries(migrations)) {
|
||||
for (let [from, to] of Object.entries(nsdata)) {
|
||||
if (typeof to == "object") {
|
||||
global[from] = {};
|
||||
for (let [frominner, toinner] of Object.entries(to)) {
|
||||
generateForward(global[from], namespace, frominner, toinner, global);
|
||||
}
|
||||
} else {
|
||||
generateForward(global, namespace, from, to);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// calGetString is special, as the argument order and kind has changed as well
|
||||
global.calGetString = function(aBundleName, aStringName, aParams, aComponent="calendar") {
|
||||
Deprecated.warning("calUtils' cal.calGetString() has changed to cal.l10n.get*String()" +
|
||||
" and the parameter order has changed",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
||||
return global.l10n.getAnyString(aComponent, aBundleName, aStringName, aParams);
|
||||
};
|
||||
|
||||
global.ProviderBase = class extends global.provider.BaseClass {
|
||||
initProviderBase() {
|
||||
Deprecated.warning("calProviderUtils' cal.ProviderBase() has changed to cal.provider.BaseClass()",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
||||
super.initProviderBase();
|
||||
}
|
||||
};
|
||||
|
||||
global.BadCertHandler = class extends global.provider.BadCertHandler {
|
||||
constructor() {
|
||||
Deprecated.warning("calProviderUtils' cal.BadCertHandler() has changed to cal.provider.BadCertHandler()",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
||||
super();
|
||||
}
|
||||
};
|
||||
|
||||
global.FreeBusyInterval = class extends global.provider.FreeBusyInterval {
|
||||
constructor() {
|
||||
Deprecated.warning("calProviderUtils' cal.FreeBusyInterval() has changed to cal.provider.FreeBusyInterval()",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
||||
super();
|
||||
}
|
||||
};
|
||||
}
|
|
@ -24,24 +24,10 @@ EXTRA_JS_MODULES.utils += [
|
|||
'utils/calXMLUtils.jsm',
|
||||
]
|
||||
|
||||
EXTRA_JS_MODULES += [
|
||||
'shim/calAlarmUtils.jsm',
|
||||
'shim/calAsyncUtils.jsm',
|
||||
'shim/calAuthUtils.jsm',
|
||||
'shim/calItemUtils.jsm',
|
||||
'shim/calIteratorUtils.jsm',
|
||||
'shim/calItipUtils.jsm',
|
||||
'shim/calPrintUtils.jsm',
|
||||
'shim/calProviderUtils.jsm',
|
||||
'shim/calViewUtils.jsm',
|
||||
'shim/calXMLUtils.jsm',
|
||||
]
|
||||
|
||||
EXTRA_JS_MODULES += [
|
||||
'calExtract.jsm',
|
||||
'calHashedArray.jsm',
|
||||
'calRecurrenceUtils.jsm',
|
||||
'calUtils.jsm',
|
||||
'calUtilsCompat.jsm',
|
||||
'ical.js',
|
||||
]
|
||||
|
|
|
@ -1,13 +0,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/. */
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["cal"];
|
||||
|
||||
Deprecated.warning("calAlarmUtils.jsm must no longer be imported directly, it" +
|
||||
" is already available via calUtils.jsm",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
|
@ -1,13 +0,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/. */
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["cal"];
|
||||
|
||||
Deprecated.warning("calAsyncUtils.jsm must no longer be imported directly, it" +
|
||||
" is already available via calUtils.jsm",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
|
@ -1,13 +0,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/. */
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["cal"];
|
||||
|
||||
Deprecated.warning("calAuthUtils.jsm must no longer be imported directly, it" +
|
||||
" is already available via calUtils.jsm",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
|
@ -1,13 +0,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/. */
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["cal"];
|
||||
|
||||
Deprecated.warning("calItemUtils.jsm must no longer be imported directly, it" +
|
||||
" is already available via calUtils.jsm",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
|
@ -1,13 +0,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/. */
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["cal"];
|
||||
|
||||
Deprecated.warning("calIteratorUtils.jsm must no longer be imported directly, it" +
|
||||
" is already available via calUtils.jsm",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
|
@ -1,13 +0,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/. */
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["cal"];
|
||||
|
||||
Deprecated.warning("calItipUtils.jsm must no longer be imported directly, it" +
|
||||
" is already available via calUtils.jsm",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
|
@ -1,13 +0,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/. */
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["cal"];
|
||||
|
||||
Deprecated.warning("calPrintUtils.jsm must no longer be imported directly, it" +
|
||||
" is already available via calUtils.jsm",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
|
@ -1,13 +0,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/. */
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["cal"];
|
||||
|
||||
Deprecated.warning("calProviderUtils.jsm must no longer be imported directly, it" +
|
||||
" is already available via calUtils.jsm",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
|
@ -1,13 +0,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/. */
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["cal"];
|
||||
|
||||
Deprecated.warning("calViewUtils.jsm must no longer be imported directly, it" +
|
||||
" is already available via calUtils.jsm",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
|
@ -1,13 +0,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/. */
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["cal"];
|
||||
|
||||
Deprecated.warning("calXMLUtils.jsm must no longer be imported directly, it" +
|
||||
" is already available via calUtils.jsm",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
|
@ -2,7 +2,6 @@
|
|||
* 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/. */
|
||||
|
||||
var { Deprecated } = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
|
||||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calHashedArray.jsm");
|
||||
|
@ -14,7 +13,7 @@ var { cal } = ChromeUtils.import("resource://calendar/modules/calHashedArray.jsm
|
|||
// NOTE: This module should not be loaded directly, it is available when
|
||||
// including calUtils.jsm under the cal.item namespace.
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["calitem", "itemDiff"]; /* exported calitem, itemDiff */
|
||||
this.EXPORTED_SYMBOLS = ["calitem"];
|
||||
|
||||
var calitem = {
|
||||
ItemDiff: (function() {
|
||||
|
@ -665,13 +664,3 @@ var calitem = {
|
|||
return "future";
|
||||
}
|
||||
};
|
||||
|
||||
// Backwards compatibility for bug 905097. Please remove with Thunderbird 61.
|
||||
class itemDiff extends calitem.ItemDiff {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
Deprecated.warning("calItemUtils' itemDiff has changed to calUtils' cal.item.ItemDiff",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=905097",
|
||||
Components.stack.caller);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ var { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm")
|
|||
var { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "cal", "resource://calendar/modules/calUtils.jsm", "cal");
|
||||
ChromeUtils.defineModuleGetter(this, "Deprecated", "resource://gre/modules/Deprecated.jsm");
|
||||
|
||||
/*
|
||||
* Helpers and base class for calendar providers
|
||||
|
@ -114,30 +113,6 @@ var calprovider = {
|
|||
return Cc["@mozilla.org/network/stream-loader;1"].createInstance(Ci.nsIStreamLoader);
|
||||
},
|
||||
|
||||
/**
|
||||
* Convert a byte array to a string
|
||||
*
|
||||
* @param {octet[]} aResult The bytes to convert
|
||||
* @param {Number} aResultLength The number of bytes
|
||||
* @param {String} aCharset The character set of the bytes, defaults to utf-8
|
||||
* @param {Boolean} aThrow If true, the function will raise an exception on error
|
||||
* @return {?String} The string result, or null on error
|
||||
*/
|
||||
convertByteArray: function(aResult, aResultLength, aCharset="utf-8", aThrow) {
|
||||
Deprecated.warning(
|
||||
"The cal.provider.convertByteArray() function has been superseded by the use of TextDecoder.",
|
||||
"https://bugzilla.mozilla.org/show_bug.cgi?id=1469499"
|
||||
);
|
||||
try {
|
||||
return new TextDecoder(aCharset).decode(Uint8Array.from(aResult));
|
||||
} catch (e) {
|
||||
if (aThrow) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* getInterface method for providers. This should be called in the context of
|
||||
* the respective provider, i.e
|
||||
|
|
|
@ -11,7 +11,7 @@ if (!("Cc" in this)) {
|
|||
const { classes: Cc, interfaces: Ci, results: Cr } = Components;
|
||||
}
|
||||
|
||||
var { cal } = ChromeUtils.import("resource://gdata-provider/modules/calUtilsShim.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
var { stringException } = ChromeUtils.import("resource://gdata-provider/modules/gdataLogging.jsm");
|
||||
var {
|
||||
calGoogleRequest,
|
||||
|
|
|
@ -8,7 +8,7 @@ if (!("Cc" in this)) {
|
|||
const { interfaces: Ci } = Components;
|
||||
}
|
||||
|
||||
var { cal } = ChromeUtils.import("resource://gdata-provider/modules/calUtilsShim.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
/* exported cancelRequest, loadRequestedUrl, reportUserClosed */
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ if (!("Cc" in this)) {
|
|||
}
|
||||
|
||||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://gdata-provider/modules/calUtilsShim.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
var { getGoogleSessionManager } = ChromeUtils.import("resource://gdata-provider/modules/gdataSession.jsm");
|
||||
var { monkeyPatch } = ChromeUtils.import("resource://gdata-provider/modules/gdataUtils.jsm");
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
(function() {
|
||||
const FOUR_WEEKS_BEFORE = -2419200;
|
||||
const { cal } = ChromeUtils.import("resource://gdata-provider/modules/calUtilsShim.jsm");
|
||||
const { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
const {
|
||||
monkeyPatch,
|
||||
getProviderString,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
var { monkeyPatch } = ChromeUtils.import("resource://gdata-provider/modules/gdataUtils.jsm");
|
||||
|
||||
var { cal } = ChromeUtils.import("resource://gdata-provider/modules/calUtilsShim.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
(function() {
|
||||
monkeyPatch(window, "updateCalendar", function(protofunc, ...args) {
|
||||
|
|
|
@ -17,7 +17,7 @@ var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
|
||||
var { httpRequest } = ChromeUtils.import("resource://gre/modules/Http.jsm");
|
||||
|
||||
var { cal } = ChromeUtils.import("resource://gdata-provider/modules/calUtilsShim.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
function parseURLData(aData) {
|
||||
let result = {};
|
||||
|
|
|
@ -1,126 +0,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/. */
|
||||
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
var { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
// calAsyncUtils and calAlarmUtils should no longer be injected directly, so first check if it is
|
||||
// already on the cal object through newer calUtils.jsm
|
||||
if (typeof cal.async == "undefined") {
|
||||
let { cal: temp } = ChromeUtils.import("resource://calendar/modules/calAsyncUtils.jsm");
|
||||
cal.async = temp.async;
|
||||
}
|
||||
if (typeof cal.alarms == "undefined") {
|
||||
let { cal: temp } = ChromeUtils.import("resource://calendar/modules/calAlarmUtils.jsm");
|
||||
cal.alarms = temp.alarms;
|
||||
}
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["cal"];
|
||||
|
||||
if (!cal.dtz) {
|
||||
cal.dtz = {
|
||||
get defaultTimezone() { return cal.calendarDefaultTimezone(); },
|
||||
get floating() { return cal.floating(); },
|
||||
get UTC() { return cal.UTC(); },
|
||||
|
||||
now: (...args) => cal.now(...args),
|
||||
ensureDateTime: (...args) => cal.ensureDateTime(...args),
|
||||
getRecentTimezones: (...args) => cal.getRecentTimezones(...args),
|
||||
saveRecentTimezone: (...args) => cal.saveRecentTimezone(...args),
|
||||
getDefaultStartDate: (...args) => cal.getDefaultStartDate(...args),
|
||||
setDefaultStartEndHour: (...args) => cal.setDefaultStartEndHour(...args),
|
||||
startDateProp: (...args) => cal.calGetStartDateProp(...args),
|
||||
endDateProp: (...args) => cal.calGetEndDateProp(...args),
|
||||
sameDay: (...args) => cal.sameDay(...args),
|
||||
jsDateToDateTime: (...args) => cal.jsDateToDateTime(...args),
|
||||
dateTimeToJsDate: (...args) => cal.dateTimeToJsDate(...args),
|
||||
fromRFC3339: (...args) => cal.fromRFC3339(...args),
|
||||
toRFC3339: (...args) => cal.toRFC3339(...args)
|
||||
};
|
||||
}
|
||||
|
||||
if (!cal.item) {
|
||||
cal.item = {
|
||||
ItemDiff: cal.itemDiff,
|
||||
isItemSupported: (...args) => cal.isItemSupported(...args),
|
||||
isEventCalendar: (...args) => cal.isEventCalendar(...args),
|
||||
isTaskCalendar: (...args) => cal.isTaskCalendar(...args),
|
||||
isEvent: (...args) => cal.isEvent(...args),
|
||||
isToDo: (...args) => cal.isToDo(...args),
|
||||
checkIfInRange: (...args) => cal.checkIfInRange(...args),
|
||||
setItemProperty: (...args) => cal.setItemProperty(...args),
|
||||
getEventDefaultTransparency: (...args) => cal.getEventDefaultTransparency(...args),
|
||||
compareContent: (...args) => cal.compareItemContent(...args),
|
||||
shiftOffset: (...args) => cal.shiftItem(...args),
|
||||
moveToDate: (...args) => cal.moveItem(...args),
|
||||
serialize: (...args) => cal.getSerializedItem(...args),
|
||||
get productId() { return cal.calGetProductId(); },
|
||||
get productVersion() { return cal.calGetProductVersion(); },
|
||||
setStaticProps: (...args) => cal.calSetProdidVersion(...args),
|
||||
findWindow: (...args) => cal.findItemWindow(...args),
|
||||
setToAllDay: (...args) => cal.setItemToAllDay(...args)
|
||||
};
|
||||
}
|
||||
|
||||
if (!cal.view || !cal.view.hashColor) {
|
||||
cal.view = Object.assign(cal.view || {}, {
|
||||
isMouseOverBox: (...args) => cal.isMouseOverBox(...args),
|
||||
removeChildElementsByAttribute: (...args) => cal.removeChildElementsByAttribute(...args),
|
||||
getParentNodeOrThis: (...args) => cal.getParentNodeOrThis(...args),
|
||||
getParentNodeOrThisByAttribute: (...args) => cal.getParentNodeOrThisByAttribute(...args),
|
||||
formatStringForCSSRule: (...args) => cal.formatStringForCSSRule(...args),
|
||||
getCompositeCalendar: (...args) => cal.getCompositeCalendar(...args),
|
||||
hashColor: (...args) => cal.hashColor(...args),
|
||||
getContrastingTextColor: (...args) => cal.getContrastingTextColor(...args),
|
||||
/* cal.view.compareItems stays the same, just a different import */
|
||||
});
|
||||
}
|
||||
|
||||
if (typeof cal.window == "undefined") {
|
||||
cal.window = {
|
||||
getCalendarWindow: function() {
|
||||
return cal.getCalendarWindow();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof cal.category == "undefined") {
|
||||
cal.category = {
|
||||
stringToArray: function(aStr) { return cal.categoriesStringToArray(aStr); },
|
||||
arrayToString: function(aArr) { return cal.categoriesArrayToString(aArr); }
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof cal.itip == "undefined") {
|
||||
let { cal: temp } = ChromeUtils.import("resource://calendar/modules/calItipUtils.jsm");
|
||||
cal.itip = temp.itip;
|
||||
}
|
||||
|
||||
if (typeof cal.itip.isInvitation == "undefined") {
|
||||
cal.itip.isInvitation = function(aItem) { return cal.isInvitation(aItem); };
|
||||
}
|
||||
|
||||
if (typeof cal.l10n == "undefined") {
|
||||
cal.l10n = {
|
||||
getAnyString: function(aComponent, aBundle, aString, aParams) {
|
||||
return cal.calGetString(aBundle, aString, aParams, aComponent);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof cal.provider == "undefined") {
|
||||
cal.provider = {
|
||||
BaseClass: cal.ProviderBase,
|
||||
prepHttpChannel: (...args) => cal.prepHttpChannel(...args),
|
||||
sendHttpRequest: (...args) => cal.sendHttpRequest(...args),
|
||||
createStreamLoader: (...args) => cal.createStreamLoader(...args),
|
||||
InterfaceRequestor_getInterface: (...args) => cal.InterfaceRequestor_getInterface(...args),
|
||||
convertByteArray: (...args) => cal.convertByteArray(...args),
|
||||
promptOverwrite: (...args) => cal.promptOverwrite(...args)
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof cal.generateQI == "undefined") {
|
||||
cal.generateQI = XPCOMUtils.generateQI.bind(XPCOMUtils);
|
||||
}
|
|
@ -11,7 +11,7 @@ if (!("Cc" in this)) {
|
|||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var { PromiseUtils } = ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm");
|
||||
|
||||
var { cal } = ChromeUtils.import("resource://gdata-provider/modules/calUtilsShim.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
var API_BASE = {
|
||||
EVENTS: "https://www.googleapis.com/calendar/v3/",
|
||||
|
|
|
@ -24,7 +24,7 @@ var { setTimeout } = ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
|||
|
||||
var { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
|
||||
|
||||
var { cal } = ChromeUtils.import("resource://gdata-provider/modules/calUtilsShim.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
var cIFBI = Ci.calIFreeBusyInterval;
|
||||
var nIPM = Ci.nsIPermissionManager;
|
||||
|
|
|
@ -19,7 +19,7 @@ var { windowsTimezoneMap } = ChromeUtils.import("resource://gdata-provider/modul
|
|||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var { PromiseUtils } = ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm");
|
||||
|
||||
var { cal } = ChromeUtils.import("resource://gdata-provider/modules/calUtilsShim.jsm");
|
||||
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
|
||||
|
||||
var FOUR_WEEKS_IN_MINUTES = 40320;
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ DIRS += [
|
|||
]
|
||||
|
||||
EXTRA_JS_MODULES += [
|
||||
'modules/calUtilsShim.jsm',
|
||||
'modules/gdataLogging.jsm',
|
||||
'modules/gdataRequest.jsm',
|
||||
'modules/gdataSession.jsm',
|
||||
|
|
|
@ -113,11 +113,11 @@ function testEventDialog() {
|
|||
event.assertValue(iframeId("item-calendar"), CALENDARNAME);
|
||||
|
||||
// Check standard title.
|
||||
let defTitle = cal.calGetString("calendar", "newEvent");
|
||||
let defTitle = cal.l10n.getAnyString("calendar", "calendar", "newEvent");
|
||||
event.assertValue(eventid("item-title"), defTitle);
|
||||
|
||||
// Prepare category.
|
||||
let categories = cal.calGetString("categories", "categories2");
|
||||
let categories = cal.l10n.getAnyString("calendar", "categories", "categories2");
|
||||
// Pick 4th value in a comma-separated list.
|
||||
let category = categories.split(",")[4];
|
||||
// Calculate date to repeat until.
|
||||
|
|
|
@ -66,7 +66,7 @@ function testEventDialogModificationPrompt() {
|
|||
invokeEventDialog(controller, createbox, (event, iframe) => {
|
||||
let { eid: eventid } = helpersForController(event);
|
||||
|
||||
let categories = cal.calGetString("categories", "categories2").split(",");
|
||||
let categories = cal.l10n.getAnyString("calendar", "categories", "categories2").split(",");
|
||||
data[0].categories.push(categories[0]);
|
||||
data[1].categories.push(categories[1], categories[2]);
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ function helpersForEditUI(controller) {
|
|||
return sel.trim().replace(/\n(\s*)/g, "");
|
||||
}
|
||||
|
||||
let isEvent = cal.isEvent(controller.window.calendarItem);
|
||||
let isEvent = cal.item.isEvent(controller.window.calendarItem);
|
||||
|
||||
let obj = {
|
||||
iframeLookup: (path) => {
|
||||
|
@ -210,7 +210,7 @@ function setData(dialog, iframe, data) {
|
|||
let { eid: iframeid } = helpersForController(iframe);
|
||||
let { iframeLookup, getDateTimePicker } = helpersForEditUI(iframe);
|
||||
|
||||
let isEvent = cal.isEvent(iframe.window.calendarItem);
|
||||
let isEvent = cal.item.isEvent(iframe.window.calendarItem);
|
||||
|
||||
let startdateInput = getDateTimePicker("STARTDATE");
|
||||
let enddateInput = getDateTimePicker("ENDDATE");
|
||||
|
|
Загрузка…
Ссылка в новой задаче