' ).prop( 'href', siteUrl ).text( siteName )
);
} else {
return siteName;
}
}
/**
* Generates the HTML embed code for the image.
*
* @param {Object} info
* @param {Image} info.imageInfo
* @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.
*/
getThumbnailHtml( 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 {Object} info
* @param {Image} info.imageInfo
* @return {string} URL
*/
getLinkUrl( info ) {
return info.imageInfo.descriptionUrl + getMediaHash( info.imageInfo.title );
}
}
module.exports = EmbedFileFormatter;
}() );