mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-14 11:06:13 +05:00
17 lines
735 B
JavaScript
17 lines
735 B
JavaScript
(function() {
|
|
document.addEventListener('click', function(event) {
|
|
var button = event.target.closest('.crawl-resume-row, .crawl-pause-row');
|
|
if (!button) return;
|
|
|
|
var form = document.getElementById('changelist-form');
|
|
var actionSelect = form ? form.querySelector('select[name="action"]') : null;
|
|
if (!form || !actionSelect) return;
|
|
|
|
form.querySelectorAll('input[name="_selected_action"]').forEach(function(checkbox) {
|
|
checkbox.checked = checkbox.value === button.getAttribute('data-crawl-id');
|
|
});
|
|
actionSelect.value = button.classList.contains('crawl-pause-row') ? 'pause_selected_crawls' : 'resume_selected_crawls';
|
|
form.submit();
|
|
});
|
|
})();
|