40 lines
1.2 KiB
HTML
40 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head><title>404 Not Found</title></head>
|
|
<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 () {
|
|
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>
|