generators

generators

Source:

The generators module includes functions that either return HTMLElements or HTML-formatted strings that are used as templates for building blocks of the app. Most functions take arguments providing content to fill these templates.

Methods

(static) actionButtons(matcher, modal) → {String}

Source:

Generates html-string containing the action buttons. It contains three main buttons that are styled depending on the type.

Parameters:
Name Type Description
matcher String
modal 'poster' | 'card'
Returns:
Type
String

(static) confirmActionAlertBox(options, proceed) → {HTMLElement}

Source:

Generates element used for an alert box with a yes/no option. Takes a callback that allows different actions depending on the clicked button.

Parameters:
Name Type Description
options Object

Data to render in the alert box

Properties
Name Type Description
title String
description String
acceptButtonText String
declineButtonText String
proceed function

Callback function for button clicks

Returns:
Type
HTMLElement

(static) infoCardContent(item) → {String}

Source:

Generates html-string containing all elements that are placed inside one info card.

Parameters:
Name Type Description
item Object
Properties
Name Type Description
ratingPercent Number
seasonNumber Number
episodeNumber Number
episodeTitle String
description String
Returns:
Type
String

(static) infoCardDummy(stack, index, id) → {HTMLElement}

Source:

Generates an element containing the basic html structure of a single info card.

Parameters:
Name Type Description
stack 'left_stack' | 'middle_stack' | 'right_stack'

Card stack it will be placed onto

index Number

Position of this card in the total stack

id String

Reference ID for trakt database

Returns:
Type
HTMLElement

(static) searchResult(item) → {HTMLElement}

Source:

Generates a html element for one search result and adds it to the sidebar.

Parameters:
Name Type Description
item Object
Properties
Name Type Description
img String
title String
description String
type String
rating Number
id Number

Reference ID for TMDB database

Returns:
Type
HTMLElement

(static) upNextPoster(item) → {HTMLElement}

Source:

Generates the an element for a single poster that is displayed on the up-next dashboard.

Parameters:
Name Type Description
item Object
Properties
Name Type Description
title String
subtitle String
rating Number
id String

Reference ID for TVDB database

season Number
matcher String
Returns:
Type
HTMLElement

(static) upNextTitle(item) → {String}

Source:

Generates html-string used for the title block on the up-next dashboard.

Parameters:
Name Type Description
item Object
Properties
Name Type Description
title String
subtitle String
Returns:
Type
String