mediawiki-extensions-Popups/src/ui/templates/pagePreview.js
Stephen Niedzielski 42816702eb Hygiene: replace Mustache templates w/ ES6 strings
Replace Mustache.js templates with template literals. An effort was made
to minimize additional refactoring, so feel free to ask for more but it
ain't coming in this PS.

Bug: T165036
Change-Id: I4a6a1d93a2922c3a9ef3ae93c47da17a35c644f0
2018-03-20 08:06:02 -05:00

25 lines
689 B
JavaScript

/**
* @module pagePreview
*/
/**
* @param {ext.popups.PreviewModel} model
* @param {boolean} hasThumbnail
* @return {string} HTML string.
*/
export function renderPagePreview(
{ url, languageCode, languageDirection }, hasThumbnail
) {
return `
<div class='mwe-popups' role='tooltip' aria-hidden>
<div class='mwe-popups-container'>
${hasThumbnail ? `<a href='${url}' class='mwe-popups-discreet'></a>` : ''}
<a dir='${languageDirection}' lang='${languageCode}' class='mwe-popups-extract' href='${url}'></a>
<footer>
<a class='mwe-popups-settings-icon mw-ui-icon mw-ui-icon-element mw-ui-icon-popups-settings'></a>
</footer>
</div>
</div>
`.trim();
}