' ).prop( 'href', siteUrl ).text( siteName )
);
} else {
return siteName;
}
};
/**
* Generates the HTML embed code for the image.
*
* @param {mw.mmv.model.EmbedFileInfo} info
* @param {string} imgUrl URL to the file itself.
* @param {number} [width] Width to put into the image element.
* @param {number} [height] Height to put into the image element.
* @return {string} Embed code.
*/
EFFP.getThumbnailHtml = function ( info, imgUrl, width, height ) {
return this.htmlUtils.jqueryToHtml(
$( '' ).append(
$( '' )
.attr( 'href', this.getLinkUrl( info ) )
.append(
$( '' )
.attr( 'src', imgUrl )
.attr( 'alt', info.alt || info.imageInfo.title.getMainText() )
.attr( 'height', height )
.attr( 'width', width )
),
$( '
' ),
this.getCreditHtml( info )
)
);
};
/**
* Generate a link which we will be using for sharing stuff.
*
* @param {mw.mmv.model.EmbedFileInfo} info
*/
EFFP.getLinkUrl = function ( info ) {
var route = new mw.mmv.routing.ThumbnailRoute( info.imageInfo.title );
return this.router.createHashedUrl( route, info.imageInfo.descriptionUrl );
};
mw.mmv.EmbedFileFormatter = EmbedFileFormatter;
}( mediaWiki, jQuery ) );