Constructor
new ActiveBoxContent(idopt)
ActiveBoxContent constructor
Name | Type | Attributes | Description |
---|---|---|---|
id | string | <optional> | An optional identifier. |
- Source
Members
amp :module:media/ActiveMediaPlayer.ActiveMediaPlayer
The ActiveMediaPlayer
associated with this content. Updated at run-time.
animatedGifFile :string
When img
is an animated GIF file, this field should contain its file name
- string
avoidOverlapping :boolean
Whether to avoid overlapping of image and text inside the cell when both are present.
- boolean
border :boolean|null
The ActiveBox
can have or not a border despite the settings of BoxBase
.
The default value null
means not to take in consideration this setting.
- boolean |
null
dimension :module:AWT.Dimension
Optimal dimension of any ActiveBox
taking this content.
id :number
Numeric identifier used in activities to resolve relationships between cells
- number
image :string
The name of the image file to display on the ActiveBox
.
- string
img :external:HTMLImageElement
The realized image used by this box content.
imgAlign :module:boxes/ActiveBoxContent.AlignType
The horizontal and vertical alignment of the image inside the cell.
imgClip :module:AWT.Shape
An optional shape used to clip the image.
innerHtmlText :string
When not null, this content should be treated as an HTML element
- string
item :number
Numeric identifier used in activities to resolve relationships between cells
- number
mbe :module:bags/MediaBagElement.MediaBagElement
The module:bads/MediaBagElement.MediaBagElement
associated with this content, if any. Updated at run-time.
mediaContent :module:media/MediaContent.MediaContent
The media content associated with this object.
style :module:boxes/BoxBase.BoxBase
The BoxBase
attribute of this content. Can be null
, meaning ActiveBox
will
try to find a suitable style scanning down through its own BoxBase, their parent's and, finally,
the default values defined in BoxBase.prototype
.
text :string
The text to display on the ActiveBox
. It can have up to two paragraphs.
- string
txtAlign :module:boxes/ActiveBoxContent.AlignType
The horizontal and vertical alignment of the text inside the cell.
Valid values are: left
, middle
, right
, top
and bottom
.
(static) EMPTY_CONTENT :module:boxes/ActiveBoxContent.ActiveBoxContent
An empty ActiveBoxContent
Methods
checkHtmlText()
Checks if cell's text uses HTML, initializing the innerHtmlText
member as needed.
getAttributes() → {object}
Gets a object with the basic attributes needed to rebuild this instance excluding functions,
parent references, constants and also attributes retaining the default value.
The resulting object is commonly usued to serialize elements in JSON format.
- The resulting object, with minimal attrributes
- Type:
- object
getDescription() → {string}
Gets a string representing this content, useful for checking if two different contents are
equivalent.
- Type:
- string
isEmpty()
Checks if this is an empty content (text
and img
are null)
isEquivalent(abc, checkCase) → {boolean}
Checks if two contents are equivalent
Name | Type | Description |
---|---|---|
abc | module:boxes/ActiveBoxContent. | The content to compare with this. |
checkCase | boolean | When |
- Type:
- boolean
prepareMedia(playStation)
Prepares the media content
Name | Type | Description |
---|---|---|
playStation | module:JClicPlayer. | Usually a |
readAlign(str) → {module:boxes/ActiveBoxContent.ActiveBoxContent~alignType}
Decode expressions with combined values of horizontal and vertical alignments in the form:
"(left|middle|right),(top|middle|bottom)"
Name | Type | Description |
---|---|---|
str | string | The string to parse |
- Type:
- module:boxes/ActiveBoxContent.
ActiveBoxContent~alignType
realizeContent(mediaBag)
Reads and initializes the image associated to this content
Name | Type | Description |
---|---|---|
mediaBag | module:bags/MediaBag. | The media bag of the current project. |
setAttributes(data, mediaBag) → {module:boxes/ActiveBoxContent.ActiveBoxContent}
Reads the properties of this ActiveBoxContent from a data object
Name | Type | Description |
---|---|---|
data | object | | The data object to be parsed, or just the text content |
mediaBag | module:bags/MediaBag. | The media bag used to retrieve images and other media |
setImgContent(img, imgClip, animatedGifFileopt)
Sets a fragment of a main image as a graphic content of this cell.
Cells cannot have two graphic contents, so image
(the specific image of this cell) should
be cleared with this setting.
Name | Type | Attributes | Description |
---|---|---|---|
img | external:HTMLImageElement | The image data | |
imgClip | module:AWT. | A shape that clips the portion of image assigned to this content. | |
animatedGifFile | string | <optional> | When |
setProperties($xml, mediaBag)
Loads settings from a specific JQuery XML element
Name | Type | Description |
---|---|---|
$xml | external:jQuery | The XML element to be parsed |
mediaBag | module:bags/MediaBag. | The media bag used to retrieve images and other media |
setTextContent(tx)
Sets the text content of this ActiveBox
Name | Type | Description |
---|---|---|
tx | string |
toString() → {string}
Overwrites the original Object.toString
method, returning getDescription
instead
- Type:
- string