1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-21 23:58:07 +02:00

Merge pull request #8462 from yurydelendik/rm=umd

Removes last UMDs from the modules.
This commit is contained in:
Yury Delendik 2017-05-31 07:27:19 -05:00 committed by GitHub
commit 1e6f49b129
28 changed files with 71 additions and 224 deletions

View file

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AnnotationLayer } from './pdfjs';
import { AnnotationLayer } from 'pdfjs-lib';
import { mozL10n } from './ui_utils';
import { SimpleLinkService } from './pdf_link_service';

View file

@ -23,7 +23,7 @@ import {
build, createBlob, getDocument, getFilenameFromUrl, InvalidPDFException,
MissingPDFException, OPS, PDFJS, shadow, UnexpectedResponseException,
UNSUPPORTED_FEATURES, version,
} from './pdfjs';
} from 'pdfjs-lib';
import { CursorTool, PDFCursorTools } from './pdf_cursor_tools';
import { PDFRenderingQueue, RenderingStates } from './pdf_rendering_queue';
import { PDFSidebar, SidebarView } from './pdf_sidebar';

View file

@ -17,7 +17,7 @@
import { DefaultExternalServices, PDFViewerApplication } from './app';
import { BasePreferences } from './preferences';
import { DownloadManager } from './download_manager';
import { PDFJS } from './pdfjs';
import { PDFJS } from 'pdfjs-lib';
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('CHROME')) {
throw new Error('Module "pdfjs-web/chromecom" shall not be used outside ' +

View file

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { createObjectURL, createValidAbsoluteUrl, PDFJS } from './pdfjs';
import { createObjectURL, createValidAbsoluteUrl, PDFJS } from 'pdfjs-lib';
if (typeof PDFJSDev !== 'undefined' && !PDFJSDev.test('CHROME || GENERIC')) {
throw new Error('Module "pdfjs-web/download_manager" shall not be used ' +

View file

@ -15,7 +15,7 @@
import { CSS_UNITS } from './ui_utils';
import { PDFPrintServiceFactory } from './app';
import { shadow } from './pdfjs';
import { shadow } from 'pdfjs-lib';
// Creates a placeholder with div and canvas with right size for the page.
function composePage(pdfDocument, pageNumber, size, printContainer) {

View file

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { createObjectURL, PDFDataRangeTransport, shadow } from './pdfjs';
import { createObjectURL, PDFDataRangeTransport, shadow } from 'pdfjs-lib';
import { BasePreferences } from './preferences';
import { PDFViewerApplication } from './app';

View file

@ -14,7 +14,7 @@
*/
import { mozL10n } from './ui_utils';
import { PasswordResponses } from './pdfjs';
import { PasswordResponses } from 'pdfjs-lib';
/**
* @typedef {Object} PasswordPromptOptions

View file

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

View file

@ -14,7 +14,7 @@
*/
import { cloneObj, getPDFFileNameFromURL, mozL10n } from './ui_utils';
import { createPromiseCapability } from './pdfjs';
import { createPromiseCapability } from 'pdfjs-lib';
const DEFAULT_FIELD_CONTENT = '-';

View file

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

View file

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

View file

@ -20,7 +20,7 @@ import {
import {
createPromiseCapability, CustomStyle, PDFJS, RenderingCancelledException,
SVGGraphics
} from './pdfjs';
} from 'pdfjs-lib';
import { getGlobalEventBus } from './dom_events';
import { RenderingStates } from './pdf_rendering_queue';

View file

@ -15,7 +15,7 @@
import { CSS_UNITS, mozL10n } from './ui_utils';
import { PDFPrintServiceFactory, PDFViewerApplication } from './app';
import { PDFJS } from './pdfjs';
import { PDFJS } from 'pdfjs-lib';
let activeService = null;
let overlayManager = null;

View file

@ -13,7 +13,9 @@
* limitations under the License.
*/
import { createPromiseCapability, RenderingCancelledException } from './pdfjs';
import {
createPromiseCapability, RenderingCancelledException
} from 'pdfjs-lib';
import { getOutputScale, mozL10n } from './ui_utils';
import { RenderingStates } from './pdf_rendering_queue';

View file

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { createPromiseCapability, PDFJS } from './pdfjs';
import { createPromiseCapability, PDFJS } from 'pdfjs-lib';
import {
CSS_UNITS, DEFAULT_SCALE, DEFAULT_SCALE_VALUE, getVisibleElements,
MAX_AUTO_SCALE, RendererType, SCROLLBAR_PADDING, scrollIntoView,

View file

@ -16,38 +16,15 @@
'use strict';
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('PRODUCTION')) {
var pdfjsLib;
// The if below protected by __pdfjsdev_webpack__ check from webpack parsing.
if (typeof __pdfjsdev_webpack__ === 'undefined') {
if (typeof window !== 'undefined' && window['pdfjs-dist/build/pdf']) {
pdfjsLib = window['pdfjs-dist/build/pdf'];
} else if (typeof require === 'function') {
if (PDFJSDev.test('LIB')) {
pdfjsLib = require('../pdf.js');
} else {
pdfjsLib = require('../build/pdf.js');
}
} else {
throw new Error('Neither `require` nor `window` found');
}
var pdfjsLib;
// The if below protected by __pdfjsdev_webpack__ check from webpack parsing.
if (typeof __pdfjsdev_webpack__ === 'undefined') {
if (typeof window !== 'undefined' && window['pdfjs-dist/build/pdf']) {
pdfjsLib = window['pdfjs-dist/build/pdf'];
} else if (typeof require === 'function') {
pdfjsLib = require('../build/pdf.js');
} else {
throw new Error('Neither `require` nor `window` found');
}
module.exports = pdfjsLib;
} else {
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdfjs', ['exports', 'pdfjs/main_loader'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../src/main_loader.js'));
} else {
factory((root.pdfjsWebPDFJS = {}), root.pdfjsMainLoader);
}
}(this, function (exports, mainLoader) {
// Re-export all mainLoader members.
for (var i in mainLoader) {
if (Object.prototype.hasOwnProperty.call(mainLoader, i)) {
exports[i] = mainLoader[i];
}
}
}));
}
module.exports = pdfjsLib;

View file

@ -14,7 +14,7 @@
*/
import { getGlobalEventBus } from './dom_events';
import { renderTextLayer } from './pdfjs';
import { renderTextLayer } from 'pdfjs-lib';
var EXPAND_DIVS_TIMEOUT = 300; // ms

View file

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