Expand all

ve.dm.MWInlineImageNode

Extends

Constructor

new ve.dm.MWInlineImageNode([element]) #

DataModel MediaWiki image node.

Parameters:

Name Type Attributes Description
element Object optional

Reference to element in linear model

Mixes in:
Source:
DataModel MediaWiki image node.

Properties

tagsToSrcAttrs :Object #

Map media tags to source attributes

Type:

Mixes in:
Source:
Map media tags to source attributes

Methods

getRdfa(mediaClass, frameType, isError) → {string} #

Get RDFa type

Parameters:

Name Type Description
mediaClass string

Media class, one of 'File', 'Image', 'Video' or 'Audio'

frameType string

Frame type, one of 'none', 'frameless', 'thumb' or 'frame'

isError boolean

Whether the included media file is missing

Mixes in:
Source:

Returns:

RDFa type

Type
string
Get RDFa type

getScalablePromise(filename) → {jQuery.Promise} #

Get the scalable promise which fetches original dimensions from the API

Parameters:

Name Type Description
filename string

The image filename whose details the scalable will represent

Mixes in:
Source:

Returns:

Promise which resolves after the image size details are fetched from the API

Type
jQuery.Promise
Get the scalable promise which fetches original dimensions from the API

resizeToBoundingBox(imageDimensions, boundingBox) → {Object} #

Translate the image dimensions into new ones according to the bounding box.

Parameters:

Name Type Description
imageDimensions Object

Width and height of the image

boundingBox Object

The limit of the bounding box

Mixes in:
Source:

Returns:

The new width and height of the scaled image.

Type
Object
Translate the image dimensions into new ones according to the bounding box.

scaleToThumbnailSize(dimensions, [mediaType]) → {Object} #

Take the given dimensions and scale them to thumbnail size.

Parameters:

Name Type Attributes Description
dimensions Object

Width and height of the image

mediaType string optional

Media type 'DRAWING' or 'BITMAP'

Mixes in:
Source:

Returns:

The new width and height of the scaled image

Type
Object
Take the given dimensions and scale them to thumbnail size.

syncScalableToType(type, mediaType, scalable) #

Update image scalable properties according to the image type.

Parameters:

Name Type Description
type string

The new image type

mediaType string

Image media type 'DRAWING' or 'BITMAP'

scalable ve.dm.Scalable

The scalable object to update

Mixes in:
Source:
Update image scalable properties according to the image type.