Constructor: AbbreviationsCache

OpenAjax.a11y.cache.AbbreviationsCache

new AbbreviationsCache(dom_cache)

Constructor for abbreviations cache object which contains a list of abbreviation items representing the abbreviations defined in a document. The item also contains a list of all the dom element objects that share the same abbreviation

Parameters:
Name Type Description
dom_cache DOMCache Reference to the DOMCache object
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
sort_property String Property of abbreviation item that the list is sorted on
sort_ascending Boolean true if list is sorted by ascending values, otherwsie false
abbreviation_items Array List of abbreviation items
length Number Number of abbreviation items in list
rule_summary_result ResultRuleSummary Rule results associated with this cache
Source:
  • scripts/cache_abbreviations.js, line 8

Methods

getAbbreviationItemByCacheId(cache_id) → {AbbreviationItem}

Returns the abbreviation item with the cache id

Parameters:
Name Type Description
cache_id String cache id of the abbreviation item object
Deprecated:
  • getAbbreviationItemByCacheId
    Source:
    • scripts/cache_abbreviations.js, line 118
    Returns:
    Returns abbreviation item object if cache id found, otherwise null
    Type
    AbbreviationItem

    <static> addAbbreviationItem(dom_element)

    Adds a DOM Element object with an abbreviation to the abbreviation item list. If the abreviation item does not exist the function will create one

    Parameters:
    Name Type Description
    dom_element DOMElement dom element to add to a abbreviation list
    Source:
    • scripts/cache_abbreviations.js, line 62

    <static> emptyCache()

    Empties all the abbreviation items from the cache

    Source:
    • scripts/cache_abbreviations.js, line 163

    <static> getItemByCacheId(cache_id) → {AbbreviationItem}

    Returns the abbreviation item with the cache id

    Parameters:
    Name Type Description
    cache_id String cache id of the abbreviation item object
    Source:
    • scripts/cache_abbreviations.js, line 122
    Returns:
    Returns abbreviation item object if cache id found, otherwise null
    Type
    AbbreviationItem

    <static> sortAbbreviationItems(ascending) → {Boolean}

    Sorts abbreviations by abbreviation_text property

    Parameters:
    Name Type Description
    ascending Boolean true if sort in ascending order; false in descending order
    Source:
    • scripts/cache_abbreviations.js, line 250
    Returns:
    Returns true if list was sorted, false if not
    Type
    Boolean

    <static> toString() → {String}

    Returns a text string representation of the abbreviation cache object

    Source:
    • scripts/cache_abbreviations.js, line 311
    Returns:
    Returns string represention the abbreviations cache object
    Type
    String

    <static> traverseDOMElementsForAbbreviations()

    Traverses the DOMElements to update the abbreviation cache

    Source:
    • scripts/cache_abbreviations.js, line 203

    <static> updateCache()

    Traverses the DOMElements to update the abbreviation cache This function is used to update the abbreviation cache when needed by a rule, it sets the up to date flag when done

    Source:
    • scripts/cache_abbreviations.js, line 227

    <static> updateCacheItems(dom_element)

    Updates the AbbreviationsCache object with information from a DOMElement object This is used during the creation of the cache and is used by the functions for either creating the cache all at one time or selectively

    Parameters:
    Name Type Description
    dom_element DOMElement DOM Element object to add to the abbreviations cache
    Source:
    • scripts/cache_abbreviations.js, line 180