Skip to content

Commit

Permalink
Merge pull request #42 from baloise/main
Browse files Browse the repository at this point in the history
Update demask UI
  • Loading branch information
robbizbal authored Nov 13, 2024
2 parents 7ba9d53 + d5bb8f6 commit def917f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/static/scripts/demask.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
document.getElementById('inputForm').addEventListener('submit', function(event) {
event.preventDefault(); // Prevent the default form submission

document.getElementById('loading-spinner').style.display = 'flex';

const inputData = document.getElementById('inputData').value;
const inputDataEntities = JSON.parse(document.getElementById('responseFieldEntities').value);

Expand All @@ -25,6 +27,8 @@ document.getElementById('inputForm').addEventListener('submit', function(event)
// Display the response in the textarea
document.getElementById('responseFieldText').value = inputData; // Format the JSON response
document.getElementById('responseFieldDeanonText').value = JSON.stringify(text.deanonymized_text, null, 2); // Format the JSON response

document.getElementById('loading-spinner').style.display = 'none';

})
.catch((error) => {
Expand Down
3 changes: 3 additions & 0 deletions src/templates/html/demask.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ <h3>Load entities</h3>
<div class="flex-item">
<h3>Input</h3>
</div>
<div class="flex-item">
<div id="loading-spinner"></div>
</div>
<div class="flex-item">
<form id="inputForm">
<textarea class="default-textarea" type="text" id="inputData" placeholder="Enter text to deanonymize or load text from a file" required></textarea>
Expand Down

0 comments on commit def917f

Please sign in to comment.