' ).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.imageInfo.title.getMainText() )
.attr( 'height', height )
.attr( 'width', width )
),
$( '
' ),
this.getCreditHtml( info )
)
);
};
/**
* Generare a link which we will be using for sharing stuff.
* FIXME this should be handled by mmv.js to be DRY
*
* @param {mw.mmv.model.EmbedFileInfo} info
*/
EFFP.getLinkUrl = function ( info ) {
return info.imageInfo.descriptionUrl + '#mediaviewer/' + info.imageInfo.title.getMainText();
};
mw.mmv.EmbedFileFormatter = EmbedFileFormatter;
}( mediaWiki, jQuery ) );