Module: modal

Controls the display and behavior of modal dialogs (pop-ups) in the UI. Handles opening, closing, and content management for modals.
Source:

Methods

(inner) closeModals() → {void}

Closes all modals and restores the previous state.
Source:
Returns:
Type
void

(inner) createModalContent(item, type) → {string}

Generates the HTML content for the modal based on the item and its type.
Parameters:
Name Type Description
item Object The content item (film or series).
type string The type of content ("film" or "series").
Source:
Returns:
The HTML string for the modal content.
Type
string

(inner) displayEpisodes(series, seasonNumber) → {void}

Displays the episodes for a given series and season in the modal.
Parameters:
Name Type Description
series Object The series object.
seasonNumber string | number The season number to display.
Source:
Returns:
Type
void

(inner) handleVideoEnded() → {void}

Handles marking content as watched when the video ends.
Source:
Returns:
Type
void

(inner) handleVideoPause() → {void}

Handles saving watch progress when the video is paused.
Source:
Returns:
Type
void

(inner) handleVideoTimeUpdate() → {void}

Handles updating watch progress while the video is playing.
Source:
Returns:
Type
void

(inner) openModal(title, type, season) → {void}

Opens the modal for a given content item (film or series).
Parameters:
Name Type Description
title string The title of the content.
type string The type of content ("film" or "series").
season string | number The season to display (for series).
Source:
Returns:
Type
void

(inner) playVideo(videoPath, type, title, seasonopt, epIndexopt) → {void}

Plays a video (film or episode) in the video modal, resuming from last watched time if available.
Parameters:
Name Type Attributes Description
videoPath string The path to the video file.
type string The type of content ("film" or "series").
title string The title of the content.
season string | number <optional>
The season number (for series).
epIndex number <optional>
The episode index (for series).
Source:
Returns:
Type
void

(inner) setupSeriesModal(series, defaultSeason) → {void}

Sets up the modal for a series, displaying seasons and episodes.
Parameters:
Name Type Description
series Object The series object.
defaultSeason string | number The season to display initially.
Source:
Returns:
Type
void

(inner) showFilmModal(film) → {void}

Displays the modal for a film with its details.
Parameters:
Name Type Description
film Object The film object to display.
Source:
Returns:
Type
void

(inner) showSeriesModal(series, season) → {void}

Displays the modal for a series with its details and selected season.
Parameters:
Name Type Description
series Object The series object to display.
season string | number The season to display.
Source:
Returns:
Type
void