redirect add page back to snapshots list automatically

This commit is contained in:
Nick Sweeting 2023-10-19 18:24:19 -07:00
parent 22bcffe5ee
commit 63c276a93d

View file

@ -33,7 +33,7 @@
<br/> <br/>
<div class="loader"></div> <div class="loader"></div>
<br/> <br/>
Check the server log or the <a href="/admin/core/archiveresult/?o=-1">Log</a> page for progress... Check the server log or the <a href="/admin/core/archiveresult/?o=-1">Log</a> page for detailed progress...
</center> </center>
</div> </div>
<form id="add-form" method="POST" class="p-form">{% csrf_token %} <form id="add-form" method="POST" class="p-form">{% csrf_token %}
@ -46,19 +46,22 @@
</form> </form>
<br/><br/><br/> <br/><br/><br/>
<center id="delay-warning" style="display: none"> <center id="delay-warning" style="display: none">
<small>(it's safe to leave this page, adding will continue in the background)</small> <small>(you will be redirected to your <a href="/">Snapshot list</a> momentarily, its safe to close this page at any time)</small>
</center> </center>
{% if absolute_add_path %} {% if absolute_add_path %}
<center id="bookmarklet"> <!-- <center id="bookmarklet">
<p>Bookmark this link to quickly add to your archive: <p>Bookmark this link to quickly add to your archive:
<a href="javascript:void(window.open('{{ absolute_add_path }}?url='+encodeURIComponent(document.location.href)));">Add to ArchiveBox</a></p> <a href="javascript:void(window.open('{{ absolute_add_path }}?url='+encodeURIComponent(document.location.href)));">Add to ArchiveBox</a></p>
</center> </center> -->
{% endif %} {% endif %}
<script> <script>
document.getElementById('add-form').addEventListener('submit', function(event) { document.getElementById('add-form').addEventListener('submit', function(event) {
document.getElementById('in-progress').style.display = 'block' document.getElementById('in-progress').style.display = 'block'
document.getElementById('add-form').style.display = 'none' document.getElementById('add-form').style.display = 'none'
document.getElementById('delay-warning').style.display = 'block' document.getElementById('delay-warning').style.display = 'block'
setTimeout(function() {
window.location = '/'
}, 2000)
return true return true
}) })
</script> </script>