Skip to content

Commit

Permalink
fixed prettier issues and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
lena.natter committed Sep 15, 2023
1 parent da44143 commit 8ccece9
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 49 deletions.
21 changes: 12 additions & 9 deletions scripts/move-build.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
const fs = require('fs-extra');
const del = require('del');
const path = require('path');
import { fileURLToPath } from "url";
const fs = require("fs-extra");
const del = require("del");
const path = require("path");

const resourcePath = path.join(__dirname, '..')
const __dirname = path.dirname(fileURLToPath(import.meta.url));

const resourcePath = path.join(__dirname, "..");

del.sync([
resourcePath + '/build/minified/**/*.map',
resourcePath + '/build/minified/**/*.pdf'
resourcePath + "/build/minified/**/*.map",
resourcePath + "/build/minified/**/*.pdf",
]);

fs.copySync(
path.join(resourcePath, 'build', 'minified'),
path.join(resourcePath, 'dist'),
path.join(resourcePath, "build", "minified"),
path.join(resourcePath, "dist")
);

fs.remove(path.join(resourcePath, 'build'));
fs.remove(path.join(resourcePath, "build"));
9 changes: 4 additions & 5 deletions src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
/** @typedef {import("../../web/interfaces").IDownloadManager} IDownloadManager */
/** @typedef {import("../../web/interfaces").IPDFLinkService} IPDFLinkService */

import { NullL10n } from "display-l10n_utils";
import { ColorConverters } from "../shared/scripting_utils.js";
import {
AnnotationBorderStyleType,
AnnotationEditorType,
Expand All @@ -35,13 +33,15 @@ import {
Util,
warn,
} from "../shared/util.js";
import { AnnotationStorage } from "./annotation_storage.js";
import {
DOMSVGFactory,
getFilenameFromUrl,
PDFDateString,
setLayerDimensions,
} from "./display_utils.js";
import { AnnotationStorage } from "./annotation_storage.js";
import { ColorConverters } from "../shared/scripting_utils.js";
import { NullL10n } from "display-l10n_utils";
import { XfaLayer } from "./xfa_layer.js";

const DEFAULT_TAB_INDEX = 1000;
Expand Down Expand Up @@ -3058,6 +3058,5 @@ export {
AnnotationLayer,
FreeTextAnnotationElement,
InkAnnotationElement,
StampAnnotationElement
StampAnnotationElement,
};

67 changes: 34 additions & 33 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@
* limitations under the License.
*/

import {
animationStarted,
apiPageLayoutToViewerModes,
apiPageModeToSidebarView,
AutoPrintRegExp,
CursorTool,
DEFAULT_SCALE_VALUE,
getActiveOrFocusedElement,
isValidRotation,
isValidScrollMode,
isValidSpreadMode,
normalizeWheelEventDirection,
parseQueryString,
ProgressBar,
RenderingStates,
ScrollMode,
SidebarView,
SpreadMode,
TextLayerMode,
} from "./ui_utils.js";
import {
AnnotationEditorType,
build,
Expand All @@ -32,48 +52,28 @@ import {
UnexpectedResponseException,
version,
} from "pdfjs-lib";
import { AppOptions, OptionKind } from "./app_options.js";
import { AutomationEventBus, EventBus } from "./event_utils.js";
import { LinkTarget, PDFLinkService } from "./pdf_link_service.js";
import { AnnotationEditorParams } from "web-annotation_editor_params";
import { OverlayManager } from "./overlay_manager.js";
import { PasswordPrompt } from "./password_prompt.js";
import { PDFAttachmentViewer } from "web-pdf_attachment_viewer";
import { PDFCursorTools } from "web-pdf_cursor_tools";
import { PDFDocumentProperties } from "web-pdf_document_properties";
import { PDFFindBar } from "web-pdf_find_bar";
import { PDFFindController } from "./pdf_find_controller.js";
import { PDFHistory } from "./pdf_history.js";
import { PDFLayerViewer } from "web-pdf_layer_viewer";
import { PDFOutlineViewer } from "web-pdf_outline_viewer";
import { PDFPresentationMode } from "web-pdf_presentation_mode";
import { PDFRenderingQueue } from "./pdf_rendering_queue.js";
import { PDFScriptingManager } from "./pdf_scripting_manager.js";
import { PDFSidebar } from "web-pdf_sidebar";
import { PDFThumbnailViewer } from "web-pdf_thumbnail_viewer";
import { PDFViewer } from "./pdf_viewer.js";
import { SecondaryToolbar } from "web-secondary_toolbar";
import { Toolbar } from "web-toolbar";
import { AppOptions, OptionKind } from "./app_options.js";
import { AutomationEventBus, EventBus } from "./event_utils.js";
import { OverlayManager } from "./overlay_manager.js";
import { PasswordPrompt } from "./password_prompt.js";
import { PDFFindController } from "./pdf_find_controller.js";
import { PDFHistory } from "./pdf_history.js";
import { LinkTarget, PDFLinkService } from "./pdf_link_service.js";
import { PDFRenderingQueue } from "./pdf_rendering_queue.js";
import { PDFScriptingManager } from "./pdf_scripting_manager.js";
import { PDFViewer } from "./pdf_viewer.js";
import {
animationStarted,
apiPageLayoutToViewerModes,
apiPageModeToSidebarView,
AutoPrintRegExp,
CursorTool,
DEFAULT_SCALE_VALUE,
getActiveOrFocusedElement,
isValidRotation,
isValidScrollMode,
isValidSpreadMode,
normalizeWheelEventDirection,
parseQueryString,
ProgressBar,
RenderingStates,
ScrollMode,
SidebarView,
SpreadMode,
TextLayerMode,
} from "./ui_utils.js";
import { ViewHistory } from "./view_history.js";

const FORCE_PAGES_LOADED_TIMEOUT = 10000; // ms
Expand Down Expand Up @@ -2233,8 +2233,10 @@ const PDFViewerApplication = {
};

if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
validateFileURL = function (file) {
// eslint-disable-next-line no-var
var validateFileURL = function (file) {
if (file === undefined) {
// eslint-disable-next-line no-useless-return
return;
}
};
Expand Down Expand Up @@ -3268,6 +3270,5 @@ const PDFPrintServiceFactory = {
export {
DefaultExternalServices,
PDFPrintServiceFactory,
PDFViewerApplication
PDFViewerApplication,
};

4 changes: 2 additions & 2 deletions web/pdf_presentation_mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
* limitations under the License.
*/

import { AnnotationEditorType } from "pdfjs-lib";
import {
normalizeWheelEventDelta,
PresentationModeState,
ScrollMode,
SpreadMode,
} from "./ui_utils.js";
import { AnnotationEditorType } from "pdfjs-lib";

const DELAY_BEFORE_HIDING_CONTROLS = 3000; // in ms
const ACTIVE_SELECTOR = "pdfPresentationMode";
Expand Down Expand Up @@ -49,7 +49,7 @@ class PDFPresentationMode {
/**
* @param {PDFPresentationModeOptions} options
*/
constructor({ container, viewer = null, pdfViewer, eventBus}) {
constructor({ container, viewer = null, pdfViewer, eventBus }) {
this.container = container;
this.viewer = viewer || container.firstElementChild;
this.pdfViewer = pdfViewer;
Expand Down

0 comments on commit 8ccece9

Please sign in to comment.