Added recovery in error 404 page

This commit is contained in:
benweet 2014-04-22 00:18:45 +01:00
parent d4c3e83cde
commit 5252d20aac
2 changed files with 23 additions and 13 deletions

View File

@ -16,6 +16,7 @@
<a href="https://stackedit.io"><img src="https://stackedit.io/res-min/img/logo-promo-128.png" width="316" height="64" /></a> <a href="https://stackedit.io"><img src="https://stackedit.io/res-min/img/logo-promo-128.png" width="316" height="64" /></a>
</p> </p>
<p>404 &mdash; Page not found</p> <p>404 &mdash; Page not found</p>
<p><a href="/recovery.html">Need StackEdit recovery?</a></p>
</body> </body>
</html> </html>

View File

@ -16,7 +16,15 @@
baseUrl: window.baseDir, baseUrl: window.baseDir,
deps: ['main'] deps: ['main']
}; };
setTimeout(function() { var timer = 5;
function waitTimer() {
try {
document.getElementById('timer').textContent = --timer;
}
catch(e) {}
if(timer) {
return setTimeout(waitTimer, 1000);
}
var failure = false; var failure = false;
try { try {
// Try to use StackEdit dependencies to save a file // Try to use StackEdit dependencies to save a file
@ -36,7 +44,8 @@
var elt = eltList[i]; var elt = eltList[i];
show(elt); show(elt);
} }
}, 5000); }
setTimeout(waitTimer, 1000);
function show(elt) { function show(elt) {
elt.className = elt.className.replace(/ hide/, ''); elt.className = elt.className.replace(/ hide/, '');
@ -109,7 +118,7 @@
</a> </a>
<h3>StackEdit recovery</h3> <h3>StackEdit recovery</h3>
<p> <p>
<strong>The download of your documents and settings will start in 5 seconds...</strong> <strong>The download of your documents and settings will start in <span id="timer">5</span> seconds...</strong>
</p> </p>
<p>To import your documents and settings back in StackEdit:</p> <p>To import your documents and settings back in StackEdit:</p>
<blockquote> <blockquote>