delay added, text changed

This commit is contained in:
mhm@mhm.com 2017-12-04 19:02:09 +01:00
parent b58cfead05
commit 28caddf3c1

View File

@ -21,6 +21,15 @@ function go_forward() {
history.forward();
}
function prepare_restore() {
if (!document.hidden) {
go_back();
break;
}
document.addEventListener("visibilitychange", go_back);
}
// there are three states
// default: register focus listener,
// on focus: go back and switch to the state forward
@ -38,17 +47,14 @@ switch (history.state) {
go_forward();
break;
default:
if (!document.hidden) {
go_back();
break;
}
document.addEventListener("visibilitychange", go_back);
setTimeout(prepare_restore, 1000);
break;
}
{% endblock %}
{% block content %}
<noscript><p>Javascript isn't enabled. So you need to manually go back in history to restore this tab.</p></noscript>
<p>If you see this site something went wrong, or you reached the end of the history, or you disabled javascript.</p>
<p>Loading suspended page...<br>
<br>
If nothing happens, something went wrong or you disabled JavaScript.</p>
{% endblock %}