Merge pull request #8285 from yurydelendik/webcjspath
Change amd to cjs path in ES6 modules
This commit is contained in:
commit
bc1f4dd9c8
@ -13,9 +13,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AnnotationLayer } from 'pdfjs-web/pdfjs';
|
||||
import { mozL10n } from 'pdfjs-web/ui_utils';
|
||||
import { SimpleLinkService } from 'pdfjs-web/pdf_link_service';
|
||||
import { AnnotationLayer } from './pdfjs';
|
||||
import { mozL10n } from './ui_utils';
|
||||
import { SimpleLinkService } from './pdf_link_service';
|
||||
|
||||
/**
|
||||
* @typedef {Object} AnnotationLayerBuilderOptions
|
||||
|
44
web/app.js
44
web/app.js
@ -18,34 +18,34 @@ import {
|
||||
animationStarted, DEFAULT_SCALE_VALUE, getPDFFileNameFromURL, localized,
|
||||
MAX_SCALE, MIN_SCALE, mozL10n, noContextMenuHandler, normalizeWheelEventDelta,
|
||||
parseQueryString, ProgressBar, RendererType, UNKNOWN_SCALE
|
||||
} from 'pdfjs-web/ui_utils';
|
||||
} from './ui_utils';
|
||||
import {
|
||||
build, createBlob, getDocument, getFilenameFromUrl, InvalidPDFException,
|
||||
MissingPDFException, OPS, PDFJS, shadow, UnexpectedResponseException,
|
||||
UNSUPPORTED_FEATURES, version,
|
||||
} from 'pdfjs-web/pdfjs';
|
||||
} from './pdfjs';
|
||||
import {
|
||||
PDFRenderingQueue, RenderingStates
|
||||
} from 'pdfjs-web/pdf_rendering_queue';
|
||||
import { PDFSidebar, SidebarView } from 'pdfjs-web/pdf_sidebar';
|
||||
import { PDFViewer, PresentationModeState } from 'pdfjs-web/pdf_viewer';
|
||||
import { getGlobalEventBus } from 'pdfjs-web/dom_events';
|
||||
import { HandTool } from 'pdfjs-web/hand_tool';
|
||||
import { OverlayManager } from 'pdfjs-web/overlay_manager';
|
||||
import { PasswordPrompt } from 'pdfjs-web/password_prompt';
|
||||
import { PDFAttachmentViewer } from 'pdfjs-web/pdf_attachment_viewer';
|
||||
import { PDFDocumentProperties } from 'pdfjs-web/pdf_document_properties';
|
||||
import { PDFFindBar } from 'pdfjs-web/pdf_find_bar';
|
||||
import { PDFFindController } from 'pdfjs-web/pdf_find_controller';
|
||||
import { PDFHistory } from 'pdfjs-web/pdf_history';
|
||||
import { PDFLinkService } from 'pdfjs-web/pdf_link_service';
|
||||
import { PDFOutlineViewer } from 'pdfjs-web/pdf_outline_viewer';
|
||||
import { PDFPresentationMode } from 'pdfjs-web/pdf_presentation_mode';
|
||||
import { PDFThumbnailViewer } from 'pdfjs-web/pdf_thumbnail_viewer';
|
||||
import { Preferences } from 'pdfjs-web/preferences';
|
||||
import { SecondaryToolbar } from 'pdfjs-web/secondary_toolbar';
|
||||
import { Toolbar } from 'pdfjs-web/toolbar';
|
||||
import { ViewHistory } from 'pdfjs-web/view_history';
|
||||
} from './pdf_rendering_queue';
|
||||
import { PDFSidebar, SidebarView } from './pdf_sidebar';
|
||||
import { PDFViewer, PresentationModeState } from './pdf_viewer';
|
||||
import { getGlobalEventBus } from './dom_events';
|
||||
import { HandTool } from './hand_tool';
|
||||
import { OverlayManager } from './overlay_manager';
|
||||
import { PasswordPrompt } from './password_prompt';
|
||||
import { PDFAttachmentViewer } from './pdf_attachment_viewer';
|
||||
import { PDFDocumentProperties } from './pdf_document_properties';
|
||||
import { PDFFindBar } from './pdf_find_bar';
|
||||
import { PDFFindController } from './pdf_find_controller';
|
||||
import { PDFHistory } from './pdf_history';
|
||||
import { PDFLinkService } from './pdf_link_service';
|
||||
import { PDFOutlineViewer } from './pdf_outline_viewer';
|
||||
import { PDFPresentationMode } from './pdf_presentation_mode';
|
||||
import { PDFThumbnailViewer } from './pdf_thumbnail_viewer';
|
||||
import { Preferences } from './preferences';
|
||||
import { SecondaryToolbar } from './secondary_toolbar';
|
||||
import { Toolbar } from './toolbar';
|
||||
import { ViewHistory } from './view_history';
|
||||
|
||||
var DEFAULT_SCALE_DELTA = 1.1;
|
||||
var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000;
|
||||
|
@ -14,10 +14,10 @@
|
||||
*/
|
||||
/* globals chrome */
|
||||
|
||||
import { DefaultExternalServices, PDFViewerApplication } from 'pdfjs-web/app';
|
||||
import { OverlayManager } from 'pdfjs-web/overlay_manager';
|
||||
import { PDFJS } from 'pdfjs-web/pdfjs';
|
||||
import { Preferences } from 'pdfjs-web/preferences';
|
||||
import { DefaultExternalServices, PDFViewerApplication } from './app';
|
||||
import { OverlayManager } from './overlay_manager';
|
||||
import { PDFJS } from './pdfjs';
|
||||
import { Preferences } from './preferences';
|
||||
|
||||
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('CHROME')) {
|
||||
throw new Error('Module "pdfjs-web/chromecom" shall not be used outside ' +
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { EventBus } from 'pdfjs-web/ui_utils';
|
||||
import { EventBus } from './ui_utils';
|
||||
|
||||
// Attaching to the application event bus to dispatch events to the DOM for
|
||||
// backwards viewer API compatibility.
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
import {
|
||||
createObjectURL, createValidAbsoluteUrl, PDFJS
|
||||
} from 'pdfjs-web/pdfjs';
|
||||
import { DefaultExternalServices, PDFViewerApplication } from 'pdfjs-web/app';
|
||||
} from './pdfjs';
|
||||
import { DefaultExternalServices, PDFViewerApplication } from './app';
|
||||
|
||||
if (typeof PDFJSDev !== 'undefined' && !PDFJSDev.test('CHROME || GENERIC')) {
|
||||
throw new Error('Module "pdfjs-web/download_manager" shall not be used ' +
|
||||
|
@ -13,9 +13,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CSS_UNITS } from 'pdfjs-web/ui_utils';
|
||||
import { PDFPrintServiceFactory } from 'pdfjs-web/app';
|
||||
import { shadow } from 'pdfjs-web/pdfjs';
|
||||
import { CSS_UNITS } from './ui_utils';
|
||||
import { PDFPrintServiceFactory } from './app';
|
||||
import { shadow } from './pdfjs';
|
||||
|
||||
// Creates a placeholder with div and canvas with right size for the page.
|
||||
function composePage(pdfDocument, pageNumber, size, printContainer) {
|
||||
|
@ -15,9 +15,9 @@
|
||||
|
||||
import {
|
||||
createObjectURL, PDFDataRangeTransport, shadow
|
||||
} from 'pdfjs-web/pdfjs';
|
||||
import { PDFViewerApplication } from 'pdfjs-web/app';
|
||||
import { Preferences } from 'pdfjs-web/preferences';
|
||||
} from './pdfjs';
|
||||
import { PDFViewerApplication } from './app';
|
||||
import { Preferences } from './preferences';
|
||||
|
||||
if (typeof PDFJSDev === 'undefined' ||
|
||||
!PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
|
||||
|
@ -13,9 +13,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { GrabToPan } from 'pdfjs-web/grab_to_pan';
|
||||
import { localized } from 'pdfjs-web/ui_utils';
|
||||
import { Preferences } from 'pdfjs-web/preferences';
|
||||
import { GrabToPan } from './grab_to_pan';
|
||||
import { localized } from './ui_utils';
|
||||
import { Preferences } from './preferences';
|
||||
|
||||
/**
|
||||
* @typedef {Object} HandToolOptions
|
||||
|
@ -13,9 +13,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { mozL10n } from 'pdfjs-web/ui_utils';
|
||||
import { OverlayManager } from 'pdfjs-web/overlay_manager';
|
||||
import { PasswordResponses } from 'pdfjs-web/pdfjs';
|
||||
import { mozL10n } from './ui_utils';
|
||||
import { OverlayManager } from './overlay_manager';
|
||||
import { PasswordResponses } from './pdfjs';
|
||||
|
||||
/**
|
||||
* @typedef {Object} PasswordPromptOptions
|
||||
|
@ -16,7 +16,7 @@
|
||||
import {
|
||||
createObjectURL, createPromiseCapability, getFilenameFromUrl, PDFJS,
|
||||
removeNullCharacters
|
||||
} from 'pdfjs-web/pdfjs';
|
||||
} from './pdfjs';
|
||||
|
||||
/**
|
||||
* @typedef {Object} PDFAttachmentViewerOptions
|
||||
|
@ -13,8 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { getPDFFileNameFromURL, mozL10n } from 'pdfjs-web/ui_utils';
|
||||
import { OverlayManager } from 'pdfjs-web/overlay_manager';
|
||||
import { getPDFFileNameFromURL, mozL10n } from './ui_utils';
|
||||
import { OverlayManager } from './overlay_manager';
|
||||
|
||||
/**
|
||||
* @typedef {Object} PDFDocumentPropertiesOptions
|
||||
|
@ -13,8 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FindStates } from 'pdfjs-web/pdf_find_controller';
|
||||
import { mozL10n } from 'pdfjs-web/ui_utils';
|
||||
import { FindStates } from './pdf_find_controller';
|
||||
import { mozL10n } from './ui_utils';
|
||||
|
||||
/**
|
||||
* Creates a "search bar" given a set of DOM elements that act as controls
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { scrollIntoView } from 'pdfjs-web/ui_utils';
|
||||
import { scrollIntoView } from './ui_utils';
|
||||
|
||||
var FindStates = {
|
||||
FIND_FOUND: 0,
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
/* globals chrome */
|
||||
|
||||
import { domEvents } from 'pdfjs-web/dom_events';
|
||||
import { domEvents } from './dom_events';
|
||||
|
||||
function PDFHistory(options) {
|
||||
this.linkService = options.linkService;
|
||||
|
@ -13,8 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { domEvents } from 'pdfjs-web/dom_events';
|
||||
import { parseQueryString } from 'pdfjs-web/ui_utils';
|
||||
import { domEvents } from './dom_events';
|
||||
import { parseQueryString } from './ui_utils';
|
||||
|
||||
var PageNumberRegExp = /^\d+$/;
|
||||
function isPageNumber(str) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
import {
|
||||
addLinkAttributes, PDFJS, removeNullCharacters
|
||||
} from 'pdfjs-web/pdfjs';
|
||||
} from './pdfjs';
|
||||
|
||||
var DEFAULT_TITLE = '\u2013';
|
||||
|
||||
|
@ -16,12 +16,12 @@
|
||||
import {
|
||||
approximateFraction, CSS_UNITS, DEFAULT_SCALE, getOutputScale, RendererType,
|
||||
roundToDivide
|
||||
} from 'pdfjs-web/ui_utils';
|
||||
} from './ui_utils';
|
||||
import {
|
||||
CustomStyle, PDFJS, RenderingCancelledException, SVGGraphics
|
||||
} from 'pdfjs-web/pdfjs';
|
||||
import { domEvents } from 'pdfjs-web/dom_events';
|
||||
import { RenderingStates } from 'pdfjs-web/pdf_rendering_queue';
|
||||
} from './pdfjs';
|
||||
import { domEvents } from './dom_events';
|
||||
import { RenderingStates } from './pdf_rendering_queue';
|
||||
|
||||
var TEXT_LAYER_RENDER_DELAY = 200; // ms
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { normalizeWheelEventDelta } from 'pdfjs-web/ui_utils';
|
||||
import { normalizeWheelEventDelta } from './ui_utils';
|
||||
|
||||
var DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS = 1500; // in ms
|
||||
var DELAY_BEFORE_HIDING_CONTROLS = 3000; // in ms
|
||||
|
@ -13,10 +13,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CSS_UNITS, mozL10n } from 'pdfjs-web/ui_utils';
|
||||
import { OverlayManager } from 'pdfjs-web/overlay_manager';
|
||||
import { PDFJS } from 'pdfjs-web/pdfjs';
|
||||
import { PDFPrintServiceFactory } from 'pdfjs-web/app';
|
||||
import { CSS_UNITS, mozL10n } from './ui_utils';
|
||||
import { OverlayManager } from './overlay_manager';
|
||||
import { PDFJS } from './pdfjs';
|
||||
import { PDFPrintServiceFactory } from './app';
|
||||
|
||||
var activeService = null;
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { mozL10n } from 'pdfjs-web/ui_utils';
|
||||
import { RenderingStates } from 'pdfjs-web/pdf_rendering_queue';
|
||||
import { mozL10n } from './ui_utils';
|
||||
import { RenderingStates } from './pdf_rendering_queue';
|
||||
|
||||
var UI_NOTIFICATION_CLASS = 'pdfSidebarNotification';
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { getOutputScale, mozL10n } from 'pdfjs-web/ui_utils';
|
||||
import { RenderingStates } from 'pdfjs-web/pdf_rendering_queue';
|
||||
import { getOutputScale, mozL10n } from './ui_utils';
|
||||
import { RenderingStates } from './pdf_rendering_queue';
|
||||
|
||||
var THUMBNAIL_WIDTH = 98; // px
|
||||
var THUMBNAIL_CANVAS_BORDER_WIDTH = 1; // px
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
import {
|
||||
getVisibleElements, scrollIntoView, watchScroll
|
||||
} from 'pdfjs-web/ui_utils';
|
||||
import { PDFThumbnailView } from 'pdfjs-web/pdf_thumbnail_view';
|
||||
} from './ui_utils';
|
||||
import { PDFThumbnailView } from './pdf_thumbnail_view';
|
||||
|
||||
var THUMBNAIL_SCROLL_MARGIN = -19;
|
||||
|
||||
|
@ -17,16 +17,16 @@ import {
|
||||
CSS_UNITS, DEFAULT_SCALE, DEFAULT_SCALE_VALUE, getVisibleElements,
|
||||
MAX_AUTO_SCALE, RendererType, SCROLLBAR_PADDING, scrollIntoView,
|
||||
UNKNOWN_SCALE, VERTICAL_PADDING, watchScroll
|
||||
} from 'pdfjs-web/ui_utils';
|
||||
} from './ui_utils';
|
||||
import {
|
||||
PDFRenderingQueue, RenderingStates,
|
||||
} from 'pdfjs-web/pdf_rendering_queue';
|
||||
import { AnnotationLayerBuilder } from 'pdfjs-web/annotation_layer_builder';
|
||||
import { domEvents } from 'pdfjs-web/dom_events';
|
||||
import { PDFJS } from 'pdfjs-web/pdfjs';
|
||||
import { PDFPageView } from 'pdfjs-web/pdf_page_view';
|
||||
import { SimpleLinkService } from 'pdfjs-web/pdf_link_service';
|
||||
import { TextLayerBuilder } from 'pdfjs-web/text_layer_builder';
|
||||
} from './pdf_rendering_queue';
|
||||
import { AnnotationLayerBuilder } from './annotation_layer_builder';
|
||||
import { domEvents } from './dom_events';
|
||||
import { PDFJS } from './pdfjs';
|
||||
import { PDFPageView } from './pdf_page_view';
|
||||
import { SimpleLinkService } from './pdf_link_service';
|
||||
import { TextLayerBuilder } from './text_layer_builder';
|
||||
|
||||
var PresentationModeState = {
|
||||
UNKNOWN: 0,
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { mozL10n, SCROLLBAR_PADDING } from 'pdfjs-web/ui_utils';
|
||||
import { mozL10n, SCROLLBAR_PADDING } from './ui_utils';
|
||||
|
||||
/**
|
||||
* @typedef {Object} SecondaryToolbarOptions
|
||||
|
@ -13,8 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { domEvents } from 'pdfjs-web/dom_events';
|
||||
import { renderTextLayer } from 'pdfjs-web/pdfjs';
|
||||
import { domEvents } from './dom_events';
|
||||
import { renderTextLayer } from './pdfjs';
|
||||
|
||||
var EXPAND_DIVS_TIMEOUT = 300; // ms
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
import {
|
||||
animationStarted, DEFAULT_SCALE, DEFAULT_SCALE_VALUE, localized, MAX_SCALE,
|
||||
MIN_SCALE, mozL10n, noContextMenuHandler
|
||||
} from 'pdfjs-web/ui_utils';
|
||||
} from './ui_utils';
|
||||
|
||||
var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading';
|
||||
var SCALE_SELECT_CONTAINER_PADDING = 8;
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PDFJS } from 'pdfjs-web/pdfjs';
|
||||
import { PDFJS } from './pdfjs';
|
||||
|
||||
var CSS_UNITS = 96.0 / 72.0;
|
||||
var DEFAULT_SCALE_VALUE = 'auto';
|
||||
|
Loading…
Reference in New Issue
Block a user