${markup(f.name, { inEmbed: true, replaceEmojis: true, inlineBlock: true })}
${markup(f.value, { inEmbed: true, replaceEmojis: true })}
`;
} else {
el = fields.insertBefore(document.createElement('div'), null);
el.outerHTML = `
${markup(f.name, { inEmbed: true, replaceEmojis: true, inlineBlock: true })}
${markup(f.value, { inEmbed: true, replaceEmojis: true })}
`;
colNum = (colNum === 9 ? 1 : colNum + 4);
num++;
}
});
colNum = 1;
let len = e.fields.filter(f => f.inline).length;
if (len === 2 || (len > 3 && len % 2 !== 0)) {
let children = Array.from(fields.children), arr = children.filter(x => x === children[len] || x === children[len - 1]);
arr[0].style.gridColumn = '1 / 7', arr[1].style.gridColumn = '7 / 13';
}
display(fields, undefined, 'grid');
} else hide(fields);
embed.classList.remove('empty');
notif.animate({ opacity: '0', bottom: '-50px', offset: 1 }, { easing: 'ease', duration: 500 }).onfinish = () => notif.style.removeProperty('display');
twemoji.parse(msgEmbed);
} else embed.classList.add('empty');
} catch (e) {
error(e);
}
}
editor.on('change', editor => {
try { update(toObj(editor.getValue())); }
catch (e) {
if (editor.getValue()) return;
embed.classList.add('empty');
content.innerHTML = '';
}
document.querySelectorAll('.markup pre > code').forEach((block) => hljs.highlightBlock(block));
});
update(toObj(editor.getValue()));
document.querySelector('.timeText').innerText = tstamp();
document.querySelectorAll('.markup pre > code').forEach((block) => hljs.highlightBlock(block));
!window.navigator.userAgent.match(/Firefox\/[\d\.]+$/g) && // Firefox pushes the text up a little
document.querySelector('.botText').style.removeProperty('top');
};