Class Index | File Index

Classes


Class gva.model.UserModel


Defined in: UserModel.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates a new UserModel instance, or returns the singleton instance.
Field Summary
Field Attributes Field Name and Description
<static>  
gva.model.UserModel.EventType
Enumeration for event types dispatched from this class
<static>  
gva.model.UserModel.TOKEN_LAST_EPISODE_CHECK
Enumeration for UserModel local storage tokens.
<static>  
gva.model.UserModel.TOKEN_SUBSCRIPTIONS
Enumeration for UserModel local storage tokens.
<static>  
gva.model.UserModel.TOKEN_WATCHED_EPISODES
Enumeration for UserModel local storage tokens.
Method Summary
Method Attributes Method Name and Description
 
Subscribes the user to a show.
 
addValueToToken(token, data)
Pushes data into a given token
 
Retrieves a token from local storage and returns the parsed data
 
Retrieves the time of the last time the user requested episode data.
 
Retrieves a list of show IDs representing the user's subscriptions.
 
Retrieves a list of the episodes a user has already watched
 
Unsubscribes the user from a given show.
 
removeValueFromToken(token, data)
Removes a value from a given token
 
setWatchedEpisode(episodeID)
Marks a given episode as watched
 
Sets the last episode check time to the current time.
Class Detail
gva.model.UserModel()
Creates a new UserModel instance, or returns the singleton instance.
Field Detail
<static> gva.model.UserModel.EventType
Enumeration for event types dispatched from this class

<static> gva.model.UserModel.TOKEN_LAST_EPISODE_CHECK
Enumeration for UserModel local storage tokens.

<static> gva.model.UserModel.TOKEN_SUBSCRIPTIONS
Enumeration for UserModel local storage tokens.

<static> gva.model.UserModel.TOKEN_WATCHED_EPISODES
Enumeration for UserModel local storage tokens.
Method Detail
addUserSubscription(showID)
Subscribes the user to a show.
Parameters:
{string} showID
The ID of the show to subscribe the user to.

addValueToToken(token, data)
Pushes data into a given token
Parameters:
{string} token
The token to add data to.
{Object} data
The data to add to the given token.

{Array} getDataAtToken(token)
Retrieves a token from local storage and returns the parsed data
Parameters:
{string} token
The name of the token to retrieve.
Returns:
{Array} The data stored under the given token.

{Date} getLastEpisodeCheck()
Retrieves the time of the last time the user requested episode data.
Returns:
{Date} The date of the last check.

{Array.} getUserSubscriptions()
Retrieves a list of show IDs representing the user's subscriptions.
Returns:
{Array.} A list of show IDs representing the user's subscriptions.

{Array.} getWatchedEpisodes()
Retrieves a list of the episodes a user has already watched
Returns:
{Array.} A list of episode IDs.

removeUserSubscription(showID)
Unsubscribes the user from a given show.
Parameters:
{string} showID
The ID of the show to unsubscribe from.

removeValueFromToken(token, data)
Removes a value from a given token
Parameters:
{string} token
The token to remove data from.
{Object} data
The item to remove from the given token.

setWatchedEpisode(episodeID)
Marks a given episode as watched
Parameters:
{string} episodeID
The ID of the episode to mark as watched.

updateLastEpisodeCheck()
Sets the last episode check time to the current time.

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