Extends
Constructor
new ve.dm.MWImageNode()abstract
#
DataModel MediaWiki image node.
- Mixes in:
- Source:
Properties
Methods
createScalable()
#
getFilename() → {string}
#
Get the normalised filename of the image
Returns:
Filename (including namespace)
- Type
- string
getMediaType() → {string|undefined
}
#
undefined
}
#
Get symbolic name of media type.
Example values: "BITMAP" for JPEG or PNG images; "DRAWING" for SVG graphics
Returns:
Symbolic media type name, or undefined if empty
- Type
-
string
|
undefined
getRdfa() → {string}
#
getScalable()
#
onAttributeChange(key, from, to)
#
Respond to attribute change. Update the rendering of the 'align', src', 'width' and 'height' attributes when they change in the model.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Attribute key |
from |
string | Old value |
to |
string | New value |
getHashObjectForRendering()static
#
getRdfa(mediaClass, frameType, isError) → {string}static
#
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 |
Returns:
RDFa type
- Type
- string
getScalablePromise(filename) → {jQuery.Promise}static
#
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 |
Returns:
Promise which resolves after the image size details are fetched from the API
- Type
- jQuery.Promise
resizeToBoundingBox(imageDimensions, boundingBox) → {Object}static
#
scaleToThumbnailSize(dimensions, [mediaType]) → {Object}static
#
syncScalableToType(type, mediaType, scalable)static
#
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 |