Constructor: LanguagesCache

OpenAjax.a11y.cache.LanguagesCache

new LanguagesCache(dom_cache)

Constructor for languages cache object which contains a list of language items representing the language changes of content in the in a document. The language items also contain a list of all the dom element objects that share the same language

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 language item that the list is sorted on
sort_ascending Boolean true if list is sorted by ascending values, otherwsie false
language_items Array List of language items
length Number Number of language items in list
rule_summary_result ResultRuleSummary Rule results associated with this cache
Source:
  • scripts/cache_languages.js, line 8

Methods

<static> addLanguageItem(dom_element)

Adds a DOM Element object with an language property to the langauge 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_languages.js, line 60

<static> emptyCache()

Empties all the language items from the cache

Source:
  • scripts/cache_languages.js, line 137

<static> sortLanguageItems(ascending) → {Boolean}

Sorts languages by language property

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

<static> toString() → {String}

Returns a text string representation of the language cache object

Source:
  • scripts/cache_languages.js, line 278
Returns:
Returns string represention the language cache object
Type
String

<static> traverseDOMElementsForLanguages()

Traverses the DOMElements to update the language cache

Source:
  • scripts/cache_languages.js, line 170

<static> updateCache()

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

Source:
  • scripts/cache_languages.js, line 194

<static> updateCacheItems(dom_element)

Updates the language cache object with information from a dom element 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 language cache
Source:
  • scripts/cache_languages.js, line 151