#include utility.js const MszShowMessageBox = async (text, title, buttons, target) => { if(typeof text !== 'string') throw 'text must be a string'; if(!(target instanceof Element)) target = document.body; if(target.querySelector('.messagebox')) return false; if(typeof title !== 'string') title = 'Information'; if(!Array.isArray(buttons)) buttons = []; let buttonsElem; const html =
{title}
{text}
{buttonsElem =
}
; let firstButton; if(buttons.length < 1) { firstButton = ; buttonsElem.appendChild(firstButton); } else { for(const button of buttons) { const buttonElem = ; buttonsElem.appendChild(buttonElem); if(firstButton === undefined) firstButton = buttonElem; } } target.appendChild(html); firstButton.focus(); return true; };