35 changed files with 12773 additions and 12683 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
/** |
||||
* @licstart The following is the entire license notice for the |
||||
* Javascript code in this page |
||||
* |
||||
* Copyright 2017 Mozilla Foundation |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
* |
||||
* @licend The above is the entire license notice for the |
||||
* Javascript code in this page |
||||
*/ |
||||
'use strict'; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
var compatibilityParams = Object.create(null); |
||||
{ |
||||
var userAgent = typeof navigator !== 'undefined' && navigator.userAgent || ''; |
||||
var isIE = /Trident/.test(userAgent); |
||||
var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent); |
||||
var isIOSChrome = /CriOS/.test(userAgent); |
||||
var isSafari = /Safari\//.test(userAgent) && !/(Chrome\/|Android\s)/.test(userAgent); |
||||
(function checkOnBlobSupport() { |
||||
if (isIE || isIOSChrome) { |
||||
compatibilityParams.disableCreateObjectURL = true; |
||||
} |
||||
})(); |
||||
(function checkRangeRequests() { |
||||
if (isSafari || isIOS) { |
||||
compatibilityParams.disableRange = true; |
||||
compatibilityParams.disableStream = true; |
||||
} |
||||
})(); |
||||
} |
||||
var apiCompatibilityParams = Object.freeze(compatibilityParams); |
||||
exports.apiCompatibilityParams = apiCompatibilityParams; |
@ -1,102 +0,0 @@
@@ -1,102 +0,0 @@
|
||||
/** |
||||
* @licstart The following is the entire license notice for the |
||||
* Javascript code in this page |
||||
* |
||||
* Copyright 2017 Mozilla Foundation |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
* |
||||
* @licend The above is the entire license notice for the |
||||
* Javascript code in this page |
||||
*/ |
||||
'use strict'; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
exports.PDFJS = exports.globalScope = undefined; |
||||
|
||||
var _util = require('../shared/util'); |
||||
|
||||
var _dom_utils = require('./dom_utils'); |
||||
|
||||
var _api = require('./api'); |
||||
|
||||
var _annotation_layer = require('./annotation_layer'); |
||||
|
||||
var _global_scope = require('../shared/global_scope'); |
||||
|
||||
var _global_scope2 = _interopRequireDefault(_global_scope); |
||||
|
||||
var _worker_options = require('./worker_options'); |
||||
|
||||
var _metadata = require('./metadata'); |
||||
|
||||
var _text_layer = require('./text_layer'); |
||||
|
||||
var _svg = require('./svg'); |
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
||||
|
||||
if (!_global_scope2.default.PDFJS) { |
||||
_global_scope2.default.PDFJS = {}; |
||||
} |
||||
var PDFJS = _global_scope2.default.PDFJS; |
||||
PDFJS.pdfBug = false; |
||||
PDFJS.OPS = _util.OPS; |
||||
PDFJS.UNSUPPORTED_FEATURES = _util.UNSUPPORTED_FEATURES; |
||||
PDFJS.shadow = _util.shadow; |
||||
PDFJS.createBlob = _util.createBlob; |
||||
PDFJS.createObjectURL = function PDFJS_createObjectURL(data, contentType) { |
||||
return (0, _util.createObjectURL)(data, contentType, PDFJS.disableCreateObjectURL); |
||||
}; |
||||
Object.defineProperty(PDFJS, 'isLittleEndian', { |
||||
configurable: true, |
||||
get: function PDFJS_isLittleEndian() { |
||||
return (0, _util.shadow)(PDFJS, 'isLittleEndian', (0, _util.isLittleEndian)()); |
||||
} |
||||
}); |
||||
PDFJS.removeNullCharacters = _util.removeNullCharacters; |
||||
PDFJS.PasswordResponses = _util.PasswordResponses; |
||||
PDFJS.PasswordException = _util.PasswordException; |
||||
PDFJS.UnknownErrorException = _util.UnknownErrorException; |
||||
PDFJS.InvalidPDFException = _util.InvalidPDFException; |
||||
PDFJS.MissingPDFException = _util.MissingPDFException; |
||||
PDFJS.UnexpectedResponseException = _util.UnexpectedResponseException; |
||||
PDFJS.Util = _util.Util; |
||||
PDFJS.PageViewport = _util.PageViewport; |
||||
PDFJS.createPromiseCapability = _util.createPromiseCapability; |
||||
PDFJS.maxImageSize = PDFJS.maxImageSize === undefined ? -1 : PDFJS.maxImageSize; |
||||
PDFJS.cMapUrl = PDFJS.cMapUrl === undefined ? null : PDFJS.cMapUrl; |
||||
PDFJS.cMapPacked = PDFJS.cMapPacked === undefined ? false : PDFJS.cMapPacked; |
||||
PDFJS.disableFontFace = PDFJS.disableFontFace === undefined ? false : PDFJS.disableFontFace; |
||||
PDFJS.disableRange = PDFJS.disableRange === undefined ? false : PDFJS.disableRange; |
||||
PDFJS.disableStream = PDFJS.disableStream === undefined ? false : PDFJS.disableStream; |
||||
PDFJS.disableAutoFetch = PDFJS.disableAutoFetch === undefined ? false : PDFJS.disableAutoFetch; |
||||
PDFJS.pdfBug = PDFJS.pdfBug === undefined ? false : PDFJS.pdfBug; |
||||
PDFJS.disableCreateObjectURL = PDFJS.disableCreateObjectURL === undefined ? false : PDFJS.disableCreateObjectURL; |
||||
PDFJS.externalLinkTarget = PDFJS.externalLinkTarget === undefined ? _dom_utils.LinkTarget.NONE : PDFJS.externalLinkTarget; |
||||
PDFJS.externalLinkRel = PDFJS.externalLinkRel === undefined ? _dom_utils.DEFAULT_LINK_REL : PDFJS.externalLinkRel; |
||||
PDFJS.isEvalSupported = PDFJS.isEvalSupported === undefined ? true : PDFJS.isEvalSupported; |
||||
PDFJS.getDocument = _api.getDocument; |
||||
PDFJS.LoopbackPort = _api.LoopbackPort; |
||||
PDFJS.PDFDataRangeTransport = _api.PDFDataRangeTransport; |
||||
PDFJS.PDFWorker = _api.PDFWorker; |
||||
PDFJS.GlobalWorkerOptions = _worker_options.GlobalWorkerOptions; |
||||
PDFJS.getFilenameFromUrl = _dom_utils.getFilenameFromUrl; |
||||
PDFJS.AnnotationLayer = _annotation_layer.AnnotationLayer; |
||||
PDFJS.renderTextLayer = _text_layer.renderTextLayer; |
||||
PDFJS.Metadata = _metadata.Metadata; |
||||
PDFJS.SVGGraphics = _svg.SVGGraphics; |
||||
exports.globalScope = _global_scope2.default; |
||||
exports.PDFJS = PDFJS; |
@ -0,0 +1,231 @@
@@ -0,0 +1,231 @@
|
||||
/** |
||||
* @licstart The following is the entire license notice for the |
||||
* Javascript code in this page |
||||
* |
||||
* Copyright 2017 Mozilla Foundation |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
* |
||||
* @licend The above is the entire license notice for the |
||||
* Javascript code in this page |
||||
*/ |
||||
'use strict'; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
exports.OptionKind = exports.AppOptions = undefined; |
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
||||
|
||||
var _pdf = require('../pdf'); |
||||
|
||||
var _viewer_compatibility = require('./viewer_compatibility'); |
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
||||
|
||||
var OptionKind = { |
||||
VIEWER: 'viewer', |
||||
API: 'api', |
||||
WORKER: 'worker' |
||||
}; |
||||
var defaultOptions = { |
||||
defaultUrl: { |
||||
value: 'compressed.tracemonkey-pldi-09.pdf', |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
defaultZoomValue: { |
||||
value: '', |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
disableFullscreen: { |
||||
value: _viewer_compatibility.viewerCompatibilityParams.disableFullscreen || false, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
disableHistory: { |
||||
value: false, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
disablePageLabels: { |
||||
value: false, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
disablePageMode: { |
||||
value: false, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
enablePrintAutoRotate: { |
||||
value: false, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
enableWebGL: { |
||||
value: false, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
externalLinkRel: { |
||||
value: 'noopener noreferrer nofollow', |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
externalLinkTarget: { |
||||
value: 0, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
imageResourcesPath: { |
||||
value: './images/', |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
locale: { |
||||
value: typeof navigator !== 'undefined' ? navigator.language : 'en-US', |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
maxCanvasPixels: { |
||||
value: _viewer_compatibility.viewerCompatibilityParams.maxCanvasPixels || 16777216, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
pdfBugEnabled: { |
||||
value: false, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
renderer: { |
||||
value: 'canvas', |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
renderInteractiveForms: { |
||||
value: false, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
showPreviousViewOnLoad: { |
||||
value: true, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
sidebarViewOnLoad: { |
||||
value: 0, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
textLayerMode: { |
||||
value: 1, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
useOnlyCssZoom: { |
||||
value: false, |
||||
kind: OptionKind.VIEWER |
||||
}, |
||||
cMapPacked: { |
||||
value: true, |
||||
kind: OptionKind.API |
||||
}, |
||||
cMapUrl: { |
||||
value: '../web/cmaps/', |
||||
kind: OptionKind.API |
||||
}, |
||||
disableAutoFetch: { |
||||
value: false, |
||||
kind: OptionKind.API |
||||
}, |
||||
disableCreateObjectURL: { |
||||
value: _pdf.apiCompatibilityParams.disableCreateObjectURL || false, |
||||
kind: OptionKind.API |
||||
}, |
||||
disableFontFace: { |
||||
value: false, |
||||
kind: OptionKind.API |
||||
}, |
||||
disableRange: { |
||||
value: _pdf.apiCompatibilityParams.disableRange || false, |
||||
kind: OptionKind.API |
||||
}, |
||||
disableStream: { |
||||
value: _pdf.apiCompatibilityParams.disableStream || false, |
||||
kind: OptionKind.API |
||||
}, |
||||
isEvalSupported: { |
||||
value: true, |
||||
kind: OptionKind.API |
||||
}, |
||||
maxImageSize: { |
||||
value: -1, |
||||
kind: OptionKind.API |
||||
}, |
||||
pdfBug: { |
||||
value: false, |
||||
kind: OptionKind.API |
||||
}, |
||||
postMessageTransfers: { |
||||
value: true, |
||||
kind: OptionKind.API |
||||
}, |
||||
verbosity: { |
||||
value: 1, |
||||
kind: OptionKind.API |
||||
}, |
||||
workerPort: { |
||||
value: null, |
||||
kind: OptionKind.WORKER |
||||
}, |
||||
workerSrc: { |
||||
value: '../build/pdf.worker.js', |
||||
kind: OptionKind.WORKER |
||||
} |
||||
}; |
||||
var userOptions = Object.create(null); |
||||
|
||||
var AppOptions = function () { |
||||
function AppOptions() { |
||||
_classCallCheck(this, AppOptions); |
||||
|
||||
throw new Error('Cannot initialize AppOptions.'); |
||||
} |
||||
|
||||
_createClass(AppOptions, null, [{ |
||||
key: 'get', |
||||
value: function get(name) { |
||||
var defaultOption = defaultOptions[name], |
||||
userOption = userOptions[name]; |
||||
if (userOption !== undefined) { |
||||
return userOption; |
||||
} |
||||
return defaultOption !== undefined ? defaultOption.value : undefined; |
||||
} |
||||
}, { |
||||
key: 'getAll', |
||||
value: function getAll() { |
||||
var kind = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; |
||||
|
||||
var options = Object.create(null); |
||||
for (var name in defaultOptions) { |
||||
var defaultOption = defaultOptions[name], |
||||
userOption = userOptions[name]; |
||||
if (kind && defaultOption.kind !== kind) { |
||||
continue; |
||||
} |
||||
options[name] = userOption !== undefined ? userOption : defaultOption.value; |
||||
} |
||||
return options; |
||||
} |
||||
}, { |
||||
key: 'set', |
||||
value: function set(name, value) { |
||||
userOptions[name] = value; |
||||
} |
||||
}, { |
||||
key: 'remove', |
||||
value: function remove(name) { |
||||
delete userOptions[name]; |
||||
} |
||||
}]); |
||||
|
||||
return AppOptions; |
||||
}(); |
||||
|
||||
exports.AppOptions = AppOptions; |
||||
exports.OptionKind = OptionKind; |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue