Constructor
new ActiveBagContent(idopt, ncw, nch)
ActiveBagContent constructor
Name | Type | Attributes | Description |
---|---|---|---|
id | string | <optional> | An optional text tag identifying this ActiveBagContent |
ncw | number | In grid-based distributions, number of columns. | |
nch | number | In grid-based distributions, number of rows. |
- Source
Members
animatedGifFile :string
Name of the img source when is an animated GIF
- string
backgroundContent :module:boxes/ActiveBoxContent.ActiveBoxContent
An optional ActiveBoxContent object with background settings.
border :boolean
Whether the cells must have a border or not
- boolean
cells :Array.<module:boxes/ActiveBoxContent.ActiveBoxContent>
The main Array of ActiveBoxContent
objects
defaultIdValue :number
The default value to be assigned at the 'id' field of children
- number
h :number
Optimal cell height
- number
id :string
The global identifier of this object: primary
, secondary
...
- string
ids :string
Used in special cases where all cells have empty content with only numeric identifiers
- string
image :string
The name of the image file used as a common image of this bag
- string
img :external:HTMLImageElement
The built image object
nch :number
Number of rows when cells are distributed in a grid
- number
ncw :number
Number of columns when cells are distributed in a grid
- number
shaper :module:shapers/Shaper.Shaper
The Shaper used to define the specific shape of each cell
style :module:boxes/BoxBase.BoxBase
The BoxBase used for this bag of cell contents
w :number
Optimal cell width
- number
Methods
addActiveBoxContent(ab)
Adds a new ActiveBoxContent
to this bag
Name | Type | Description |
---|---|---|
ab | module:boxes/ActiveBoxContent. | The ActiveBoxContent to add |
avoidAllIdsNull(maxId)
Cheks if the id
values of all ActiveBoxContent
objects are -1 and, if true,
sets new ids to them, with values between 0 and maxId
Name | Type | Description |
---|---|---|
maxId | number | The maximum value of identifiers |
getActiveBoxContent(i) → {module:boxes/ActiveBoxContent.ActiveBoxContent}
Gets the nth ActiveBoxContent
in cells
Name | Type | Description |
---|---|---|
i | number | The index of the content to be retrieved |
getActiveBoxContentWith(id, item) → {module:boxes/ActiveBoxContent.ActiveBoxContent}
Finds the ActiveBoxContent with specific id
and item
values
Name | Type | Description |
---|---|---|
id | number | |
item | number |
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
getBoxBase() → {module:boxes/BoxBase.BoxBase}
Retrieves the BoxBase
of this bag, creating a new one if it was null
getNumCells() → {number}
Gets the total number of cells of this bag
- Type:
- number
getShaper() → {module:shapers/Shaper.Shaper}
Retrieves the Shaper
of this bag, creating a new one if it was null
getTotalHeight() → {number}
Gets the estimated total height of this bag
- Type:
- number
getTotalWidth() → {number}
Gets the estimated total width of this content bag
- Type:
- number
isEmpty() → {boolean}
Checks if the bag is empty
- Type:
- boolean
prepareMedia(playStation)
Prepares the media content of all elements
Name | Type | Description |
---|---|---|
playStation | module:JClicPlayer. | The |
setAttributes(data, mediaBag) → {module:boxes/ActiveBagContent.ActiveBagContent}
Reads the properties of this ActiveBagContent from a data object
Name | Type | Description |
---|---|---|
data | object | The data object to be parsed |
mediaBag | module:bags/MediaBag. | The project's MediaBag |
setCellsAttribute(key, value)
Sets value
to the key
attribute of all cells
Name | Type | Description |
---|---|---|
key | string | The key where the value will be stored |
value | any | The supplied value. Can be of any type. |
setIds(ids)
Sets id
values to a all the ActiveBoxContent
elements of his bag.
Name | Type | Description |
---|---|---|
ids | Array.<number> | Array of numeric identifiers |
setImgContent(mb, sh, roundSizes)
Sets the content of the cells based on a image spliced by a shaper
Name | Type | Description |
---|---|---|
mb | module:bags/MediaBag. | The MediaBag used to retrieve the image |
sh | module:shapers/Shaper. | The Shaper used to splice the image |
roundSizes | boolean | When |
setProperties($xml, mediaBag)
Loads the object settings from a specific JQuery XML element
Name | Type | Description |
---|---|---|
$xml | external:jQuery | The XML element to parse |
mediaBag | module:bags/MediaBag. | The project's MediaBag |
- Source
setTextContent(txt, setNcw, setNch)
Sets the content of this bag based on an array of strings
Name | Type | Description |
---|---|---|
txt | Array.<string> | The array of strings to be used as content. |
setNcw | number | Number of columns |
setNch | number | Number of rows |