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),
|
defaultViewport: pdfPage.getViewport(SCALE),
|
||||||
// We can enable text/annotations layers, if needed
|
// We can enable text/annotations layers, if needed
|
||||||
textLayerFactory: new PDFJS.DefaultTextLayerFactory(),
|
textLayerFactory: new PDFJS.DefaultTextLayerFactory(),
|
||||||
annotationsLayerFactory: new PDFJS.DefaultAnnotationsLayerFactory()
|
annotationLayerFactory: new PDFJS.DefaultAnnotationLayerFactory()
|
||||||
});
|
});
|
||||||
// Associates the actual page with the view, and drawing it
|
// Associates the actual page with the view, and drawing it
|
||||||
pdfPageView.setPdfPage(pdfPage);
|
pdfPageView.setPdfPage(pdfPage);
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} AnnotationsLayerBuilderOptions
|
* @typedef {Object} AnnotationLayerBuilderOptions
|
||||||
* @property {HTMLDivElement} pageDiv
|
* @property {HTMLDivElement} pageDiv
|
||||||
* @property {PDFPage} pdfPage
|
* @property {PDFPage} pdfPage
|
||||||
* @property {IPDFLinkService} linkService
|
* @property {IPDFLinkService} linkService
|
||||||
@ -26,12 +26,12 @@
|
|||||||
/**
|
/**
|
||||||
* @class
|
* @class
|
||||||
*/
|
*/
|
||||||
var AnnotationsLayerBuilder = (function AnnotationsLayerBuilderClosure() {
|
var AnnotationLayerBuilder = (function AnnotationLayerBuilderClosure() {
|
||||||
/**
|
/**
|
||||||
* @param {AnnotationsLayerBuilderOptions} options
|
* @param {AnnotationLayerBuilderOptions} options
|
||||||
* @constructs AnnotationsLayerBuilder
|
* @constructs AnnotationLayerBuilder
|
||||||
*/
|
*/
|
||||||
function AnnotationsLayerBuilder(options) {
|
function AnnotationLayerBuilder(options) {
|
||||||
this.pageDiv = options.pageDiv;
|
this.pageDiv = options.pageDiv;
|
||||||
this.pdfPage = options.pdfPage;
|
this.pdfPage = options.pdfPage;
|
||||||
this.linkService = options.linkService;
|
this.linkService = options.linkService;
|
||||||
@ -39,14 +39,14 @@ var AnnotationsLayerBuilder = (function AnnotationsLayerBuilderClosure() {
|
|||||||
this.div = null;
|
this.div = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
AnnotationsLayerBuilder.prototype =
|
AnnotationLayerBuilder.prototype =
|
||||||
/** @lends AnnotationsLayerBuilder.prototype */ {
|
/** @lends AnnotationLayerBuilder.prototype */ {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {PageViewport} viewport
|
* @param {PageViewport} viewport
|
||||||
* @param {string} intent (default value is 'display')
|
* @param {string} intent (default value is 'display')
|
||||||
*/
|
*/
|
||||||
render: function AnnotationsLayerBuilder_render(viewport, intent) {
|
render: function AnnotationLayerBuilder_render(viewport, intent) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var parameters = {
|
var parameters = {
|
||||||
intent: (intent === undefined ? 'display' : intent),
|
intent: (intent === undefined ? 'display' : intent),
|
||||||
@ -79,7 +79,7 @@ var AnnotationsLayerBuilder = (function AnnotationsLayerBuilderClosure() {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
hide: function AnnotationsLayerBuilder_hide() {
|
hide: function AnnotationLayerBuilder_hide() {
|
||||||
if (!this.div) {
|
if (!this.div) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -87,22 +87,22 @@ var AnnotationsLayerBuilder = (function AnnotationsLayerBuilderClosure() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return AnnotationsLayerBuilder;
|
return AnnotationLayerBuilder;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @implements IPDFAnnotationsLayerFactory
|
* @implements IPDFAnnotationLayerFactory
|
||||||
*/
|
*/
|
||||||
function DefaultAnnotationsLayerFactory() {}
|
function DefaultAnnotationLayerFactory() {}
|
||||||
DefaultAnnotationsLayerFactory.prototype = {
|
DefaultAnnotationLayerFactory.prototype = {
|
||||||
/**
|
/**
|
||||||
* @param {HTMLDivElement} pageDiv
|
* @param {HTMLDivElement} pageDiv
|
||||||
* @param {PDFPage} pdfPage
|
* @param {PDFPage} pdfPage
|
||||||
* @returns {AnnotationsLayerBuilder}
|
* @returns {AnnotationLayerBuilder}
|
||||||
*/
|
*/
|
||||||
createAnnotationsLayerBuilder: function (pageDiv, pdfPage) {
|
createAnnotationLayerBuilder: function (pageDiv, pdfPage) {
|
||||||
return new AnnotationsLayerBuilder({
|
return new AnnotationLayerBuilder({
|
||||||
pageDiv: pageDiv,
|
pageDiv: pageDiv,
|
||||||
pdfPage: pdfPage,
|
pdfPage: pdfPage,
|
||||||
linkService: new SimpleLinkService(),
|
linkService: new SimpleLinkService(),
|
@ -106,12 +106,12 @@ IPDFTextLayerFactory.prototype = {
|
|||||||
/**
|
/**
|
||||||
* @interface
|
* @interface
|
||||||
*/
|
*/
|
||||||
function IPDFAnnotationsLayerFactory() {}
|
function IPDFAnnotationLayerFactory() {}
|
||||||
IPDFAnnotationsLayerFactory.prototype = {
|
IPDFAnnotationLayerFactory.prototype = {
|
||||||
/**
|
/**
|
||||||
* @param {HTMLDivElement} pageDiv
|
* @param {HTMLDivElement} pageDiv
|
||||||
* @param {PDFPage} pdfPage
|
* @param {PDFPage} pdfPage
|
||||||
* @returns {AnnotationsLayerBuilder}
|
* @returns {AnnotationLayerBuilder}
|
||||||
*/
|
*/
|
||||||
createAnnotationsLayerBuilder: function (pageDiv, pdfPage) {}
|
createAnnotationLayerBuilder: function (pageDiv, pdfPage) {}
|
||||||
};
|
};
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
/* globals RenderingStates, PDFJS, DEFAULT_SCALE, CSS_UNITS, getOutputScale,
|
/* globals RenderingStates, PDFJS, DEFAULT_SCALE, CSS_UNITS, getOutputScale,
|
||||||
TextLayerBuilder, AnnotationsLayerBuilder, Promise,
|
TextLayerBuilder, AnnotationLayerBuilder, Promise,
|
||||||
approximateFraction, roundToDivide */
|
approximateFraction, roundToDivide */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
@ -28,7 +28,7 @@ var TEXT_LAYER_RENDER_DELAY = 200; // ms
|
|||||||
* @property {PageViewport} defaultViewport - The page viewport.
|
* @property {PageViewport} defaultViewport - The page viewport.
|
||||||
* @property {PDFRenderingQueue} renderingQueue - The rendering queue object.
|
* @property {PDFRenderingQueue} renderingQueue - The rendering queue object.
|
||||||
* @property {IPDFTextLayerFactory} textLayerFactory
|
* @property {IPDFTextLayerFactory} textLayerFactory
|
||||||
* @property {IPDFAnnotationsLayerFactory} annotationsLayerFactory
|
* @property {IPDFAnnotationLayerFactory} annotationLayerFactory
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,7 +49,7 @@ var PDFPageView = (function PDFPageViewClosure() {
|
|||||||
var defaultViewport = options.defaultViewport;
|
var defaultViewport = options.defaultViewport;
|
||||||
var renderingQueue = options.renderingQueue;
|
var renderingQueue = options.renderingQueue;
|
||||||
var textLayerFactory = options.textLayerFactory;
|
var textLayerFactory = options.textLayerFactory;
|
||||||
var annotationsLayerFactory = options.annotationsLayerFactory;
|
var annotationLayerFactory = options.annotationLayerFactory;
|
||||||
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.renderingId = 'page' + id;
|
this.renderingId = 'page' + id;
|
||||||
@ -62,7 +62,7 @@ var PDFPageView = (function PDFPageViewClosure() {
|
|||||||
|
|
||||||
this.renderingQueue = renderingQueue;
|
this.renderingQueue = renderingQueue;
|
||||||
this.textLayerFactory = textLayerFactory;
|
this.textLayerFactory = textLayerFactory;
|
||||||
this.annotationsLayerFactory = annotationsLayerFactory;
|
this.annotationLayerFactory = annotationLayerFactory;
|
||||||
|
|
||||||
this.renderingState = RenderingStates.INITIAL;
|
this.renderingState = RenderingStates.INITIAL;
|
||||||
this.resume = null;
|
this.resume = null;
|
||||||
@ -502,10 +502,10 @@ var PDFPageView = (function PDFPageViewClosure() {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (this.annotationsLayerFactory) {
|
if (this.annotationLayerFactory) {
|
||||||
if (!this.annotationLayer) {
|
if (!this.annotationLayer) {
|
||||||
this.annotationLayer = this.annotationsLayerFactory.
|
this.annotationLayer = this.annotationLayerFactory.
|
||||||
createAnnotationsLayerBuilder(div, this.pdfPage);
|
createAnnotationLayerBuilder(div, this.pdfPage);
|
||||||
}
|
}
|
||||||
this.annotationLayer.render(this.viewport, 'display');
|
this.annotationLayer.render(this.viewport, 'display');
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
*/
|
*/
|
||||||
/*jshint globalstrict: false */
|
/*jshint globalstrict: false */
|
||||||
/* globals PDFJS, PDFViewer, PDFPageView, TextLayerBuilder, PDFLinkService,
|
/* globals PDFJS, PDFViewer, PDFPageView, TextLayerBuilder, PDFLinkService,
|
||||||
DefaultTextLayerFactory, AnnotationsLayerBuilder, PDFHistory,
|
DefaultTextLayerFactory, AnnotationLayerBuilder, PDFHistory,
|
||||||
DefaultAnnotationsLayerFactory, getFileName, ProgressBar */
|
DefaultAnnotationLayerFactory, getFileName, ProgressBar */
|
||||||
|
|
||||||
// Initializing PDFJS global object (if still undefined)
|
// Initializing PDFJS global object (if still undefined)
|
||||||
if (typeof PDFJS === 'undefined') {
|
if (typeof PDFJS === 'undefined') {
|
||||||
@ -35,8 +35,8 @@ if (typeof PDFJS === 'undefined') {
|
|||||||
PDFJS.PDFLinkService = PDFLinkService;
|
PDFJS.PDFLinkService = PDFLinkService;
|
||||||
PDFJS.TextLayerBuilder = TextLayerBuilder;
|
PDFJS.TextLayerBuilder = TextLayerBuilder;
|
||||||
PDFJS.DefaultTextLayerFactory = DefaultTextLayerFactory;
|
PDFJS.DefaultTextLayerFactory = DefaultTextLayerFactory;
|
||||||
PDFJS.AnnotationsLayerBuilder = AnnotationsLayerBuilder;
|
PDFJS.AnnotationLayerBuilder = AnnotationLayerBuilder;
|
||||||
PDFJS.DefaultAnnotationsLayerFactory = DefaultAnnotationsLayerFactory;
|
PDFJS.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory;
|
||||||
PDFJS.PDFHistory = PDFHistory;
|
PDFJS.PDFHistory = PDFHistory;
|
||||||
|
|
||||||
PDFJS.getFileName = getFileName;
|
PDFJS.getFileName = getFileName;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
@import url(text_layer_builder.css);
|
@import url(text_layer_builder.css);
|
||||||
@import url(annotations_layer_builder.css);
|
@import url(annotation_layer_builder.css);
|
||||||
|
|
||||||
.pdfViewer .canvasWrapper {
|
.pdfViewer .canvasWrapper {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
SCROLLBAR_PADDING, VERTICAL_PADDING, MAX_AUTO_SCALE, CSS_UNITS,
|
SCROLLBAR_PADDING, VERTICAL_PADDING, MAX_AUTO_SCALE, CSS_UNITS,
|
||||||
DEFAULT_SCALE, scrollIntoView, getVisibleElements, RenderingStates,
|
DEFAULT_SCALE, scrollIntoView, getVisibleElements, RenderingStates,
|
||||||
PDFJS, Promise, TextLayerBuilder, PDFRenderingQueue,
|
PDFJS, Promise, TextLayerBuilder, PDFRenderingQueue,
|
||||||
AnnotationsLayerBuilder, DEFAULT_SCALE_VALUE */
|
AnnotationLayerBuilder, DEFAULT_SCALE_VALUE */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ var DEFAULT_CACHE_SIZE = 10;
|
|||||||
//#include pdf_rendering_queue.js
|
//#include pdf_rendering_queue.js
|
||||||
//#include pdf_page_view.js
|
//#include pdf_page_view.js
|
||||||
//#include text_layer_builder.js
|
//#include text_layer_builder.js
|
||||||
//#include annotations_layer_builder.js
|
//#include annotation_layer_builder.js
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} PDFViewerOptions
|
* @typedef {Object} PDFViewerOptions
|
||||||
@ -294,7 +294,7 @@ var PDFViewer = (function pdfViewer() {
|
|||||||
defaultViewport: viewport.clone(),
|
defaultViewport: viewport.clone(),
|
||||||
renderingQueue: this.renderingQueue,
|
renderingQueue: this.renderingQueue,
|
||||||
textLayerFactory: textLayerFactory,
|
textLayerFactory: textLayerFactory,
|
||||||
annotationsLayerFactory: this
|
annotationLayerFactory: this
|
||||||
});
|
});
|
||||||
bindOnAfterAndBeforeDraw(pageView);
|
bindOnAfterAndBeforeDraw(pageView);
|
||||||
this._pages.push(pageView);
|
this._pages.push(pageView);
|
||||||
@ -751,10 +751,10 @@ var PDFViewer = (function pdfViewer() {
|
|||||||
/**
|
/**
|
||||||
* @param {HTMLDivElement} pageDiv
|
* @param {HTMLDivElement} pageDiv
|
||||||
* @param {PDFPage} pdfPage
|
* @param {PDFPage} pdfPage
|
||||||
* @returns {AnnotationsLayerBuilder}
|
* @returns {AnnotationLayerBuilder}
|
||||||
*/
|
*/
|
||||||
createAnnotationsLayerBuilder: function (pageDiv, pdfPage) {
|
createAnnotationLayerBuilder: function (pageDiv, pdfPage) {
|
||||||
return new AnnotationsLayerBuilder({
|
return new AnnotationLayerBuilder({
|
||||||
pageDiv: pageDiv,
|
pageDiv: pageDiv,
|
||||||
pdfPage: pdfPage,
|
pdfPage: pdfPage,
|
||||||
linkService: this.linkService
|
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_rendering_queue.js"></script>
|
||||||
<script src="pdf_page_view.js"></script>
|
<script src="pdf_page_view.js"></script>
|
||||||
<script src="text_layer_builder.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_viewer.js"></script>
|
||||||
<script src="pdf_thumbnail_view.js"></script>
|
<script src="pdf_thumbnail_view.js"></script>
|
||||||
<script src="pdf_thumbnail_viewer.js"></script>
|
<script src="pdf_thumbnail_viewer.js"></script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user