Skip to content

Commit

Permalink
fixes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
vgarcia007 committed Sep 15, 2024
1 parent 9baadd4 commit aa7052b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ class="far fa-smile fa-fw fa-10x"></i></span>
function set_state_idle() {
$('#status-image').html('<i class="far fa-smile fa-fw fa-10x"></i>');
$('#status-text').text('Ready to scan');
$('.trigger-scan').removeClass('disabled');
}

function set_state_waiting() {
$('#status-image').html('<i class="fas fa-hourglass-half fa-fw fa-10x"></i>');
$('#status-text').text('Waiting for rear pages');
$('.trigger-scan').removeClass('disabled');
}

function set_state_scan() {
Expand All @@ -114,11 +116,13 @@ function set_state_scan() {
$('#status-image').html(spinnerimage);
}
$('#status-text').text('Scan in progress');
$('.trigger-scan').addClass('disabled');
}

function set_state_ocr() {
$('#status-image').html('<i class="fas fa-brain fa-fw fa-10x"></i>');
$('#status-text').text('OCR in progress');
$('.trigger-scan').removeClass('disabled');
}

function set_state(state) {
Expand All @@ -143,6 +147,8 @@ function set_state(state) {
$(document).ready(function() {

$('.trigger-scan').click(function() {
$(this).focus()
$(this).blur();
var target = $(this).data('trigger');
$.post('/scan.php', {
target: target
Expand All @@ -157,6 +163,7 @@ function set_state(state) {


let state = 'idle';


if (data.ocr && data.waiting && !data.scan) {
state = 'ocr';
Expand Down

0 comments on commit aa7052b

Please sign in to comment.