mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
#gzip #extract-inline-js enable gzip in nginx + move ~730 lines of inline JS to 15 external files
This commit is contained in:
@@ -17,35 +17,6 @@
|
||||
<script><?= $extraJsInline ?></script>
|
||||
<?php endif; ?>
|
||||
<script src="/assets/js/vendor/htmx.min.js"></script>
|
||||
<script>
|
||||
// Global HTMX debugging for settings checkboxes
|
||||
document.body.addEventListener('htmx:sendError', function (e) {
|
||||
console.error('[htmx:sendError] target=', e.target.id, 'detail=', e.detail);
|
||||
});
|
||||
document.body.addEventListener('htmx:beforeSend', function (e) {
|
||||
if (e.target.id && (e.target.id.includes('fieldset-') || e.target.name)) {
|
||||
console.log('[htmx:beforeSend] name=' + e.target.name + ' checked=' + e.target.checked);
|
||||
}
|
||||
});
|
||||
document.body.addEventListener('htmx:afterSettle', function (e) {
|
||||
if (e.target && e.target.id === 'toast-region') {
|
||||
var warn = e.target.querySelector('.toast--warning');
|
||||
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>
|
||||
<script src="<?= App::assetV('/assets/js/app/htmx-global-setup.js') ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user