Bug 1866180 - ESMify UIFontSize module. r=vineet

Differential Revision: https://phabricator.services.mozilla.com/D194450

--HG--
rename : mail/modules/UIFontSize.jsm => mail/modules/UIFontSize.sys.mjs
extra : amend_source : 9fcb77851318f31f23efc8b7de40fb99f1833fd3
This commit is contained in:
Alessandro Castellani 2023-11-23 20:06:01 +02:00
Родитель 446757451c
Коммит c4cfb59919
16 изменённых файлов: 33 добавлений и 26 удалений

Просмотреть файл

@ -37,11 +37,14 @@ var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { UIDensity } = ChromeUtils.import("resource:///modules/UIDensity.jsm");
var { UIFontSize } = ChromeUtils.import("resource:///modules/UIFontSize.jsm");
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
ChromeUtils.defineESModuleGetters(this, {
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
FeedUtils: "resource:///modules/FeedUtils.jsm",
FolderUtils: "resource:///modules/FolderUtils.jsm",

Просмотреть файл

@ -15,9 +15,9 @@ const THUNDERBIRD_THEME_PREVIEWS = new Map([
],
]);
var { UIFontSize } = ChromeUtils.import("resource:///modules/UIFontSize.jsm");
ChromeUtils.defineESModuleGetters(this, {
ExtensionData: "resource://gre/modules/Extension.sys.mjs",
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
XPCOMUtils.defineLazyPreferenceGetter(

Просмотреть файл

@ -26,11 +26,11 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
ChromeUtils.defineESModuleGetters(this, {
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
UIDensity: "resource:///modules/UIDensity.jsm",
UIFontSize: "resource:///modules/UIFontSize.jsm",
});
const messengerBundle = Services.strings.createBundle(

Просмотреть файл

@ -25,15 +25,15 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
ChromeUtils.defineESModuleGetters(this, {
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
BrowserToolboxLauncher:
"resource://devtools/client/framework/browser-toolbox/Launcher.sys.mjs",
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
MailUtils: "resource:///modules/MailUtils.jsm",
MimeParser: "resource:///modules/mimeParser.jsm",
UIDensity: "resource:///modules/UIDensity.jsm",
UIFontSize: "resource:///modules/UIFontSize.jsm",
});
Object.defineProperty(this, "BrowserConsoleManager", {

Просмотреть файл

@ -24,10 +24,13 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
ChromeUtils.defineESModuleGetters(this, {
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
BondOpenPGP: "chrome://openpgp/content/BondOpenPGP.jsm",
UIDensity: "resource:///modules/UIDensity.jsm",
UIFontSize: "resource:///modules/UIFontSize.jsm",
});
var messageBrowser;

Просмотреть файл

@ -9,7 +9,9 @@
/* import-globals-from mailCore.js */
/* globals contentProgress, statusFeedback */
var { UIFontSize } = ChromeUtils.import("resource:///modules/UIFontSize.jsm");
ChromeUtils.defineESModuleGetters(this, {
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
// Wrap in a block to prevent leaking to window scope.
{

Просмотреть файл

@ -25,13 +25,13 @@ ChromeUtils.defineESModuleGetters(this, {
FetchConfig: "resource:///modules/accountcreation/FetchConfig.sys.mjs",
GuessConfig: "resource:///modules/accountcreation/GuessConfig.sys.mjs",
Sanitizer: "resource:///modules/accountcreation/Sanitizer.sys.mjs",
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
CardDAVUtils: "resource:///modules/CardDAVUtils.jsm",
OAuth2Providers: "resource:///modules/OAuth2Providers.jsm",
UIDensity: "resource:///modules/UIDensity.jsm",
UIFontSize: "resource:///modules/UIFontSize.jsm",
});
var {

Просмотреть файл

@ -11,7 +11,6 @@ var { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
var { UIDensity } = ChromeUtils.import("resource:///modules/UIDensity.jsm");
var { UIFontSize } = ChromeUtils.import("resource:///modules/UIFontSize.jsm");
var { IMServices } = ChromeUtils.importESModule(
"resource:///modules/IMServices.sys.mjs"
);
@ -27,6 +26,7 @@ ChromeUtils.defineESModuleGetters(this, {
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
PluralForm: "resource:///modules/PluralForm.sys.mjs",
cal: "resource:///modules/calendar/calUtils.sys.mjs",
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {

Просмотреть файл

@ -48,6 +48,7 @@ var { ExtensionParent } = ChromeUtils.importESModule(
ChromeUtils.defineESModuleGetters(this, {
SelectionUtils: "resource://gre/modules/SelectionUtils.sys.mjs",
ShortcutUtils: "resource://gre/modules/ShortcutUtils.sys.mjs",
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
@ -55,7 +56,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
MailUtils: "resource:///modules/MailUtils.jsm",
EnigmailKeyRing: "chrome://openpgp/content/modules/keyRing.jsm",
BondOpenPGP: "chrome://openpgp/content/BondOpenPGP.jsm",
UIFontSize: "resource:///modules/UIFontSize.jsm",
UIDensity: "resource:///modules/UIDensity.jsm",
});

Просмотреть файл

@ -17,11 +17,11 @@ ChromeUtils.defineESModuleGetters(this, {
PluralForm: "resource:///modules/PluralForm.sys.mjs",
AccountCreationUtils:
"resource:///modules/accountcreation/AccountCreationUtils.sys.mjs",
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
UIDensity: "resource:///modules/UIDensity.jsm",
UIFontSize: "resource:///modules/UIFontSize.jsm",
});
var { gAccountSetupLogger } = AccountCreationUtils;

Просмотреть файл

@ -25,13 +25,13 @@ var { calendarDeactivator } = ChromeUtils.import(
"resource:///modules/calendar/calCalendarDeactivator.jsm"
);
var { UIDensity } = ChromeUtils.import("resource:///modules/UIDensity.jsm");
var { UIFontSize } = ChromeUtils.import("resource:///modules/UIFontSize.jsm");
var paneDeck = document.getElementById("paneDeck");
var defaultPane = "paneGeneral";
ChromeUtils.defineESModuleGetters(this, {
AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "gSubDialog", function () {

Просмотреть файл

@ -2,20 +2,14 @@
* 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";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const EXPORTED_SYMBOLS = ["UIFontSize"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
var langGroup = Services.prefs.getComplexValue(
const langGroup = Services.prefs.getComplexValue(
"font.language.group",
Ci.nsIPrefLocalizedString
).data;
var registeredWindows = new Set();
const registeredWindows = new Set();
/**
* Update the font size of the registered window.
@ -75,7 +69,7 @@ function updateAllWindows() {
/**
* The object controlling the global font size.
*/
var UIFontSize = {
export const UIFontSize = {
// Default value is 0 so we know the font wasn't changed.
DEFAULT: 0,
// Font size limit to avoid unusable UI.

Просмотреть файл

@ -36,7 +36,7 @@ EXTRA_JS_MODULES += [
"TagUtils.jsm",
"TBDistCustomizer.jsm",
"UIDensity.jsm",
"UIFontSize.jsm",
"UIFontSize.sys.mjs",
]
EXTRA_JS_MODULES.sessionstore += [

Просмотреть файл

@ -8,7 +8,10 @@ var { MailServices } = ChromeUtils.import(
);
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { UIDensity } = ChromeUtils.import("resource:///modules/UIDensity.jsm");
var { UIFontSize } = ChromeUtils.import("resource:///modules/UIFontSize.jsm");
ChromeUtils.defineESModuleGetters(this, {
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
var gSelectedServer = null;
var gSelectedFolder = null;

Просмотреть файл

@ -38,7 +38,10 @@ var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { UIDensity } = ChromeUtils.import("resource:///modules/UIDensity.jsm");
var { UIFontSize } = ChromeUtils.import("resource:///modules/UIFontSize.jsm");
ChromeUtils.defineESModuleGetters(this, {
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
ChromeUtils.defineModuleGetter(
this,

Просмотреть файл

@ -260,7 +260,6 @@
"resource:///modules/ThunderbirdProfileMigrator.jsm": "comm/mail/components/migration/src/ThunderbirdProfileMigrator.jsm",
"resource:///modules/ToLocaleFormat.jsm": "comm/chat/modules/ToLocaleFormat.jsm",
"resource:///modules/UIDensity.jsm": "comm/mail/modules/UIDensity.jsm",
"resource:///modules/UIFontSize.jsm": "comm/mail/modules/UIFontSize.jsm",
"resource:///modules/VCardUtils.jsm": "comm/mailnews/addrbook/modules/VCardUtils.jsm",
"resource:///modules/VirtualFolderWrapper.jsm": "comm/mailnews/base/src/VirtualFolderWrapper.jsm",
"resource:///modules/WinUnreadBadge.jsm": "comm/mailnews/base/src/WinUnreadBadge.jsm",