Methods
(static) createThumbnail(rawThumbnail, useCSSClipPath) → {ext.popups.Thumbnail|null}
Creates a thumbnail from the representation of a thumbnail returned by the PageImages MediaWiki API query module.
If there's no thumbnail, the thumbnail is too small, or the thumbnail's URL
contains characters that could be used to perform an
XSS attack via CSS,
then null
is returned.
Extracted from mw.popups.renderer.article.createThumbnail
.
Parameters:
Name | Type | Description |
---|---|---|
rawThumbnail |
Object | |
useCSSClipPath |
boolean |
- Source:
Returns:
- Type
- ext.popups.Thumbnail | null
(static) createThumbnailSVG(className, url, x, y, thumbnailWidth, thumbnailHeight, width, height) → {HTMLElement}
Creates the SVG image element that represents the thumbnail.
This function is distinct from createThumbnail
as it abstracts away some
browser issues that are uncovered when manipulating elements across
namespaces.
Parameters:
Name | Type | Description |
---|---|---|
className |
string | |
url |
string | |
x |
number | |
y |
number | |
thumbnailWidth |
number | |
thumbnailHeight |
number | |
width |
number | |
height |
number |
- Source:
Returns:
- Type
- HTMLElement
(inner) addAttributes(node, attrs)
Sets multiple attributes on a node.
Parameters:
Name | Type | Description |
---|---|---|
node |
HTMLElement | |
attrs |
Record.<String, String> |
- Source: