Constructor
new Utils()
#
- Source:
Methods
createHeader(text) → {jQuery}static
#
Creates header from given options.
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string |
Returns:
- Type
- jQuery
- Source:
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]
- Source:
createSelectMenu(options, def) → {jQuery}static
#
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:
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:
getThumbnailUrlPromise(width) → {jQuery.Promise.<string>}static
#
Gets a promise for the large thumbnail URL. This is needed because thumbnail URLs cannot be reliably guessed, even if we know the full size of the image - most of the time replacing the size in another thumbnail URL works (as long as the new size is not larger than the full size), but if the file name is very long and with the larger size the URL length would exceed a certain threshold, a different schema is used instead.
Parameters:
| Name | Type | Description |
|---|---|---|
width |
number |
Returns:
- Type
- jQuery.Promise.<string>
Fires:
- Source:
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: