Properties
formatter
#
Formatter converting image data into formats needed for output
Properties:
| Type | Description |
|---|---|
| EmbedFileFormatter |
LARGE_IMAGE_HEIGHT_THRESHOLDstatic
#
Properties:
| Name | Type | Description |
|---|---|---|
Height |
number | threshold at which an image is to be considered "large" |
LARGE_IMAGE_WIDTH_THRESHOLDstatic
#
Properties:
| Name | Type | Description |
|---|---|---|
Width |
number | threshold at which an image is to be considered "large" |
Methods
attach()
#
Registers listeners.
createSizePulldownMenus($container)
#
createSnippetSelectionButtons($container)
#
createSnippetTextAreas($container)
#
Creates text areas for html and wikitext snippets.
Parameters:
| Name | Type | Description |
|---|---|---|
$container |
jQuery |
empty()
#
getPossibleImageSizesForWikitext(width, height) → {Utils.ImageSizes}
#
Calculates possible image sizes for wikitext snippets. It returns up to three possible snippet frame sizes (small, medium, large).
Parameters:
| Name | Type | Description |
|---|---|---|
width |
number | |
height |
number |
Returns:
- Type
- Utils.ImageSizes
getSizeOptions(width, height) → {Embed.SizeOptions}
#
Gets size options for html and wikitext snippets.
Parameters:
| Name | Type | Description |
|---|---|---|
width |
number | |
height |
number |
Returns:
- Type
- Embed.SizeOptions
handleSizeSwitch()
#
Handles size menu change events.
handleTypeSwitch(value)
#
Handles snippet type switch.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
string | 'html' or 'wikitext' |
resetCurrentSizeMenuToDefault()
#
Reset current menu selection to default item.
set(imageInfo, [caption], [alt])
#
Sets the data on the element.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
imageInfo |
ImageModel | ||
caption |
string |
optional |
|
alt |
string |
optional |
unattach()
#
Clears listeners.
updateEmbedHtml(thumbnail, width, height)
#
Sets the HTML embed text.
Assumes that the set() method has already been called to update this.embedFileInfo
Parameters:
| Name | Type | Description |
|---|---|---|
thumbnail |
Thumbnail | (can be just an empty object) |
width |
number | New width to set |
height |
number | New height to set |
updateEmbedWikitext(width)
#
Updates the wikitext embed text with a new value for width.
Assumes that the set method has already been called.
Parameters:
| Name | Type | Description |
|---|---|---|
width |
number |
Type Definitions
SizeOptions
#
Type:
Properties:
| Name | Type | Description |
|---|---|---|
html |
Utils.ImageSizes | Collection of possible image sizes for html snippets |
wikitext |
Utils.ImageSizes | Collection of possible image sizes for wikitext snippets |