Namespace: addContent

addContent

Edit or insert a new movie or show to the local storge base on the from at add-content.html
Source:

Methods

(static) editFormHandler(ind)

Called when we want to edit an exsit show or movie. It will fill in the form with all the data corresponding with the specfic show or movie with thier special index. When user click the submit button it will update the new data to local stroge at corresponding index. For example: editFormHandler(0) will fill in the from with the data at local storge has index 0
Parameters:
Name Type Description
ind number The index value for the Movie or Show
Source:

(static) editMovie()

Update the edit data to local storge with the corresponding index.
Source:

(static) editShow()

Update the edit data to local storge with the corresponding index. The editShow function deals a little specially with being able to make our 2D array to pass, it has an array "episodeArray" and array "toPush" Since "totalSeasons" isn't needed to create the expandedCard it's bypassed Everytime an element with name "episodes" the function create false boolean values which will represent unwatched episodes, and these are pushed to episode array to create a 2D array.
Source:

(static) init()

The init() function for the add-content.html. It will check if the calling link has index or not. If have index then we are edit a exsit show and movie. Then we will calling editFormHandler with the corresponding index inside the link. If the calling link doesn't have index then we are inserting a new movie or show to the watch list. Then we will calling initFormHandler() to insert a new movie and show. For example if the location is ./assets/pages/add-content.html?ind=0 Then the index for the movie or show we want edit is 0. Then we will just called editformhandler(0) to edit it.
Source:

(static) initFormHandler()

Called when we want to create a new show or movie. It will For example: editFormHandler(0) will fill in the from with the data at local storge has index 0
Source:

(static) insertMovie()

The function to create a movie object if that is the current form being submitted
Source:

(static) insertShow()

The insertShow function deals a little specially with being able to make our 2D array to pass, it has an array "episodeArray" and array "toPush" Since "totalSeasons" isn't needed to create the expandedCard it's bypassed Everytime an element with name "episodes" the function create false boolean values which will represent unwatched episodes, and these are pushed to episode array to create a 2D array. Small objects still need to be created from this currently Once the objects are created, you are taken to the homepage
Source: