Browse Source

Merge pull request #8378 from Snuffleupagus/es6-modules-src-shared

Convert the files in the `/src/shared` folder to ES6 modules
Yury Delendik 8 years ago committed by GitHub
parent
commit
206ad8d8b2
  1. 16
      src/shared/compatibility.js
  2. 150
      src/shared/util.js

16
src/shared/compatibility.js

@ -15,19 +15,7 @@
/* eslint-disable no-extend-native */ /* eslint-disable no-extend-native */
/* globals VBArray, PDFJS, global */ /* globals VBArray, PDFJS, global */
'use strict'; // Skip compatibility checks for the extensions and if we already ran
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/shared/compatibility', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsSharedCompatibility = {}));
}
}(this, function (exports) {
// Skip compatibility checks for the extensions and if we already run
// this module. // this module.
if ((typeof PDFJSDev === 'undefined' || if ((typeof PDFJSDev === 'undefined' ||
!PDFJSDev.test('FIREFOX || MOZCENTRAL || CHROME')) && !PDFJSDev.test('FIREFOX || MOZCENTRAL || CHROME')) &&
@ -1850,5 +1838,3 @@ PDFJS.compatibilityChecked = true;
})(); })();
} }
}));

150
src/shared/util.js

@ -14,18 +14,7 @@
*/ */
/* globals global, process, __pdfjsdev_webpack__ */ /* globals global, process, __pdfjsdev_webpack__ */
'use strict'; import './compatibility';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/shared/util', ['exports', 'pdfjs/shared/compatibility'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./compatibility.js'));
} else {
factory((root.pdfjsSharedUtil = {}), root.pdfjsSharedCompatibility);
}
}(this, function (exports, compatibility) {
var globalScope = (typeof window !== 'undefined') ? window : var globalScope = (typeof window !== 'undefined') ? window :
(typeof global !== 'undefined') ? global : (typeof global !== 'undefined') ? global :
@ -1363,71 +1352,72 @@ function loadJpegStream(id, imageUrl, objs) {
img.src = imageUrl; img.src = imageUrl;
} }
exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX; export {
exports.IDENTITY_MATRIX = IDENTITY_MATRIX; FONT_IDENTITY_MATRIX,
exports.OPS = OPS; IDENTITY_MATRIX,
exports.VERBOSITY_LEVELS = VERBOSITY_LEVELS; OPS,
exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; VERBOSITY_LEVELS,
exports.AnnotationBorderStyleType = AnnotationBorderStyleType; UNSUPPORTED_FEATURES,
exports.AnnotationFieldFlag = AnnotationFieldFlag; AnnotationBorderStyleType,
exports.AnnotationFlag = AnnotationFlag; AnnotationFieldFlag,
exports.AnnotationType = AnnotationType; AnnotationFlag,
exports.FontType = FontType; AnnotationType,
exports.ImageKind = ImageKind; FontType,
exports.CMapCompressionType = CMapCompressionType; ImageKind,
exports.InvalidPDFException = InvalidPDFException; CMapCompressionType,
exports.MessageHandler = MessageHandler; InvalidPDFException,
exports.MissingDataException = MissingDataException; MessageHandler,
exports.MissingPDFException = MissingPDFException; MissingDataException,
exports.NotImplementedException = NotImplementedException; MissingPDFException,
exports.PageViewport = PageViewport; NotImplementedException,
exports.PasswordException = PasswordException; PageViewport,
exports.PasswordResponses = PasswordResponses; PasswordException,
exports.StatTimer = StatTimer; PasswordResponses,
exports.StreamType = StreamType; StatTimer,
exports.TextRenderingMode = TextRenderingMode; StreamType,
exports.UnexpectedResponseException = UnexpectedResponseException; TextRenderingMode,
exports.UnknownErrorException = UnknownErrorException; UnexpectedResponseException,
exports.Util = Util; UnknownErrorException,
exports.XRefParseException = XRefParseException; Util,
exports.arrayByteLength = arrayByteLength; XRefParseException,
exports.arraysToBytes = arraysToBytes; arrayByteLength,
exports.assert = assert; arraysToBytes,
exports.bytesToString = bytesToString; assert,
exports.createBlob = createBlob; bytesToString,
exports.createPromiseCapability = createPromiseCapability; createBlob,
exports.createObjectURL = createObjectURL; createPromiseCapability,
exports.deprecated = deprecated; createObjectURL,
exports.error = error; deprecated,
exports.getLookupTableFactory = getLookupTableFactory; error,
exports.getVerbosityLevel = getVerbosityLevel; getLookupTableFactory,
exports.globalScope = globalScope; getVerbosityLevel,
exports.info = info; globalScope,
exports.isArray = isArray; info,
exports.isArrayBuffer = isArrayBuffer; isArray,
exports.isBool = isBool; isArrayBuffer,
exports.isEmptyObj = isEmptyObj; isBool,
exports.isInt = isInt; isEmptyObj,
exports.isNum = isNum; isInt,
exports.isString = isString; isNum,
exports.isSpace = isSpace; isString,
exports.isNodeJS = isNodeJS; isSpace,
exports.isSameOrigin = isSameOrigin; isNodeJS,
exports.createValidAbsoluteUrl = createValidAbsoluteUrl; isSameOrigin,
exports.isLittleEndian = isLittleEndian; createValidAbsoluteUrl,
exports.isEvalSupported = isEvalSupported; isLittleEndian,
exports.loadJpegStream = loadJpegStream; isEvalSupported,
exports.log2 = log2; loadJpegStream,
exports.readInt8 = readInt8; log2,
exports.readUint16 = readUint16; readInt8,
exports.readUint32 = readUint32; readUint16,
exports.removeNullCharacters = removeNullCharacters; readUint32,
exports.setVerbosityLevel = setVerbosityLevel; removeNullCharacters,
exports.shadow = shadow; setVerbosityLevel,
exports.string32 = string32; shadow,
exports.stringToBytes = stringToBytes; string32,
exports.stringToPDFString = stringToPDFString; stringToBytes,
exports.stringToUTF8String = stringToUTF8String; stringToPDFString,
exports.utf8StringToString = utf8StringToString; stringToUTF8String,
exports.warn = warn; utf8StringToString,
})); warn,
};

Loading…
Cancel
Save