Global

Members

appButton :HTMLElement

App button

Type:
  • HTMLElement
Source:
See:
  • Used in: click

appContent :HTMLElement

App content

Type:
  • HTMLElement
Source:
See:

(constant) urlAPI :String

API route 'Rick and morty'

Type:
  • String
Source:
See:

Methods

adblockDetected()

Callback executed if adblock is installed

Source:
See:
  • Used inside messageAlert
  • Used in: checkAdblock

adblockDisabled()

Callback executed if adblock is disabled

Source:
See:
  • Used in: checkAdblock

adblockVerify()

Verify if the user has installed the Adblock browser extension

Source:
See:

addCurrentYear()

Add the current year to the copyright

Source:
See:

ajaxHandler(url, action) → {object}

API request

Parameters:
Name Type Description
url String

root of the API

action String

name of the action to excute

Source:
See:
Returns:
Type
object

appContentAdd(url)

Add link of the API to the app content

Parameters:
Name Type Description
url String

root of the API

Source:
See:
  • Used in: click

cardCreate(listCardsInner, responseData)

Create card with the data response

Parameters:
Name Type Description
listCardsInner Element

DOM element that wraps up the card list

responseData object

response data of the ajax handler (json)

Source:
See:

cardMoveImage()

Move the card image up.

Source:
See:

cardToggleView(item, thisView)

See more card info

Parameters:
Name Type Description
item HTMLCollectionOf

list of cards

thisView Element

card selected

Source:
See:

cardWhenClicked()

Event click in the card

Source:
See:

delay(fn, ms)

Executes a function after a given time

Parameters:
Name Type Description
fn function

function to execute

ms Number

delay time in miliseconds

Source:
See:

filterActive(item, thisActive)

Add class 'is-active' to the item of the navigation clicked.

Parameters:
Name Type Description
item HTMLCollectionOf

filter list

thisActive Element

filter selected

Source:
See:

filterAdd(elementDom, responseData)

Add navigation menu filtering through the 3 types of data (characters, locations and episodes) to the app content.

Parameters:
Name Type Description
elementDom HTMLElement

DOM element where the filter is inserted

responseData Object

response data of the ajax handler (json)

Source:
See:

filterAddAllContent()

Insert the content

Source:
See:

filterAddContent(elementDom, responseData)

Add the filter content application

Parameters:
Name Type Description
elementDom HTMLElement

DOM element where the filter content is inserted

responseData Object

response data of the ajax handler (json)

Source:
See:

filterAddContentInfo(responseData) → {Element}

Insert information to the content with the number of results of the request

Parameters:
Name Type Description
responseData Object

response data of the ajax handler (json)

Source:
See:
Returns:
Type
Element

filterAddContentResults(responseData) → {Element}

Insert results to the content of the request

Parameters:
Name Type Description
responseData Object

response data of the ajax handler (json)

Source:
See:
Returns:
Type
Element

filterFoundContent()

Check if the contents of one filter are shown and before loading another one, delete it

Source:
See:

filterRemoveContent()

Remove the selected filter content of the application content

Source:
See:

firstUpperCase(string) → {String}

Converts the first letter of a string to uppercase

Parameters:
Name Type Description
string String

string with the this letter in lowercase

Source:
See:
Returns:

returns the same modified string

Type
String

functionAnonimAutoExecuted()

Anonymous auto executed function

Source:
See:

getCurrentYear() → {Number}

Get the current year

Source:
See:
Returns:
Type
Number

loaderAdd()

Add loading animation

Source:
See:

loaderCreate() → {HTMLElement}

Creation of a loading animation

Source:
See:
Returns:
Type
HTMLElement

loaderRemove()

Remove loading animation

Source:
See:

messageAdd(messageId, messageClass, messageText)

Create the message component

Parameters:
Name Type Description
messageId String

Id for events js

messageClass String

Class css with modifier BEM of the message

messageText String

Text of the message

Source:
See:

messageAlertAdd(messageName, messageText)

Create a alert personalized

Parameters:
Name Type Description
messageName String

Name of message in camellCase

messageText String

Text of message

Source:
See:

messageCloseAdd()

Create a button for remove the message

Source:
See:

messageError404Add()

Add message error 404 (search not found)

Source:
See:

messageRemove(messageId)

Remove the message component

Parameters:
Name Type Description
messageId String

id of the message to remove

Source:
See:

paginationAdd(responseData)

Add pagination

Parameters:
Name Type Description
responseData Object

response data of the ajax handler (json)

Source:
See:

paginationCreate(responseData)

Create pagination

Parameters:
Name Type Description
responseData Object

response data of the ajax handler (json)

Source:
See:

paginationRemove()

Remove pagination

Source:
See:

paginationSetCounter(responseData)

Create counter pagination

Parameters:
Name Type Description
responseData Object

response data of the ajax handler (json)

Source:
See:

searchAdd(filterActive)

Add searcher

Parameters:
Name Type Description
filterActive Element

filter selected

Source:
See:

searchCreate()

Create searcher

Source:
See:

searchGet(filterActive)

Get the active filter to find it.

Parameters:
Name Type Description
filterActive Element

filter selected

Source:
See:

searchRemove()

Remove searcher

Source:
See:

setAction(action, elementDom, dataResponse)

List of functions to choose from

Parameters:
Name Type Description
action String

name of the action to excute

elementDom HTMLElement

DOM element where the response data is inserted

dataResponse Object

response data of the ajax handler (json)

Source:
See:

svgMe() → {Object}

Converts an <img> tag, with a .svg extention and a class svgMe, into a <svg> tag.

Source:
See:
Returns:

Return the file svg

Type
Object

Events

click

View more card info when click it.

Type:
  • object
Source:
See:

click

Remove/Add content and pagination by selecting the filter from the navigation menu.

Type:
  • object
Source:
See:

click

Get API data

Type:
  • Object
Source:
See:

click

Remove / Add content and pagination when selecting the filter of the navigation menu.

Type:
  • object
Source:
See:

keyup

Search by selected filter name when typing in the search engine input.

Type:
  • Object
Source:
See: