Remove a superfluous "s" in AnnotationsLayerBuilder
from files in web/
This patch makes the naming consistent with the `TextLayerBuilder`, and also the new `AnnotationLayer`, and should thus help reduce possible confusion when working with the code. Please note that the files were renamed using `git mv`, in order to preserve blame.
This commit is contained in:
parent
a8d760d97f
commit
3079dd937f
@ -47,7 +47,7 @@ PDFJS.getDocument(DEFAULT_URL).then(function (pdfDocument) {
|
||||
defaultViewport: pdfPage.getViewport(SCALE),
|
||||
// We can enable text/annotations layers, if needed
|
||||
textLayerFactory: new PDFJS.DefaultTextLayerFactory(),
|
||||
annotationsLayerFactory: new PDFJS.DefaultAnnotationsLayerFactory()
|
||||
annotationLayerFactory: new PDFJS.DefaultAnnotationLayerFactory()
|
||||
});
|
||||
// Associates the actual page with the view, and drawing it
|
||||
pdfPageView.setPdfPage(pdfPage);
|
||||
|
@ -17,7 +17,7 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @typedef {Object} AnnotationsLayerBuilderOptions
|
||||
* @typedef {Object} AnnotationLayerBuilderOptions
|
||||
* @property {HTMLDivElement} pageDiv
|
||||
* @property {PDFPage} pdfPage
|
||||
* @property {IPDFLinkService} linkService
|
||||
@ -26,12 +26,12 @@
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
var AnnotationsLayerBuilder = (function AnnotationsLayerBuilderClosure() {
|
||||
var AnnotationLayerBuilder = (function AnnotationLayerBuilderClosure() {
|
||||
/**
|
||||
* @param {AnnotationsLayerBuilderOptions} options
|
||||
* @constructs AnnotationsLayerBuilder
|
||||
* @param {AnnotationLayerBuilderOptions} options
|
||||
* @constructs AnnotationLayerBuilder
|
||||
*/
|
||||
function AnnotationsLayerBuilder(options) {
|
||||
function AnnotationLayerBuilder(options) {
|
||||
this.pageDiv = options.pageDiv;
|
||||
this.pdfPage = options.pdfPage;
|
||||
this.linkService = options.linkService;
|
||||
@ -39,14 +39,14 @@ var AnnotationsLayerBuilder = (function AnnotationsLayerBuilderClosure() {
|
||||
this.div = null;
|
||||
}
|
||||
|
||||
AnnotationsLayerBuilder.prototype =
|
||||
/** @lends AnnotationsLayerBuilder.prototype */ {
|
||||
AnnotationLayerBuilder.prototype =
|
||||
/** @lends AnnotationLayerBuilder.prototype */ {
|
||||
|
||||
/**
|
||||
* @param {PageViewport} viewport
|
||||
* @param {string} intent (default value is 'display')
|
||||
*/
|
||||
render: function AnnotationsLayerBuilder_render(viewport, intent) {
|
||||
render: function AnnotationLayerBuilder_render(viewport, intent) {
|
||||
var self = this;
|
||||
var parameters = {
|
||||
intent: (intent === undefined ? 'display' : intent),
|
||||
@ -79,7 +79,7 @@ var AnnotationsLayerBuilder = (function AnnotationsLayerBuilderClosure() {
|
||||
});
|
||||
},
|
||||
|
||||
hide: function AnnotationsLayerBuilder_hide() {
|
||||
hide: function AnnotationLayerBuilder_hide() {
|
||||
if (!this.div) {
|
||||
return;
|
||||
}
|
||||
@ -87,22 +87,22 @@ var AnnotationsLayerBuilder = (function AnnotationsLayerBuilderClosure() {
|
||||
}
|
||||
};
|
||||
|
||||
return AnnotationsLayerBuilder;
|
||||
return AnnotationLayerBuilder;
|
||||
})();
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @implements IPDFAnnotationsLayerFactory
|
||||
* @implements IPDFAnnotationLayerFactory
|
||||
*/
|
||||
function DefaultAnnotationsLayerFactory() {}
|
||||
DefaultAnnotationsLayerFactory.prototype = {
|
||||
function DefaultAnnotationLayerFactory() {}
|
||||
DefaultAnnotationLayerFactory.prototype = {
|
||||
/**
|
||||
* @param {HTMLDivElement} pageDiv
|
||||
* @param {PDFPage} pdfPage
|
||||
* @returns {AnnotationsLayerBuilder}
|
||||
* @returns {AnnotationLayerBuilder}
|
||||
*/
|
||||
createAnnotationsLayerBuilder: function (pageDiv, pdfPage) {
|
||||
return new AnnotationsLayerBuilder({
|
||||
createAnnotationLayerBuilder: function (pageDiv, pdfPage) {
|
||||
return new AnnotationLayerBuilder({
|
||||
pageDiv: pageDiv,
|
||||
pdfPage: pdfPage,
|
||||
linkService: new SimpleLinkService(),
|
@ -106,12 +106,12 @@ IPDFTextLayerFactory.prototype = {
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
function IPDFAnnotationsLayerFactory() {}
|
||||
IPDFAnnotationsLayerFactory.prototype = {
|
||||
function IPDFAnnotationLayerFactory() {}
|
||||
IPDFAnnotationLayerFactory.prototype = {
|
||||
/**
|
||||
* @param {HTMLDivElement} pageDiv
|
||||
* @param {PDFPage} pdfPage
|
||||
* @returns {AnnotationsLayerBuilder}
|
||||
* @returns {AnnotationLayerBuilder}
|
||||
*/
|
||||
createAnnotationsLayerBuilder: function (pageDiv, pdfPage) {}
|
||||
createAnnotationLayerBuilder: function (pageDiv, pdfPage) {}
|
||||
};
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals RenderingStates, PDFJS, DEFAULT_SCALE, CSS_UNITS, getOutputScale,
|
||||
TextLayerBuilder, AnnotationsLayerBuilder, Promise,
|
||||
TextLayerBuilder, AnnotationLayerBuilder, Promise,
|
||||
approximateFraction, roundToDivide */
|
||||
|
||||
'use strict';
|
||||
@ -28,7 +28,7 @@ var TEXT_LAYER_RENDER_DELAY = 200; // ms
|
||||
* @property {PageViewport} defaultViewport - The page viewport.
|
||||
* @property {PDFRenderingQueue} renderingQueue - The rendering queue object.
|
||||
* @property {IPDFTextLayerFactory} textLayerFactory
|
||||
* @property {IPDFAnnotationsLayerFactory} annotationsLayerFactory
|
||||
* @property {IPDFAnnotationLayerFactory} annotationLayerFactory
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -49,7 +49,7 @@ var PDFPageView = (function PDFPageViewClosure() {
|
||||
var defaultViewport = options.defaultViewport;
|
||||
var renderingQueue = options.renderingQueue;
|
||||
var textLayerFactory = options.textLayerFactory;
|
||||
var annotationsLayerFactory = options.annotationsLayerFactory;
|
||||
var annotationLayerFactory = options.annotationLayerFactory;
|
||||
|
||||
this.id = id;
|
||||
this.renderingId = 'page' + id;
|
||||
@ -62,7 +62,7 @@ var PDFPageView = (function PDFPageViewClosure() {
|
||||
|
||||
this.renderingQueue = renderingQueue;
|
||||
this.textLayerFactory = textLayerFactory;
|
||||
this.annotationsLayerFactory = annotationsLayerFactory;
|
||||
this.annotationLayerFactory = annotationLayerFactory;
|
||||
|
||||
this.renderingState = RenderingStates.INITIAL;
|
||||
this.resume = null;
|
||||
@ -502,10 +502,10 @@ var PDFPageView = (function PDFPageViewClosure() {
|
||||
}
|
||||
);
|
||||
|
||||
if (this.annotationsLayerFactory) {
|
||||
if (this.annotationLayerFactory) {
|
||||
if (!this.annotationLayer) {
|
||||
this.annotationLayer = this.annotationsLayerFactory.
|
||||
createAnnotationsLayerBuilder(div, this.pdfPage);
|
||||
this.annotationLayer = this.annotationLayerFactory.
|
||||
createAnnotationLayerBuilder(div, this.pdfPage);
|
||||
}
|
||||
this.annotationLayer.render(this.viewport, 'display');
|
||||
}
|
||||
|
@ -14,8 +14,8 @@
|
||||
*/
|
||||
/*jshint globalstrict: false */
|
||||
/* globals PDFJS, PDFViewer, PDFPageView, TextLayerBuilder, PDFLinkService,
|
||||
DefaultTextLayerFactory, AnnotationsLayerBuilder, PDFHistory,
|
||||
DefaultAnnotationsLayerFactory, getFileName, ProgressBar */
|
||||
DefaultTextLayerFactory, AnnotationLayerBuilder, PDFHistory,
|
||||
DefaultAnnotationLayerFactory, getFileName, ProgressBar */
|
||||
|
||||
// Initializing PDFJS global object (if still undefined)
|
||||
if (typeof PDFJS === 'undefined') {
|
||||
@ -35,8 +35,8 @@ if (typeof PDFJS === 'undefined') {
|
||||
PDFJS.PDFLinkService = PDFLinkService;
|
||||
PDFJS.TextLayerBuilder = TextLayerBuilder;
|
||||
PDFJS.DefaultTextLayerFactory = DefaultTextLayerFactory;
|
||||
PDFJS.AnnotationsLayerBuilder = AnnotationsLayerBuilder;
|
||||
PDFJS.DefaultAnnotationsLayerFactory = DefaultAnnotationsLayerFactory;
|
||||
PDFJS.AnnotationLayerBuilder = AnnotationLayerBuilder;
|
||||
PDFJS.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory;
|
||||
PDFJS.PDFHistory = PDFHistory;
|
||||
|
||||
PDFJS.getFileName = getFileName;
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
@import url(text_layer_builder.css);
|
||||
@import url(annotations_layer_builder.css);
|
||||
@import url(annotation_layer_builder.css);
|
||||
|
||||
.pdfViewer .canvasWrapper {
|
||||
overflow: hidden;
|
||||
|
@ -16,7 +16,7 @@
|
||||
SCROLLBAR_PADDING, VERTICAL_PADDING, MAX_AUTO_SCALE, CSS_UNITS,
|
||||
DEFAULT_SCALE, scrollIntoView, getVisibleElements, RenderingStates,
|
||||
PDFJS, Promise, TextLayerBuilder, PDFRenderingQueue,
|
||||
AnnotationsLayerBuilder, DEFAULT_SCALE_VALUE */
|
||||
AnnotationLayerBuilder, DEFAULT_SCALE_VALUE */
|
||||
|
||||
'use strict';
|
||||
|
||||
@ -33,7 +33,7 @@ var DEFAULT_CACHE_SIZE = 10;
|
||||
//#include pdf_rendering_queue.js
|
||||
//#include pdf_page_view.js
|
||||
//#include text_layer_builder.js
|
||||
//#include annotations_layer_builder.js
|
||||
//#include annotation_layer_builder.js
|
||||
|
||||
/**
|
||||
* @typedef {Object} PDFViewerOptions
|
||||
@ -294,7 +294,7 @@ var PDFViewer = (function pdfViewer() {
|
||||
defaultViewport: viewport.clone(),
|
||||
renderingQueue: this.renderingQueue,
|
||||
textLayerFactory: textLayerFactory,
|
||||
annotationsLayerFactory: this
|
||||
annotationLayerFactory: this
|
||||
});
|
||||
bindOnAfterAndBeforeDraw(pageView);
|
||||
this._pages.push(pageView);
|
||||
@ -751,10 +751,10 @@ var PDFViewer = (function pdfViewer() {
|
||||
/**
|
||||
* @param {HTMLDivElement} pageDiv
|
||||
* @param {PDFPage} pdfPage
|
||||
* @returns {AnnotationsLayerBuilder}
|
||||
* @returns {AnnotationLayerBuilder}
|
||||
*/
|
||||
createAnnotationsLayerBuilder: function (pageDiv, pdfPage) {
|
||||
return new AnnotationsLayerBuilder({
|
||||
createAnnotationLayerBuilder: function (pageDiv, pdfPage) {
|
||||
return new AnnotationLayerBuilder({
|
||||
pageDiv: pageDiv,
|
||||
pdfPage: pdfPage,
|
||||
linkService: this.linkService
|
||||
|
@ -81,7 +81,7 @@ See https://github.com/adobe-type-tools/cmap-resources
|
||||
<script src="pdf_rendering_queue.js"></script>
|
||||
<script src="pdf_page_view.js"></script>
|
||||
<script src="text_layer_builder.js"></script>
|
||||
<script src="annotations_layer_builder.js"></script>
|
||||
<script src="annotation_layer_builder.js"></script>
|
||||
<script src="pdf_viewer.js"></script>
|
||||
<script src="pdf_thumbnail_view.js"></script>
|
||||
<script src="pdf_thumbnail_viewer.js"></script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user