mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-16 18:58:45 +00:00
1200cb5279
For now just adding story entries for footer element and last modified. Bug: T244106 Change-Id: Ib36f22f9b9d805f87fc074d12473497cfaf91b79
27 lines
765 B
JavaScript
27 lines
765 B
JavaScript
/**
|
|
*
|
|
* @param {string} msg to display
|
|
* @param {number} height of placeholder
|
|
* @return {string}
|
|
*/
|
|
const placeholder = ( msg, height ) => {
|
|
return `<div style="width: 100%; height: ${height || 200}px; margin-bottom: 2px;
|
|
font-size: 1.4em; padding: 8px;
|
|
display: flex; background: #eaecf0; align-items: center; justify-content: center;">${msg}</div>`;
|
|
};
|
|
|
|
/**
|
|
*
|
|
* @param {string} story to describe.
|
|
* @param {string} annotation to annotate story with.
|
|
* @param {number} height of placeholder
|
|
* @return {string}
|
|
*/
|
|
const withAnnotation = ( story, annotation, height ) => {
|
|
const node = document.createElement( 'div' );
|
|
node.innerHTML = placeholder( annotation, height ) + story;
|
|
return node.outerHTML;
|
|
};
|
|
|
|
export { placeholder, withAnnotation };
|