Update static/js/script.js
Browse files- static/js/script.js +3 -9
static/js/script.js
CHANGED
|
@@ -26,9 +26,9 @@ function captureImage() {
|
|
| 26 |
.then(response => response.json())
|
| 27 |
.then(data => {
|
| 28 |
console.log(data.message);
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
})
|
| 33 |
.catch(console.error);
|
| 34 |
}
|
|
@@ -59,15 +59,9 @@ function performOCR() {
|
|
| 59 |
function showLoading() {
|
| 60 |
const loadingElement = document.getElementById('loading');
|
| 61 |
loadingElement.style.display = 'block';
|
| 62 |
-
let dots = 0;
|
| 63 |
-
loadingInterval = setInterval(() => {
|
| 64 |
-
dots = (dots + 1) % 4;
|
| 65 |
-
loadingElement.innerText = 'Loading' + '.'.repeat(dots);
|
| 66 |
-
}, 500);
|
| 67 |
}
|
| 68 |
|
| 69 |
function hideLoading() {
|
| 70 |
-
clearInterval(loadingInterval);
|
| 71 |
const loadingElement = document.getElementById('loading');
|
| 72 |
loadingElement.style.display = 'none';
|
| 73 |
}
|
|
|
|
| 26 |
.then(response => response.json())
|
| 27 |
.then(data => {
|
| 28 |
console.log(data.message);
|
| 29 |
+
const capturedImage = document.getElementById('captured-image');
|
| 30 |
+
capturedImage.src = imageData;
|
| 31 |
+
capturedImage.style.display = 'block';
|
| 32 |
})
|
| 33 |
.catch(console.error);
|
| 34 |
}
|
|
|
|
| 59 |
function showLoading() {
|
| 60 |
const loadingElement = document.getElementById('loading');
|
| 61 |
loadingElement.style.display = 'block';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
}
|
| 63 |
|
| 64 |
function hideLoading() {
|
|
|
|
| 65 |
const loadingElement = document.getElementById('loading');
|
| 66 |
loadingElement.style.display = 'none';
|
| 67 |
}
|