@ -29,6 +29,7 @@
@@ -29,6 +29,7 @@
var AnnotationBorderStyleType = sharedUtil . AnnotationBorderStyleType ;
var AnnotationType = sharedUtil . AnnotationType ;
var isInt = sharedUtil . isInt ;
var Util = sharedUtil . Util ;
var addLinkAttributes = displayDOMUtils . addLinkAttributes ;
var LinkTarget = displayDOMUtils . LinkTarget ;
@ -427,6 +428,8 @@ var WidgetAnnotationElement = (function WidgetAnnotationElementClosure() {
@@ -427,6 +428,8 @@ var WidgetAnnotationElement = (function WidgetAnnotationElementClosure() {
* /
var TextWidgetAnnotationElement = (
function TextWidgetAnnotationElementClosure ( ) {
var TEXT _ALIGNMENT = [ 'left' , 'center' , 'right' ] ;
function TextWidgetAnnotationElement ( parameters ) {
WidgetAnnotationElement . call ( this , parameters ) ;
}
@ -442,26 +445,33 @@ var TextWidgetAnnotationElement = (
@@ -442,26 +445,33 @@ var TextWidgetAnnotationElement = (
render : function TextWidgetAnnotationElement _render ( ) {
this . container . className = 'textWidgetAnnotation' ;
var element = null ;
if ( this . renderInteractiveForms ) {
var inpu t = document . createElement ( 'input' ) ;
inpu t. type = 'text' ;
inpu t. value = this . data . fieldValue ;
elemen t = document . createElement ( 'input' ) ;
elemen t. type = 'text' ;
elemen t. value = this . data . fieldValue ;
this . container . appendChild ( input ) ;
if ( isInt ( this . data . maxLen ) ) {
element . maxLength = this . data . maxLen ;
}
} else {
var content = document . createElement ( 'div' ) ;
content . textContent = this . data . fieldValue ;
var textAlignment = this . data . textAlignment ;
content . style . textAlign = [ 'left' , 'center' , 'right' ] [ textAlignment ] ;
content . style . verticalAlign = 'middle' ;
content . style . display = 'table-cell' ;
var font = ( this . data . fontRefName ?
this . page . commonObjs . getData ( this . data . fontRefName ) : null ) ;
this . _setTextStyle ( content , font ) ;
this . container . appendChild ( content ) ;
element = document . createElement ( 'div' ) ;
element . textContent = this . data . fieldValue ;
element . style . verticalAlign = 'middle' ;
element . style . display = 'table-cell' ;
var font = null ;
if ( this . data . fontRefName ) {
font = this . page . commonObjs . getData ( this . data . fontRefName ) ;
}
this . _setTextStyle ( element , font ) ;
}
if ( isInt ( this . data . textAlignment ) ) {
element . style . textAlign = TEXT _ALIGNMENT [ this . data . textAlignment ] ;
}
this . container . appendChild ( element ) ;
return this . container ;
} ,