Expand all

Utils

A helper class for reuse logic.

Constructor

new Utils() #

Methods

createHeader(text) → {jQuery}static #

Creates header from given options.

Parameters:

Name Type Description
text string

Returns:

Type
jQuery
Source:
Creates header from given options.

createInputWithCopy(title, placeholder) → {Array.<jQuery>}static #

Creates input element with copy button from given options.

Parameters:

Name Type Description
title string
placeholder string

Returns:

[$input, $div]

Type
Array.<jQuery>
Source:
Creates input element with copy button from given options.

createSelectMenu(options, def) → {jQuery}static #

Creates select menu from given options.

Parameters:

Name Type Description
options Array.<string>
def string

Returns:

Type
jQuery
Source:
Creates select menu from given options.

getDimensionsMessageHtml(sizeLabel, width, height) → {string}static #

Generates an i18n message for a label, given a size label and image dimensions

Parameters:

Name Type Description
sizeLabel string
width number
height number

Returns:

i18n label html

Type
string
Source:
Generates an i18n message for a label, given a size label and image dimensions

getPossibleImageSizesForHtml(width, height) → {Utils.ImageSizes}static #

Calculates possible image sizes for html snippets. It returns up to three possible snippet frame sizes (small, medium, large) plus the original image size.

Parameters:

Name Type Description
width number
height number

Returns:

Type
Utils.ImageSizes
Source:
Calculates possible image sizes for html snippets.

Type Definitions

Dimensions #

Type:

Properties:

Name Type Description
width number
height number
Source:

ImageSizes #

Type:

Properties:

Name Type Attributes Description
small Utils.Dimensions
medium Utils.Dimensions
large Utils.Dimensions
xl Utils.Dimensions optional

Only present in HTML

original Utils.Dimensions optional

Only present in HTML

Source: