Skip to content

Commit

Permalink
Enable loader/ready for individual files
Browse files Browse the repository at this point in the history
  • Loading branch information
ross-spencer committed Jun 30, 2024
1 parent 4e0cc20 commit a009cc9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sf/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,21 @@ window.onload = () => {
toggleInit();
document.getElementById('butOpen').addEventListener('click', () => {
window.showOpenFilePicker().then(handles => {
complete = '<div class="w3-panel w3-pale-green w3-border"><h4>Complete!</h4><p>Siegfried has finished scanning, \'run Demystify\' to show the results.</p></div>';
for (const idx in handles) {
const args = getArgs();
args.unshift(handles[idx]);
document.getElementById('ready').style.visibility = "hidden";
document.getElementById('ready').style.height = "0px";
document.getElementById('loader').style.visibility = "visible";
document.getElementById('loader').style.height = "auto";
identify.apply(null, args).then(result => {
document.getElementById('sf-results').value = result;
document.getElementById('loader').style.visibility = "hidden";
document.getElementById('loader').style.height = "0px";
document.getElementById('ready').innerHTML = complete;
document.getElementById('ready').style.visibility = "visible";
document.getElementById('ready').style.height = "auto";
}).catch((err) => {
console.log("file selection error: " + err);
});
Expand Down

0 comments on commit a009cc9

Please sign in to comment.