Class Index | File Index

Classes


Class gva.model.DataModel


Defined in: DataModel.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates a new DataModel instance, or returns the singleton instance.
Field Summary
Field Attributes Field Name and Description
 
<static>  
gva.model.DataModel.EventType
Enumeration for DataModel event types.
 
Method Summary
Method Attributes Method Name and Description
 
getData(refreshRequest)
Requests all video/category data.
 
Searches episode data by ID and returns any matching episode object
 
Searches episode data by slug and returns any matching episode object
 
getEpisodes(refreshRequest)
Retrieves all episodes
 
getEpisodesByShow(showID, unwatched)
Convenience method that searches episode data to find all episodes from a particular show and optionally filtering for unwatched episodes.
 
Searches shows data by ID and returns any matching show object
 
Searches shows data by slug and returns any matching show object
 
Retrieves a list of all available shows
 
onDataLoaded(event)
Event handler for when data is loaded.
 
onLoadError(event)
Event handler for a data loading error
 
Searches episode data for the given term and returns a list of results
 
Searches episode data for new episodes since a given date.
 
setData(data)
Sets the current show and episode data object and updates the object content based on user data from local storage
Class Detail
gva.model.DataModel()
Creates a new DataModel instance, or returns the singleton instance.
Field Detail
episodesData

<static> gva.model.DataModel.EventType
Enumeration for DataModel event types.

showsData
Method Detail
getData(refreshRequest)
Requests all video/category data.
Parameters:
{boolean} refreshRequest
If true this function will ignore existing data and request updated episode data.

{Object} getEpisodeByID(id)
Searches episode data by ID and returns any matching episode object
Parameters:
{string} id
The id of the episode to find.
Returns:
{Object} The episode object with the specified id.

{Object} getEpisodeBySlug(slug)
Searches episode data by slug and returns any matching episode object
Parameters:
{string} slug
The slug of the episode to find.
Returns:
{Object} The episode object with the specified slug.

getEpisodes(refreshRequest)
Retrieves all episodes
Parameters:
{boolean} refreshRequest
If true this function will ignore existing data and request updated episode data.

{Array} getEpisodesByShow(showID, unwatched)
Convenience method that searches episode data to find all episodes from a particular show and optionally filtering for unwatched episodes.
Parameters:
{string} showID
The id of the show.
{Boolean} unwatched
Return only unwatched episodes if true.
Returns:
{Array} An array of episode objects.

{Object} getShowByID(id)
Searches shows data by ID and returns any matching show object
Parameters:
{string} id
The id of the show to find.
Returns:
{Object} The show object with the specified id.

{Object} getShowBySlug(slug)
Searches shows data by slug and returns any matching show object
Parameters:
{string} slug
The slug of the show to find.
Returns:
{Object} The show object with the specified slug.

getShows()
Retrieves a list of all available shows

onDataLoaded(event)
Event handler for when data is loaded.
Parameters:
{goog.events.Event=} event
The event containing the response data.

onLoadError(event)
Event handler for a data loading error
Parameters:
{goog.events.Event=} event
The error event.

{Array.} searchEpisodes(term)
Searches episode data for the given term and returns a list of results
Parameters:
{string} term
The term to search for within episode data.
Returns:
{Array.} A list of matched episodes.

{Array} searchEpisodesByTimestamp(startTime)
Searches episode data for new episodes since a given date.
Parameters:
{number} startTime
The integer timestamp of the earlier episode airdate to return.
Returns:
{Array} The array of episodes found.

setData(data)
Sets the current show and episode data object and updates the object content based on user data from local storage
Parameters:
{Object} data
The JSON data object for the shows and episodes.

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Dec 22 2011 17:41:23 GMT-0800 (PST)