new ImagesCache(dom_cache)
Creates cache object representing information related to images in a document
Parameters:
Name | Type | Description |
---|---|---|
dom_cache |
DOMCache | Reference to the DOMCache object |
- Source:
- scripts/cache_images.js, line 7
Properties:
Name | Type | Description |
---|---|---|
dom_cache |
DOMCache | Reference to the DOMCache object |
up_to_date |
Boolean | Boolean true if the cache has been creating using the current DOMElements, else false NOTE: This is a common property of all caches and is used when selectively build caches based on whether a rule needs the cache |
image_elements |
Array | List of image element objects in the document |
length |
Number | Number of image element objects in the list |
sort_property |
String | Image element object property the list of link objects is sorted by |
sort_ascending |
Boolean | true if list is sorted in ascending order, otherwise false |
rule_summary_result |
ResultRuleSummary | Rule results associated with this cache |
Methods
-
getImageElementByCacheId(cache_id) → {ImageElement|null}
-
Finds the the image element object with the matching cache id
Parameters:
Name Type Description cache_id
String Cache id of image element object - Deprecated:
- getImageElementByCacheId
- Source:
- scripts/cache_images.js, line 96
Returns:
Returns cache image element object if cache id is found, otherwise null- Type
- ImageElement | null
-
<static> addImageElement(image_element) → {Number}
-
Adds a image element to the list of image elements and generates a cache id for the object.
Parameters:
Name Type Description image_element
ImageElement image element object to add - Source:
- scripts/cache_images.js, line 58
Returns:
Returns the length of the list of image element objects- Type
- Number
-
<static> emptyCache()
-
Resests the ImagesCache object properties and empties all the lists and arrays
- Source:
- scripts/cache_images.js, line 129
-
<static> getItemByCacheId(cache_id) → {ImageElement|null}
-
Finds the the image element object with the matching cache id
Parameters:
Name Type Description cache_id
String Cache id of image element object - Source:
- scripts/cache_images.js, line 100
Returns:
Returns cache image element object if cache id is found, otherwise null- Type
- ImageElement | null
-
<static> traverseDOMElementsForImageElements(dom_element)
-
Traverses DOMElement objects in the tree to update the images cache
Parameters:
Name Type Description dom_element
DOMElement dom element object to check for inclusion in images cache - Source:
- scripts/cache_images.js, line 172
-
<static> updateCache()
-
Traverses the DOMElements to update the images cache NOTE: This function is only used when the specialized caches are build as rules need them. In this condition, if the rules dependent on the links cache are disabled, this cache would not be updated
- Source:
- scripts/cache_images.js, line 197
-
<static> updateCacheItems(dom_element)
-
Updates the images cache object by checking to see if a dom element should be added to the cache
Parameters:
Name Type Description dom_element
DOMElement dom element object to check for inclusion in images cache - Source:
- scripts/cache_images.js, line 145