#gzip #extract-inline-js enable gzip in nginx + move ~730 lines of inline JS to 15 external files

This commit is contained in:
Pontoporeia
2026-06-24 12:56:09 +02:00
parent 0ff6ee78d9
commit e74f9210c5
35 changed files with 1198 additions and 843 deletions

View File

@@ -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>