mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Move all PDFJS.xxx settings into display/global.
This commit is contained in:
parent
6c9f418aae
commit
1d12aed5ca
17 changed files with 538 additions and 403 deletions
|
@ -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;
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue