Tale |
TaleUsed to provide access to passages. This is analogous to the TiddlyWiki class in the core TiddlyWiki code. Summary
passagesAn associative array of Passage objects in the story. The key for this array is the title of the passage. Tale
Initializes a new Tale object with the contents of the DOM element with the id storeArea, constructing new Passages as it traverses the tree. Parametersnone get
A getter function that returns a certain Passage object belonging to the tale. You may either retrieve a passage by its title or id. Parameters
ReturnsA Passage object. If no passage exists matching the passed key, a null value is returned. See alsolookup
Searches the Tale for all passages matching a certain criteria. You may optionally specify a secondary field to sort the results on. Parameters
ReturnsAn array of Passages. If no passages met the search criteria, an empty array is returned. See alsoreset
Calls the Passage.reset method on all Passages in the tale, restoring the story to its initial state. Parametersnone Returnsnothing |
Initializes a new Tale object with the contents of the DOM element with the id storeArea, constructing new Passages as it traverses the tree.
function Tale()
Checks whether the tale has a passage with either the title passed (if the key parameter is a string) or an id (if a number is passed instead).
Tale.prototype.has = function ( key )
A getter function that returns a certain Passage object belonging to the tale.
Tale.prototype.get = function ( key )
Searches the Tale for all passages matching a certain criteria.
Tale.prototype.lookup = function( field, value, sortField )
Calls the Passage.reset method on all Passages in the tale, restoring the story to its initial state.
Tale.prototype.reset = function()
Resets the passage’s text property to its initialText property.
Passage.prototype.reset = function()