Skip to content

Remove the NullL10n default value from viewer components not included in the COMPONENTS-bundle #13020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions web/password_prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* limitations under the License.
*/

import { NullL10n } from "./ui_utils.js";
import { PasswordResponses } from "pdfjs-lib";

/**
Expand All @@ -37,12 +36,7 @@ class PasswordPrompt {
* @param {boolean} [isViewerEmbedded] - If the viewer is embedded, in e.g.
* an <iframe> or an <object>. The default value is `false`.
*/
constructor(
options,
overlayManager,
l10n = NullL10n,
isViewerEmbedded = false
) {
constructor(options, overlayManager, l10n, isViewerEmbedded = false) {
this.overlayName = options.overlayName;
this.container = options.container;
this.label = options.label;
Expand Down
3 changes: 1 addition & 2 deletions web/pdf_document_properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
getPageSizeInches,
getPDFFileNameFromURL,
isPortraitOrientation,
NullL10n,
} from "./ui_utils.js";

const DEFAULT_FIELD_CONTENT = "-";
Expand Down Expand Up @@ -63,7 +62,7 @@ class PDFDocumentProperties {
{ overlayName, fields, container, closeButton },
overlayManager,
eventBus,
l10n = NullL10n
l10n
) {
this.overlayName = overlayName;
this.fields = fields;
Expand Down
3 changes: 1 addition & 2 deletions web/pdf_find_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/

import { FindState } from "./pdf_find_controller.js";
import { NullL10n } from "./ui_utils.js";

const MATCHES_COUNT_LIMIT = 1000;

Expand All @@ -25,7 +24,7 @@ const MATCHES_COUNT_LIMIT = 1000;
* is done by PDFFindController.
*/
class PDFFindBar {
constructor(options, eventBus, l10n = NullL10n) {
constructor(options, eventBus, l10n) {
this.opened = false;

this.bar = options.bar || null;
Expand Down
4 changes: 2 additions & 2 deletions web/pdf_print_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* limitations under the License.
*/

import { CSS_UNITS, NullL10n } from "./ui_utils.js";
import { PDFPrintServiceFactory, PDFViewerApplication } from "./app.js";
import { CSS_UNITS } from "./ui_utils.js";
import { viewerCompatibilityParams } from "./viewer_compatibility.js";

let activeService = null;
Expand Down Expand Up @@ -82,7 +82,7 @@ function PDFPrintService(
this._printResolution = printResolution || 150;
this._optionalContentConfigPromise =
optionalContentConfigPromise || pdfDocument.getOptionalContentConfig();
this.l10n = l10n || NullL10n;
this.l10n = l10n;
this.currentPage = -1;
// The temporary canvas where renderPage paints one page at a time.
this.scratchCanvas = document.createElement("canvas");
Expand Down
10 changes: 2 additions & 8 deletions web/pdf_sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { NullL10n, PresentationModeState, SidebarView } from "./ui_utils.js";
import { PresentationModeState, SidebarView } from "./ui_utils.js";
import { RenderingStates } from "./pdf_rendering_queue.js";

const UI_NOTIFICATION_CLASS = "pdfSidebarNotification";
Expand Down Expand Up @@ -61,13 +61,7 @@ class PDFSidebar {
/**
* @param {PDFSidebarOptions} options
*/
constructor({
elements,
pdfViewer,
pdfThumbnailViewer,
eventBus,
l10n = NullL10n,
}) {
constructor({ elements, pdfViewer, pdfThumbnailViewer, eventBus, l10n }) {
this.isOpen = false;
this.active = SidebarView.THUMBS;
this.isInitialViewSet = false;
Expand Down
4 changes: 1 addition & 3 deletions web/pdf_sidebar_resizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
* limitations under the License.
*/

import { NullL10n } from "./ui_utils.js";

const SIDEBAR_WIDTH_VAR = "--sidebar-width";
const SIDEBAR_MIN_WIDTH = 200; // pixels
const SIDEBAR_RESIZING_CLASS = "sidebarResizing";
Expand All @@ -33,7 +31,7 @@ class PDFSidebarResizer {
* @param {EventBus} eventBus - The application event bus.
* @param {IL10n} l10n - Localization service.
*/
constructor(options, eventBus, l10n = NullL10n) {
constructor(options, eventBus, l10n) {
this.isRTL = false;
this.sidebarOpen = false;
this.doc = document.documentElement;
Expand Down
4 changes: 2 additions & 2 deletions web/pdf_thumbnail_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { getOutputScale, NullL10n } from "./ui_utils.js";
import { getOutputScale } from "./ui_utils.js";
import { RenderingCancelledException } from "pdfjs-lib";
import { RenderingStates } from "./pdf_rendering_queue.js";

Expand Down Expand Up @@ -97,7 +97,7 @@ class PDFThumbnailView {
renderingQueue,
checkSetImageDisabled,
disableCanvasToImageConversion = false,
l10n = NullL10n,
l10n,
}) {
this.id = id;
this.renderingId = "thumbnail" + id;
Expand Down
9 changes: 1 addition & 8 deletions web/pdf_thumbnail_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import {
getVisibleElements,
isValidRotation,
NullL10n,
scrollIntoView,
watchScroll,
} from "./ui_utils.js";
Expand Down Expand Up @@ -45,13 +44,7 @@ class PDFThumbnailViewer {
/**
* @param {PDFThumbnailViewerOptions} options
*/
constructor({
container,
eventBus,
linkService,
renderingQueue,
l10n = NullL10n,
}) {
constructor({ container, eventBus, linkService, renderingQueue, l10n }) {
this.container = container;
this.linkService = linkService;
this.renderingQueue = renderingQueue;
Expand Down
3 changes: 1 addition & 2 deletions web/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
MAX_SCALE,
MIN_SCALE,
noContextMenuHandler,
NullL10n,
} from "./ui_utils.js";

const PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading";
Expand Down Expand Up @@ -58,7 +57,7 @@ class Toolbar {
* @param {EventBus} eventBus
* @param {IL10n} l10n - Localization service.
*/
constructor(options, eventBus, l10n = NullL10n) {
constructor(options, eventBus, l10n) {
this.toolbar = options.container;
this.eventBus = eventBus;
this.l10n = l10n;
Expand Down