mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2025-02-17 05:48:24 +00:00
Previously, when you clicked the Add button, the page wouldn't change. It looked like it wasn't doing anything, as noted by @rcarmo (https://github.com/ArchiveBox/ArchiveBox/issues/658#issuecomment-948300055) I didn't track it down the exact reason why. It may be that Safari didn't like the two opening <h3>s, but I was able to find a bunch of people complaining about Safari being very finicky with innerHTML and actually repainting the page, enough that I decided to try just extending the block hide/show behavior already done with the delay-warning, and it works for me now in both Chrome and Safari. For #658.
71 lines
2.6 KiB
HTML
71 lines
2.6 KiB
HTML
{% extends "core/base.html" %}
|
||
|
||
{% load static %}
|
||
{% load i18n %}
|
||
|
||
{% block breadcrumbs %}
|
||
<div class="breadcrumbs">
|
||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||
{% if title %} › {{ title }}{% endif %}
|
||
</div>
|
||
{% endblock %}
|
||
|
||
{% block extra_head %}
|
||
<link rel="stylesheet" href="{% static 'add.css' %}" />
|
||
{% endblock %}
|
||
|
||
{% block body %}
|
||
<div style="max-width: 1440px; margin: auto; float: none">
|
||
<br/><br/>
|
||
{% if stdout %}
|
||
<h1>Add new URLs to your archive: results</h1>
|
||
<pre id="stdout">
|
||
{{ stdout | safe }}
|
||
<br/><br/>
|
||
</pre>
|
||
<br/>
|
||
<center>
|
||
<a href="/add" id="submit"> Add more URLs ➕</a>
|
||
</center>
|
||
{% else %}
|
||
<div id="in-progress" style="display: none;">
|
||
<center><h3>Adding URLs to index and running archive methods...</h3>
|
||
<br/>
|
||
<div class="loader"></div>
|
||
<br/>
|
||
Check the server log or the <a href="/admin/core/archiveresult/?o=-1">Log</a> page for progress...
|
||
</center>
|
||
</div>
|
||
<form id="add-form" method="POST" class="p-form">{% csrf_token %}
|
||
<h1>Add new URLs to your archive</h1>
|
||
<br/>
|
||
{{ form.as_p }}
|
||
<center>
|
||
<button role="submit" id="submit"> Add URLs and archive ➕</button>
|
||
</center>
|
||
</form>
|
||
<br/><br/><br/>
|
||
<center id="delay-warning" style="display: none">
|
||
<small>(it's safe to leave this page, adding will continue in the background)</small>
|
||
</center>
|
||
{% if absolute_add_path %}
|
||
<center id="bookmarklet">
|
||
<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>
|
||
</center>
|
||
{% endif %}
|
||
<script>
|
||
document.getElementById('add-form').addEventListener('submit', function(event) {
|
||
document.getElementById('in-progress').style.display = 'block'
|
||
document.getElementById('add-form').style.display = 'none'
|
||
document.getElementById('delay-warning').style.display = 'block'
|
||
return true
|
||
})
|
||
</script>
|
||
{% endif %}
|
||
</div>
|
||
{% endblock %}
|
||
|
||
{% block footer %}{% endblock %}
|
||
|
||
{% block sidebar %}{% endblock %}
|