This function is an copy of the function found in the Hype Runtime. As that is an IIFE it isn't available and hence we need to redifine it for custom event handling following the official Hype Event schema.
Name | Type | Description | |
---|---|---|---|
event |
Object
|
This object contains at least the event type (name of event) and in some cases some additional information (key, value) or nested structures |
|
element |
HTMLElement
|
This is the element the current tagert of the event or null if the event doesn't require or was called without an target |
Returns the result of the event. Mostly this is an Boolean in case of Hype as it uses the events in an Observer pattern.
This helper does a backwards treewalk from the element it is started on and returns the symbolInstance if one is found. This function was originally written by Stephen Decker from Tumult Inc. but has been tweaked to use the Hype Symbol Cache. The cache is also used to return save the search result for child elements of symbols. Hence, a repeated symbol won't be a treewalk but rather a simple lookup.
Name | Type | Description | |
---|---|---|---|
element |
HTMLElement
|
The element to start the treewalk on |
Object
Returns the first found symbolInstance while tree walking or null if no symbolInstance is found
This function reset the entire symbol cache and purging the entire symbol cache. This resets the return values for getSymbolInstanceById an getSymbolInstancesByName for all symbol instances.
Name | Type | Description | |
---|---|---|---|
refreshImmediately |
Boolean
|
If this is set to true it will fire HypeSymbolInit rather then only deleting the symbol cache. |
Void
This function reset the symbol cache of an single symbol by purging its symbol instance from the symbol cache. This resets the return values for getSymbolInstanceById an getSymbolInstancesByName for the symbol instance with the given id.
Name | Type | Description | |
---|---|---|---|
id |
String
|
This is the id of the symbol cache that should be reseted |
|
refreshImmediately |
Boolean
|
If this is set to true it will fire HypeSymbolInit rather then only deleting the symbol cache. |
Void
This function overrides the original Hype document API and returns the symbol instance from the cache lookup instead. The original function is still available and aliased as hypeDocument._getSymbolInstanceById.
Name | Type | Description | |
---|---|---|---|
id |
String
|
The id your trying to get the symbolinstace from |
Void
This function overrides the original Hype document API and returns the symbol instances requested by name from the cache lookup instead. The original function is still available and aliased as hypeDocument._getSymbolInstancesByName.
Name | Type | Description | |
---|---|---|---|
id |
String
|
The id your trying to get the symbol instance from |
Void
This function refreshes the symbol cache by requesting a fresh copy of the symbol instance APi from the Hype Runtime and firing the custom event HypeSymbolInit afterwards
Name | Type | Description | |
---|---|---|---|
id |
String
|
The id your trying to refresh the symbol instance for |
Void
This function refreshes the symbol cache by requesting a fresh copy of the symbol instance API from the Hype Runtime and firing the custom event HypeSymbolInit afterwards but only if the system cache isn't already set for the id
Name | Type | Description | |
---|---|---|---|
id |
String
|
The id your trying to refresh the symbol instance for |
Void
Name | Type | Description | |
---|---|---|---|
version |
String
|
Version of the extension |
Void