Global

Methods

CreateActionListeners(data, shadowDom)

Parameters:
Name Type Description
data * data passed in to expandedShowCard
shadowDom * shadowDom associated with current object Creates action listener for the trash button
Source:

CreateActionListeners(data, seasonNumber, shadowDom)

This function takes in the current selected season (chosen by clicking a button) and then generates event listeners to switch seasons, if a season is clicked it will take update the current html to reflect the checkbox array for that season For the checkboxes which are displayed depending on the season selected, event listeners are generated so that data.episodeArray booleans are updated depending on if the checkboxes are checked or unchecked
Parameters:
Name Type Description
data Object data passed in to expandedShowCard
seasonNumber number current selected season
shadowDom * shadowDOM associated with current object
Source:

data(data)

Called when the .data property is set on this element For example: let expandedMovieCard = document.createElement('expanded-movie-card'); // Calls constructor() expandedMovieCard.data = { foo: 'bar' } // Calls set data({ foo: 'bar' }) expandedMovieCard and smallMovieCard get data from same data object, smallMovieCard just uses part of the data expandedMovieCard theoretically can just take a copy of the data object in the smallMovieCard
Parameters:
Name Type Description
data Object The data to pass into the , must be of the following format: { "movieName" : "string" "movieFar" : "string" "movieTime" : "string" "imgSrc" : "string" "imgAlt" : "string" "rating" : number "review" : "string" "id" : num representing place in local storage }
Source:

data(data)

Called when the .data property is set on this element For example: let expandedShowCard = document.createElement('small-show-card'); // Calls constructor() expandedShowCard.data = { foo: 'bar' } // Calls set data({ foo: 'bar' }) expandedShowCard and smallShowCard get data from same data object, smallShowCard just uses part of the data
Parameters:
Name Type Description
data Object The data to pass into the , must be of the following format: { "episodeArray": 2D array of booleans representing episodes per season and whether they have been watched "id" : num representing place in local storage "imgSrc" : "string" "imgAlt" : "string" "movie" : boolean representing whether or not item is a move "rating" : number "review" : "string" "showTitle" : "string" }
Source:

data(data)

Called when the .data property is set on this element For example: let smallMovieCard = document.createElement('small-movie-card'); // Calls constructor() smallMovieCard.data = { foo: 'bar' } // Calls set data({ foo: 'bar' }) expandedMovieCard and smallMovieCard get data from same data object, smallMovieCard just uses part of the data
Parameters:
Name Type Description
data Object The data to pass into the , must be of the following format: { "id" : number "imgSrc" : "string" "movie" : boolean representing whether or not item is a move "movieFar" : number "movieName" : "string" "movieTime" : number "rating" : number "review" : "string" }
Source:

data() → {Object}

Returns the data of the small movie card object
Source:
Returns:
- the movie card's data
Type
Object

data(data)

Called when the .data property is set on this element For example: let smallShowCard = document.createElement('small-show-card'); // Calls constructor() smallShowCard.data = { foo: 'bar' } // Calls set data({ foo: 'bar' }) expandedShowCard and smallShowCard get data from same data object, smallShowCard just uses part of the data
Parameters:
Name Type Description
data Object The data to pass into the , must be of the following format: { "episodeArray": 2D array of booleans representing episodes per season and whether they have been watched "imgSrc" : "string" "imgAlt" : "string" "movie" : boolean representing whether or not item is a move "showTitle" : "string" "rating" : number "review" : "string" "id" : num representing place in local storage }
Source:

data() → {Object}

Returns the data set to the show card
Source:
Returns:
- small show card's data
Type
Object

episodesWatched(episodeArray)

Exports a function that returns the total number of episodes with a watch value of true
Parameters:
Name Type Description
episodeArray * The 2D boolean array that stores the watch value of all episodes
Source:
Returns:
The number of watched episodes for the given show

generatedInnerHTML(data) → {string}

Parameters:
Name Type Description
data * a reference to the movie data object
Source:
Returns:
string representing the innerHTML of the expandedMovieCard
Type
string

generatedInnerHTML(data, seasonNumber) → {string}

Generates string representing innerHTML of expandedShowCard element
Parameters:
Name Type Description
data Object data passed in to expandedShowCard
seasonNumber number the current selected season
Source:
Returns:
string representing the innerHTML of the expandedShowCard
Type
string

generateEpisodesForSeason(episodes, seasonNumber)

Generates a HTML string for the episodes section
Parameters:
Name Type Description
episodes Array an array of booleans representing which episodes are watched in a season
seasonNumber number the current selected season
Source:
Returns:
a HTML string used to generate the episodes section

generateSeasonsHTML(episodes, seasonNumber)

Returns a string of HTML that generates multiple "progress bars" for each season You can click through the top labels, each labeled "Season X", to switch between progress bars Each bit of progress is marked by an image.
Parameters:
Name Type Description
episodes Array an array of booleans representing the episodes in each season and whether or not they have been watched
seasonNumber number the current selected season
Source:
Returns:
a string representing the HTML for progress bars for each season

totalepisodeNum(episodeArray)

Exports a function that returns the total number of episodes stored in the episodeArray in data
Parameters:
Name Type Description
episodeArray * The 2D boolean array that stores the watch value of all episodes
Source:
Returns:
The number of episodes stored in the episodeArray

update(data, shadowDom)

Parameters:
Name Type Description
data * data passed in to expandedShowCard
shadowDom * shadowDom associated with current object This function gets the article associated with the shadow and then calls innerHTML on it The generation will create the page with a progress bar representing true or false on if the episode is watched or not Then, createActionListeners is called to generate listerners for the buttons created
Source:

update(data, seasonNumber, shadowDom)

This function gets the article associated with the shadow and then calls innerHTML on it The generation will create the page with season buttons and checkboxes representing true or false on if the episode is watched or not Then, createActionListeners is called to generate listeners for the buttons and checkboxes created This function is called everytime a season button is selected
Parameters:
Name Type Description
data Object data passed in to expandedShowCard
seasonNumber number the current selected season
shadowDom * shadowDOM associated with current object
Source: