Members
(constant) init
Immediately invoked function, this attaches event listeners, load data's, and loads the home page.
- Source:
(constant) saveData
Saves the data's in the user browser storage.
- Source:
(constant) unExpandSidebar
Unexpand the sidebar navigation.
- Source:
Methods
apiFetch(url, pageName)
Parameters:
Name | Type | Description |
---|---|---|
url |
string | URL of the api to be fetched |
pageName |
string | The title of the page ex[discoverMovies,popularMovies] |
- Source:
Returns:
The results of the fetched data.
(async) controlBookmarkBtn(isActive)
Controls the bookmark button functionality in the expand page.
Parameters:
Name | Type | Description |
---|---|---|
isActive |
boolean | If the expanded movie/tv show has been bookmarked already. |
- Source:
controlBookmarks()
Controls the rendering of bookmarks movie/tv show cards.
- Source:
(async) controlDiscoverMovies()
Controls the rendering of the home page.
- Source:
controlExpandBackButton()
Controls the back button functionality in the expansion page.
- Source:
(async) controlExpansionSection()
Controls the rendering of the expansion page when a movie/tv show card has been clicked.
- Source:
(async) controlGenreCards(event)
Controls the genre filtering buttons.
Parameters:
Name | Type | Description |
---|---|---|
event |
event | event fired when genre filter button has been clicked. |
- Source:
controlMovieCards(viewType, viewName, pageTypeopt, filtering, pageNumopt)
This function is responsible for rendering the cards in the page as well as the genre buttons, pagination buttons, and the error message.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
viewType |
Object | The view that will be rendered [discoverView.js, trendingView.js, and etc.]. |
||
viewName |
String | The name of the view to be rendered in the page. |
||
pageType |
String |
<optional> |
home | The page type to be rendered in the page [home,trending,movies-pop,tvs-pop ]. |
filtering |
Boolean | If genre filtering is available in that type of page. |
||
pageNum |
Number |
<optional> |
1 | The page number of the movie cards to be displayed. |
- Source:
(async) controlMovieSection(event)
Controls the expand button functionality of movie/tv show cards in the page.
Parameters:
Name | Type | Description |
---|---|---|
event |
event | Event that fires when user clicked the button. |
- Source:
(async) controlNavBtns(event)
Controls the sidebar buttons functionality.
Parameters:
Name | Type | Description |
---|---|---|
event |
event | Event that fires when a button has been clicked in the sidebar. |
- Source:
(async) controlPagination(event)
Controls pagination buttons functionality.
Parameters:
Name | Type | Description |
---|---|---|
event |
event | Event that fires when user clicked the button. |
- Source:
(async) controlSearchResults()
Controls the search bar functionality.
- Source:
controlSettings(event)
Controls the settings panel buttons functionality.
Parameters:
Name | Type | Description |
---|---|---|
event |
event | Event that fires when user clicks a button in the settings. |
- Source:
createDiscoverCards(pageName, pageNum)
Fetches the data's from the API to be rendered in the page.
Parameters:
Name | Type | Description |
---|---|---|
pageName |
string | Name of the page to be rendered. |
pageNum |
number | Number of the page to be rendered. |
createExpandPage(videoId)
Fetches the data's of the movie/tv show that has been expanded from TMDB API.
Parameters:
Name | Type | Description |
---|---|---|
videoId |
number | movie/tv show id - |
createGenreCards()
Fetch filtered genre movie/tv show cards data in the API to be rendered in the page.
createPageResults(btnType, pageNum)
Fetches the data of page results from the TMD API.
Parameters:
Name | Type | Description |
---|---|---|
btnType |
string | type of the button that the user clicked |
pageNum |
number | number of the page to fetch |
createSearchResults(searchVal)
Fetches the data that the user searched from the TMDB Api.
Parameters:
Name | Type | Description |
---|---|---|
searchVal |
string | string to search in the api |
getMovieTvData(videoId, detailType)
Parameters:
Name | Type | Description |
---|---|---|
videoId |
number | id of the movie/tv show |
detailType |
string | type of the data to be searched ex.[videos,credits] |
- Source:
Returns:
The results of the fetched data
loadDatas()
Fetch the data's from the user browser storage and set it in the data.
- Source:
(async) renderGenreCards()
Controls the rendering of the filtered movies/tv shows in the page.
- Source:
showExpandSection()
Shows the expanded page when a movie/tv show id has been detected in the URL.
- Source: