refactor: move frontend JS to external files and enable strict CSP

This commit is contained in:
dev
2026-09-09 10:06:49 +03:00
parent d6e589d2f5
commit 018c65adc5
34 changed files with 2444 additions and 2307 deletions
+16
View File
@@ -0,0 +1,16 @@
(function(){
const params = new URLSearchParams(location.search);
const code = params.get('code') || '404';
const title = params.get('title') || '';
const message = params.get('message') || '';
const details = params.get('details') || '';
document.getElementById('errorCode').textContent = code;
document.getElementById('errorTitle').textContent = title || (code === '404' ? 'Страница не найдена' : 'Ошибка');
document.getElementById('errorMessage').textContent = message || (code === '404' ? 'Запрашиваемая страница не существует или была перемещена.' : 'Произошла ошибка на сервере.');
if (details) {
document.getElementById('errorDetails').style.display = 'block';
document.getElementById('errorStack').textContent = details;
}
})();
document.querySelector('.error-actions button').addEventListener('click', () => history.back());