mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-11-09 19:20:09 +01:00
feat: render actual elements in markdown cheatsheet instead of labels
Replace text labels (h1, bold, italic) with rendered HTML in the Rendu column: headings, strong, em, del, code, links, blockquote, lists, hr, sup, small
This commit is contained in:
1 parent
4a2b000fca
commit
38ef550397
16 files changed
+577
-103
No files matched your search
@@ -7,6 +7,9 @@
|
||||
hx-target="#toast-region">
|
||||
</aside>
|
||||
|
||||
<!-- Markdown cheatsheet container (filled by HTMX on demand) -->
|
||||
<div id="md-cheatsheet-container"></div>
|
||||
|
||||
<?php foreach ($extraJs ?? [] as $js): ?>
|
||||
<script src="<?= App::assetV($js) ?>"></script>
|
||||
<?php endforeach; ?>
|
||||
@@ -30,6 +33,19 @@ document.body.addEventListener('htmx:afterSettle', function (e) {
|
||||
if (warn) { warn.setAttribute('tabindex', '-1'); warn.focus(); }
|
||||
}
|
||||
});
|
||||
|
||||
// Markdown cheatsheet: close on backdrop click, remove stale dialogs before new one arrives
|
||||
document.body.addEventListener('htmx:beforeRequest', function(e) {
|
||||
if (e.detail.requestConfig && e.detail.requestConfig.path === '/admin/markdown-cheatsheet-fragment.php') {
|
||||
var old = document.getElementById('md-cheatsheet-dialog');
|
||||
if (old) old.remove();
|
||||
}
|
||||
});
|
||||
document.body.addEventListener('click', function(e) {
|
||||
if (e.target.tagName === 'DIALOG' && e.target.id === 'md-cheatsheet-dialog') {
|
||||
e.target.close();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user