mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-22 03:52:52 +00:00
42816702eb
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
25 lines
689 B
JavaScript
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();
|
|
}
|