Moves shared/global to display/global
This commit is contained in:
parent
e372f3608b
commit
a8e5912cb1
8 changed files with 36 additions and 37 deletions
|
@ -21,19 +21,19 @@
|
|||
define('pdfjs/display/api', ['exports', 'pdfjs/shared/util',
|
||||
'pdfjs/display/font_loader', 'pdfjs/display/canvas',
|
||||
'pdfjs/display/metadata', 'pdfjs/display/dom_utils',
|
||||
'pdfjs/shared/global', 'require'], factory);
|
||||
'pdfjs/display/global', 'require'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('../shared/util.js'), require('./font_loader.js'),
|
||||
require('./canvas.js'), require('./metadata.js'),
|
||||
require('./dom_utils.js'), require('../shared/global.js'));
|
||||
require('./dom_utils.js'), require('./global.js'));
|
||||
} else {
|
||||
factory((root.pdfjsDisplayAPI = {}), root.pdfjsSharedUtil,
|
||||
root.pdfjsDisplayFontLoader, root.pdfjsDisplayCanvas,
|
||||
root.pdfjsDisplayMetadata, root.pdfjsDisplayDOMUtils,
|
||||
root.pdfjsSharedGlobal);
|
||||
root.pdfjsDisplayGlobal);
|
||||
}
|
||||
}(this, function (exports, sharedUtil, displayFontLoader, displayCanvas,
|
||||
displayMetadata, displayDOMUtils, sharedGlobal, amdRequire) {
|
||||
displayMetadata, displayDOMUtils, displayGlobal, amdRequire) {
|
||||
|
||||
var InvalidPDFException = sharedUtil.InvalidPDFException;
|
||||
var MessageHandler = sharedUtil.MessageHandler;
|
||||
|
@ -59,8 +59,8 @@ var FontLoader = displayFontLoader.FontLoader;
|
|||
var CanvasGraphics = displayCanvas.CanvasGraphics;
|
||||
var createScratchCanvas = displayCanvas.createScratchCanvas;
|
||||
var Metadata = displayMetadata.Metadata;
|
||||
var PDFJS = sharedGlobal.PDFJS;
|
||||
var globalScope = sharedGlobal.globalScope;
|
||||
var PDFJS = displayGlobal.PDFJS;
|
||||
var globalScope = displayGlobal.globalScope;
|
||||
|
||||
var DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536
|
||||
|
||||
|
|
|
@ -18,21 +18,20 @@
|
|||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs/display/dom_utils', ['exports', 'pdfjs/shared/util',
|
||||
'pdfjs/shared/global'], factory);
|
||||
'pdfjs/display/global'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('../shared/util.js'),
|
||||
require('../shared/global.js'));
|
||||
factory(exports, require('../shared/util.js'), require('./global.js'));
|
||||
} else {
|
||||
factory((root.pdfjsDisplayDOMUtils = {}), root.pdfjsSharedUtil,
|
||||
root.pdfjsSharedGlobal);
|
||||
root.pdfjsDisplayGlobal);
|
||||
}
|
||||
}(this, function (exports, sharedUtil, sharedGlobal) {
|
||||
}(this, function (exports, sharedUtil, displayGlobal) {
|
||||
|
||||
var deprecated = sharedUtil.deprecated;
|
||||
var removeNullCharacters = sharedUtil.removeNullCharacters;
|
||||
var shadow = sharedUtil.shadow;
|
||||
var warn = sharedUtil.warn;
|
||||
var PDFJS = sharedGlobal.PDFJS;
|
||||
var PDFJS = displayGlobal.PDFJS;
|
||||
|
||||
/**
|
||||
* Optimised CSS custom property getter/setter.
|
||||
|
|
|
@ -19,15 +19,14 @@
|
|||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs/display/font_loader', ['exports', 'pdfjs/shared/util',
|
||||
'pdfjs/shared/global'], factory);
|
||||
'pdfjs/display/global'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('../shared/util.js'),
|
||||
require('../shared/global.js'));
|
||||
factory(exports, require('../shared/util.js'), require('./global.js'));
|
||||
} else {
|
||||
factory((root.pdfjsDisplayFontLoader = {}), root.pdfjsSharedUtil,
|
||||
root.pdfjsSharedGlobal);
|
||||
root.pdfjsDisplayGlobal);
|
||||
}
|
||||
}(this, function (exports, sharedUtil, sharedGlobal) {
|
||||
}(this, function (exports, sharedUtil, displayGlobal) {
|
||||
|
||||
var assert = sharedUtil.assert;
|
||||
var bytesToString = sharedUtil.bytesToString;
|
||||
|
@ -35,9 +34,9 @@ var string32 = sharedUtil.string32;
|
|||
var shadow = sharedUtil.shadow;
|
||||
var warn = sharedUtil.warn;
|
||||
|
||||
var PDFJS = sharedGlobal.PDFJS;
|
||||
var globalScope = sharedGlobal.globalScope;
|
||||
var isWorker = sharedGlobal.isWorker;
|
||||
var PDFJS = displayGlobal.PDFJS;
|
||||
var globalScope = displayGlobal.globalScope;
|
||||
var isWorker = displayGlobal.isWorker;
|
||||
|
||||
function FontLoader(docId) {
|
||||
this.docId = docId;
|
||||
|
|
85
src/display/global.js
Normal file
85
src/display/global.js
Normal file
|
@ -0,0 +1,85 @@
|
|||
/* Copyright 2015 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.
|
||||
*/
|
||||
/* globals pdfjsVersion, pdfjsBuild */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs/display/global', ['exports', 'pdfjs/shared/util'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('../shared/util.js'));
|
||||
} else {
|
||||
factory((root.pdfjsDisplayGlobal = {}), root.pdfjsSharedUtil);
|
||||
}
|
||||
}(this, function (exports, sharedUtil) {
|
||||
|
||||
var globalScope = sharedUtil.globalScope;
|
||||
|
||||
var isWorker = (typeof window === 'undefined');
|
||||
|
||||
// The global PDFJS object exposes the API
|
||||
// In production, it will be declared outside a global wrapper
|
||||
// In development, it will be declared here
|
||||
if (!globalScope.PDFJS) {
|
||||
globalScope.PDFJS = {};
|
||||
}
|
||||
var PDFJS = globalScope.PDFJS;
|
||||
|
||||
if (typeof pdfjsVersion !== 'undefined') {
|
||||
PDFJS.version = pdfjsVersion;
|
||||
}
|
||||
if (typeof pdfjsBuild !== 'undefined') {
|
||||
PDFJS.build = pdfjsBuild;
|
||||
}
|
||||
|
||||
PDFJS.pdfBug = false;
|
||||
|
||||
if (PDFJS.verbosity !== undefined) {
|
||||
sharedUtil.setVerbosityLevel(PDFJS.verbosity);
|
||||
}
|
||||
|
||||
PDFJS.VERBOSITY_LEVELS = sharedUtil.VERBOSITY_LEVELS;
|
||||
PDFJS.OPS = sharedUtil.OPS;
|
||||
PDFJS.UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES;
|
||||
PDFJS.isValidUrl = sharedUtil.isValidUrl;
|
||||
PDFJS.shadow = sharedUtil.shadow;
|
||||
PDFJS.createBlob = sharedUtil.createBlob;
|
||||
PDFJS.createObjectURL = function PDFJS_createObjectURL(data, contentType) {
|
||||
return sharedUtil.createObjectURL(data, contentType,
|
||||
PDFJS.disableCreateObjectURL);
|
||||
};
|
||||
Object.defineProperty(PDFJS, 'isLittleEndian', {
|
||||
configurable: true,
|
||||
get: function PDFJS_isLittleEndian() {
|
||||
var value = sharedUtil.isLittleEndian();
|
||||
return sharedUtil.shadow(PDFJS, 'isLittleEndian', value);
|
||||
}
|
||||
});
|
||||
PDFJS.removeNullCharacters = sharedUtil.removeNullCharacters;
|
||||
PDFJS.PasswordResponses = sharedUtil.PasswordResponses;
|
||||
PDFJS.PasswordException = sharedUtil.PasswordException;
|
||||
PDFJS.UnknownErrorException = sharedUtil.UnknownErrorException;
|
||||
PDFJS.InvalidPDFException = sharedUtil.InvalidPDFException;
|
||||
PDFJS.MissingPDFException = sharedUtil.MissingPDFException;
|
||||
PDFJS.UnexpectedResponseException = sharedUtil.UnexpectedResponseException;
|
||||
PDFJS.Util = sharedUtil.Util;
|
||||
PDFJS.PageViewport = sharedUtil.PageViewport;
|
||||
PDFJS.createPromiseCapability = sharedUtil.createPromiseCapability;
|
||||
|
||||
exports.globalScope = globalScope;
|
||||
exports.isWorker = isWorker;
|
||||
exports.PDFJS = globalScope.PDFJS;
|
||||
}));
|
|
@ -18,20 +18,20 @@
|
|||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs/display/text_layer', ['exports', 'pdfjs/shared/util',
|
||||
'pdfjs/display/dom_utils', 'pdfjs/shared/global'], factory);
|
||||
'pdfjs/display/dom_utils', 'pdfjs/display/global'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('../shared/util.js'), require('./dom_utils.js'),
|
||||
require('../shared/global.js'));
|
||||
require('./global.js'));
|
||||
} else {
|
||||
factory((root.pdfjsDisplayTextLayer = {}), root.pdfjsSharedUtil,
|
||||
root.pdfjsDisplayDOMUtils, root.pdfjsSharedGlobal);
|
||||
root.pdfjsDisplayDOMUtils, root.pdfjsDisplayGlobal);
|
||||
}
|
||||
}(this, function (exports, sharedUtil, displayDOMUtils, sharedGlobal) {
|
||||
}(this, function (exports, sharedUtil, displayDOMUtils, displayGlobal) {
|
||||
|
||||
var Util = sharedUtil.Util;
|
||||
var createPromiseCapability = sharedUtil.createPromiseCapability;
|
||||
var CustomStyle = displayDOMUtils.CustomStyle;
|
||||
var PDFJS = sharedGlobal.PDFJS;
|
||||
var PDFJS = displayGlobal.PDFJS;
|
||||
|
||||
/**
|
||||
* Text layer render parameters.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue