diff --git a/src/content_delegate.js b/src/content_delegate.js index d0b966f2..7f73b3e5 100644 --- a/src/content_delegate.js +++ b/src/content_delegate.js @@ -595,6 +595,32 @@ ContentDelegate.prototype.onDownloadAllSubmit = async function (event) { const browserSpecificFetch = navigator.userAgent.indexOf('Safari') + navigator.userAgent.indexOf('Chrome') < 0 ? content.fetch : window.fetch; + // load options + const options = await getItemsFromStorage('options'); + // generate the filename + const pacerCaseId = event.data.id.match(/caseid\=\d*/)[0].replace(/caseid\=/, ''); + const filename = generateFileName(options, pacerCaseId); + + // show loading message + let mainDiv = document.getElementById('cmecfMainContent'); + let loadingMessageWrapper = document.createElement('div'); + loadingMessageWrapper.setAttribute('id', 'loading-message'); + loadingMessageWrapper.style.textAlign = 'center'; + + const spinner = document.createElement('i'); + spinner.classList.add('fa', 'fa-spinner', 'fa-spin'); + spinner.setAttribute('id', 'recap-button-spinner'); + + let spanText = document.createElement('span'); + spanText.style.fontFamily = 'helvetica,arial,serif'; + spanText.style.fontSize = '13px'; + spanText.style.padding = '0px 10px'; + spanText.innerHTML = `Download in progress for file ${filename}`; + + loadingMessageWrapper.appendChild(spinner); + loadingMessageWrapper.appendChild(spanText); + mainDiv.append(loadingMessageWrapper); + // fetch the html page which contains the