js/display.js
Handles the display and rendering of media items, hero section, details overlay, collections, and notifications.
- Source:
Methods
(static) closeActorDetails()
Closes the actor details overlay.
- Source:
(static) closeDetails()
Closes the details overlay.
- Source:
(static) createMediaCard(item, extraClassesopt, showStatusBadgesopt) → {HTMLElement}
Creates a media card element for a given media item.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
item |
Object | The media item to create a card for. | ||
extraClasses |
string |
<optional> |
"" | Additional CSS classes to apply to the card. |
showStatusBadges |
boolean |
<optional> |
true | Whether to display watch/resume badges. |
- Source:
Returns:
The created media card element.
- Type
- HTMLElement
(static) openActorDetails(actor, filmsData, seriesData)
Opens the actor details overlay.
Parameters:
| Name | Type | Description |
|---|---|---|
actor |
Object | Actor object. |
filmsData |
Object | Films data keyed by title. |
seriesData |
Object | Series data keyed by title. |
- Source:
(static) openDetails(item, preferredSeasonopt)
Opens the details overlay for a given media item.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
item |
Object | The media item to display details for. | ||
preferredSeason |
string | null |
<optional> |
null | Optional season to pre-select. |
- Source:
(static) playCurrentMedia()
Plays the currently selected media in the details overlay.
- Source:
(static) refreshActiveSeriesDetails()
Refreshes the details overlay for the active series.
This is useful after watching an episode to update the watched status.
- Source:
(static) renderActorsList(actorsData, filmsData, seriesData)
Renders the grid of actors (photo + nom).
Parameters:
| Name | Type | Description |
|---|---|---|
actorsData |
Object | Actors keyed by slug/id. |
filmsData |
Object | Films data keyed by title. |
seriesData |
Object | Series data keyed by title. |
- Source:
(static) renderActorsListSearch(actorsData, filmsData, seriesData)
Renders a list of actors in a search results section.
Parameters:
| Name | Type | Description |
|---|---|---|
actorsData |
Array | Array of actor objects to display. |
filmsData |
Object | Films data for opening actor details. |
seriesData |
Object | Series data for opening actor details. |
- Source:
(static) renderCollections(collectionsData, appData)
Renders collections of media items.
Parameters:
| Name | Type | Description |
|---|---|---|
collectionsData |
Object | The collections data. |
appData |
Object | The application data containing films and series. |
- Source:
(static) renderGrid(items, optionsopt)
Renders a grid of media items.
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
items |
Array | The list of media items to render. | ||||||||||||
options |
Object |
<optional> |
{} | Optional rendering options.
Properties
|
- Source:
(static) renderHorizontalRow(containerId, items)
Renders a horizontal row of media items.
Parameters:
| Name | Type | Description |
|---|---|---|
containerId |
string | The ID of the container element. |
items |
Array | The list of media items to render. |
- Source:
(static) renderNotifs(list)
Renders the list of notifications.
Parameters:
| Name | Type | Description |
|---|---|---|
list |
Array | The list of notifications to render. |
- Source:
(static) setupHero(item)
Sets up the hero section with the given media item.
Parameters:
| Name | Type | Description |
|---|---|---|
item |
Object | The media item to display in the hero section. |
- Source:
(inner) availabilityBadge(isAvailable) → {string}
Generates an availability badge HTML.
Parameters:
| Name | Type | Description |
|---|---|---|
isAvailable |
boolean | Whether the item is available in the catalog. |
- Source:
Returns:
HTML string for the availability badge.
- Type
- string
(inner) computeAge(dateStr) → {number|null}
Computes age from a birth date string.
Parameters:
| Name | Type | Description |
|---|---|---|
dateStr |
string | The birth date string. |
- Source:
Returns:
The calculated age or null if invalid.
- Type
- number | null
(inner) formatBirthDate(dateStr) → {string}
Formats a birth date string into a localized French date format.
Parameters:
| Name | Type | Description |
|---|---|---|
dateStr |
string | The birth date string. |
- Source:
Returns:
Formatted date or "Date inconnue" if invalid.
- Type
- string
(inner) openActorDetailsWithRoute(actor, filmsData, seriesData)
Opens actor details and syncs route if available.
Parameters:
| Name | Type | Description |
|---|---|---|
actor |
Object | Actor item. |
filmsData |
Object | Films data. |
seriesData |
Object | Series data. |
- Source:
(inner) openDetailsWithRoute(item)
Opens media details and syncs route if available.
Parameters:
| Name | Type | Description |
|---|---|---|
item |
Object | Media item. |
- Source:
(inner) renderEpisodes(episodes, seasonNum)
Renders the list of episodes for a given season.
Parameters:
| Name | Type | Description |
|---|---|---|
episodes |
Array | The list of episodes to render. |
seasonNum |
number | string | The season number. |
- Source:
(inner) renderTimeline(timelineEl, filmography, filmsData, seriesData)
Renders the filmography timeline for an actor.
Parameters:
| Name | Type | Description |
|---|---|---|
timelineEl |
HTMLElement | The timeline container element. |
filmography |
Array | Array of filmography items. |
filmsData |
Object | Films data for availability check. |
seriesData |
Object | Series data for availability check. |
- Source:
(inner) resolveAssetUrl(path) → {string}
Resolves a relative asset path against the app base path.
Parameters:
| Name | Type | Description |
|---|---|---|
path |
string | Asset path. |
- Source:
Returns:
Absolute asset URL.
- Type
- string
(inner) typeBadge(type) → {string}
Generates a media type badge (Film/Série).
Parameters:
| Name | Type | Description |
|---|---|---|
type |
string | The media type ('serie' or 'film'). |
- Source:
Returns:
HTML string for the type badge.
- Type
- string