Merge pull request #8285 from yurydelendik/webcjspath

Change amd to cjs path in ES6 modules
This commit is contained in:
Jonas Jenwald 2017-04-14 18:35:39 +02:00 committed by GitHub
commit bc1f4dd9c8
27 changed files with 82 additions and 82 deletions

View File

@ -13,9 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { AnnotationLayer } from 'pdfjs-web/pdfjs'; import { AnnotationLayer } from './pdfjs';
import { mozL10n } from 'pdfjs-web/ui_utils'; import { mozL10n } from './ui_utils';
import { SimpleLinkService } from 'pdfjs-web/pdf_link_service'; import { SimpleLinkService } from './pdf_link_service';
/** /**
* @typedef {Object} AnnotationLayerBuilderOptions * @typedef {Object} AnnotationLayerBuilderOptions

View File

@ -18,34 +18,34 @@ import {
animationStarted, DEFAULT_SCALE_VALUE, getPDFFileNameFromURL, localized, animationStarted, DEFAULT_SCALE_VALUE, getPDFFileNameFromURL, localized,
MAX_SCALE, MIN_SCALE, mozL10n, noContextMenuHandler, normalizeWheelEventDelta, MAX_SCALE, MIN_SCALE, mozL10n, noContextMenuHandler, normalizeWheelEventDelta,
parseQueryString, ProgressBar, RendererType, UNKNOWN_SCALE parseQueryString, ProgressBar, RendererType, UNKNOWN_SCALE
} from 'pdfjs-web/ui_utils'; } from './ui_utils';
import { import {
build, createBlob, getDocument, getFilenameFromUrl, InvalidPDFException, build, createBlob, getDocument, getFilenameFromUrl, InvalidPDFException,
MissingPDFException, OPS, PDFJS, shadow, UnexpectedResponseException, MissingPDFException, OPS, PDFJS, shadow, UnexpectedResponseException,
UNSUPPORTED_FEATURES, version, UNSUPPORTED_FEATURES, version,
} from 'pdfjs-web/pdfjs'; } from './pdfjs';
import { import {
PDFRenderingQueue, RenderingStates PDFRenderingQueue, RenderingStates
} from 'pdfjs-web/pdf_rendering_queue'; } from './pdf_rendering_queue';
import { PDFSidebar, SidebarView } from 'pdfjs-web/pdf_sidebar'; import { PDFSidebar, SidebarView } from './pdf_sidebar';
import { PDFViewer, PresentationModeState } from 'pdfjs-web/pdf_viewer'; import { PDFViewer, PresentationModeState } from './pdf_viewer';
import { getGlobalEventBus } from 'pdfjs-web/dom_events'; import { getGlobalEventBus } from './dom_events';
import { HandTool } from 'pdfjs-web/hand_tool'; import { HandTool } from './hand_tool';
import { OverlayManager } from 'pdfjs-web/overlay_manager'; import { OverlayManager } from './overlay_manager';
import { PasswordPrompt } from 'pdfjs-web/password_prompt'; import { PasswordPrompt } from './password_prompt';
import { PDFAttachmentViewer } from 'pdfjs-web/pdf_attachment_viewer'; import { PDFAttachmentViewer } from './pdf_attachment_viewer';
import { PDFDocumentProperties } from 'pdfjs-web/pdf_document_properties'; import { PDFDocumentProperties } from './pdf_document_properties';
import { PDFFindBar } from 'pdfjs-web/pdf_find_bar'; import { PDFFindBar } from './pdf_find_bar';
import { PDFFindController } from 'pdfjs-web/pdf_find_controller'; import { PDFFindController } from './pdf_find_controller';
import { PDFHistory } from 'pdfjs-web/pdf_history'; import { PDFHistory } from './pdf_history';
import { PDFLinkService } from 'pdfjs-web/pdf_link_service'; import { PDFLinkService } from './pdf_link_service';
import { PDFOutlineViewer } from 'pdfjs-web/pdf_outline_viewer'; import { PDFOutlineViewer } from './pdf_outline_viewer';
import { PDFPresentationMode } from 'pdfjs-web/pdf_presentation_mode'; import { PDFPresentationMode } from './pdf_presentation_mode';
import { PDFThumbnailViewer } from 'pdfjs-web/pdf_thumbnail_viewer'; import { PDFThumbnailViewer } from './pdf_thumbnail_viewer';
import { Preferences } from 'pdfjs-web/preferences'; import { Preferences } from './preferences';
import { SecondaryToolbar } from 'pdfjs-web/secondary_toolbar'; import { SecondaryToolbar } from './secondary_toolbar';
import { Toolbar } from 'pdfjs-web/toolbar'; import { Toolbar } from './toolbar';
import { ViewHistory } from 'pdfjs-web/view_history'; import { ViewHistory } from './view_history';
var DEFAULT_SCALE_DELTA = 1.1; var DEFAULT_SCALE_DELTA = 1.1;
var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000; var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000;

View File

@ -14,10 +14,10 @@
*/ */
/* globals chrome */ /* globals chrome */
import { DefaultExternalServices, PDFViewerApplication } from 'pdfjs-web/app'; import { DefaultExternalServices, PDFViewerApplication } from './app';
import { OverlayManager } from 'pdfjs-web/overlay_manager'; import { OverlayManager } from './overlay_manager';
import { PDFJS } from 'pdfjs-web/pdfjs'; import { PDFJS } from './pdfjs';
import { Preferences } from 'pdfjs-web/preferences'; import { Preferences } from './preferences';
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('CHROME')) { if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('CHROME')) {
throw new Error('Module "pdfjs-web/chromecom" shall not be used outside ' + throw new Error('Module "pdfjs-web/chromecom" shall not be used outside ' +

View File

@ -13,7 +13,7 @@
* limitations under the License. * 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 // Attaching to the application event bus to dispatch events to the DOM for
// backwards viewer API compatibility. // backwards viewer API compatibility.

View File

@ -15,8 +15,8 @@
import { import {
createObjectURL, createValidAbsoluteUrl, PDFJS createObjectURL, createValidAbsoluteUrl, PDFJS
} from 'pdfjs-web/pdfjs'; } from './pdfjs';
import { DefaultExternalServices, PDFViewerApplication } from 'pdfjs-web/app'; import { DefaultExternalServices, PDFViewerApplication } from './app';
if (typeof PDFJSDev !== 'undefined' && !PDFJSDev.test('CHROME || GENERIC')) { if (typeof PDFJSDev !== 'undefined' && !PDFJSDev.test('CHROME || GENERIC')) {
throw new Error('Module "pdfjs-web/download_manager" shall not be used ' + throw new Error('Module "pdfjs-web/download_manager" shall not be used ' +

View File

@ -13,9 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { CSS_UNITS } from 'pdfjs-web/ui_utils'; import { CSS_UNITS } from './ui_utils';
import { PDFPrintServiceFactory } from 'pdfjs-web/app'; import { PDFPrintServiceFactory } from './app';
import { shadow } from 'pdfjs-web/pdfjs'; import { shadow } from './pdfjs';
// Creates a placeholder with div and canvas with right size for the page. // Creates a placeholder with div and canvas with right size for the page.
function composePage(pdfDocument, pageNumber, size, printContainer) { function composePage(pdfDocument, pageNumber, size, printContainer) {

View File

@ -15,9 +15,9 @@
import { import {
createObjectURL, PDFDataRangeTransport, shadow createObjectURL, PDFDataRangeTransport, shadow
} from 'pdfjs-web/pdfjs'; } from './pdfjs';
import { PDFViewerApplication } from 'pdfjs-web/app'; import { PDFViewerApplication } from './app';
import { Preferences } from 'pdfjs-web/preferences'; import { Preferences } from './preferences';
if (typeof PDFJSDev === 'undefined' || if (typeof PDFJSDev === 'undefined' ||
!PDFJSDev.test('FIREFOX || MOZCENTRAL')) { !PDFJSDev.test('FIREFOX || MOZCENTRAL')) {

View File

@ -13,9 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { GrabToPan } from 'pdfjs-web/grab_to_pan'; import { GrabToPan } from './grab_to_pan';
import { localized } from 'pdfjs-web/ui_utils'; import { localized } from './ui_utils';
import { Preferences } from 'pdfjs-web/preferences'; import { Preferences } from './preferences';
/** /**
* @typedef {Object} HandToolOptions * @typedef {Object} HandToolOptions

View File

@ -13,9 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { mozL10n } from 'pdfjs-web/ui_utils'; import { mozL10n } from './ui_utils';
import { OverlayManager } from 'pdfjs-web/overlay_manager'; import { OverlayManager } from './overlay_manager';
import { PasswordResponses } from 'pdfjs-web/pdfjs'; import { PasswordResponses } from './pdfjs';
/** /**
* @typedef {Object} PasswordPromptOptions * @typedef {Object} PasswordPromptOptions

View File

@ -16,7 +16,7 @@
import { import {
createObjectURL, createPromiseCapability, getFilenameFromUrl, PDFJS, createObjectURL, createPromiseCapability, getFilenameFromUrl, PDFJS,
removeNullCharacters removeNullCharacters
} from 'pdfjs-web/pdfjs'; } from './pdfjs';
/** /**
* @typedef {Object} PDFAttachmentViewerOptions * @typedef {Object} PDFAttachmentViewerOptions

View File

@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { getPDFFileNameFromURL, mozL10n } from 'pdfjs-web/ui_utils'; import { getPDFFileNameFromURL, mozL10n } from './ui_utils';
import { OverlayManager } from 'pdfjs-web/overlay_manager'; import { OverlayManager } from './overlay_manager';
/** /**
* @typedef {Object} PDFDocumentPropertiesOptions * @typedef {Object} PDFDocumentPropertiesOptions

View File

@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { FindStates } from 'pdfjs-web/pdf_find_controller'; import { FindStates } from './pdf_find_controller';
import { mozL10n } from 'pdfjs-web/ui_utils'; import { mozL10n } from './ui_utils';
/** /**
* Creates a "search bar" given a set of DOM elements that act as controls * Creates a "search bar" given a set of DOM elements that act as controls

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { scrollIntoView } from 'pdfjs-web/ui_utils'; import { scrollIntoView } from './ui_utils';
var FindStates = { var FindStates = {
FIND_FOUND: 0, FIND_FOUND: 0,

View File

@ -14,7 +14,7 @@
*/ */
/* globals chrome */ /* globals chrome */
import { domEvents } from 'pdfjs-web/dom_events'; import { domEvents } from './dom_events';
function PDFHistory(options) { function PDFHistory(options) {
this.linkService = options.linkService; this.linkService = options.linkService;

View File

@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { domEvents } from 'pdfjs-web/dom_events'; import { domEvents } from './dom_events';
import { parseQueryString } from 'pdfjs-web/ui_utils'; import { parseQueryString } from './ui_utils';
var PageNumberRegExp = /^\d+$/; var PageNumberRegExp = /^\d+$/;
function isPageNumber(str) { function isPageNumber(str) {

View File

@ -15,7 +15,7 @@
import { import {
addLinkAttributes, PDFJS, removeNullCharacters addLinkAttributes, PDFJS, removeNullCharacters
} from 'pdfjs-web/pdfjs'; } from './pdfjs';
var DEFAULT_TITLE = '\u2013'; var DEFAULT_TITLE = '\u2013';

View File

@ -16,12 +16,12 @@
import { import {
approximateFraction, CSS_UNITS, DEFAULT_SCALE, getOutputScale, RendererType, approximateFraction, CSS_UNITS, DEFAULT_SCALE, getOutputScale, RendererType,
roundToDivide roundToDivide
} from 'pdfjs-web/ui_utils'; } from './ui_utils';
import { import {
CustomStyle, PDFJS, RenderingCancelledException, SVGGraphics CustomStyle, PDFJS, RenderingCancelledException, SVGGraphics
} from 'pdfjs-web/pdfjs'; } from './pdfjs';
import { domEvents } from 'pdfjs-web/dom_events'; import { domEvents } from './dom_events';
import { RenderingStates } from 'pdfjs-web/pdf_rendering_queue'; import { RenderingStates } from './pdf_rendering_queue';
var TEXT_LAYER_RENDER_DELAY = 200; // ms var TEXT_LAYER_RENDER_DELAY = 200; // ms

View File

@ -13,7 +13,7 @@
* limitations under the License. * 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_RESETTING_SWITCH_IN_PROGRESS = 1500; // in ms
var DELAY_BEFORE_HIDING_CONTROLS = 3000; // in ms var DELAY_BEFORE_HIDING_CONTROLS = 3000; // in ms

View File

@ -13,10 +13,10 @@
* limitations under the License. * limitations under the License.
*/ */
import { CSS_UNITS, mozL10n } from 'pdfjs-web/ui_utils'; import { CSS_UNITS, mozL10n } from './ui_utils';
import { OverlayManager } from 'pdfjs-web/overlay_manager'; import { OverlayManager } from './overlay_manager';
import { PDFJS } from 'pdfjs-web/pdfjs'; import { PDFJS } from './pdfjs';
import { PDFPrintServiceFactory } from 'pdfjs-web/app'; import { PDFPrintServiceFactory } from './app';
var activeService = null; var activeService = null;

View File

@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { mozL10n } from 'pdfjs-web/ui_utils'; import { mozL10n } from './ui_utils';
import { RenderingStates } from 'pdfjs-web/pdf_rendering_queue'; import { RenderingStates } from './pdf_rendering_queue';
var UI_NOTIFICATION_CLASS = 'pdfSidebarNotification'; var UI_NOTIFICATION_CLASS = 'pdfSidebarNotification';

View File

@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { getOutputScale, mozL10n } from 'pdfjs-web/ui_utils'; import { getOutputScale, mozL10n } from './ui_utils';
import { RenderingStates } from 'pdfjs-web/pdf_rendering_queue'; import { RenderingStates } from './pdf_rendering_queue';
var THUMBNAIL_WIDTH = 98; // px var THUMBNAIL_WIDTH = 98; // px
var THUMBNAIL_CANVAS_BORDER_WIDTH = 1; // px var THUMBNAIL_CANVAS_BORDER_WIDTH = 1; // px

View File

@ -15,8 +15,8 @@
import { import {
getVisibleElements, scrollIntoView, watchScroll getVisibleElements, scrollIntoView, watchScroll
} from 'pdfjs-web/ui_utils'; } from './ui_utils';
import { PDFThumbnailView } from 'pdfjs-web/pdf_thumbnail_view'; import { PDFThumbnailView } from './pdf_thumbnail_view';
var THUMBNAIL_SCROLL_MARGIN = -19; var THUMBNAIL_SCROLL_MARGIN = -19;

View File

@ -17,16 +17,16 @@ import {
CSS_UNITS, DEFAULT_SCALE, DEFAULT_SCALE_VALUE, getVisibleElements, CSS_UNITS, DEFAULT_SCALE, DEFAULT_SCALE_VALUE, getVisibleElements,
MAX_AUTO_SCALE, RendererType, SCROLLBAR_PADDING, scrollIntoView, MAX_AUTO_SCALE, RendererType, SCROLLBAR_PADDING, scrollIntoView,
UNKNOWN_SCALE, VERTICAL_PADDING, watchScroll UNKNOWN_SCALE, VERTICAL_PADDING, watchScroll
} from 'pdfjs-web/ui_utils'; } from './ui_utils';
import { import {
PDFRenderingQueue, RenderingStates, PDFRenderingQueue, RenderingStates,
} from 'pdfjs-web/pdf_rendering_queue'; } from './pdf_rendering_queue';
import { AnnotationLayerBuilder } from 'pdfjs-web/annotation_layer_builder'; import { AnnotationLayerBuilder } from './annotation_layer_builder';
import { domEvents } from 'pdfjs-web/dom_events'; import { domEvents } from './dom_events';
import { PDFJS } from 'pdfjs-web/pdfjs'; import { PDFJS } from './pdfjs';
import { PDFPageView } from 'pdfjs-web/pdf_page_view'; import { PDFPageView } from './pdf_page_view';
import { SimpleLinkService } from 'pdfjs-web/pdf_link_service'; import { SimpleLinkService } from './pdf_link_service';
import { TextLayerBuilder } from 'pdfjs-web/text_layer_builder'; import { TextLayerBuilder } from './text_layer_builder';
var PresentationModeState = { var PresentationModeState = {
UNKNOWN: 0, UNKNOWN: 0,

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { mozL10n, SCROLLBAR_PADDING } from 'pdfjs-web/ui_utils'; import { mozL10n, SCROLLBAR_PADDING } from './ui_utils';
/** /**
* @typedef {Object} SecondaryToolbarOptions * @typedef {Object} SecondaryToolbarOptions

View File

@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { domEvents } from 'pdfjs-web/dom_events'; import { domEvents } from './dom_events';
import { renderTextLayer } from 'pdfjs-web/pdfjs'; import { renderTextLayer } from './pdfjs';
var EXPAND_DIVS_TIMEOUT = 300; // ms var EXPAND_DIVS_TIMEOUT = 300; // ms

View File

@ -16,7 +16,7 @@
import { import {
animationStarted, DEFAULT_SCALE, DEFAULT_SCALE_VALUE, localized, MAX_SCALE, animationStarted, DEFAULT_SCALE, DEFAULT_SCALE_VALUE, localized, MAX_SCALE,
MIN_SCALE, mozL10n, noContextMenuHandler MIN_SCALE, mozL10n, noContextMenuHandler
} from 'pdfjs-web/ui_utils'; } from './ui_utils';
var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading'; var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading';
var SCALE_SELECT_CONTAINER_PADDING = 8; var SCALE_SELECT_CONTAINER_PADDING = 8;

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { PDFJS } from 'pdfjs-web/pdfjs'; import { PDFJS } from './pdfjs';
var CSS_UNITS = 96.0 / 72.0; var CSS_UNITS = 96.0 / 72.0;
var DEFAULT_SCALE_VALUE = 'auto'; var DEFAULT_SCALE_VALUE = 'auto';