Constructor
new TextActivityDocument()
TextActivityDocument constructor
Members
lastBoxId :number
Index of the last ActiveBox
activated.
- number
numTargets :number
Number of targets
- number
p :object
The main document, represented as a collection of DOM objects
- object
style :object
Collection of named styles of the document
- object
tabSpc :number
Number of blank spaces between tabulators.
- number
targetType :string
Type of targets used in this activity. Possible values are: TT_FREE
, TT_CHAR
, TT_WORD
and TT_PARAGRAPH
.
- string
tmb :object
A bag of TargetMarker
objects
- object
(static) DEFAULT_DOC_STYLE
Default style
Methods
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
getFullStyle(name) → {object}
Gets a style
object filled with default attributes plus attributes present in the
requested style name.
Name | Type | Description |
---|---|---|
name | string | The requested style name |
- The result of combining
default
with the requested style
- Type:
- object
getRawText() → {string}
Gets the full text of this document in raw format
- The text of the document.
- Type:
- string
readDocAttributes($xml) → {object}
Reads sets of text attributes, sometimes in form of named styles
Name | Type | Description |
---|---|---|
$xml | external:jQuery | The XML element to parse |
- Type:
- object
setAttributes(data) → {module:activities/text/TextActivityDocument.TextActivityDocument}
Reads the properties of this TextActivityDocument from a data object
Name | Type | Description |
---|---|---|
data | object | The data object to be parsed, or just the text content |
setProperties($xml, mediaBag)
Loads the document settings from a specific JQuery XML element
Name | Type | Description |
---|---|---|
$xml | external:jQuery | The XML element to parse |
mediaBag | module:bags/MediaBag. | The media bag used to load images and media content |