ui: only render extra content on richmedia class (#743)

This commit is contained in:
panda authored and GitHub committed 2024-03-08 17:17:36 +08:00
1 parent 1b8f209429
commit 48e8c7b3fd
16 files changed
+21 -21

No files matched your search

@@ -12,7 +12,7 @@ async function historyDialog(payload, time, uid) {
const rawHtml = await fetch(`${payload}?time=${ts}&render=1`).then((res) => res.text());
new InfoDialog({
$body: tpl`
<div class="typo">
<div class="typo richmedia">
<p><div data-user>${uid}</div> ${i18n('Edited at')} <span class="time relative" data-timestamp="${ts / 1000}">${time}</span></p>
${{ templateRaw: true, html: rawHtml }}
</div>`,
@@ -17,7 +17,7 @@ const highlighterPage = new AutoloadPage('highlighterPage', () => {
$container.find('pre code').get().forEach((code) => {
const $code = $(code);
const $root = $code.parent().parent();
const $typo = $code.closest('.typo');
const $typo = $code.closest('.richmedia');
const language = ($(code).attr('class') || '').trim();
const m = language.match(/language-input([0-9]+)/);
if (m?.[1]) {
@@ -18,8 +18,8 @@ const katexPage = new AutoloadPage('katexPage', () => {
],
}));
}
runKatex($('.typo'));
$(document).on('vjContentNew', (e) => runKatex($(e.target).find('.typo').addBack('.typo')));
runKatex($('.richmedia'));
$(document).on('vjContentNew', (e) => runKatex($(e.target).find('.richmedia').addBack('.richmedia')));
});
});