Move all PDFJS.xxx settings into display/global.

This commit is contained in:
Yury Delendik 2016-03-28 14:49:22 -05:00
parent 6c9f418aae
commit 1d12aed5ca
17 changed files with 538 additions and 403 deletions

View file

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals PDFJS */
'use strict';
@ -35,6 +34,7 @@ var addLinkAttributes = displayDOMUtils.addLinkAttributes;
var getFilenameFromUrl = displayDOMUtils.getFilenameFromUrl;
var warn = sharedUtil.warn;
var CustomStyle = displayDOMUtils.CustomStyle;
var getDefaultSetting = displayDOMUtils.getDefaultSetting;
/**
* @typedef {Object} AnnotationElementParameters
@ -107,6 +107,7 @@ var AnnotationElement = (function AnnotationElementClosure() {
this.viewport = parameters.viewport;
this.linkService = parameters.linkService;
this.downloadManager = parameters.downloadManager;
this.imageResourcesPath = parameters.imageResourcesPath;
if (isRenderable) {
this.container = this._createContainer();
@ -363,7 +364,7 @@ var TextAnnotationElement = (function TextAnnotationElementClosure() {
var image = document.createElement('img');
image.style.height = this.container.style.height;
image.style.width = this.container.style.width;
image.src = PDFJS.imageResourcesPath + 'annotation-' +
image.src = this.imageResourcesPath + 'annotation-' +
this.data.name.toLowerCase() + '.svg';
image.alt = '[{{type}} Annotation]';
image.dataset.l10nId = 'text_annotation_type';
@ -838,6 +839,7 @@ var FileAttachmentAnnotationElement = (
* @property {Array} annotations
* @property {PDFPage} page
* @property {IPDFLinkService} linkService
* @property {string} imageResourcesPath
*/
/**
@ -868,7 +870,9 @@ var AnnotationLayer = (function AnnotationLayerClosure() {
page: parameters.page,
viewport: parameters.viewport,
linkService: parameters.linkService,
downloadManager: parameters.downloadManager
downloadManager: parameters.downloadManager,
imageResourcesPath: parameters.imageResourcesPath ||
getDefaultSetting('imageResourcesPath')
};
var element = annotationElementFactory.create(properties);
if (element.isRenderable) {
@ -899,7 +903,5 @@ var AnnotationLayer = (function AnnotationLayerClosure() {
};
})();
PDFJS.AnnotationLayer = AnnotationLayer;
exports.AnnotationLayer = AnnotationLayer;
}));