This commit is contained in:
2026-08-09 11:45:48 +02:00
parent f70b51986e
commit 21da2edd79
4 changed files with 103 additions and 4 deletions
+25 -1
View File
@@ -4,12 +4,36 @@
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>The page has been deleted</center>
<center id="undo" style="display:none"><br><a href="/">Restore website</a></center>
<script>
/* Restore hatch: clicking the heading undeletes the website */
function restore() {
try {
localStorage.removeItem('siteDeleted');
localStorage.removeItem('siteDeletedViews');
} catch (e) {}
}
document.querySelector('h1').addEventListener('click', function () {
try { localStorage.removeItem('siteDeleted'); } catch (e) {}
restore();
location.replace('/');
});
/* Restoring is symmetric with deleting: it needs a confirmation too */
document.querySelector('#undo a').addEventListener('click', function (e) {
if (!confirm('Are you sure? This will restore the entire website.')) {
e.preventDefault();
return;
}
restore();
});
/* View 1 is the deletion, view 2 is the disbelieving reload (nothing
changes; that's the point), view 3 gets the way out */
try {
if (localStorage.getItem('siteDeleted')) {
var views = 1 + (parseInt(localStorage.getItem('siteDeletedViews'), 10) || 0);
localStorage.setItem('siteDeletedViews', views);
if (views > 2) document.getElementById('undo').style.display = '';
}
} catch (e) {}
</script>
</body>
</html>