|
|
@ -84,7 +84,7 @@ AnnotationElementFactory.prototype = |
|
|
|
return new StrikeOutAnnotationElement(parameters); |
|
|
|
return new StrikeOutAnnotationElement(parameters); |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
throw new Error('Unimplemented annotation type "' + subtype + '"'); |
|
|
|
return new AnnotationElement(parameters); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -94,15 +94,18 @@ AnnotationElementFactory.prototype = |
|
|
|
* @alias AnnotationElement |
|
|
|
* @alias AnnotationElement |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
var AnnotationElement = (function AnnotationElementClosure() { |
|
|
|
var AnnotationElement = (function AnnotationElementClosure() { |
|
|
|
function AnnotationElement(parameters) { |
|
|
|
function AnnotationElement(parameters, isRenderable) { |
|
|
|
|
|
|
|
this.isRenderable = isRenderable || false; |
|
|
|
this.data = parameters.data; |
|
|
|
this.data = parameters.data; |
|
|
|
this.layer = parameters.layer; |
|
|
|
this.layer = parameters.layer; |
|
|
|
this.page = parameters.page; |
|
|
|
this.page = parameters.page; |
|
|
|
this.viewport = parameters.viewport; |
|
|
|
this.viewport = parameters.viewport; |
|
|
|
this.linkService = parameters.linkService; |
|
|
|
this.linkService = parameters.linkService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isRenderable) { |
|
|
|
this.container = this._createContainer(); |
|
|
|
this.container = this._createContainer(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
AnnotationElement.prototype = /** @lends AnnotationElement.prototype */ { |
|
|
|
AnnotationElement.prototype = /** @lends AnnotationElement.prototype */ { |
|
|
|
/** |
|
|
|
/** |
|
|
@ -216,7 +219,7 @@ var AnnotationElement = (function AnnotationElementClosure() { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
var LinkAnnotationElement = (function LinkAnnotationElementClosure() { |
|
|
|
var LinkAnnotationElement = (function LinkAnnotationElementClosure() { |
|
|
|
function LinkAnnotationElement(parameters) { |
|
|
|
function LinkAnnotationElement(parameters) { |
|
|
|
AnnotationElement.call(this, parameters); |
|
|
|
AnnotationElement.call(this, parameters, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Util.inherit(LinkAnnotationElement, AnnotationElement, { |
|
|
|
Util.inherit(LinkAnnotationElement, AnnotationElement, { |
|
|
@ -298,7 +301,9 @@ var LinkAnnotationElement = (function LinkAnnotationElementClosure() { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
var TextAnnotationElement = (function TextAnnotationElementClosure() { |
|
|
|
var TextAnnotationElement = (function TextAnnotationElementClosure() { |
|
|
|
function TextAnnotationElement(parameters) { |
|
|
|
function TextAnnotationElement(parameters) { |
|
|
|
AnnotationElement.call(this, parameters); |
|
|
|
var isRenderable = !!(parameters.data.hasPopup || |
|
|
|
|
|
|
|
parameters.data.title || parameters.data.contents); |
|
|
|
|
|
|
|
AnnotationElement.call(this, parameters, isRenderable); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Util.inherit(TextAnnotationElement, AnnotationElement, { |
|
|
|
Util.inherit(TextAnnotationElement, AnnotationElement, { |
|
|
@ -352,7 +357,9 @@ var TextAnnotationElement = (function TextAnnotationElementClosure() { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
var WidgetAnnotationElement = (function WidgetAnnotationElementClosure() { |
|
|
|
var WidgetAnnotationElement = (function WidgetAnnotationElementClosure() { |
|
|
|
function WidgetAnnotationElement(parameters) { |
|
|
|
function WidgetAnnotationElement(parameters) { |
|
|
|
AnnotationElement.call(this, parameters); |
|
|
|
var isRenderable = !parameters.data.hasAppearance && |
|
|
|
|
|
|
|
!!parameters.data.fieldValue; |
|
|
|
|
|
|
|
AnnotationElement.call(this, parameters, isRenderable); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Util.inherit(WidgetAnnotationElement, AnnotationElement, { |
|
|
|
Util.inherit(WidgetAnnotationElement, AnnotationElement, { |
|
|
@ -419,7 +426,8 @@ var WidgetAnnotationElement = (function WidgetAnnotationElementClosure() { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
var PopupAnnotationElement = (function PopupAnnotationElementClosure() { |
|
|
|
var PopupAnnotationElement = (function PopupAnnotationElementClosure() { |
|
|
|
function PopupAnnotationElement(parameters) { |
|
|
|
function PopupAnnotationElement(parameters) { |
|
|
|
AnnotationElement.call(this, parameters); |
|
|
|
var isRenderable = !!(parameters.data.title || parameters.data.contents); |
|
|
|
|
|
|
|
AnnotationElement.call(this, parameters, isRenderable); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Util.inherit(PopupAnnotationElement, AnnotationElement, { |
|
|
|
Util.inherit(PopupAnnotationElement, AnnotationElement, { |
|
|
@ -609,7 +617,7 @@ var PopupElement = (function PopupElementClosure() { |
|
|
|
var HighlightAnnotationElement = ( |
|
|
|
var HighlightAnnotationElement = ( |
|
|
|
function HighlightAnnotationElementClosure() { |
|
|
|
function HighlightAnnotationElementClosure() { |
|
|
|
function HighlightAnnotationElement(parameters) { |
|
|
|
function HighlightAnnotationElement(parameters) { |
|
|
|
AnnotationElement.call(this, parameters); |
|
|
|
AnnotationElement.call(this, parameters, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Util.inherit(HighlightAnnotationElement, AnnotationElement, { |
|
|
|
Util.inherit(HighlightAnnotationElement, AnnotationElement, { |
|
|
@ -636,7 +644,7 @@ var HighlightAnnotationElement = ( |
|
|
|
var UnderlineAnnotationElement = ( |
|
|
|
var UnderlineAnnotationElement = ( |
|
|
|
function UnderlineAnnotationElementClosure() { |
|
|
|
function UnderlineAnnotationElementClosure() { |
|
|
|
function UnderlineAnnotationElement(parameters) { |
|
|
|
function UnderlineAnnotationElement(parameters) { |
|
|
|
AnnotationElement.call(this, parameters); |
|
|
|
AnnotationElement.call(this, parameters, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Util.inherit(UnderlineAnnotationElement, AnnotationElement, { |
|
|
|
Util.inherit(UnderlineAnnotationElement, AnnotationElement, { |
|
|
@ -662,7 +670,7 @@ var UnderlineAnnotationElement = ( |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
var SquigglyAnnotationElement = (function SquigglyAnnotationElementClosure() { |
|
|
|
var SquigglyAnnotationElement = (function SquigglyAnnotationElementClosure() { |
|
|
|
function SquigglyAnnotationElement(parameters) { |
|
|
|
function SquigglyAnnotationElement(parameters) { |
|
|
|
AnnotationElement.call(this, parameters); |
|
|
|
AnnotationElement.call(this, parameters, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Util.inherit(SquigglyAnnotationElement, AnnotationElement, { |
|
|
|
Util.inherit(SquigglyAnnotationElement, AnnotationElement, { |
|
|
@ -689,7 +697,7 @@ var SquigglyAnnotationElement = (function SquigglyAnnotationElementClosure() { |
|
|
|
var StrikeOutAnnotationElement = ( |
|
|
|
var StrikeOutAnnotationElement = ( |
|
|
|
function StrikeOutAnnotationElementClosure() { |
|
|
|
function StrikeOutAnnotationElementClosure() { |
|
|
|
function StrikeOutAnnotationElement(parameters) { |
|
|
|
function StrikeOutAnnotationElement(parameters) { |
|
|
|
AnnotationElement.call(this, parameters); |
|
|
|
AnnotationElement.call(this, parameters, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Util.inherit(StrikeOutAnnotationElement, AnnotationElement, { |
|
|
|
Util.inherit(StrikeOutAnnotationElement, AnnotationElement, { |
|
|
@ -736,7 +744,7 @@ var AnnotationLayer = (function AnnotationLayerClosure() { |
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0, ii = parameters.annotations.length; i < ii; i++) { |
|
|
|
for (var i = 0, ii = parameters.annotations.length; i < ii; i++) { |
|
|
|
var data = parameters.annotations[i]; |
|
|
|
var data = parameters.annotations[i]; |
|
|
|
if (!data || !data.hasHtml) { |
|
|
|
if (!data) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -748,8 +756,10 @@ var AnnotationLayer = (function AnnotationLayerClosure() { |
|
|
|
linkService: parameters.linkService |
|
|
|
linkService: parameters.linkService |
|
|
|
}; |
|
|
|
}; |
|
|
|
var element = annotationElementFactory.create(properties); |
|
|
|
var element = annotationElementFactory.create(properties); |
|
|
|
|
|
|
|
if (element.isRenderable) { |
|
|
|
parameters.div.appendChild(element.render()); |
|
|
|
parameters.div.appendChild(element.render()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|